pub struct Emulator { /* private fields */ }
ps2
only.Expand description
A Playstation 2 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:
- PCSX2
- Retroarch (64-bit version, using the
pcsx2_libretro.dll
core)
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:
- PCSX2
- Retroarch (64-bit version, using the
pcsx2_libretro.dll
core)
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 PS2 memory address to a real memory address in the emulator process’ virtual memory space
Valid addresses for the PS2 range from 0x00100000
to 0x01FFFFFF
.
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.
In PS2, memory addresses are mapped at fixed locations starting
from 0x00100000
(addresses below this threashold are
reserved for the kernel).
Valid addresses for the PS2’s memory range from 0x00100000
to 0x01FFFFFF
Providing any offset outside the range of the PS2’s RAM will return
Err()
.
Sourcepub fn read_pointer_path<T: CheckedBitPattern>(
&self,
base_address: u32,
path: &[u32],
) -> Result<T, Error>
pub fn read_pointer_path<T: CheckedBitPattern>( &self, base_address: u32, path: &[u32], ) -> Result<T, Error>
Follows a path of pointers from the address given and reads a value of the type specified from the process at the end of the pointer path.