Struct rust_libretro_sys::retro_memory_map
source · [−]#[repr(C)]pub struct retro_memory_map {
pub descriptors: *const retro_memory_descriptor,
pub num_descriptors: c_uint,
}Expand description
The frontend may use the largest value of ‘start’+‘select’ in a certain namespace to infer the size of the address space.
If the address space is larger than that, a mapping with .ptr=NULL should be at the end of the array, with .select set to all ones for as long as the address space is big.
Sample descriptors (minus .ptr, and RETRO_MEMFLAG_ on the flags): SNES WRAM: .start=0x7E0000, .len=0x20000 (Note that this must be mapped before the ROM in most cases; some of the ROM mappers try to claim $7E0000, or at least $7E8000.) SNES SPC700 RAM: .addrspace=“S”, .len=0x10000 SNES WRAM mirrors: .flags=MIRROR, .start=0x000000, .select=0xC0E000, .len=0x2000 .flags=MIRROR, .start=0x800000, .select=0xC0E000, .len=0x2000 SNES WRAM mirrors, alternate equivalent descriptor: .flags=MIRROR, .select=0x40E000, .disconnect=~0x1FFF (Various similar constructions can be created by combining parts of the above two.) SNES LoROM (512KB, mirrored a couple of times): .flags=CONST, .start=0x008000, .select=0x408000, .disconnect=0x8000, .len=5121024 .flags=CONST, .start=0x400000, .select=0x400000, .disconnect=0x8000, .len=5121024 SNES HiROM (4MB): .flags=CONST, .start=0x400000, .select=0x400000, .len=410241024 .flags=CONST, .offset=0x8000, .start=0x008000, .select=0x408000, .len=410241024 SNES ExHiROM (8MB): .flags=CONST, .offset=0, .start=0xC00000, .select=0xC00000, .len=410241024 .flags=CONST, .offset=410241024, .start=0x400000, .select=0xC00000, .len=410241024 .flags=CONST, .offset=0x8000, .start=0x808000, .select=0xC08000, .len=410241024 .flags=CONST, .offset=410241024+0x8000, .start=0x008000, .select=0xC08000, .len=410241024 Clarify the size of the address space: .ptr=NULL, .select=0xFFFFFF .len can be implied by .select in many of them, but was included for clarity.
Fields
descriptors: *const retro_memory_descriptornum_descriptors: c_uintTrait Implementations
sourceimpl Clone for retro_memory_map
impl Clone for retro_memory_map
sourcefn clone(&self) -> retro_memory_map
fn clone(&self) -> retro_memory_map
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for retro_memory_map
impl Debug for retro_memory_map
impl Copy for retro_memory_map
Auto Trait Implementations
impl RefUnwindSafe for retro_memory_map
impl !Send for retro_memory_map
impl !Sync for retro_memory_map
impl Unpin for retro_memory_map
impl UnwindSafe for retro_memory_map
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
