From 238fb799d7ac22fb74637bf85a8e33364985c0c5 Mon Sep 17 00:00:00 2001 From: 4am Date: Fri, 12 Nov 2021 20:46:05 -0500 Subject: [PATCH] combine some IDX files --- Makefile | 29 ++++++++++--------- bin/addfile.sh | 19 +++++++++++++ res/_FileInformation.txt | 1 + src/constants.a | 5 ++-- src/glue.launch.a | 11 ++++---- src/glue.prorwts2.a | 2 ++ src/index/artwork.idx.a | 8 ++++++ src/index/attract.idx.a | 8 ++++++ src/index/dfx.idx.a | 8 ++++++ src/index/dhgr.idx.a | 8 ++++++ src/index/fx.idx.a | 8 ++++++ src/index/gamehelp.idx.a | 8 ++++++ src/index/gr.idx.a | 8 ++++++ src/index/miniattract.idx.a | 8 ++++++ src/index/prelaunch.idx.a | 8 ++++++ src/index/slideshow.idx.a | 8 ++++++ src/index/standard.prelaunch.a | 8 ++++++ src/prodos.path.a | 51 +++++++++++++++------------------- src/ui.attract.dhgr.a | 12 ++++---- src/ui.attract.gr.a | 6 ++-- src/ui.attract.hgr.a | 6 ++-- src/ui.attract.mode.a | 20 ++++++------- src/ui.attract.shr.a | 6 ++-- src/ui.browse.mode.a | 8 +++--- src/ui.credits.a | 8 +++--- 25 files changed, 189 insertions(+), 83 deletions(-) create mode 100755 bin/addfile.sh create mode 100644 src/index/artwork.idx.a create mode 100644 src/index/attract.idx.a create mode 100644 src/index/dfx.idx.a create mode 100644 src/index/dhgr.idx.a create mode 100644 src/index/fx.idx.a create mode 100644 src/index/gamehelp.idx.a create mode 100644 src/index/gr.idx.a create mode 100644 src/index/miniattract.idx.a create mode 100644 src/index/prelaunch.idx.a create mode 100644 src/index/slideshow.idx.a create mode 100644 src/index/standard.prelaunch.a diff --git a/Makefile b/Makefile index ac2bc6c12..57f70e255 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ CADIUS=cadius # version 3.1.0 or later EXOMIZER=exomizer mem -q -P23 -lnone -dsk: asm index +dsk: index asmproboot asmlauncher cp res/blank.hdv build/"$(DISK)" cp res/_FileInformation.txt build/ $(CADIUS) ADDFILE build/"$(DISK)" "/$(VOLUME)/" build/LAUNCHER.SYSTEM >>build/log @@ -46,13 +46,13 @@ dsk: asm index # for f in \ build/TOTAL.DATA \ + build/TOTAL.IDX \ res/TITLE \ res/COVER \ res/HELP \ build/PREFS.CONF \ build/CREDITS \ build/HELPTEXT \ - build/ATTRACT.IDX \ build/SEARCH00.IDX \ build/SEARCH01.IDX \ build/SEARCH10.IDX \ @@ -61,13 +61,6 @@ dsk: asm index res/CACHE01.IDX \ res/CACHE10.IDX \ res/CACHE11.IDX \ - build/FX.IDX \ - build/DFX.IDX \ - build/GAMEHELP.IDX \ - build/SLIDESHOW.IDX \ - build/MINIATTRACT.IDX \ - build/PRELAUNCH.IDX \ - build/ARTWORK.IDX \ build/HGR0.IDX \ build/HGR1.IDX \ build/HGR2.IDX \ @@ -75,8 +68,6 @@ dsk: asm index build/HGR4.IDX \ build/HGR5.IDX \ build/HGR6.IDX \ - build/DHGR.IDX \ - build/GR.IDX \ res/DECRUNCH \ res/JOYSTICK \ res/Finder.Data \ @@ -188,8 +179,20 @@ index: md asmfx asmprelaunch compress [ -f build/ARTWORK.IDX ] || ((for f in res/ARTWORK.SHR/*; do \ echo "$$(basename $$f)"; \ done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/ARTWORK.SHR > build/ARTWORK.IDX) - -asm: asmlauncher asmfx asmprelaunch asmproboot +# +# add IDX files to the combined index file and generate +# the index records that callers use to reference them +# + bin/addfile.sh build/PRELAUNCH.IDX build/TOTAL.IDX > src/index/prelaunch.idx.a + bin/addfile.sh build/ATTRACT.IDX build/TOTAL.IDX > src/index/attract.idx.a + bin/addfile.sh build/FX.IDX build/TOTAL.IDX > src/index/fx.idx.a + bin/addfile.sh build/DFX.IDX build/TOTAL.IDX > src/index/dfx.idx.a + bin/addfile.sh build/GAMEHELP.IDX build/TOTAL.IDX > src/index/gamehelp.idx.a + bin/addfile.sh build/SLIDESHOW.IDX build/TOTAL.IDX > src/index/slideshow.idx.a + bin/addfile.sh build/MINIATTRACT.IDX build/TOTAL.IDX > src/index/miniattract.idx.a + bin/addfile.sh build/DHGR.IDX build/TOTAL.IDX > src/index/dhgr.idx.a + bin/addfile.sh build/GR.IDX build/TOTAL.IDX > src/index/gr.idx.a + bin/addfile.sh build/ARTWORK.IDX build/TOTAL.IDX > src/index/artwork.idx.a asmlauncher: md $(ACME) -DBUILDNUMBER=`git rev-list --count HEAD` src/4cade.a 2>build/relbase.log diff --git a/bin/addfile.sh b/bin/addfile.sh new file mode 100755 index 000000000..3b70c7956 --- /dev/null +++ b/bin/addfile.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# parameters +# 1 - input file +# 2 - output filename for data file +# stdout - source code of index record + +touch "$2" +size=$(wc -c < "$1") +offset=$(wc -c < "$2") +cat "$1" >> "$2" +echo ";" +echo "; Index record for $1" +echo ";" +echo "; This file is automatically generated" +echo ";" +echo " !byte 0" +echo " !be24 $offset" +echo " !le16 $size" diff --git a/res/_FileInformation.txt b/res/_FileInformation.txt index 1d02728a4..26614321a 100644 --- a/res/_FileInformation.txt +++ b/res/_FileInformation.txt @@ -2,6 +2,7 @@ LAUNCHER.SYSTEM=Type(FF),AuxType(2000),Access(C3) TOTAL.DATA=Type(06),AuxType(0000),Access(C3) +TOTAL.IDX=Type(06),AuxType(0000),Access(C3) PREFS.CONF=Type(04),AuxType(BD00),Access(C3) ATTRACT.IDX=Type(06),AuxType(6000),Access(C3) MINIATTRACT.IDX=Type(06),AuxType(6000),Access(C3) diff --git a/src/constants.a b/src/constants.a index 7bd36bdef..2af4de37b 100644 --- a/src/constants.a +++ b/src/constants.a @@ -68,7 +68,8 @@ ; ; MAIN MEMORY DURING PER-GAME HELP ; 0800.. - help text -; 6000.. - game help index file +; 6000..9FFF - search index +; A000.. - game help index file ; ;------------------------------------------------------------------------------ @@ -201,7 +202,7 @@ PRELAUNCH_STANDARD_SIZE = 61 ; LoadStandardPrelaunch, eventually to be d iCurBlockLo = $D401 ; constant iCurBlockHi = $D403 ; constant launchpatch = $D662 ; glue.launch.a -iAddToPath = $FE94 ; Roger Rabbit, avoid, use Infiltrator 2 style instead +iAddToPath = $FEB6 ; 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/glue.launch.a b/src/glue.launch.a index 44a1d3faf..ddabc4942 100644 --- a/src/glue.launch.a +++ b/src/glue.launch.a @@ -127,10 +127,10 @@ PlayGameInAY jsr ClearScreens ; avoid seeing code load into the HGR page ; (clobbers $106, must do now before loading prelaunch code) - jsr LoadFile ; load prelaunch index file - !word kRootDirectory - !word kPrelaunchIndexFile + jsr LoadIndexedFile ; load prelaunch index file + !word kTotalIndexFile - !word gSearchCache + !word kPrelaunchIndexRecord jsr okvs_find !word - @@ -217,6 +217,5 @@ LoadStandardPrelaunch !word $0106 !word + rts -+ !byte 0 - !be24 0 - !le16 PRELAUNCH_STANDARD_SIZE ++ + !source "src/index/standard.prelaunch.a" diff --git a/src/glue.prorwts2.a b/src/glue.prorwts2.a index f8eda4ab3..511f6e805 100644 --- a/src/glue.prorwts2.a +++ b/src/glue.prorwts2.a @@ -175,6 +175,8 @@ LoadIndexedFile jsr @set_nameaddr +LDPARAMPTR 5, zpword inc $BF0E ; disable ROM mapping on return + jsr SwitchToBank2 + jsr resetRoot ldx #2 ldy #0 lda (zpword), y diff --git a/src/index/artwork.idx.a b/src/index/artwork.idx.a new file mode 100644 index 000000000..92e2bcfa5 --- /dev/null +++ b/src/index/artwork.idx.a @@ -0,0 +1,8 @@ +; +; Index record for build/ARTWORK.IDX +; +; This file is automatically generated +; + !byte 0 + !be24 33099 + !le16 4186 diff --git a/src/index/attract.idx.a b/src/index/attract.idx.a new file mode 100644 index 000000000..6ba3afffd --- /dev/null +++ b/src/index/attract.idx.a @@ -0,0 +1,8 @@ +; +; Index record for build/ATTRACT.IDX +; +; This file is automatically generated +; + !byte 0 + !be24 6132 + !le16 5157 diff --git a/src/index/dfx.idx.a b/src/index/dfx.idx.a new file mode 100644 index 000000000..c985e82fd --- /dev/null +++ b/src/index/dfx.idx.a @@ -0,0 +1,8 @@ +; +; Index record for build/DFX.IDX +; +; This file is automatically generated +; + !byte 0 + !be24 13435 + !le16 1242 diff --git a/src/index/dhgr.idx.a b/src/index/dhgr.idx.a new file mode 100644 index 000000000..59f045526 --- /dev/null +++ b/src/index/dhgr.idx.a @@ -0,0 +1,8 @@ +; +; Index record for build/DHGR.IDX +; +; This file is automatically generated +; + !byte 0 + !be24 31757 + !le16 1249 diff --git a/src/index/fx.idx.a b/src/index/fx.idx.a new file mode 100644 index 000000000..0e113c95f --- /dev/null +++ b/src/index/fx.idx.a @@ -0,0 +1,8 @@ +; +; Index record for build/FX.IDX +; +; This file is automatically generated +; + !byte 0 + !be24 11289 + !le16 2146 diff --git a/src/index/gamehelp.idx.a b/src/index/gamehelp.idx.a new file mode 100644 index 000000000..85d3c4dd7 --- /dev/null +++ b/src/index/gamehelp.idx.a @@ -0,0 +1,8 @@ +; +; Index record for build/GAMEHELP.IDX +; +; This file is automatically generated +; + !byte 0 + !be24 14677 + !le16 6132 diff --git a/src/index/gr.idx.a b/src/index/gr.idx.a new file mode 100644 index 000000000..7515ac511 --- /dev/null +++ b/src/index/gr.idx.a @@ -0,0 +1,8 @@ +; +; Index record for build/GR.IDX +; +; This file is automatically generated +; + !byte 0 + !be24 33006 + !le16 93 diff --git a/src/index/miniattract.idx.a b/src/index/miniattract.idx.a new file mode 100644 index 000000000..2b2f979c1 --- /dev/null +++ b/src/index/miniattract.idx.a @@ -0,0 +1,8 @@ +; +; Index record for build/MINIATTRACT.IDX +; +; This file is automatically generated +; + !byte 0 + !be24 25625 + !le16 6132 diff --git a/src/index/prelaunch.idx.a b/src/index/prelaunch.idx.a new file mode 100644 index 000000000..f3993d401 --- /dev/null +++ b/src/index/prelaunch.idx.a @@ -0,0 +1,8 @@ +; +; Index record for build/PRELAUNCH.IDX +; +; This file is automatically generated +; + !byte 0 + !be24 0 + !le16 6132 diff --git a/src/index/slideshow.idx.a b/src/index/slideshow.idx.a new file mode 100644 index 000000000..49de3c7e4 --- /dev/null +++ b/src/index/slideshow.idx.a @@ -0,0 +1,8 @@ +; +; Index record for build/SLIDESHOW.IDX +; +; This file is automatically generated +; + !byte 0 + !be24 20809 + !le16 4816 diff --git a/src/index/standard.prelaunch.a b/src/index/standard.prelaunch.a new file mode 100644 index 000000000..65ba8257f --- /dev/null +++ b/src/index/standard.prelaunch.a @@ -0,0 +1,8 @@ +; +; Index record for standard prelaunch code +; +; The file is maintained by hand +; + !byte 0 + !be24 0 + !le16 PRELAUNCH_STANDARD_SIZE diff --git a/src/prodos.path.a b/src/prodos.path.a index 6e1e32b5d..567f7a746 100644 --- a/src/prodos.path.a +++ b/src/prodos.path.a @@ -57,6 +57,10 @@ kTotalDataFile !byte 10 !raw "TOTAL.DATA" +kTotalIndexFile + !byte 9 + !raw "TOTAL.IDX" + kHGRTitleDirectory !byte 10 !raw "TITLE.HGR/" @@ -76,13 +80,11 @@ gHGRActionIndexNumber !raw "_" !raw ".IDX" -kDHGRActionIndexFile - !byte 8 - !raw "DHGR.IDX" +kDHGRActionIndexRecord + !source "src/index/dhgr.idx.a" -kGRActionIndexFile - !byte 6 - !raw "GR.IDX" +kGRActionIndexRecord + !source "src/index/gr.idx.a" kDemoDirectory !byte 5 @@ -97,7 +99,7 @@ kFXDirectory !byte 3 !raw "FX/" -kPrelaunchIndexFile +kPrelaunchIndexRecord !byte 13 !raw "PRELAUNCH.IDX" @@ -109,33 +111,26 @@ kGlobalPrefsFilename !byte 10 !raw "PREFS.CONF" -kAttractModeIndexFile - !byte 11 - !raw "ATTRACT.IDX" +kAttractModeIndexRecord + !source "src/index/attract.idx.a" -kMiniAttractIndexFile - !byte 15 - !raw "MINIATTRACT.IDX" +kMiniAttractIndexRecord + !source "src/index/miniattract.idx.a" -kAttractModeSlideshowIndexFile - !byte 13 - !raw "SLIDESHOW.IDX" +kAttractModeSlideshowIndexRecord + !source "src/index/slideshow.idx.a" -kFXIndexFile - !byte 6 - !raw "FX.IDX" +kFXIndexRecord + !source "src/index/fx.idx.a" -kDFXIndexFile - !byte 7 - !raw "DFX.IDX" +kDFXIndexRecord + !source "src/index/dfx.idx.a" -kGameHelpIndexFile - !byte 12 - !raw "GAMEHELP.IDX" +kGameHelpIndexRecord + !source "src/index/gamehelp.idx.a" -kSHRArtworkIndexFile - !byte 11 - !raw "ARTWORK.IDX" +kSHRArtworkIndexRecord + !source "src/index/artwork.idx.a" kCreditsFile !byte 7 diff --git a/src/ui.attract.dhgr.a b/src/ui.attract.dhgr.a index 6cbfa2b0d..66ace9146 100644 --- a/src/ui.attract.dhgr.a +++ b/src/ui.attract.dhgr.a @@ -133,10 +133,10 @@ gMachineInDHGRMode=*+1 ; $6000..$BFFF/main contains transition effect code ;------------------------------------------------------------------------------ LoadDHGRTransition - jsr LoadFile ; load DHGR transition effects list into $6000 - !word kRootDirectory - !word kDFXIndexFile + jsr LoadIndexedFile ; load DHGR transition effects list into $6000 + !word kTotalIndexFile - !word $6000 + !word kDFXIndexRecord jsr pref_get ; get DHGR transition effect from prefs !word kNextDFX @@ -320,10 +320,10 @@ RedrawForDHGR LoadIndexedDHGRFile ; in: caller has set IndexedDHGRFilename ; out: all flags & registers clobbered - jsr LoadFile ; load index file into $4000 - !word kRootDirectory - !word kDHGRActionIndexFile + jsr LoadIndexedFile ; load index file into $4000 + !word kTotalIndexFile - !word $4000 + !word kDHGRActionIndexRecord jsr okvs_find !word - diff --git a/src/ui.attract.gr.a b/src/ui.attract.gr.a index 99cc5e6ea..507cb310d 100644 --- a/src/ui.attract.gr.a +++ b/src/ui.attract.gr.a @@ -103,10 +103,10 @@ GRActionCallback LoadIndexedGRFile ; in: caller has set IndexedGRFilename ; out: all flags & registers clobbered - jsr LoadFile ; load index file into $4600 - !word kRootDirectory - !word kGRActionIndexFile + jsr LoadIndexedFile ; load index file into $4600 + !word kTotalIndexFile - !word $4600 + !word kGRActionIndexRecord jsr okvs_find !word - diff --git a/src/ui.attract.hgr.a b/src/ui.attract.hgr.a index 8b3d44a75..32a590c23 100644 --- a/src/ui.attract.hgr.a +++ b/src/ui.attract.hgr.a @@ -64,10 +64,10 @@ HGRSingle ; $6000..$BFFF contains transition effect code ;------------------------------------------------------------------------------ LoadHGRTransition - jsr LoadFile ; load HGR transition effects list into $6000 - !word kRootDirectory - !word kFXIndexFile + jsr LoadIndexedFile ; load HGR transition effects list into $6000 + !word kTotalIndexFile - !word $6000 + !word kFXIndexRecord jsr pref_get ; get HGR transition effect from prefs !word kNextFX diff --git a/src/ui.attract.mode.a b/src/ui.attract.mode.a index 1209c2848..93d3b57e2 100644 --- a/src/ui.attract.mode.a +++ b/src/ui.attract.mode.a @@ -24,10 +24,10 @@ MegaAttractMode jsr BlankHGR ; switch to HGR page 1 (once cleared) - jsr LoadFile ; load pre-parsed attract mode configuration data into $6000 - !word kRootDirectory - !word kAttractModeIndexFile + jsr LoadIndexedFile ; load pre-parsed attract mode configuration data into $6000 + !word kTotalIndexFile - !word $6000 + !word kAttractModeIndexRecord jsr pref_get ; get attract mode module from prefs !word kNextAttract @@ -70,10 +70,10 @@ MegaAttractMode MiniAttractMode jsr GetGameToLaunch +ST16 + - jsr LoadFile - !word kRootDirectory - !word kMiniAttractIndexFile + jsr LoadIndexedFile + !word kTotalIndexFile - !word $0800 + !word kMiniAttractIndexRecord jsr okvs_find !word - + !word $FDFD ; SMC @@ -91,8 +91,6 @@ MiniAttractMode stx @MiniAttractIndex+1 stx @MiniAttractIndex+3 @loop - jsr SwitchToBank2 - jsr resetRoot jsr LoadIndexedFile !word kTotalDataFile - !word $6000 @@ -185,10 +183,10 @@ RunAttractModule ; it's a slideshow, so load slideshow configuration file pha ; save module type - jsr LoadFile ; load slideshow configuration file into $4000 - !word kAttractModeSlideshowIndexFile - !word kRootDirectory + jsr LoadIndexedFile ; load slideshow configuration file into $4000 + !word kTotalIndexFile - !word $4000 + !word kAttractModeSlideshowIndexRecord jsr okvs_find !word - @key2 !word $FDFD ; SMC diff --git a/src/ui.attract.shr.a b/src/ui.attract.shr.a index 067acf47c..3944db3c5 100644 --- a/src/ui.attract.shr.a +++ b/src/ui.attract.shr.a @@ -101,10 +101,10 @@ SHRArtworkCallback LoadIndexedSHRFile ; in: caller has populated IndexedSHRFilename ; out: all flags & registers clobbered - jsr LoadFile ; load index file into $2000 - !word kRootDirectory - !word kSHRArtworkIndexFile + jsr LoadIndexedFile ; load index file into $2000 + !word kTotalIndexFile - !word $2000 + !word kSHRArtworkIndexRecord jsr okvs_find !word - diff --git a/src/ui.browse.mode.a b/src/ui.browse.mode.a index dbc31fb21..b0c206aa8 100644 --- a/src/ui.browse.mode.a +++ b/src/ui.browse.mode.a @@ -85,6 +85,8 @@ notLastGame +STX16 gGameToLaunch jmp OnBrowseChanged +ReloadIndexAndLaunch + jsr ReloadSearchIndex OnBrowseLaunch jsr PlayGame jsr BlankHGR @@ -96,13 +98,11 @@ OnBrowseCheat OnBrowseTab jsr MiniAttractMode - pha ; must reload search index before calling either - jsr ReloadSearchIndex ; PlayGame or LoadGameTitleOffscreen, because - pla ; mini attract mode may have clobbered all of main memory cmp #$8D - beq OnBrowseLaunch + beq ReloadIndexAndLaunch ; execution falls through here ForceBrowseChanged + jsr ReloadSearchIndex bit CLEARKBD ; execution falls through here OnBrowseChanged diff --git a/src/ui.credits.a b/src/ui.credits.a index 38cb95480..9a4882a7f 100644 --- a/src/ui.credits.a +++ b/src/ui.credits.a @@ -20,10 +20,10 @@ Help bcs @global +ST16 @game - jsr LoadFile - !word kRootDirectory - !word kGameHelpIndexFile -@okvsPtr !word $6000 + jsr LoadIndexedFile + !word kTotalIndexFile +@okvsPtr !word gSearchCache + !word kGameHelpIndexRecord jsr okvs_find !word @okvsPtr