#[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_descriptor
§num_descriptors: c_uint
Trait Implementations§
Source§impl Clone for retro_memory_map
impl Clone for retro_memory_map
Source§fn clone(&self) -> retro_memory_map
fn clone(&self) -> retro_memory_map
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more