From b68d8bbf92d31a11825277479afdab8cf9ace942 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 30 Nov 2024 20:50:00 +0200 Subject: [PATCH] Updated GB_write_memory (markdown) --- GB_write_memory.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/GB_write_memory.md b/GB_write_memory.md index 1305968..8681547 100644 --- a/GB_write_memory.md +++ b/GB_write_memory.md @@ -6,8 +6,20 @@ In `memory.h` ## Description -TBD +Performs an 8-bit memory write on a 16-bit address on the emulator instance, as if it was performed by the SM83 CPU ## Thread Safety `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). + +## Notes + +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 like 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 writeable (e.g. VRAM during mode 3), you can use [[GB_get_direct_access]]. + +## See Also + +* [[GB_read_memory]] +* [[GB_safe_read_memory]] +* [[GB_get_direct_access]] \ No newline at end of file