Skip to content

GB_safe_read_memory

Lior Halphon edited this page Nov 30, 2024 · 4 revisions

Definition

uint8_t GB_safe_read_memory(GB_gameboy_t *gb, uint16_t addr);

In memory.h

Description

Performs a memory read on a 16-bit address in the emulator instance and returns the 8-bit read value, while avoiding side effects that would occur if the CPU were to perform the same read.

Thread Safety

GB_safe_read_memory must not be called if the instance is being run in another thread, but may be called from the current one (via a callback).

Notes

To read data outside of a currently mapped bank, or to read from a memory region that might not be currently readable (e.g., VRAM during mode 3), you can use GB_get_direct_access.

See Also

Clone this wiki locally