-
-
Notifications
You must be signed in to change notification settings - Fork 216
GB_safe_read_memory
Lior Halphon edited this page Nov 30, 2024
·
4 revisions
uint8_t GB_safe_read_memory(GB_gameboy_t *gb, uint16_t addr);
In memory.h
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.
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).
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.