stable exit to GS/OS

This commit is contained in:
Peter Ferrie 2020-07-30 10:21:42 -07:00
parent 068f485964
commit 9c6a93029e
4 changed files with 13 additions and 8 deletions

View File

@ -46,6 +46,11 @@ Reenter
jsr DisableAccelerator ; back to 1 MHz (especially important on IIgs
; which restores default speed on Ctrl-Reset)
jsr CloseHandles ; close any open handles to restore ProRWTS
ldx #(end_promote-promote-1)
- lda promote,x ; copy ProDOS shim to main memory for GS/OS exit
sta $bf00,x
dex
bpl -
ldx #5
- lda ResetVector,x ; copy reentry wrapper to bottom of stack
sta $100,x ; (used as reset vector because //e always

View File

@ -336,7 +336,7 @@ OneTimeSetup
lda $E100BD ; Make sure GS/OS was the boot OS
!cpu 6502
beq @NotGSOS
ldx #5
ldx #(QuitToGSOS_e-QuitToGSOS)-1
- lda QuitToGSOS,x
sta PatchQuit,x
dex
@ -454,8 +454,14 @@ CopyDevs
!byte 1
QuitToGSOS
lda #$8B
sta ProDOS_exit+1 ; restore bank 1
lda #$FF ; no prefix
sta ProDOS_prefix
!cpu 65816
clc
xce
jmp $E0D000
!cpu 6502
QuitToGSOS_e

View File

@ -7,8 +7,7 @@
;
; LC RAM BANK 1
; D000..E908 - persistent data structures (gGlobalPrefsStore, gGamesListStore)
; ...unused...
; E914..FFF1 - main program code
; E909..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

@ -18,11 +18,6 @@ LaunchInternal
sty RestoreStackNextTime + 1
; tell |Reenter| to restore the stack and stack pointer
ldx #(end_promote-promote-1)
- lda promote,x ; copy ProDOS shim to main memory
sta $bf00,x
dex
bpl -
tya
ldy #$18
- sta $bf57,y