diff --git a/README.md b/README.md index 6bab768..69299a2 100644 --- a/README.md +++ b/README.md @@ -114,8 +114,9 @@ Line: ### Keys +- Ctrl-F1: Reset button - F5: Toggle speed between real and fastest -- Ctrl F5: Show current speed in Mhz +- Ctrl-F5: Show current speed in Mhz - F6: Toggle between NTSC color TV and green phosphor monochrome monitor - F7: Save current state to disk - F8: Restore state from disk diff --git a/apple2.go b/apple2.go index b198e0d..b868327 100644 --- a/apple2.go +++ b/apple2.go @@ -121,6 +121,8 @@ const ( CommandToggleCPUTrace // CommandKill stops the cpu execution loop CommandKill + // CommandReset executes a 6502 reset + CommandReset ) // SendCommand enqueues a command to the emulator thread @@ -161,6 +163,8 @@ func (a *Apple2) executeCommand(command int) { fmt.Printf("Chargen page %v\n", a.cg.page) case CommandToggleCPUTrace: a.cpu.SetTrace(!a.cpu.GetTrace()) + case CommandReset: + a.cpu.Reset() } } diff --git a/apple2sdl/sdlKeyboard.go b/apple2sdl/sdlKeyboard.go index a8c2c2e..24298d0 100644 --- a/apple2sdl/sdlKeyboard.go +++ b/apple2sdl/sdlKeyboard.go @@ -96,6 +96,10 @@ func (k *sdlKeyboard) putKey(keyEvent *sdl.KeyboardEvent) { result = 127 // Base64A // Control of the emulator + case sdl.K_F1: + if ctrl { + k.a.SendCommand(apple2.CommandReset) + } case sdl.K_F5: if ctrl { k.a.SendCommand(apple2.CommandShowSpeed)