exit to GS/OS

This commit is contained in:
Peter Ferrie 2020-07-29 21:37:32 -07:00
parent 60663f5e8d
commit 068f485964
3 changed files with 22 additions and 1 deletions

View File

@ -330,6 +330,19 @@ PrintAsDecimal
OneTimeSetup
lda zpMachineStatus
sta MachineStatus ; save machine status in LC RAM
and #IS_IIGS
beq @NotGSOS
!cpu 65816
lda $E100BD ; Make sure GS/OS was the boot OS
!cpu 6502
beq @NotGSOS
ldx #5
- lda QuitToGSOS,x
sta PatchQuit,x
dex
bpl -
@NotGSOS
ldy #$0b
CopyDevs
lda $BF13,y
@ -439,3 +452,10 @@ CopyDevs
!byte 100
!byte 10
!byte 1
QuitToGSOS
!cpu 65816
clc
xce
jmp $E0D000
!cpu 6502

View File

@ -8,7 +8,7 @@
; LC RAM BANK 1
; D000..E908 - persistent data structures (gGlobalPrefsStore, gGamesListStore)
; ...unused...
; E926..FFF1 - main program code
; E914..FFF1 - main program code
; FFF2..FFF9 - API functions and global constants available for main program
; code, prelaunchers, transition effects, &c.
; (Wait/UnwaitForVBL, MockingboardStuff, MachineStatus)

View File

@ -17,6 +17,7 @@
OnQuit
jsr SwitchToBank2
jsr EnableAcceleratorAndSwitchToBank1
PatchQuit
inc $101 ; bank in ROM
+LDADDR ROM_REBOOT
+ST16 $104