SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit e9be438d9109af815f8e7b9d85fdb0de2092b7c9 parent 1b50856dcfd07b538933b59f23a93db64384d92c Author: Lior Halphon <LIJI32@gmail.com> Date: Tue, 4 Jul 2023 00:21:57 +0300 Turns out jr triggers the OAM bug, thanks Sono! Diffstat:
| M | Core/sm83_cpu.c | 8 | ++++---- |
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Core/sm83_cpu.c b/Core/sm83_cpu.c @@ -721,9 +721,9 @@ static void rra(GB_gameboy_t *gb, uint8_t opcode) static void jr_r8(GB_gameboy_t *gb, uint8_t opcode) { - /* Todo: Verify timing */ - gb->pc += (int8_t)cycle_read(gb, gb->pc) + 1; - cycle_no_access(gb); + int8_t offset = (int8_t)cycle_read(gb, gb->pc++); + cycle_oam_bug_pc(gb); + gb->pc += offset; } static bool condition_code(GB_gameboy_t *gb, uint8_t opcode) @@ -748,7 +748,7 @@ static void jr_cc_r8(GB_gameboy_t *gb, uint8_t opcode) int8_t offset = cycle_read(gb, gb->pc++); if (condition_code(gb, opcode)) { gb->pc += offset; - cycle_no_access(gb); + cycle_oam_bug_pc(gb); } }
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.