From 03a3113d02325ab19bf263d3a29fdc2ab09528d4 Mon Sep 17 00:00:00 2001 From: 4am Date: Tue, 9 Nov 2021 13:39:16 -0500 Subject: [PATCH] store action GR screenshots in TOTAL.DATA --- Makefile | 6 +++++ bin/generate-mini-attract-mode.sh | 1 - res/ATTRACT.CONF | 2 +- res/ATTRACT/BC | 2 +- res/ATTRACT/FIREBUG | 4 +-- res/ATTRACT/OW | 2 +- res/ATTRACT/POLLYWOG | 2 +- src/constants.a | 2 +- src/fx/fx.gr.fizzle.a | 4 +-- src/prodos.path.a | 6 ++--- src/ui.attract.gr.a | 44 ++++++++++++++++++++----------- src/ui.wait.a | 4 --- 12 files changed, 47 insertions(+), 32 deletions(-) diff --git a/Makefile b/Makefile index 6b22fb5cd..b40a0f3ce 100644 --- a/Makefile +++ b/Makefile @@ -77,6 +77,7 @@ dsk: asm index build/HGR5.IDX \ build/HGR6.IDX \ build/DHGR.IDX \ + build/GR.IDX \ res/DECRUNCH \ res/JOYSTICK \ res/Finder.Data \ @@ -178,6 +179,11 @@ index: md asmfx asmprelaunch [ -f build/HGR6.IDX ] || ((for f in res/ACTION.HGR/[YZ]*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/ACTION.HGR > build/HGR6.IDX) [ -f build/DHGR.IDX ] || ((for f in res/ACTION.DHGR/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/ACTION.DHGR > build/DHGR.IDX) # +# precompute indexed files for GR action screenshots +# note: these can be padded because they are not compressed +# + [ -f build/GR.IDX ] || ((for f in res/ACTION.GR/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a -p build/TOTAL.DATA res/ACTION.GR > build/GR.IDX) +# # precompute indexed files for SHR artwork # note: these can not be padded because they are compressed and the decompressor needs the exact size # diff --git a/bin/generate-mini-attract-mode.sh b/bin/generate-mini-attract-mode.sh index f3ccccec7..c13f150d5 100755 --- a/bin/generate-mini-attract-mode.sh +++ b/bin/generate-mini-attract-mode.sh @@ -35,7 +35,6 @@ cat res/GAMES.CONF | cat res/SS/ACTGR*.CONF | egrep "(^|=)""$game""$" | cut -d"=" -f1 | - sed -e "s/^/ACTION.GR\//g" | sed -e "s/$/=D/g" | sort | uniq >> /tmp/g diff --git a/res/ATTRACT.CONF b/res/ATTRACT.CONF index 9e3812d2a..989c13613 100644 --- a/res/ATTRACT.CONF +++ b/res/ATTRACT.CONF @@ -28,7 +28,7 @@ # A = single HGR file (|key| is a file in /ACTION.HGR/) # B = single DHGR file (|key| is a file in /ACTION.DHGR/) # C = single SHR file (|key| is a file in /ARTWORK.SHR/) -# D = single GR file (|key| is arbitrary path from program root directory) +# D = single GR file (|key| is a file in /ACTION.GR/) # # Blank lines and lines beginning with '#' are ignored (like this one!) # A line beginning with '[' terminates the parsing diff --git a/res/ATTRACT/BC b/res/ATTRACT/BC index 7765ed8c3..dfabe154d 100644 --- a/res/ATTRACT/BC +++ b/res/ATTRACT/BC @@ -3,6 +3,6 @@ # This file is automatically generated # -ACTION.GR/BC=D +BC=D [eof] diff --git a/res/ATTRACT/FIREBUG b/res/ATTRACT/FIREBUG index 11ff8f279..5a81456af 100644 --- a/res/ATTRACT/FIREBUG +++ b/res/ATTRACT/FIREBUG @@ -4,8 +4,8 @@ # FIREBUG=C -ACTION.GR/FIREBUG2=D -ACTION.GR/FIREBUG=D +FIREBUG2=D +FIREBUG=D FIREBUG=0 [eof] diff --git a/res/ATTRACT/OW b/res/ATTRACT/OW index 3c885f292..2d2a6efc4 100644 --- a/res/ATTRACT/OW +++ b/res/ATTRACT/OW @@ -3,6 +3,6 @@ # This file is automatically generated # -ACTION.GR/OW=D +OW=D [eof] diff --git a/res/ATTRACT/POLLYWOG b/res/ATTRACT/POLLYWOG index 645de6cb2..aa27d927a 100644 --- a/res/ATTRACT/POLLYWOG +++ b/res/ATTRACT/POLLYWOG @@ -3,6 +3,6 @@ # This file is automatically generated # -ACTION.GR/POLLYWOG=D +POLLYWOG=D [eof] diff --git a/src/constants.a b/src/constants.a index e751a921a..17c719c4a 100644 --- a/src/constants.a +++ b/src/constants.a @@ -156,7 +156,7 @@ PRELAUNCH_STANDARD_SIZE = 61 ; LoadStandardPrelaunch, eventually to be d iCurBlockLo = $D401 ; constant iCurBlockHi = $D403 ; constant launchpatch = $D662 ; glue.launch.a -iAddToPath = $FE90 ; Roger Rabbit, avoid, use Infiltrator 2 style instead +iAddToPath = $FE94 ; Roger Rabbit, avoid, use Infiltrator 2 style instead itraverse = $D964 ; Roger Rabbit, avoid, use Infiltrator 2 style instead ldrlo = $55 ; constant ldrhi = $56 ; constant diff --git a/src/fx/fx.gr.fizzle.a b/src/fx/fx.gr.fizzle.a index 53e30a0ad..bcbfdae70 100644 --- a/src/fx/fx.gr.fizzle.a +++ b/src/fx/fx.gr.fizzle.a @@ -3,7 +3,7 @@ !cpu 6502 !to "build/FX/GR.FIZZLE",plain -*=$6400 +*=$6000 ;init RNG @@ -47,7 +47,7 @@ ora #4 sta $3d - eor #$64 + eor #$44 sta $27 ;set mask according to offset diff --git a/src/prodos.path.a b/src/prodos.path.a index 1aae17a3e..6e1e32b5d 100644 --- a/src/prodos.path.a +++ b/src/prodos.path.a @@ -80,9 +80,9 @@ kDHGRActionIndexFile !byte 8 !raw "DHGR.IDX" -kGRActionDirectory - !byte 10 - !raw "ACTION.GR/" +kGRActionIndexFile + !byte 6 + !raw "GR.IDX" kDemoDirectory !byte 5 diff --git a/src/ui.attract.gr.a b/src/ui.attract.gr.a index 73e3276b1..99cc5e6ea 100644 --- a/src/ui.attract.gr.a +++ b/src/ui.attract.gr.a @@ -33,14 +33,11 @@ GRActionSlideshow ; graphics mode set to display hi-res screen ;------------------------------------------------------------------------------ GRSingle - +ST16 @fname + +ST16 IndexedGRFilename jsr BlankGR ; switch to GR mode with initial blank screen - jsr LoadFile ; load GR screenshot into $6000 - !word kRootDirectory -@fname !word $FDFD ; SMC - !word $6000 - jsr LoadGRTransition ; load transition effect code at $6400 - jsr ExecuteTransitionAt6400AndWait + jsr LoadIndexedGRFile ; load GR screen at $4000 + jsr LoadGRTransition ; load transition effect code at $6000 + jsr ExecuteTransitionAt6000AndWait jmp BlankHGR ; switch back to HGR mode with initial blank screen on exit ;------------------------------------------------------------------------------ @@ -67,14 +64,14 @@ BlankGR ; ; in: none ; out: all registers and flags clobbered -; $6400..$BFFF/main contains transition effect code (probably not all +; $6000..$BFFF/main contains transition effect code (probably not all ; of that, but no promises) ;------------------------------------------------------------------------------ LoadGRTransition jsr LoadFile !word kFXDirectory !word kGRFizzleFile - !word $6400 + !word $6000 GRRTS rts ;------------------------------------------------------------------------------ @@ -92,7 +89,7 @@ GRActionCallback bit KBD bmi GRRTS - +ST16 + + +ST16 IndexedGRFilename jsr FindGameInActionSlideshow ; if game name is not found (C will be set here), it means the game @@ -100,9 +97,26 @@ GRActionCallback ; it from slideshows bcs GRRTS - jsr LoadFile ; load GR screenshot into $6000 - !word kGRActionDirectory -+ !word $FDFD ; SMC - !word $6000 + jsr LoadIndexedGRFile + jmp ExecuteTransitionAt6000AndWait - jmp ExecuteTransitionAt6400AndWait +LoadIndexedGRFile +; in: caller has set IndexedGRFilename +; out: all flags & registers clobbered + jsr LoadFile ; load index file into $4600 + !word kRootDirectory + !word kGRActionIndexFile +- !word $4600 + + jsr okvs_find + !word - +IndexedGRFilename + !word $FDFD ; SMC + +ST16 @indexRecordPtr + + jsr LoadIndexedFile ; load GR screenshot at $4000 + !word kTotalDataFile ; because that's where the transition code expects to find it + !word $4000 +@indexRecordPtr + !word $FDFD ; SMC + rts diff --git a/src/ui.wait.a b/src/ui.wait.a index 4a78aad0d..e08530753 100644 --- a/src/ui.wait.a +++ b/src/ui.wait.a @@ -4,7 +4,6 @@ ; UI functions for doing things then waiting, or waiting then doing things ; ; - ExecuteTransitionAt6000AndWait -; - ExecuteTransitionAt6400AndWait ; - ExecuteTransitionAtA000AndWait ; - ExecuteTransitionAndWait ; - WaitForKeyFor30Seconds @@ -13,9 +12,6 @@ ExecuteTransitionAt6000AndWait ldy #$60 +HIDE_NEXT_2_BYTES -ExecuteTransitionAt6400AndWait - ldy #$64 - +HIDE_NEXT_2_BYTES ExecuteTransitionAtA000AndWait ldy #$A0 ; /!\ execution falls through here to ExecuteTransitionAndWait