From 50a84b4099e7f66c3ee782cb2a0c2579d41dfd32 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Tue, 5 Dec 2017 20:23:17 -0600 Subject: [PATCH] Remove cycles field from mos6502 struct It was both unused and not necessary, as we can simply compute the number of cycles in the execute function. --- include/mos6502.h | 15 --------------- src/mos6502.c | 1 - 2 files changed, 16 deletions(-) diff --git a/include/mos6502.h b/include/mos6502.h index d2cba91..b5675c2 100644 --- a/include/mos6502.h +++ b/include/mos6502.h @@ -54,21 +54,6 @@ typedef struct { */ vm_16bit last_addr; - /* - * This field contains the number of CPU cycles that the last - * instruction handled should consume. In order to accurately - * emulate any architecture, we must model the type of "wait" time - * each instruction would cause. - * - * It should also be pointed out that the number of cycles is both - * informed by the instruction _and_ the address mode. For example, - * an instruction executed in zero-page address mode would consume - * fewer cycles than one executed in absolute address mode, because - * in the latter, the CPU would have to read ahead to discover a - * 16-bit operand vs. the 8-bit operand in the former. - */ - int cycles; - /* * Our program counter register; this is what we'll use to determine * where we're "at" in memory while executing opcodes. We use a diff --git a/src/mos6502.c b/src/mos6502.c index c8fcc57..06f8133 100644 --- a/src/mos6502.c +++ b/src/mos6502.c @@ -150,7 +150,6 @@ mos6502_create() cpu->memory = vm_segment_create(MOS6502_MEMSIZE); cpu->last_addr = 0; - cpu->cycles = 0; cpu->PC = 0; cpu->A = 0; cpu->X = 0;