mirror of
https://github.com/a2-4am/4cade.git
synced 2024-12-11 11:49:20 +00:00
206 lines
5.2 KiB
Plaintext
206 lines
5.2 KiB
Plaintext
;license:MIT
|
|
;(c) 2018-2021 by 4am
|
|
;
|
|
; ProDOS - functions for constructing and passing around ProDOS pathnames
|
|
;
|
|
; Public functions
|
|
; - SetPath
|
|
; - AddToPath
|
|
;
|
|
|
|
;------------------------------------------------------------------------------
|
|
; SetPath/AddToPath
|
|
; append a length-prefixed string to gPathname
|
|
; SetPath will reset the path first
|
|
;
|
|
; in: A contains low byte of address of length-prefixed string to append
|
|
; Y contains high byte of address of length-prefixed string to append
|
|
; out: all registers and flags clobbered
|
|
; $02/$03 (PTR/PTR+1) clobbered
|
|
; gPathname updated with concatenated length-prefixed string
|
|
;------------------------------------------------------------------------------
|
|
SetPath
|
|
kRootDirectory=*+1
|
|
ldx #0
|
|
stx gPathname
|
|
; execution falls through here
|
|
|
|
AddToPath
|
|
+ST16 PTR
|
|
ldy #0
|
|
lda (PTR),y ; length of this segment
|
|
beq @done
|
|
tay
|
|
iny
|
|
sty @max
|
|
ldx gPathname ; current pathname length
|
|
ldy #$01
|
|
- lda (PTR),y
|
|
sta gPathname+1,x
|
|
inx
|
|
iny
|
|
@max = *+1
|
|
cpy #$D1 ; SMC
|
|
bcc -
|
|
stx gPathname
|
|
@done
|
|
rts
|
|
|
|
kSearchIndexRecord
|
|
!byte 0
|
|
!be24 0 ; SMC in 4cade.init
|
|
!le16 0 ; SMC in 4cade.init
|
|
|
|
kSearchCacheRecord
|
|
!byte 0
|
|
!be24 0 ; SMC in 4cade.init
|
|
!le16 0 ; SMC in 4cade.init
|
|
|
|
kPrelaunchIndexRecord
|
|
!source "src/index/prelaunch.idx.a"
|
|
|
|
kDemoIndexRecord
|
|
!source "src/index/demo.idx.a"
|
|
|
|
kAttractModeIndexRecord
|
|
!source "src/index/attract.idx.a"
|
|
|
|
kMiniAttractIndexLo
|
|
!byte <kMiniAttractIndexRecord0
|
|
!byte <kMiniAttractIndexRecord1
|
|
kMiniAttractIndexHi
|
|
!byte >kMiniAttractIndexRecord0
|
|
!byte >kMiniAttractIndexRecord1
|
|
kMiniAttractIndexRecord0
|
|
!source "src/index/miniattract0.idx.a"
|
|
kMiniAttractIndexRecord1
|
|
!source "src/index/miniattract1.idx.a"
|
|
|
|
kAttractModeSlideshowIndexRecord
|
|
!source "src/index/slideshow.idx.a"
|
|
|
|
kFXIndexRecord
|
|
!source "src/index/fx.idx.a"
|
|
|
|
kDFXIndexRecord
|
|
!source "src/index/dfx.idx.a"
|
|
|
|
kSFXIndexRecord
|
|
!source "src/index/sfx.idx.a"
|
|
|
|
kFXCodeIndexRecord
|
|
!source "src/index/fxcode.idx.a"
|
|
|
|
kFXDataIndexRecord
|
|
!source "src/index/fxdata.idx.a"
|
|
|
|
kGameHelpIndexRecord
|
|
!source "src/index/gamehelp.idx.a"
|
|
|
|
kHGRTitleIndexRecord
|
|
!source "src/index/title.idx.a"
|
|
|
|
kDHGRTitleIndexRecord
|
|
!source "src/index/dtitle.idx.a"
|
|
|
|
kSHRArtworkIndexRecord
|
|
!source "src/index/artwork.idx.a"
|
|
|
|
kDHGRActionIndexRecord
|
|
!source "src/index/dhgr.idx.a"
|
|
|
|
kGRActionIndexRecord
|
|
!source "src/index/gr.idx.a"
|
|
|
|
kDGRActionIndexRecord
|
|
!source "src/index/dgr.idx.a"
|
|
|
|
kHGRActionIndexLo
|
|
!byte <kHGRActionIndexRecord0
|
|
!byte <kHGRActionIndexRecord1
|
|
!byte <kHGRActionIndexRecord2
|
|
!byte <kHGRActionIndexRecord3
|
|
!byte <kHGRActionIndexRecord4
|
|
!byte <kHGRActionIndexRecord5
|
|
!byte <kHGRActionIndexRecord6
|
|
kHGRActionIndexHi
|
|
!byte >kHGRActionIndexRecord0
|
|
!byte >kHGRActionIndexRecord1
|
|
!byte >kHGRActionIndexRecord2
|
|
!byte >kHGRActionIndexRecord3
|
|
!byte >kHGRActionIndexRecord4
|
|
!byte >kHGRActionIndexRecord5
|
|
!byte >kHGRActionIndexRecord6
|
|
kHGRActionIndexRecord0
|
|
!source "src/index/hgr0.idx.a"
|
|
kHGRActionIndexRecord1
|
|
!source "src/index/hgr1.idx.a"
|
|
kHGRActionIndexRecord2
|
|
!source "src/index/hgr2.idx.a"
|
|
kHGRActionIndexRecord3
|
|
!source "src/index/hgr3.idx.a"
|
|
kHGRActionIndexRecord4
|
|
!source "src/index/hgr4.idx.a"
|
|
kHGRActionIndexRecord5
|
|
!source "src/index/hgr5.idx.a"
|
|
kHGRActionIndexRecord6
|
|
!source "src/index/hgr6.idx.a"
|
|
|
|
kCreditsRecord
|
|
!source "src/index/credits.idx.a"
|
|
|
|
kHelpTextRecord
|
|
!source "src/index/helptext.idx.a"
|
|
|
|
kDecrunchRecord
|
|
!source "src/index/decrunch.idx.a"
|
|
|
|
kJoystickRecord
|
|
!source "src/index/joystick.idx.a"
|
|
|
|
kXSingleRecord
|
|
!source "src/index/xsingle.idx.a"
|
|
|
|
kTotalDataFile
|
|
+PSTRING "TOTAL.DATA"
|
|
|
|
kAnimatedTitleDirectory
|
|
+PSTRING "TITLE.ANIMATED/"
|
|
|
|
kGameDirectory
|
|
+PSTRING "X/"
|
|
kGameDirectoryLen = 3 ; we need this elsewhere
|
|
|
|
kFXDirectory
|
|
+PSTRING "FX/"
|
|
|
|
kGlobalPrefsFilename
|
|
+PSTRING "PREFS.CONF"
|
|
|
|
kStandardPrelaunchRecord
|
|
!source "src/index/standard.prelaunch.a"
|
|
|
|
kCoverFadeRecord
|
|
!source "src/index/coverfade.idx.a"
|
|
|
|
; following three records must end up on the same page
|
|
; after relocation to LC RAM
|
|
kHelpBackgroundRecord
|
|
!source "src/index/res.help.idx.a"
|
|
|
|
kTitleRecord
|
|
!source "src/index/res.title.idx.a"
|
|
|
|
kCoverRecord
|
|
!source "src/index/res.cover.idx.a"
|
|
|
|
!if (RELBASE != $2000) and (>kCoverRecord != >kHelpBackgroundRecord) {
|
|
!serious "cover records are not all on the same page: ", kHelpBackgroundRecord, ", ", kTitleRecord, ", ", kCoverRecord
|
|
}
|
|
|
|
kGRFizzleRecord
|
|
!source "src/index/gr.fizzle.idx.a"
|
|
|
|
kDGRFizzleRecord
|
|
!source "src/index/dgr.fizzle.idx.a"
|