summaryrefslogtreecommitdiff
path: root/cpu.c
diff options
context:
space:
mode:
authorPeter Fors <peter.fors@mindkiller.com>2025-04-05 08:58:12 +0200
committerPeter Fors <peter.fors@mindkiller.com>2025-04-05 08:58:12 +0200
commitf1bd6a7d2f4ffe3e5263e0254bcf7522ab381264 (patch)
treee75bde292329f337d619f9a997aab9b17c37e38b /cpu.c
parent8c82be43720d9e221a9e2541c9ff6151015838bb (diff)
transform to switch case for ppu_tick()
Diffstat (limited to 'cpu.c')
-rw-r--r--cpu.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/cpu.c b/cpu.c
index eb7c837..263ee6e 100644
--- a/cpu.c
+++ b/cpu.c
@@ -92,13 +92,8 @@ static void cpu_tick(struct nes_state *state) {
uint8_t opcode;
- // if(cpu->pc <= 0x90cc || cpu->pc >= 0x90e6) {
- // printf("%5.5d %4.4x: ", line++, cpu->pc);
- // opcode = memory_read(state, cpu->pc++);
- // printf("%2.2x a:%2.2x x:%2.2x y:%2.2x p:%2.2x sp:%2.2x cycle: %ld\n", opcode, cpu->a, cpu->x, cpu->y, pack_flags(cpu), cpu->sp, state->cycles);
- // } else {
- opcode = memory_read(state, cpu->pc++);
- // }
+ // printf("%5.5d %4.4x: ", line++, cpu->pc);
+ opcode = memory_read(state, cpu->pc++);
+ // printf("%2.2x a:%2.2x x:%2.2x y:%2.2x p:%2.2x sp:%2.2x cycle: %ld\n", opcode, cpu->a, cpu->x, cpu->y, pack_flags(cpu), cpu->sp, state->cycles);
opcode_lut[opcode](state);
-
}