diff options
| author | Peter Fors <peter.fors@mindkiller.com> | 2025-04-03 20:02:00 +0200 |
|---|---|---|
| committer | Peter Fors <peter.fors@mindkiller.com> | 2025-04-03 20:02:00 +0200 |
| commit | 6274071e3857c1640cc5aef804cb86509ab312f9 (patch) | |
| tree | 1a4e56b3c3b4bfb4d8f0d2f588487d6e227c3b27 /memory.c | |
| parent | 971e51eebbf088f1ac590da1fc57e803eb1ee8cf (diff) | |
Move to glfw
Diffstat (limited to 'memory.c')
| -rw-r--r-- | memory.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -2,7 +2,7 @@ static uint8_t memory_read(struct nes_state *restrict state, uint32_t offset) { - state->cycle++; + state->cycles++; ppu_tick(state); ppu_tick(state); ppu_tick(state); if(offset > 0xffff) { @@ -30,17 +30,13 @@ static uint8_t memory_read(struct nes_state *restrict state, uint32_t offset) { } static void memory_write(struct nes_state *restrict state, uint32_t offset, uint8_t value) { - state->cycle++; + state->cycles++; ppu_tick(state); ppu_tick(state); ppu_tick(state); if(offset > 0xffff) { printf("%x\n", offset); } -// if(offset == 0x0300) { -// printf("WRITE $0300 = %02x @ PC=%04x\n", value, state->cpu.pc); -// } - if(offset < 0x2000) { state->ram[offset & 0x07ff] = value; } else if(offset < 0x4000) { @@ -81,7 +77,7 @@ static uint8_t memory_read_dma(struct nes_state *restrict state, uint32_t offset } static uint8_t memory_read_dummy(struct nes_state *restrict state, uint32_t offset) { - state->cycle++; + state->cycles++; ppu_tick(state); ppu_tick(state); ppu_tick(state); if(offset < 0x2000) { |
