summaryrefslogtreecommitdiff
path: root/emu/6502.c
diff options
context:
space:
mode:
Diffstat (limited to 'emu/6502.c')
-rw-r--r--emu/6502.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/emu/6502.c b/emu/6502.c
index dbdf5a1..e39dc38 100644
--- a/emu/6502.c
+++ b/emu/6502.c
@@ -8,10 +8,19 @@ static const uint16_t reset_vector = 0xFFFC;
static const uint16_t ZP_base = 0x0;
static const uint16_t SP_base = 0x100;
-void cpu_6502_init( cpu_6502_t *cpu, bus_t *bus )
+void cpu_6502_init( cpu_6502_t *cpu, bus_t *bus, bool initialize )
{
cpu->bus = bus;
cpu->debug_flags = 0;
+ cpu->steps = 0;
+
+ if( initialize ) {
+ cpu->PC = 0x0000;
+ cpu->SP = 0x00;
+ cpu->A = 0x00;
+ cpu->X = 0x00;
+ cpu->Y = 0x00;
+ }
}
uint16_t cpu_6502_read_word( cpu_6502_t *cpu, uint16_t addr )