From 3d70e69f6c9fbdcb890c6986096330e4f6611a32 Mon Sep 17 00:00:00 2001 From: Peter Fors Date: Thu, 29 May 2025 19:19:59 +0200 Subject: added mapper_tick() functionality, regressed 200fps, and optimized it back up to ~1940fps --- cpu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'cpu.c') diff --git a/cpu.c b/cpu.c index 23825aa..f6a070e 100644 --- a/cpu.c +++ b/cpu.c @@ -80,13 +80,10 @@ static inline void check_interrupts(struct nes_state *state) { static inline void cpu_tick(struct nes_state *state) { struct cpu_state * restrict cpu = &state->cpu; - check_interrupts(state); - uint8_t opcode; - // printf("%4.4x: ", cpu->pc); - opcode = memory_read(state, cpu->pc++); + uint8_t 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); } -- cgit v1.2.3