pass in load address if we know it

This commit is contained in:
4am 2019-09-09 22:58:16 -04:00
parent 904ae802ec
commit 282fbd9806
4 changed files with 21 additions and 24 deletions

View File

@ -192,25 +192,24 @@ OneTimeSetup
+READ_RAM1_WRITE_RAM1
+STAY gRootDirectory
jsr LoadFile ; load preferences file into its default address ($8000)
jsr LoadFile ; load preferences file into $8000
!word kRootDirectory
!word kGlobalPrefsFilename
!word 0
- !word $8000
jsr ParseKeyValueList ; parse contents into OKVS data structure into LC RAM bank
!word gGlobalPrefsStore
!word ldrlo2 ; (ldrlo2) points to last load address, so $8000
!word -
!byte 16
+LDAY SRC ; (SRC) points to free space after the OKVS data structure we just created
+STAY gGamesListStore ; save pointer to free space for next store
jsr LoadFile ; load games list file into its default address ($8000)
jsr LoadFile ; load games list file into $8000
!word kRootDirectory
!word @kGameListConfFile
!word 0
- !word $8000
jsr ParseGamesList ; parse games list into OKVS data structure in LC RAM bank
!word gGamesListStore
!word ldrlo2 ; (ldrlo2) points to last load address, so $8000
!word -
jsr okvs_len
!word gGamesListStore

View File

@ -59,13 +59,13 @@ DHGRSingle
; $6000..$BFFF/main contains transition effect code
;------------------------------------------------------------------------------
.LoadDHGRTransition
jsr LoadFile ; load DHGR transition effects list into its default address ($8000)
jsr LoadFile ; load DHGR transition effects list into $8000
!word kRootDirectory
!word kDFXConfFile
!word 0
- !word $8000
jsr ParseKeyValueList ; parse DHGR transition effects list into $6000
!word gDFXStore
!word ldrlo2 ; (ldrlo2) points to last load address
!word -
!byte 0
jsr okvs_get ; get next DHGR transition effect from prefs

View File

@ -163,13 +163,13 @@ HGRSingle
; $6000..$BFFF contains transition effect code
;------------------------------------------------------------------------------
.LoadHGRTransition
jsr LoadFile ; load HGR transition effects list into its default address ($8000)
jsr LoadFile ; load HGR transition effects list into $8000
!word kRootDirectory
!word kFXConfFile
!word 0
- !word $8000
jsr ParseKeyValueList ; parse HGR transition effects list into $6000
!word gFXStore
!word ldrlo2 ; (ldrlo2) points to last load address
!word -
!byte 0
jsr okvs_get ; get next HGR transition effect from prefs

View File

@ -111,17 +111,15 @@ MiniAttractMode
lda #0
sta @MiniAttractIndex
@loop
; load mini attract mode configuration file into its default address ($8000)
jsr LoadFile
jsr LoadFile ; load mini attract mode configuration file into $8000
!word kMiniAttractDirectory
@fname !word $FDFD ; SMC
!word 0
- !word $8000
jsr ParseKeyValueList ; parse configuration into OKVS data structure at $6000
!word gAttractModeStore
!word ldrlo2 ; (ldrlo2) points to last load address, so $8000
!word -
!byte 0
jsr okvs_len
@ -212,13 +210,13 @@ RunAttractModule
; it's a slideshow, so load and parse slideshow configuration file
pha ; save module type
jsr LoadFile ; load slideshow configuration file into its default address ($4000)
jsr LoadFile ; load slideshow configuration file into $4000
!word kAttractModeSlideshowDirectory
@key2 !word $FDFD ; SMC
!word 0
- !word $4000
jsr ParseKeyValueList ; parse into an OKVS data structure at $0800
!word gSlideshowStore
!word ldrlo2 ; (ldrlo2) points to address of last loaded file, so $4000
!word -
!byte 0
pla ; restore module type
@ -252,13 +250,13 @@ RunAttractModule
LoadAndParseAttractModeConf
; TODO refactor launch code then make this private
jsr LoadFile ; load attract-mode configuration file into its default address ($8000)
jsr LoadFile ; load attract-mode configuration file into $8000
!word kRootDirectory
!word @AttractModeConfFile
!word 0
- !word $8000
jsr ParseKeyValueList ; parse attract-mode configuration into OKVS data structure at $6000
!word gAttractModeStore
!word ldrlo2 ; (ldrlo2) points to last load address, so $8000
!word -
!byte 0
rts
@AttractModeConfFile