SplitScript reference / GBAEmulator / read

GBAEmulator.read

Method

GBAEmulator.read<T>(address: u32) -> T! where T: MemoryReadable

Reads a typed value from emulated GBA memory.

The expected MemoryReadable type determines the byte layout. Valid reads lie entirely within EWRAM (0x02000000..0x02040000) or IWRAM (0x03000000..0x03008000).

Parameters

  • address: The original GBA hardware address.

Effects: reads process memory, requires an attached process

Runtime behavior: available while a process is attached, except in onDetach; synchronous

Examples

Read an emulated value

let room: u8 = gba.read(0x03000010) else 0