nes: fix write() bug

This commit is contained in:
Steven Hugg committed 2026-09-29 14:51:29 +02:00
1 parent b49d273d10
commit 54cd3e4823
5 files changed
+35 -4

No files matched your search

+5
View File
@@ -107,6 +107,11 @@ class JSNESMachine {
loadState(s) { this.p.loadState(s); }
read(a: number) { return this.p.readAddress(a); }
readConst(a: number) { return this.p.readAddress(a); }
// for the debugger: RAM, or the mapper, without cpu.write()'s bus cycle
write(a: number, v: number) {
if (a < 0x2000) this.p.nes.cpu.mem[a & 0x7ff] = v;
else this.p.nes.mmap.write(a, v);
}
connectProbe(probe: ProbeAll) { this.p.connectProbe(probe); }
}