From 6765fa976f9f1391f578bc129ad2a4854b408dab Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Sun, 25 Nov 2018 19:46:34 -0800 Subject: [PATCH 1/2] sync --- winmake.bat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/winmake.bat b/winmake.bat index 61de20813..6f3d19d92 100644 --- a/winmake.bat +++ b/winmake.bat @@ -87,7 +87,8 @@ call :asm 1>nul copy /y res\_FileInformation.txt build\ >>build\log %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\LAUNCHER.SYSTEM" >>build\log %CADIUS% CREATEFOLDER "build\%DISK%" "/%VOLUME%/X/" >>build\log -%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\PREFS.CONF" >>build\log +1>nul copy /y res\prefs.conf build\PREFS.CONF >>build\log +%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\PREFS.CONF" >>build\log %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\GAMES.CONF" >>build\log %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\ATTRACT.CONF" >>build\log %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\FX.CONF" >>build\log From fe3493d2b35c0cef29b6e46169cce74e3815d598 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Mon, 26 Nov 2018 11:43:39 -0800 Subject: [PATCH 2/2] preserve screen holes across demo --- src/4cade.a | 1 + src/4cade.init.a | 5 ++++ src/glue.prorwts2.a | 55 +++++++++++++++++++++++++++++++++++++++++++ src/ui.attract.mode.a | 1 + 4 files changed, 62 insertions(+) diff --git a/src/4cade.a b/src/4cade.a index c801a5ef4..a8938127a 100644 --- a/src/4cade.a +++ b/src/4cade.a @@ -13,6 +13,7 @@ FirstMover Reenter ; self-running demos should call this to exit back to 4cade +READ_RAM1_WRITE_RAM1 jsr CloseHandles ; close any open handles to restore ProRWTS state to original + jsr SaveScreenHoles ; restore screen hole contents from saved copy Main ldx #$FF txs diff --git a/src/4cade.init.a b/src/4cade.init.a index 258dc8fa4..4c031ce7a 100644 --- a/src/4cade.init.a +++ b/src/4cade.init.a @@ -51,6 +51,11 @@ ProRWTSBuffer ; so we reuse as much of the 1-time code as possible ; and fill the rest with zeros OneTimeSetup + lda MachineStatus + sta oldstatus + jsr SaveScreenHoles ; save initial copy of screen hole content + lda #$91 + sta holepatch ; enable restoring of copy from now on lda hddopendir+1 ; save current directory as 'root' ldy hddopendir+3 +STAY gRootDirectory diff --git a/src/glue.prorwts2.a b/src/glue.prorwts2.a index 0be700628..23bef1988 100644 --- a/src/glue.prorwts2.a +++ b/src/glue.prorwts2.a @@ -7,6 +7,8 @@ ; - LoadFile ; - LoadDHRFile ; - SaveSmallFile +; - CloseHandles +; - SaveScreenHoles ; ; A general note about paths: ; @@ -240,6 +242,15 @@ traverse @go rts +;------------------------------------------------------------------------------ +; promote [private] +; +; tiny ProDOS-style interface for ProRWTS +; in: whatever ProDOS expects for the supported functions +; out: carry clear, A=0 +; X, Y, and other flags clobbered +;------------------------------------------------------------------------------ + promote !pseudopc $bf00 { lda $c08b @@ -269,6 +280,50 @@ ProDOS_prefix=$bfd0 } end_promote +;------------------------------------------------------------------------------ +; SaveScreenHoles +; preserve screen hole contents across demo execution +; to avoid crashing later on disk access +; +; in: nothing +; out: all flags clobbered +; all registers clobbered +;------------------------------------------------------------------------------ + +SaveScreenHoles + lda #4 + sta namhi + ldx #0 + stx namlo + sta bloklo +-- ldy #$78 +- lda (namlo),y + pha + lda holey_stuff,x +holepatch ;sta->lda + lda (namlo),y + pla + sta holey_stuff,x + inx + tya + eor #$80 + tay + bmi - + iny + bpl - + inc namhi + dec bloklo + bne -- + lda oldstatus + ldx MachineStatus + sta MachineStatus + sta oldstatus + rts +oldstatus + !byte 0 +holey_stuff + !fill 64 + ;------------------------------------------------------------------------------ ; ProDOS_enter ; intercept certain ProDOS requests diff --git a/src/ui.attract.mode.a b/src/ui.attract.mode.a index aa240c92d..bf57ce81a 100644 --- a/src/ui.attract.mode.a +++ b/src/ui.attract.mode.a @@ -82,6 +82,7 @@ gAttractIndex +LOAD_FILE_IMM @key + jsr SaveScreenHoles ; save screen hole contents in case game changes them ldx #(End_Prelaunch-Prelaunch-1) - lda Prelaunch,x ; copy pre-launch code to main memory sta $100,x