From eaaf63a06994b592ac6c7c5fb0d8161acbc8e9a3 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Tue, 5 Dec 2017 18:41:34 -0600 Subject: [PATCH] Zero out last_addr and cycles This fixes a super-annoying bug in the unit-test suite where we would fail randomly because sometimes last_addr would have garbage in it. --- src/mos6502.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mos6502.c b/src/mos6502.c index 512a75d..649b622 100644 --- a/src/mos6502.c +++ b/src/mos6502.c @@ -149,6 +149,8 @@ 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;