SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 49ec02b3b371e031da32a261cf01112871bf9f1b parent e9be438d9109af815f8e7b9d85fdb0de2092b7c9 Author: Lior Halphon <LIJI32@gmail.com> Date: Tue, 4 Jul 2023 01:07:01 +0300 Replace cycle_oam_bug_pc with a generic call to cycle_oam_bug Diffstat:
| M | Core/sm83_cpu.c | 16 | +++------------- |
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/Core/sm83_cpu.c b/Core/sm83_cpu.c @@ -372,16 +372,6 @@ static void cycle_oam_bug(GB_gameboy_t *gb, uint8_t register_id) gb->pending_cycles = 4; } -static void cycle_oam_bug_pc(GB_gameboy_t *gb) -{ - if (gb->pending_cycles) { - GB_advance_cycles(gb, gb->pending_cycles); - } - gb->address_bus = gb->pc; - GB_trigger_oam_bug(gb, gb->pc); /* Todo: test T-cycle timing */ - gb->pending_cycles = 4; -} - static void flush_pending_cycles(GB_gameboy_t *gb) { if (gb->pending_cycles) { @@ -722,7 +712,7 @@ static void rra(GB_gameboy_t *gb, uint8_t opcode) static void jr_r8(GB_gameboy_t *gb, uint8_t opcode) { int8_t offset = (int8_t)cycle_read(gb, gb->pc++); - cycle_oam_bug_pc(gb); + cycle_oam_bug(gb, GB_REGISTER_PC); gb->pc += offset; } @@ -748,7 +738,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_oam_bug_pc(gb); + cycle_oam_bug(gb, GB_REGISTER_PC); } } @@ -1713,7 +1703,7 @@ void GB_cpu_run(GB_gameboy_t *gb) uint16_t call_addr = gb->pc; cycle_read(gb, gb->pc++); - cycle_oam_bug_pc(gb); + cycle_oam_bug(gb, GB_REGISTER_PC); gb->pc--; GB_trigger_oam_bug(gb, gb->sp); /* Todo: test T-cycle timing */ cycle_no_access(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.