Map the RESET button to CTRL-F1

This commit is contained in:
Ivan Izaguirre 2019-11-21 00:13:53 +01:00
parent 202f7b36ce
commit 5b8409413c
3 changed files with 10 additions and 1 deletions

View File

@ -114,8 +114,9 @@ Line:
### Keys ### Keys
- Ctrl-F1: Reset button
- F5: Toggle speed between real and fastest - 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 - F6: Toggle between NTSC color TV and green phosphor monochrome monitor
- F7: Save current state to disk - F7: Save current state to disk
- F8: Restore state from disk - F8: Restore state from disk

View File

@ -121,6 +121,8 @@ const (
CommandToggleCPUTrace CommandToggleCPUTrace
// CommandKill stops the cpu execution loop // CommandKill stops the cpu execution loop
CommandKill CommandKill
// CommandReset executes a 6502 reset
CommandReset
) )
// SendCommand enqueues a command to the emulator thread // 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) fmt.Printf("Chargen page %v\n", a.cg.page)
case CommandToggleCPUTrace: case CommandToggleCPUTrace:
a.cpu.SetTrace(!a.cpu.GetTrace()) a.cpu.SetTrace(!a.cpu.GetTrace())
case CommandReset:
a.cpu.Reset()
} }
} }

View File

@ -96,6 +96,10 @@ func (k *sdlKeyboard) putKey(keyEvent *sdl.KeyboardEvent) {
result = 127 // Base64A result = 127 // Base64A
// Control of the emulator // Control of the emulator
case sdl.K_F1:
if ctrl {
k.a.SendCommand(apple2.CommandReset)
}
case sdl.K_F5: case sdl.K_F5:
if ctrl { if ctrl {
k.a.SendCommand(apple2.CommandShowSpeed) k.a.SendCommand(apple2.CommandShowSpeed)