mirror of
https://github.com/freewilll/apple2-go.git
synced 2024-06-08 06:29:28 +00:00
moved reset to a better place
This commit is contained in:
parent
0f17ecfd21
commit
91cf87d297
|
@ -21,13 +21,6 @@ var resetKeysDown bool
|
|||
var fpsKeysDown bool
|
||||
var breakAddress *uint16
|
||||
|
||||
func reset() {
|
||||
bootVector := 0xfffc
|
||||
lsb := mmu.PageTable[bootVector>>8][bootVector&0xff] // TODO move readMemory to mmu
|
||||
msb := mmu.PageTable[(bootVector+1)>>8][(bootVector+1)&0xff]
|
||||
cpu.State.PC = uint16(lsb) + uint16(msb)<<8
|
||||
}
|
||||
|
||||
// checkSpecialKeys checks
|
||||
// - ctrl-alt-R has been pressed. Releasing the R does a warm reset
|
||||
// - ctrl-alt-F has been pressed, toggling FPS display
|
||||
|
@ -36,7 +29,7 @@ func checkSpecialKeys() {
|
|||
resetKeysDown = true
|
||||
} else if ebiten.IsKeyPressed(ebiten.KeyControl) && ebiten.IsKeyPressed(ebiten.KeyAlt) && !ebiten.IsKeyPressed(ebiten.KeyR) && resetKeysDown {
|
||||
resetKeysDown = false
|
||||
reset()
|
||||
cpu.Reset()
|
||||
|
||||
} else {
|
||||
resetKeysDown = false
|
||||
|
@ -97,7 +90,7 @@ func main() {
|
|||
audio.Mute = *mute
|
||||
system.Init()
|
||||
|
||||
reset()
|
||||
cpu.Reset()
|
||||
|
||||
ebiten.Run(update, 280*video.ScreenSizeFactor, 192*video.ScreenSizeFactor, 2, "Apple //e")
|
||||
}
|
||||
|
|
|
@ -852,3 +852,10 @@ func Run(showInstructions bool, breakAddress *uint16, disableFirmwareWait bool,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func Reset() {
|
||||
bootVector := 0xfffc
|
||||
lsb := mmu.PageTable[bootVector>>8][bootVector&0xff] // TODO move readMemory to mmu
|
||||
msb := mmu.PageTable[(bootVector+1)>>8][(bootVector+1)&0xff]
|
||||
State.PC = uint16(lsb) + uint16(msb)<<8
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user