SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 9e57201b0820ece8b1087579422347f2f776e3a6 parent 25e3414974cbc463ac2ab261764deb91a65b56fc Author: Lior Halphon <LIJI32@gmail.com> Date: Sun, 5 Dec 2021 16:18:54 +0200 Accurate IF clear timing Diffstat:
| M | Core/sm83_cpu.c | 4 | ++++ |
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/Core/sm83_cpu.c b/Core/sm83_cpu.c @@ -1639,6 +1639,10 @@ void GB_cpu_run(GB_gameboy_t *gb) interrupt_queue >>= 1; interrupt_bit++; } + assert(gb->pending_cycles > 2); + gb->pending_cycles -= 2; + flush_pending_cycles(gb); + gb->pending_cycles = 2; gb->io_registers[GB_IO_IF] &= ~(1 << interrupt_bit); gb->pc = interrupt_bit * 8 + 0x40; }
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.