merge TOTAL.IDX into TOTAL.DATA and remove filename parameter from LoadIndexedFile

This commit is contained in:
4am 2021-11-16 17:44:12 -05:00
parent cdaeb336f2
commit c7f6e02e2d
40 changed files with 65 additions and 115 deletions

View File

@ -44,7 +44,6 @@ dsk: index asmproboot asmlauncher
#
for f in \
build/TOTAL.DATA \
build/TOTAL.IDX \
res/TITLE \
res/COVER \
res/HELP \
@ -175,34 +174,33 @@ index: md asmfx asmprelaunch compress
# add IDX files to the combined index file and generate
# the index records that callers use to reference them
#
rm -f build/TOTAL.IDX
bin/addfile.sh build/SEARCH00.IDX build/TOTAL.IDX > src/index/search00.idx.a
bin/addfile.sh res/CACHE00.IDX build/TOTAL.IDX > src/index/cache00.idx.a
bin/addfile.sh build/SEARCH01.IDX build/TOTAL.IDX > src/index/search01.idx.a
bin/addfile.sh res/CACHE01.IDX build/TOTAL.IDX > src/index/cache01.idx.a
bin/addfile.sh build/SEARCH10.IDX build/TOTAL.IDX > src/index/search10.idx.a
bin/addfile.sh res/CACHE10.IDX build/TOTAL.IDX > src/index/cache10.idx.a
bin/addfile.sh build/SEARCH11.IDX build/TOTAL.IDX > src/index/search11.idx.a
bin/addfile.sh res/CACHE11.IDX build/TOTAL.IDX > src/index/cache11.idx.a
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/TITLE.IDX build/TOTAL.IDX > src/index/title.idx.a
bin/addfile.sh build/DTITLE.IDX build/TOTAL.IDX > src/index/dtitle.idx.a
bin/addfile.sh build/HGR0.IDX build/TOTAL.IDX > src/index/hgr0.idx.a
bin/addfile.sh build/HGR1.IDX build/TOTAL.IDX > src/index/hgr1.idx.a
bin/addfile.sh build/HGR2.IDX build/TOTAL.IDX > src/index/hgr2.idx.a
bin/addfile.sh build/HGR3.IDX build/TOTAL.IDX > src/index/hgr3.idx.a
bin/addfile.sh build/HGR4.IDX build/TOTAL.IDX > src/index/hgr4.idx.a
bin/addfile.sh build/HGR5.IDX build/TOTAL.IDX > src/index/hgr5.idx.a
bin/addfile.sh build/HGR6.IDX build/TOTAL.IDX > src/index/hgr6.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
[ -f build/index ] || bin/addfile.sh build/SEARCH00.IDX build/TOTAL.DATA > src/index/search00.idx.a
[ -f build/index ] || bin/addfile.sh res/CACHE00.IDX build/TOTAL.DATA > src/index/cache00.idx.a
[ -f build/index ] || bin/addfile.sh build/SEARCH01.IDX build/TOTAL.DATA > src/index/search01.idx.a
[ -f build/index ] || bin/addfile.sh res/CACHE01.IDX build/TOTAL.DATA > src/index/cache01.idx.a
[ -f build/index ] || bin/addfile.sh build/SEARCH10.IDX build/TOTAL.DATA > src/index/search10.idx.a
[ -f build/index ] || bin/addfile.sh res/CACHE10.IDX build/TOTAL.DATA > src/index/cache10.idx.a
[ -f build/index ] || bin/addfile.sh build/SEARCH11.IDX build/TOTAL.DATA > src/index/search11.idx.a
[ -f build/index ] || bin/addfile.sh res/CACHE11.IDX build/TOTAL.DATA > src/index/cache11.idx.a
[ -f build/index ] || bin/addfile.sh build/PRELAUNCH.IDX build/TOTAL.DATA > src/index/prelaunch.idx.a
[ -f build/index ] || bin/addfile.sh build/ATTRACT.IDX build/TOTAL.DATA > src/index/attract.idx.a
[ -f build/index ] || bin/addfile.sh build/FX.IDX build/TOTAL.DATA > src/index/fx.idx.a
[ -f build/index ] || bin/addfile.sh build/DFX.IDX build/TOTAL.DATA > src/index/dfx.idx.a
[ -f build/index ] || bin/addfile.sh build/GAMEHELP.IDX build/TOTAL.DATA > src/index/gamehelp.idx.a
[ -f build/index ] || bin/addfile.sh build/SLIDESHOW.IDX build/TOTAL.DATA > src/index/slideshow.idx.a
[ -f build/index ] || bin/addfile.sh build/MINIATTRACT.IDX build/TOTAL.DATA > src/index/miniattract.idx.a
[ -f build/index ] || bin/addfile.sh build/TITLE.IDX build/TOTAL.DATA > src/index/title.idx.a
[ -f build/index ] || bin/addfile.sh build/DTITLE.IDX build/TOTAL.DATA > src/index/dtitle.idx.a
[ -f build/index ] || bin/addfile.sh build/HGR0.IDX build/TOTAL.DATA > src/index/hgr0.idx.a
[ -f build/index ] || bin/addfile.sh build/HGR1.IDX build/TOTAL.DATA > src/index/hgr1.idx.a
[ -f build/index ] || bin/addfile.sh build/HGR2.IDX build/TOTAL.DATA > src/index/hgr2.idx.a
[ -f build/index ] || bin/addfile.sh build/HGR3.IDX build/TOTAL.DATA > src/index/hgr3.idx.a
[ -f build/index ] || bin/addfile.sh build/HGR4.IDX build/TOTAL.DATA > src/index/hgr4.idx.a
[ -f build/index ] || bin/addfile.sh build/HGR5.IDX build/TOTAL.DATA > src/index/hgr5.idx.a
[ -f build/index ] || bin/addfile.sh build/HGR6.IDX build/TOTAL.DATA > src/index/hgr6.idx.a
[ -f build/index ] || bin/addfile.sh build/DHGR.IDX build/TOTAL.DATA > src/index/dhgr.idx.a
[ -f build/index ] || bin/addfile.sh build/GR.IDX build/TOTAL.DATA > src/index/gr.idx.a
[ -f build/index ] || bin/addfile.sh build/ARTWORK.IDX build/TOTAL.DATA > src/index/artwork.idx.a
touch build/index
asmlauncher: md

View File

@ -11,7 +11,7 @@
; ...unused...
; E000..E3FF - HGR font data
; ...unused...
; E841..FFEE - main program code
; E893..FFEE - main program code
; FFEF..FFF9 - API functions and global constants available for main program
; code, prelaunchers, transition effects, &c.
; (LoadFileDirect, Wait/UnwaitForVBL, MockingboardStuff, MachineStatus)
@ -201,7 +201,7 @@ PRELAUNCH_STANDARD_SIZE = 61 ; LoadStandardPrelaunch, eventually to be d
iCurBlockLo = $D601 ; constant
iCurBlockHi = $D603 ; constant
launchpatch = $D853 ; glue.launch.a
iAddToPath = $FEB0 ; Roger Rabbit, avoid, use Infiltrator 2 style instead
iAddToPath = $FEBA ; Roger Rabbit, avoid, use Infiltrator 2 style instead
itraverse = $DB31 ; Roger Rabbit, avoid, use Infiltrator 2 style instead
ldrlo = $55 ; constant
ldrhi = $56 ; constant

View File

@ -128,7 +128,6 @@ PlayGameInAY
; (clobbers $106, must do now before loading prelaunch code)
jsr LoadIndexedFile ; load prelaunch index file
!word kTotalIndexFile
- !word gSearchCache
!word kPrelaunchIndexRecord
@ -138,7 +137,6 @@ PlayGameInAY
+ST16 @indexRecordPtr
jsr LoadIndexedFile
!word kTotalDataFile
!word $0106
@indexRecordPtr
!word $FDFD ; SMC
@ -213,7 +211,6 @@ Joystick
LoadStandardPrelaunch
jsr LoadIndexedFile ; load standard prelaunch code at $0106
!word kTotalDataFile
!word $0106
!word +
rts

View File

@ -100,10 +100,9 @@ LoadAuxFile
; record within the index. Most callers use okvs_find() for this, although some
; have hard-coded records generated at build time.
;
; in: stack contains 6 bytes of parameters:
; +1 [word] pointer to filename of merged data file
; +3 [word] address of load destination
; +5 [word] pointer to index record
; in: stack contains 4 bytes of parameters:
; +1 [word] address of load destination
; +3 [word] pointer to index record
; out: all flags clobbered
; all registers clobbered
;------------------------------------------------------------------------------
@ -113,9 +112,9 @@ LoadAuxIndexedFile
LoadIndexedFile
lda #$8D ; STA
sta @iauxreq
+PARAMS_ON_STACK 6
jsr @set_nameaddr
+LDPARAMPTR 5, zpword
+PARAMS_ON_STACK 4
+LDPARAMPTR 1, @address
+LDPARAMPTR 3, zpword
inc $BF0E ; disable ROM mapping on return
jsr SwitchToBank2
jsr resetRoot
@ -155,23 +154,10 @@ LoadIndexedFile
dec $BF0E ; re-enable ROM mapping on return
jmp SwitchToBank1
@set_nameaddr
ldx #0
ldy #1
jsr +
iny
ldx #@address - @filename
+ lda (PARAM), y
sta @filename, x
iny
lda (PARAM), y
sta @filename + 1, x
rts
@c8_parms
!byte 3
@filename
!word $DFDF ; SMC
!word kTotalDataFile
!byte 0
@ce_parms
!byte $d0

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 111209
!be24 9882226
!le16 4186

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 64624
!be24 9835641
!le16 5174

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 8000
!be24 9779017
!le16 3580

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 20332
!be24 9791349
!le16 3940

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 35693
!be24 9806710
!le16 4615

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 52930
!be24 9823947
!le16 5562

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 71944
!be24 9842961
!le16 1242

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 109867
!be24 9880884
!le16 1249

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 96015
!be24 9867032
!le16 464

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 69798
!be24 9840815
!le16 2146

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 73186
!be24 9844203
!le16 6132

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 111116
!be24 9882133
!le16 93

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 96479
!be24 9867496
!le16 4364

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 100843
!be24 9871860
!le16 1516

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 102359
!be24 9873376
!le16 1031

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 103390
!be24 9874407
!le16 3237

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 106627
!be24 9877644
!le16 2694

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 109321
!be24 9880338
!le16 441

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 109762
!be24 9880779
!le16 105

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 84154
!be24 9855171
!le16 6132

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 58492
!be24 9829509
!le16 6132

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 0
!be24 9771017
!le16 8000

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 11580
!be24 9782597
!le16 8752

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 24272
!be24 9795289
!le16 11421

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 40308
!be24 9811325
!le16 12622

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 79318
!be24 9850335
!le16 4836

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 90286
!be24 9861303
!le16 5729

View File

@ -134,10 +134,6 @@ kTotalDataFile
!byte 10
!raw "TOTAL.DATA"
kTotalIndexFile
!byte 9
!raw "TOTAL.IDX"
kAnimatedTitleDirectory
!byte 15
!raw "TITLE.ANIMATED/"

View File

@ -28,18 +28,16 @@ InputBuffer
;------------------------------------------------------------------------------
; ReloadSearchIndex
;
; Load index to support search UI
; Load indexes to support search UI
;
; in: none
; out: gSearchStore populated
;------------------------------------------------------------------------------
ReloadSearchIndex
jsr LoadIndexedFile ; load appropriate search index into $8200
!word kTotalIndexFile
!word gSearchIndex
!word kSearchIndexRecord
jsr LoadIndexedFile ; load appropriate search cache into $B000
!word kTotalIndexFile
!word gSearchCache
!word kSearchCacheRecord
rts

View File

@ -134,7 +134,6 @@ gMachineInDHGRMode=*+1
;------------------------------------------------------------------------------
LoadDHGRTransition
jsr LoadIndexedFile ; load DHGR transition effects list into $6000
!word kTotalIndexFile
- !word $6000
!word kDFXIndexRecord
@ -152,7 +151,6 @@ LoadDHGRTransition
+ !word $FDFD ; SMC
jsr LoadIndexedFile
!word kTotalDataFile
!word $6000
@indexRecordPtr
!word $FDFD ; SMC
@ -187,7 +185,6 @@ DHGRTitleCallback
+ST16 gGameToLaunch ; while it's visible (we'll launch it)
jsr LoadIndexedFile ; load index file into $4000
!word kTotalIndexFile
- !word $4000
!word kDHGRTitleIndexRecord
@ -332,7 +329,6 @@ LoadIndexedDHGRFile
; in: caller has set IndexedDHGRFilename
; out: all flags & registers clobbered
jsr LoadIndexedFile ; load index file into $4000
!word kTotalIndexFile
- !word $4000
!word kDHGRActionIndexRecord
@ -343,7 +339,6 @@ IndexedDHGRFilename
+ST16 @indexRecordPtr
jsr LoadAuxIndexedFile ; load compressed DHGR screenshot at aux $3FF8
!word kTotalDataFile
!word $3FF8
@indexRecordPtr
!word $FDFD ; SMC

View File

@ -104,7 +104,6 @@ LoadIndexedGRFile
; in: caller has set IndexedGRFilename
; out: all flags & registers clobbered
jsr LoadIndexedFile ; load index file into $4600
!word kTotalIndexFile
- !word $4600
!word kGRActionIndexRecord
@ -115,8 +114,7 @@ IndexedGRFilename
+ST16 @indexRecordPtr
jsr LoadIndexedFile ; load GR screenshot at $4000
!word kTotalDataFile ; because that's where the transition code expects to find it
!word $4000
!word $4000 ; because that's where the transition code expects to find it
@indexRecordPtr
!word $FDFD ; SMC
rts

View File

@ -65,7 +65,6 @@ HGRSingle
;------------------------------------------------------------------------------
LoadHGRTransition
jsr LoadIndexedFile ; load HGR transition effects list into $6000
!word kTotalIndexFile
- !word $6000
!word kFXIndexRecord
@ -83,7 +82,6 @@ LoadHGRTransition
+ !word $FDFD ; SMC
jsr LoadIndexedFile
!word kTotalDataFile
!word $6000
@indexRecordPtr
!word $FDFD ; SMC
@ -117,7 +115,6 @@ HGRTitleCallback
+ST16 gGameToLaunch ; while it's visible (we'll launch it)
jsr LoadIndexedFile ; load index file into $4000
!word kTotalIndexFile
- !word $4000
!word kHGRTitleIndexRecord
@ -127,7 +124,6 @@ HGRTitleCallback
+ST16 @indexRecordPtr
jsr LoadIndexedFile ; load HGR graphic at $4000
!word kTotalDataFile
!word $4000
@indexRecordPtr
!word $FDFD ; SMC
@ -180,7 +176,6 @@ LoadIndexedHGRFile
sta HGRActionIndexRecord+1
jsr LoadIndexedFile ; load index file into $4000
!word kTotalIndexFile
HGRActionIndexPtr
!word $4000
HGRActionIndexRecord
@ -193,7 +188,6 @@ IndexedHGRFilename
+ST16 @indexRecordPtr
jsr LoadIndexedFile ; load compressed HGR screenshot at $3FF8
!word kTotalDataFile
!word $3FF8
@indexRecordPtr
!word $FDFD ; SMC

View File

@ -25,7 +25,6 @@ MegaAttractMode
jsr BlankHGR ; switch to HGR page 1 (once cleared)
jsr LoadIndexedFile ; load pre-parsed attract mode configuration data into $6000
!word kTotalIndexFile
- !word $6000
!word kAttractModeIndexRecord
@ -71,7 +70,6 @@ MiniAttractMode
jsr GetGameToLaunch
+ST16 +
jsr LoadIndexedFile
!word kTotalIndexFile
- !word $0800
!word kMiniAttractIndexRecord
jsr okvs_find
@ -92,7 +90,6 @@ MiniAttractMode
stx @MiniAttractIndex+3
@loop
jsr LoadIndexedFile
!word kTotalDataFile
- !word $6000
!word OKVS_CACHE
@ -184,7 +181,6 @@ RunAttractModule
; it's a slideshow, so load slideshow configuration file
pha ; save module type
jsr LoadIndexedFile ; load slideshow configuration file into $4000
!word kTotalIndexFile
- !word $4000
!word kAttractModeSlideshowIndexRecord
jsr okvs_find
@ -192,7 +188,6 @@ RunAttractModule
@key2 !word $FDFD ; SMC
+ST16 +
jsr LoadIndexedFile
!word kTotalDataFile
!word $800
+ !word $FDFD ; SMC
pla ; restore module type

View File

@ -102,7 +102,6 @@ LoadIndexedSHRFile
; in: caller has populated IndexedSHRFilename
; out: all flags & registers clobbered
jsr LoadIndexedFile ; load index file into $2000
!word kTotalIndexFile
- !word $2000
!word kSHRArtworkIndexRecord
@ -113,7 +112,6 @@ IndexedSHRFilename
+ST16 @indexRecordPtr
jsr LoadIndexedFile ; load compressed SHR artwork at $1FF8/main (not aux)
!word kTotalDataFile
!word $1FF8
@indexRecordPtr
!word $FDFD ; SMC

View File

@ -21,7 +21,6 @@ Help
+ST16 @game
jsr LoadIndexedFile
!word kTotalIndexFile
@okvsPtr !word gSearchCache
!word kGameHelpIndexRecord
@ -31,7 +30,6 @@ Help
+ST16 @indexRecordPtr
jsr LoadIndexedFile
!word kTotalDataFile
!word $800
@indexRecordPtr
!word $FDFD ; SMC

View File

@ -111,7 +111,6 @@ LoadIndexedDHRFile
sta @dhgr_addr_aux + 1
sta @dhgr_addr_main + 1
jsr LoadAuxIndexedFile
!word kTotalDataFile
@dhgr_addr_aux
!word $FD00 ; SMC high byte
!word OKVS_CACHE
@ -123,7 +122,6 @@ LoadIndexedDHRFile
bcc +
inc OKVS_CACHE + 1
+ jsr LoadIndexedFile ; load next $2000 bytes into main memory
!word kTotalDataFile
@dhgr_addr_main
!word $FD00 ; SMC high byte
!word OKVS_CACHE
@ -140,7 +138,6 @@ LoadIndexedDHRFile
+LD16 PTR
+ST16 @hgrIndexRecordPtr
jsr LoadIndexedFile
!word kTotalDataFile
@hgr_addr
!word $FD00 ; SMC high byte
@hgrIndexRecordPtr