SmsVirtualMemory

Struct SmsVirtualMemory 

Source
pub struct SmsVirtualMemory { /* private fields */ }

Trait Implementations§

Source§

impl Memory16 for SmsVirtualMemory

Source§

fn read(&mut self, logical_address: u16) -> u8

Read a byte.
Source§

fn write(&mut self, logical_address: u16, value: u8)

Write a byte.
Source§

impl SmsMemory for SmsVirtualMemory

Source§

fn set_system_ram_kib(&mut self, kib: usize)

Set how many KiB of RAM the system has.
Source§

fn mapper(&self) -> SmsMemoryMapper

Source§

fn set_mapper(&mut self, mapper: SmsMemoryMapper)

Source§

fn page(&self, slot: u8) -> MemoryPage

What memory page is slot mapped to? Read more
Source§

fn rom_len(&self) -> usize

How much ROM on the cartridge, in bytes?
Source§

fn map_page_impl(&mut self, slot: u8, page: MemoryPage)

Map slot to page (for implementors of this trait; consumers should call map_page. Read more
Source§

fn rom_read(&self, index: usize) -> u8

Read a byte of ROM. Read more
Source§

fn rom_write(&mut self, index: usize, value: u8)

Write a byte of ROM. Read more
Source§

fn main_cartridge_ram_len(&self) -> usize

How much RAM is on the cartridge, in bytes? Read more
Source§

fn main_cartridge_ram_read(&self, index: usize) -> u8

Read a byte of cartridge RAM. Read more
Source§

fn main_cartridge_ram_write(&mut self, index: usize, value: u8)

Write a byte of cartridge RAM. Read more
Source§

fn half_cartridge_ram_len(&self) -> usize

How much RAM is on the cartridge, in bytes? Read more
Source§

fn half_cartridge_ram_read(&self, index: usize) -> u8

Read a byte of cartridge RAM. Read more
Source§

fn half_cartridge_ram_write(&mut self, index: usize, value: u8)

Write a byte of cartridge RAM. Read more
Source§

fn system_ram_len(&self) -> usize

How much system RAM, in bytes? Read more
Source§

fn system_ram_read(&self, index: usize) -> u8

Read a byte of system RAM. Read more
Source§

fn system_ram_write(&mut self, index: usize, value: u8)

Write a byte of system RAM. Read more
Source§

fn state(&self) -> SmsMemoryState

Source§

fn map_page(&mut self, slot: u8, page: MemoryPage)

Map slot to page. Read more
Source§

impl SmsMemoryLoad for SmsVirtualMemory

Source§

fn load_ref(state: &SmsMemoryState) -> Result<Self, SmsMemoryLoadError>

Load from a reference to a SmsMemoryState. Read more
Source§

fn load(state: SmsMemoryState) -> Result<Self, SmsMemoryLoadError>

Load from an SmsMemoryState. Read more
Source§

fn from_rom(rom: Box<[u8; 16384]>) -> Result<Self, SmsMemoryLoadError>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.