Struct 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_descriptor§num_descriptors: c_uint

Trait Implementations§

Source§

impl Clone for retro_memory_map

Source§

fn clone(&self) -> retro_memory_map

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for retro_memory_map

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for retro_memory_map

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.