-
-
Notifications
You must be signed in to change notification settings - Fork 212
GB_write_memory
void GB_write_memory(GB_gameboy_t *gb, uint16_t addr, uint8_t value);
In memory.h
Performs an 8-bit memory write on a 16-bit address on the emulator instance, as if it were performed by the SM83 CPU.
GB_write_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).
The ROM is not writable, as the CPU is unable to perform a ROM write. Attempting to write to the ROM will perform an MBC register write, just as if the write was performed by the CPU. To dynamically modify the ROM, use GB_get_direct_access.
To write data outside of a currently mapped bank, or to write to a memory region that might not be currently writable (e.g., VRAM during mode 3), you can use GB_get_direct_access.