Do not reset cycle counter on cpu reset

This commit is contained in:
Ivan Izaguirre 2019-11-23 18:29:56 +01:00
parent e833d71fad
commit d45b39b180
2 changed files with 2 additions and 4 deletions

View File

@ -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

View File

@ -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)
}