pub struct Emulator { /* private fields */ }
sms
only.Expand description
A SEGA Master System / GameGear emulator that the auto splitter is attached to.
Implementations§
Source§impl Emulator
impl Emulator
Sourcepub fn attach() -> Option<Self>
pub fn attach() -> Option<Self>
Attaches to the emulator process
Returns Option<T>
if successful, None
otherwise.
Supported emulators are:
- Retroarch, with one of the following cores:
genesis_plus_gx_libretro.dll
,genesis_plus_gx_wide_libretro.dll
,picodrive_libretro.dll
,smsplus_libretro.dll
,gearsystem_libretro.dll
- Fusion
- BlastEm
Sourcepub async fn wait_attach() -> Self
pub async fn wait_attach() -> Self
Asynchronously awaits attaching to a target emulator, yielding back to the runtime between each try.
Supported emulators are:
- Retroarch, with one of the following cores:
genesis_plus_gx_libretro.dll
,genesis_plus_gx_wide_libretro.dll
,picodrive_libretro.dll
,smsplus_libretro.dll
,gearsystem_libretro.dll
- Fusion
- BlastEm
Sourcepub fn is_open(&self) -> bool
pub fn is_open(&self) -> bool
Checks whether the emulator is still open. If it is not open anymore, you should drop the emulator.
Sourcepub const fn until_closes<F>(&self, future: F) -> UntilEmulatorCloses<'_, F> ⓘ
pub const fn until_closes<F>(&self, future: F) -> UntilEmulatorCloses<'_, F> ⓘ
Executes a future until the emulator process closes.
Sourcepub fn update(&self) -> bool
pub fn update(&self) -> bool
Calls the internal routines needed in order to find (and update, if needed) the address of the emulated RAM.
Returns true if successful, false otherwise.
Sourcepub fn get_address(&self, offset: u32) -> Result<Address, Error>
pub fn get_address(&self, offset: u32) -> Result<Address, Error>
Converts a SEGA Master System memory address to a real memory address in the emulator process’ virtual memory space
Valid addresses for the SMS range from 0xC000
to 0xDFFF
.
Sourcepub fn read<T: CheckedBitPattern>(&self, offset: u32) -> Result<T, Error>
pub fn read<T: CheckedBitPattern>(&self, offset: u32) -> Result<T, Error>
Reads any value from the emulated RAM.
The offset provided is meant to be the same used on the original hardware.
The SEGA Master System has 8KB of RAM, mapped from address
0xC000
to 0xDFFF
.
Providing any offset outside this range will return Err()
.