diff --git a/src/4cade.a b/src/4cade.a index db0c9a5d7..04963b957 100644 --- a/src/4cade.a +++ b/src/4cade.a @@ -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 diff --git a/src/4cade.init.a b/src/4cade.init.a index b66669aa0..f729a2ef5 100644 --- a/src/4cade.init.a +++ b/src/4cade.init.a @@ -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 diff --git a/src/constants.a b/src/constants.a index 3d1c50993..67674fc23 100644 --- a/src/constants.a +++ b/src/constants.a @@ -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) diff --git a/src/glue.launch.lc2.a b/src/glue.launch.lc2.a index c439a020f..f62863b5c 100644 --- a/src/glue.launch.lc2.a +++ b/src/glue.launch.lc2.a @@ -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