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

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)
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)

View File

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

View File

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

View File

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

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
!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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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