asr::emulator::gba

Struct Emulator

Source
pub struct Emulator { /* private fields */ }
Available on crate feature gba only.
Expand description

A Nintendo Gameboy Advance emulator that the auto splitter is attached to.

Implementations§

Source§

impl Emulator

Source

pub fn attach() -> Option<Self>

Attaches to the emulator process

Returns Option<Genesis> if successful, None otherwise.

Supported emulators are:

  • VisualBoyAdvance
  • VisualBoyAdvance-M
  • mGBA
  • NO$GBA
  • BizHawk
  • Retroarch, with one of the following cores: vbam_libretro.dll, vba_next_libretro.dll, mednafen_gba_libretro.dll, mgba_libretro.dll, gpsp_libretro.dll
Source

pub async fn wait_attach() -> Self

Asynchronously awaits attaching to a target emulator, yielding back to the runtime between each try.

Supported emulators are:

  • VisualBoyAdvance
  • VisualBoyAdvance-M
  • mGBA
  • NO$GBA
  • BizHawk
  • Retroarch, with one of the following cores: vbam_libretro.dll, vba_next_libretro.dll, mednafen_gba_libretro.dll, mgba_libretro.dll, gpsp_libretro.dll
Source

pub fn is_open(&self) -> bool

Checks whether the emulator is still open. If it is not open anymore, you should drop the emulator.

Source

pub const fn until_closes<F>(&self, future: F) -> UntilEmulatorCloses<'_, F>

Executes a future until the emulator process closes.

Source

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.

Source

pub fn get_address(&self, offset: u32) -> Result<Address, Error>

Converts a GBA memory address to a real memory address in the emulator process’ virtual memory space

Valid addresses range:

  • from 0x02000000 to 0x0203FFFF for EWRAM
  • from 0x03000000 to 0x03007FFF for IWRAM
Source

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 memory address as usually mapped on the original hardware. Valid addresses range:

  • from 0x02000000 to 0x0203FFFF for EWRAM
  • from 0x03000000 to 0x03007FFF for IWRAM

Values outside these ranges are invalid, and will make this method immediately return Err().

Source

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.

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> 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.