summaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/memory.c b/memory.c
index baf10e9..35c1d41 100644
--- a/memory.c
+++ b/memory.c
@@ -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) {