Struct spectrusty::memory::SinglePageMemory
source · Trait Implementations§
source§impl<const MEM_SIZE: usize, const RAM_BOT: u16> Clone for SinglePageMemory<MEM_SIZE, RAM_BOT>
impl<const MEM_SIZE: usize, const RAM_BOT: u16> Clone for SinglePageMemory<MEM_SIZE, RAM_BOT>
source§fn clone(&self) -> SinglePageMemory<MEM_SIZE, RAM_BOT>
fn clone(&self) -> SinglePageMemory<MEM_SIZE, RAM_BOT>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<const MEM_SIZE: usize, const RAM_BOT: u16> Default for SinglePageMemory<MEM_SIZE, RAM_BOT>
impl<const MEM_SIZE: usize, const RAM_BOT: u16> Default for SinglePageMemory<MEM_SIZE, RAM_BOT>
source§impl<'de, const MEM_SIZE: usize, const RAM_BOT: u16> Deserialize<'de> for SinglePageMemory<MEM_SIZE, RAM_BOT>
impl<'de, const MEM_SIZE: usize, const RAM_BOT: u16> Deserialize<'de> for SinglePageMemory<MEM_SIZE, RAM_BOT>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<const MEM_SIZE: usize, const RAM_BOT: u16> Serialize for SinglePageMemory<MEM_SIZE, RAM_BOT>
impl<const MEM_SIZE: usize, const RAM_BOT: u16> Serialize for SinglePageMemory<MEM_SIZE, RAM_BOT>
source§impl<const MEM_SIZE: usize, const RAM_BOT: u16> ZxMemory for SinglePageMemory<MEM_SIZE, RAM_BOT>
impl<const MEM_SIZE: usize, const RAM_BOT: u16> ZxMemory for SinglePageMemory<MEM_SIZE, RAM_BOT>
source§const SCR_BANKS_MAX: usize = 1usize
const SCR_BANKS_MAX: usize = 1usize
A maximum value allowed for a
screen_bank
argumentsource§const ROM_BANKS_MAX: usize = 0usize
const ROM_BANKS_MAX: usize = 0usize
A maximum value allowed for a
rom_bank
argumentsource§const RAM_BANKS_MAX: usize = 0usize
const RAM_BANKS_MAX: usize = 0usize
A maximum value allowed for a
ram_bank
argumentsource§fn write(&mut self, addr: u16, val: u8)
fn write(&mut self, addr: u16, val: u8)
If
addr
is above RAMTOP
the function should do nothing.source§fn write16(&mut self, addr: u16, val: u16)
fn write16(&mut self, addr: u16, val: u16)
If addr is above
RAMTOP
the function should do nothing.source§fn read_screen(&self, _screen_bank: usize, addr: u16) -> u8
fn read_screen(&self, _screen_bank: usize, addr: u16) -> u8
Reads a byte from screen memory at the given
addr
. Read moresource§fn mem_ref(&self) -> &[u8] ⓘ
fn mem_ref(&self) -> &[u8] ⓘ
Provides a continuous view into the whole memory (all banks: ROM + RAM).
source§fn mem_mut(&mut self) -> &mut [u8] ⓘ
fn mem_mut(&mut self) -> &mut [u8] ⓘ
Provides a continuous view into the whole memory (all banks: ROM + RAM).
source§fn screen_ref(&self, screen_bank: usize) -> Result<&ScreenArray>
fn screen_ref(&self, screen_bank: usize) -> Result<&ScreenArray>
Returns a reference to the screen memory. Read more
source§fn screen_mut(&mut self, screen_bank: usize) -> Result<&mut ScreenArray>
fn screen_mut(&mut self, screen_bank: usize) -> Result<&mut ScreenArray>
Returns a mutable reference to the screen memory. Read more
source§fn page_kind(&self, page: u8) -> Result<MemoryKind>
fn page_kind(&self, page: u8) -> Result<MemoryKind>
Returns an enum describing what kind of memory is currently paged at the specified
page
. Read moresource§fn page_bank(&self, page: u8) -> Result<(MemoryKind, usize)>
fn page_bank(&self, page: u8) -> Result<(MemoryKind, usize)>
Returns a tuple of an enum describing what kind of memory and which bank of that memory is
currently paged at the specified
page
. Read moresource§fn page_mut(&mut self, page: u8) -> Result<&mut [u8]>
fn page_mut(&mut self, page: u8) -> Result<&mut [u8]>
page
should be less or equal to PAGES_MAX.source§fn rom_bank_ref(&self, rom_bank: usize) -> Result<&[u8]>
fn rom_bank_ref(&self, rom_bank: usize) -> Result<&[u8]>
rom_bank
should be less or equal to ROM_BANKS_MAX
.source§fn rom_bank_mut(&mut self, rom_bank: usize) -> Result<&mut [u8]>
fn rom_bank_mut(&mut self, rom_bank: usize) -> Result<&mut [u8]>
rom_bank
should be less or equal to ROM_BANKS_MAX
.source§fn ram_bank_ref(&self, ram_bank: usize) -> Result<&[u8]>
fn ram_bank_ref(&self, ram_bank: usize) -> Result<&[u8]>
ram_bank
should be less or equal to RAM_BANKS_MAX
.source§fn ram_bank_mut(&mut self, ram_bank: usize) -> Result<&mut [u8]>
fn ram_bank_mut(&mut self, ram_bank: usize) -> Result<&mut [u8]>
ram_bank
should be less or equal to RAM_BANKS_MAX
.source§fn map_rom_bank(&mut self, rom_bank: usize, page: u8) -> Result<()>
fn map_rom_bank(&mut self, rom_bank: usize, page: u8) -> Result<()>
rom_bank
should be less or equal to ROM_BANKS_MAX
and page
should be less or equal to PAGES_MAX.source§fn map_ram_bank(&mut self, ram_bank: usize, page: u8) -> Result<()>
fn map_ram_bank(&mut self, ram_bank: usize, page: u8) -> Result<()>
ram_bank
should be less or equal to RAM_BANKS_MAX
and page
should be less or equal to PAGES_MAX.source§fn page_index_at(&self, address: u16) -> Result<MemPageOffset>
fn page_index_at(&self, address: u16) -> Result<MemPageOffset>
Returns
Ok(MemPageOffset)
if address is equal to or less than ZxMemory::RAMTOP.source§fn map_exrom(
&mut self,
_exrom_bank: Rc<[u8]>,
_page: u8
) -> Result<(), ZxMemoryError>
fn map_exrom(
&mut self,
_exrom_bank: Rc<[u8]>,
_page: u8
) -> Result<(), ZxMemoryError>
Maps EX-ROM bank at the specified
page
. Read moresource§fn unmap_exrom(&mut self, _exrom_bank: &Rc<[u8]>)
fn unmap_exrom(&mut self, _exrom_bank: &Rc<[u8]>)
Unmaps an external ROM if the currently mapped EX-ROM bank is the same as in the argument.
Otherwise does nothing. Read more
source§fn is_exrom_at(&self, _page: u8) -> bool
fn is_exrom_at(&self, _page: u8) -> bool
Returns
true
if an EX-ROM bank is currently being mapped at the specified memory page
.source§fn has_mapped_exrom(&self, _exrom_bank: &Rc<[u8]>) -> bool
fn has_mapped_exrom(&self, _exrom_bank: &Rc<[u8]>) -> bool
Returns
true
if a specified EX-ROM bank is currently being mapped.source§fn rom_mut(&mut self) -> &mut [u8] ⓘ
fn rom_mut(&mut self) -> &mut [u8] ⓘ
Provides a continuous mutable view into the ROM memory (all banks).
source§fn load_into_rom<R>(&mut self, rd: R) -> Result<(), ZxMemoryError>where
R: Read,
fn load_into_rom<R>(&mut self, rd: R) -> Result<(), ZxMemoryError>where
R: Read,
The data read depends on how big ROM is ZxMemory::ROM_SIZE.
Results in an error when the ROM data size is less than the
ROM_SIZE
. Read moresource§fn load_into_rom_bank<R>(
&mut self,
rom_bank: usize,
rd: R
) -> Result<(), ZxMemoryError>where
R: Read,
fn load_into_rom_bank<R>(
&mut self,
rom_bank: usize,
rd: R
) -> Result<(), ZxMemoryError>where
R: Read,
Results in an error when the ROM data size is less than the ROM bank’s size.
source§fn iter_pages<A>(
&self,
address_range: A
) -> Result<MemPageRefIter<'_, Self>, ZxMemoryError>where
A: RangeBounds<u16>,
fn iter_pages<A>(
&self,
address_range: A
) -> Result<MemPageRefIter<'_, Self>, ZxMemoryError>where
A: RangeBounds<u16>,
Returns an iterator of memory page slice references intersecting with a given address range. Read more
source§fn for_each_page_mut<A, F>(
&mut self,
address_range: A,
f: F
) -> Result<(), ZxMemoryError>where
A: RangeBounds<u16>,
F: for<'a> FnMut(PageMutSlice<'a>) -> Result<(), ZxMemoryError>,
fn for_each_page_mut<A, F>(
&mut self,
address_range: A,
f: F
) -> Result<(), ZxMemoryError>where
A: RangeBounds<u16>,
F: for<'a> FnMut(PageMutSlice<'a>) -> Result<(), ZxMemoryError>,
Iterates over mutable memory page slices PageMutSlice intersecting with a given address range
passing the slices to the closure
f
. Read moresource§fn load_into_mem<A, R>(
&mut self,
address_range: A,
rd: R
) -> Result<(), ZxMemoryError>where
A: RangeBounds<u16>,
R: Read,
fn load_into_mem<A, R>(
&mut self,
address_range: A,
rd: R
) -> Result<(), ZxMemoryError>where
A: RangeBounds<u16>,
R: Read,
Reads data into a paged-in memory area at the given address range.
Auto Trait Implementations§
impl<const MEM_SIZE: usize, const RAM_BOT: u16> RefUnwindSafe for SinglePageMemory<MEM_SIZE, RAM_BOT>
impl<const MEM_SIZE: usize, const RAM_BOT: u16> Send for SinglePageMemory<MEM_SIZE, RAM_BOT>
impl<const MEM_SIZE: usize, const RAM_BOT: u16> Sync for SinglePageMemory<MEM_SIZE, RAM_BOT>
impl<const MEM_SIZE: usize, const RAM_BOT: u16> Unpin for SinglePageMemory<MEM_SIZE, RAM_BOT>
impl<const MEM_SIZE: usize, const RAM_BOT: u16> UnwindSafe for SinglePageMemory<MEM_SIZE, RAM_BOT>
Blanket Implementations§
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
Formats each item in a sequence. Read more
source§impl<S, T> IntoSample<S> for Twhere
S: FromSample<T>,
impl<S, T> IntoSample<S> for Twhere
S: FromSample<T>,
source§fn into_sample(self) -> S
fn into_sample(self) -> S
Convert to
S
a sample type from self
.§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
Borrows
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
Immutable access to the
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
Mutable access to the
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
Immutable access to the
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
Mutable access to the
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
Immutable access to the
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Mutable access to the
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds. Read more§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds. Read more§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds. Read more§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
Calls
.tap_ref()
only in debug builds, and is erased in release
builds. Read more§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds. Read more