combine some IDX files

This commit is contained in:
4am 2021-11-12 20:46:05 -05:00
parent 4d7a06984e
commit 238fb799d7
25 changed files with 189 additions and 83 deletions

View File

@ -27,7 +27,7 @@ CADIUS=cadius
# version 3.1.0 or later # version 3.1.0 or later
EXOMIZER=exomizer mem -q -P23 -lnone EXOMIZER=exomizer mem -q -P23 -lnone
dsk: asm index dsk: index asmproboot asmlauncher
cp res/blank.hdv build/"$(DISK)" cp res/blank.hdv build/"$(DISK)"
cp res/_FileInformation.txt build/ cp res/_FileInformation.txt build/
$(CADIUS) ADDFILE build/"$(DISK)" "/$(VOLUME)/" build/LAUNCHER.SYSTEM >>build/log $(CADIUS) ADDFILE build/"$(DISK)" "/$(VOLUME)/" build/LAUNCHER.SYSTEM >>build/log
@ -46,13 +46,13 @@ dsk: asm index
# #
for f in \ for f in \
build/TOTAL.DATA \ build/TOTAL.DATA \
build/TOTAL.IDX \
res/TITLE \ res/TITLE \
res/COVER \ res/COVER \
res/HELP \ res/HELP \
build/PREFS.CONF \ build/PREFS.CONF \
build/CREDITS \ build/CREDITS \
build/HELPTEXT \ build/HELPTEXT \
build/ATTRACT.IDX \
build/SEARCH00.IDX \ build/SEARCH00.IDX \
build/SEARCH01.IDX \ build/SEARCH01.IDX \
build/SEARCH10.IDX \ build/SEARCH10.IDX \
@ -61,13 +61,6 @@ dsk: asm index
res/CACHE01.IDX \ res/CACHE01.IDX \
res/CACHE10.IDX \ res/CACHE10.IDX \
res/CACHE11.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/HGR0.IDX \
build/HGR1.IDX \ build/HGR1.IDX \
build/HGR2.IDX \ build/HGR2.IDX \
@ -75,8 +68,6 @@ dsk: asm index
build/HGR4.IDX \ build/HGR4.IDX \
build/HGR5.IDX \ build/HGR5.IDX \
build/HGR6.IDX \ build/HGR6.IDX \
build/DHGR.IDX \
build/GR.IDX \
res/DECRUNCH \ res/DECRUNCH \
res/JOYSTICK \ res/JOYSTICK \
res/Finder.Data \ res/Finder.Data \
@ -188,8 +179,20 @@ index: md asmfx asmprelaunch compress
[ -f build/ARTWORK.IDX ] || ((for f in res/ARTWORK.SHR/*; do \ [ -f build/ARTWORK.IDX ] || ((for f in res/ARTWORK.SHR/*; do \
echo "$$(basename $$f)"; \ echo "$$(basename $$f)"; \
done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/ARTWORK.SHR > build/ARTWORK.IDX) 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 asmlauncher: md
$(ACME) -DBUILDNUMBER=`git rev-list --count HEAD` src/4cade.a 2>build/relbase.log $(ACME) -DBUILDNUMBER=`git rev-list --count HEAD` src/4cade.a 2>build/relbase.log

19
bin/addfile.sh Executable file
View File

@ -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"

View File

@ -2,6 +2,7 @@
LAUNCHER.SYSTEM=Type(FF),AuxType(2000),Access(C3) LAUNCHER.SYSTEM=Type(FF),AuxType(2000),Access(C3)
TOTAL.DATA=Type(06),AuxType(0000),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) PREFS.CONF=Type(04),AuxType(BD00),Access(C3)
ATTRACT.IDX=Type(06),AuxType(6000),Access(C3) ATTRACT.IDX=Type(06),AuxType(6000),Access(C3)
MINIATTRACT.IDX=Type(06),AuxType(6000),Access(C3) MINIATTRACT.IDX=Type(06),AuxType(6000),Access(C3)

View File

@ -68,7 +68,8 @@
; ;
; MAIN MEMORY DURING PER-GAME HELP ; MAIN MEMORY DURING PER-GAME HELP
; 0800.. - help text ; 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 iCurBlockLo = $D401 ; constant
iCurBlockHi = $D403 ; constant iCurBlockHi = $D403 ; constant
launchpatch = $D662 ; glue.launch.a 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 itraverse = $D964 ; Roger Rabbit, avoid, use Infiltrator 2 style instead
ldrlo = $55 ; constant ldrlo = $55 ; constant
ldrhi = $56 ; constant ldrhi = $56 ; constant

View File

@ -127,10 +127,10 @@ PlayGameInAY
jsr ClearScreens ; avoid seeing code load into the HGR page jsr ClearScreens ; avoid seeing code load into the HGR page
; (clobbers $106, must do now before loading prelaunch code) ; (clobbers $106, must do now before loading prelaunch code)
jsr LoadFile ; load prelaunch index file jsr LoadIndexedFile ; load prelaunch index file
!word kRootDirectory !word kTotalIndexFile
!word kPrelaunchIndexFile
- !word gSearchCache - !word gSearchCache
!word kPrelaunchIndexRecord
jsr okvs_find jsr okvs_find
!word - !word -
@ -217,6 +217,5 @@ LoadStandardPrelaunch
!word $0106 !word $0106
!word + !word +
rts rts
+ !byte 0 +
!be24 0 !source "src/index/standard.prelaunch.a"
!le16 PRELAUNCH_STANDARD_SIZE

View File

@ -175,6 +175,8 @@ LoadIndexedFile
jsr @set_nameaddr jsr @set_nameaddr
+LDPARAMPTR 5, zpword +LDPARAMPTR 5, zpword
inc $BF0E ; disable ROM mapping on return inc $BF0E ; disable ROM mapping on return
jsr SwitchToBank2
jsr resetRoot
ldx #2 ldx #2
ldy #0 ldy #0
lda (zpword), y lda (zpword), y

8
src/index/artwork.idx.a Normal file
View File

@ -0,0 +1,8 @@
;
; Index record for build/ARTWORK.IDX
;
; This file is automatically generated
;
!byte 0
!be24 33099
!le16 4186

8
src/index/attract.idx.a Normal file
View File

@ -0,0 +1,8 @@
;
; Index record for build/ATTRACT.IDX
;
; This file is automatically generated
;
!byte 0
!be24 6132
!le16 5157

8
src/index/dfx.idx.a Normal file
View File

@ -0,0 +1,8 @@
;
; Index record for build/DFX.IDX
;
; This file is automatically generated
;
!byte 0
!be24 13435
!le16 1242

8
src/index/dhgr.idx.a Normal file
View File

@ -0,0 +1,8 @@
;
; Index record for build/DHGR.IDX
;
; This file is automatically generated
;
!byte 0
!be24 31757
!le16 1249

8
src/index/fx.idx.a Normal file
View File

@ -0,0 +1,8 @@
;
; Index record for build/FX.IDX
;
; This file is automatically generated
;
!byte 0
!be24 11289
!le16 2146

8
src/index/gamehelp.idx.a Normal file
View File

@ -0,0 +1,8 @@
;
; Index record for build/GAMEHELP.IDX
;
; This file is automatically generated
;
!byte 0
!be24 14677
!le16 6132

8
src/index/gr.idx.a Normal file
View File

@ -0,0 +1,8 @@
;
; Index record for build/GR.IDX
;
; This file is automatically generated
;
!byte 0
!be24 33006
!le16 93

View File

@ -0,0 +1,8 @@
;
; Index record for build/MINIATTRACT.IDX
;
; This file is automatically generated
;
!byte 0
!be24 25625
!le16 6132

View File

@ -0,0 +1,8 @@
;
; Index record for build/PRELAUNCH.IDX
;
; This file is automatically generated
;
!byte 0
!be24 0
!le16 6132

View File

@ -0,0 +1,8 @@
;
; Index record for build/SLIDESHOW.IDX
;
; This file is automatically generated
;
!byte 0
!be24 20809
!le16 4816

View File

@ -0,0 +1,8 @@
;
; Index record for standard prelaunch code
;
; The file is maintained by hand
;
!byte 0
!be24 0
!le16 PRELAUNCH_STANDARD_SIZE

View File

@ -57,6 +57,10 @@ kTotalDataFile
!byte 10 !byte 10
!raw "TOTAL.DATA" !raw "TOTAL.DATA"
kTotalIndexFile
!byte 9
!raw "TOTAL.IDX"
kHGRTitleDirectory kHGRTitleDirectory
!byte 10 !byte 10
!raw "TITLE.HGR/" !raw "TITLE.HGR/"
@ -76,13 +80,11 @@ gHGRActionIndexNumber
!raw "_" !raw "_"
!raw ".IDX" !raw ".IDX"
kDHGRActionIndexFile kDHGRActionIndexRecord
!byte 8 !source "src/index/dhgr.idx.a"
!raw "DHGR.IDX"
kGRActionIndexFile kGRActionIndexRecord
!byte 6 !source "src/index/gr.idx.a"
!raw "GR.IDX"
kDemoDirectory kDemoDirectory
!byte 5 !byte 5
@ -97,7 +99,7 @@ kFXDirectory
!byte 3 !byte 3
!raw "FX/" !raw "FX/"
kPrelaunchIndexFile kPrelaunchIndexRecord
!byte 13 !byte 13
!raw "PRELAUNCH.IDX" !raw "PRELAUNCH.IDX"
@ -109,33 +111,26 @@ kGlobalPrefsFilename
!byte 10 !byte 10
!raw "PREFS.CONF" !raw "PREFS.CONF"
kAttractModeIndexFile kAttractModeIndexRecord
!byte 11 !source "src/index/attract.idx.a"
!raw "ATTRACT.IDX"
kMiniAttractIndexFile kMiniAttractIndexRecord
!byte 15 !source "src/index/miniattract.idx.a"
!raw "MINIATTRACT.IDX"
kAttractModeSlideshowIndexFile kAttractModeSlideshowIndexRecord
!byte 13 !source "src/index/slideshow.idx.a"
!raw "SLIDESHOW.IDX"
kFXIndexFile kFXIndexRecord
!byte 6 !source "src/index/fx.idx.a"
!raw "FX.IDX"
kDFXIndexFile kDFXIndexRecord
!byte 7 !source "src/index/dfx.idx.a"
!raw "DFX.IDX"
kGameHelpIndexFile kGameHelpIndexRecord
!byte 12 !source "src/index/gamehelp.idx.a"
!raw "GAMEHELP.IDX"
kSHRArtworkIndexFile kSHRArtworkIndexRecord
!byte 11 !source "src/index/artwork.idx.a"
!raw "ARTWORK.IDX"
kCreditsFile kCreditsFile
!byte 7 !byte 7

View File

@ -133,10 +133,10 @@ gMachineInDHGRMode=*+1
; $6000..$BFFF/main contains transition effect code ; $6000..$BFFF/main contains transition effect code
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
LoadDHGRTransition LoadDHGRTransition
jsr LoadFile ; load DHGR transition effects list into $6000 jsr LoadIndexedFile ; load DHGR transition effects list into $6000
!word kRootDirectory !word kTotalIndexFile
!word kDFXIndexFile
- !word $6000 - !word $6000
!word kDFXIndexRecord
jsr pref_get ; get DHGR transition effect from prefs jsr pref_get ; get DHGR transition effect from prefs
!word kNextDFX !word kNextDFX
@ -320,10 +320,10 @@ RedrawForDHGR
LoadIndexedDHGRFile LoadIndexedDHGRFile
; in: caller has set IndexedDHGRFilename ; in: caller has set IndexedDHGRFilename
; out: all flags & registers clobbered ; out: all flags & registers clobbered
jsr LoadFile ; load index file into $4000 jsr LoadIndexedFile ; load index file into $4000
!word kRootDirectory !word kTotalIndexFile
!word kDHGRActionIndexFile
- !word $4000 - !word $4000
!word kDHGRActionIndexRecord
jsr okvs_find jsr okvs_find
!word - !word -

View File

@ -103,10 +103,10 @@ GRActionCallback
LoadIndexedGRFile LoadIndexedGRFile
; in: caller has set IndexedGRFilename ; in: caller has set IndexedGRFilename
; out: all flags & registers clobbered ; out: all flags & registers clobbered
jsr LoadFile ; load index file into $4600 jsr LoadIndexedFile ; load index file into $4600
!word kRootDirectory !word kTotalIndexFile
!word kGRActionIndexFile
- !word $4600 - !word $4600
!word kGRActionIndexRecord
jsr okvs_find jsr okvs_find
!word - !word -

View File

@ -64,10 +64,10 @@ HGRSingle
; $6000..$BFFF contains transition effect code ; $6000..$BFFF contains transition effect code
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
LoadHGRTransition LoadHGRTransition
jsr LoadFile ; load HGR transition effects list into $6000 jsr LoadIndexedFile ; load HGR transition effects list into $6000
!word kRootDirectory !word kTotalIndexFile
!word kFXIndexFile
- !word $6000 - !word $6000
!word kFXIndexRecord
jsr pref_get ; get HGR transition effect from prefs jsr pref_get ; get HGR transition effect from prefs
!word kNextFX !word kNextFX

View File

@ -24,10 +24,10 @@ MegaAttractMode
jsr BlankHGR ; switch to HGR page 1 (once cleared) jsr BlankHGR ; switch to HGR page 1 (once cleared)
jsr LoadFile ; load pre-parsed attract mode configuration data into $6000 jsr LoadIndexedFile ; load pre-parsed attract mode configuration data into $6000
!word kRootDirectory !word kTotalIndexFile
!word kAttractModeIndexFile
- !word $6000 - !word $6000
!word kAttractModeIndexRecord
jsr pref_get ; get attract mode module from prefs jsr pref_get ; get attract mode module from prefs
!word kNextAttract !word kNextAttract
@ -70,10 +70,10 @@ MegaAttractMode
MiniAttractMode MiniAttractMode
jsr GetGameToLaunch jsr GetGameToLaunch
+ST16 + +ST16 +
jsr LoadFile jsr LoadIndexedFile
!word kRootDirectory !word kTotalIndexFile
!word kMiniAttractIndexFile
- !word $0800 - !word $0800
!word kMiniAttractIndexRecord
jsr okvs_find jsr okvs_find
!word - !word -
+ !word $FDFD ; SMC + !word $FDFD ; SMC
@ -91,8 +91,6 @@ MiniAttractMode
stx @MiniAttractIndex+1 stx @MiniAttractIndex+1
stx @MiniAttractIndex+3 stx @MiniAttractIndex+3
@loop @loop
jsr SwitchToBank2
jsr resetRoot
jsr LoadIndexedFile jsr LoadIndexedFile
!word kTotalDataFile !word kTotalDataFile
- !word $6000 - !word $6000
@ -185,10 +183,10 @@ RunAttractModule
; it's a slideshow, so load slideshow configuration file ; it's a slideshow, so load slideshow configuration file
pha ; save module type pha ; save module type
jsr LoadFile ; load slideshow configuration file into $4000 jsr LoadIndexedFile ; load slideshow configuration file into $4000
!word kAttractModeSlideshowIndexFile !word kTotalIndexFile
!word kRootDirectory
- !word $4000 - !word $4000
!word kAttractModeSlideshowIndexRecord
jsr okvs_find jsr okvs_find
!word - !word -
@key2 !word $FDFD ; SMC @key2 !word $FDFD ; SMC

View File

@ -101,10 +101,10 @@ SHRArtworkCallback
LoadIndexedSHRFile LoadIndexedSHRFile
; in: caller has populated IndexedSHRFilename ; in: caller has populated IndexedSHRFilename
; out: all flags & registers clobbered ; out: all flags & registers clobbered
jsr LoadFile ; load index file into $2000 jsr LoadIndexedFile ; load index file into $2000
!word kRootDirectory !word kTotalIndexFile
!word kSHRArtworkIndexFile
- !word $2000 - !word $2000
!word kSHRArtworkIndexRecord
jsr okvs_find jsr okvs_find
!word - !word -

View File

@ -85,6 +85,8 @@ notLastGame
+STX16 gGameToLaunch +STX16 gGameToLaunch
jmp OnBrowseChanged jmp OnBrowseChanged
ReloadIndexAndLaunch
jsr ReloadSearchIndex
OnBrowseLaunch OnBrowseLaunch
jsr PlayGame jsr PlayGame
jsr BlankHGR jsr BlankHGR
@ -96,13 +98,11 @@ OnBrowseCheat
OnBrowseTab OnBrowseTab
jsr MiniAttractMode 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 cmp #$8D
beq OnBrowseLaunch beq ReloadIndexAndLaunch
; execution falls through here ; execution falls through here
ForceBrowseChanged ForceBrowseChanged
jsr ReloadSearchIndex
bit CLEARKBD bit CLEARKBD
; execution falls through here ; execution falls through here
OnBrowseChanged OnBrowseChanged

View File

@ -20,10 +20,10 @@ Help
bcs @global bcs @global
+ST16 @game +ST16 @game
jsr LoadFile jsr LoadIndexedFile
!word kRootDirectory !word kTotalIndexFile
!word kGameHelpIndexFile @okvsPtr !word gSearchCache
@okvsPtr !word $6000 !word kGameHelpIndexRecord
jsr okvs_find jsr okvs_find
!word @okvsPtr !word @okvsPtr