From d45b39b18037182a273bd1c92bda53ad76d6abab Mon Sep 17 00:00:00 2001 From: Ivan Izaguirre Date: Sat, 23 Nov 2019 18:29:56 +0100 Subject: [PATCH] Do not reset cycle counter on cpu reset --- apple2sdl/sdlKeyboard.go | 2 -- core6502/execute.go | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/apple2sdl/sdlKeyboard.go b/apple2sdl/sdlKeyboard.go index 24298d0..5565700 100644 --- a/apple2sdl/sdlKeyboard.go +++ b/apple2sdl/sdlKeyboard.go @@ -44,8 +44,6 @@ func (k *sdlKeyboard) putKey(keyEvent *sdl.KeyboardEvent) { 10 A=PEEK(49152) 20 PRINT A, A - 128 30 GOTO 10 - - Missing Reset button */ if keyEvent.Type != sdl.KEYDOWN { // Process only key pushes diff --git a/core6502/execute.go b/core6502/execute.go index a3c37c5..3f44439 100644 --- a/core6502/execute.go +++ b/core6502/execute.go @@ -72,10 +72,10 @@ func (s *State) ExecuteInstruction() { } } -// Reset resets the processor state. Moves the program counter to the vector in 0cfffc. +// Reset resets the processor. Moves the program counter to the vector in 0cfffc. func (s *State) Reset() { startAddress := getWord(s.mem, vectorReset) - s.cycles = 0 + s.cycles += 6 s.reg.setPC(startAddress) }