SplitScript reference / GenesisEmulator / read

GenesisEmulator.read

Method

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

Reads a typed value from emulated Genesis work RAM.

Valid reads lie entirely within 0x0000..=0xffff. Unaligned reads work across 16-bit word boundaries, and primitive values, record fields, and fixed-array elements use the Genesis's big-endian byte order.

Parameters

  • address: The original Genesis work-RAM offset.

Effects: reads process memory, requires an attached process

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

Examples

Read an unaligned emulated value

let score: u32 = genesis.read(0x1201) else 0