#[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§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.