2018-09-13 13:53:04 +00:00
|
|
|
;license:MIT
|
2021-10-12 23:37:45 +00:00
|
|
|
;(c) 2018-2021 by 4am
|
2018-09-13 13:53:04 +00:00
|
|
|
;
|
|
|
|
; ProDOS - functions for constructing and passing around ProDOS pathnames
|
|
|
|
;
|
|
|
|
; Public functions
|
2019-06-22 19:50:24 +00:00
|
|
|
; - SetPath
|
2018-09-13 13:53:04 +00:00
|
|
|
; - AddToPath
|
|
|
|
;
|
|
|
|
|
2019-10-10 04:26:18 +00:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
; 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
|
2020-05-29 20:17:25 +00:00
|
|
|
!if RELBASE != $2000 {
|
|
|
|
!ifdef PASS2 {
|
|
|
|
} else { ;PASS2
|
|
|
|
!if * != iAddToPath {
|
2021-10-15 20:00:40 +00:00
|
|
|
!error "iAddToPath=",*, ", fix constants.a, rebuild prelaunch"
|
2020-05-29 20:17:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-10-10 04:26:18 +00:00
|
|
|
AddToPath
|
2020-03-24 20:30:14 +00:00
|
|
|
+ST16 PTR
|
2019-10-10 04:26:18 +00:00
|
|
|
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
|
|
|
|
|
2021-10-24 05:14:25 +00:00
|
|
|
kTotalDataFile
|
|
|
|
!byte 10
|
|
|
|
!raw "TOTAL.DATA"
|
|
|
|
|
2018-12-29 18:29:17 +00:00
|
|
|
kHGRTitleDirectory
|
2019-06-22 19:50:24 +00:00
|
|
|
!byte 10
|
|
|
|
!raw "TITLE.HGR/"
|
2019-02-09 01:48:07 +00:00
|
|
|
|
|
|
|
kDHGRTitleDirectory
|
2019-06-22 19:50:24 +00:00
|
|
|
!byte 11
|
|
|
|
!raw "TITLE.DHGR/"
|
2018-10-28 18:04:52 +00:00
|
|
|
|
2019-09-28 12:35:48 +00:00
|
|
|
kAnimatedTitleDirectory
|
|
|
|
!byte 15
|
|
|
|
!raw "TITLE.ANIMATED/"
|
|
|
|
|
2021-10-20 03:07:56 +00:00
|
|
|
kHGRActionIndexFile
|
|
|
|
!byte 8
|
|
|
|
!raw "HGR"
|
|
|
|
gHGRActionIndexNumber
|
|
|
|
!raw "_"
|
|
|
|
!raw ".IDX"
|
|
|
|
|
2021-10-21 17:04:01 +00:00
|
|
|
kHGRActionDataFile=kTotalDataFile
|
2018-12-29 18:29:17 +00:00
|
|
|
|
2021-10-24 05:14:25 +00:00
|
|
|
kDHGRActionIndexFile
|
|
|
|
!byte 8
|
|
|
|
!raw "DHGR.IDX"
|
|
|
|
|
|
|
|
kDHGRActionDataFile=kTotalDataFile
|
|
|
|
|
2019-02-09 01:48:07 +00:00
|
|
|
kDHGRActionDirectory
|
2019-06-22 19:50:24 +00:00
|
|
|
!byte 12
|
|
|
|
!raw "ACTION.DHGR/"
|
2018-09-13 13:53:04 +00:00
|
|
|
|
2019-07-15 15:42:05 +00:00
|
|
|
kGRActionDirectory
|
|
|
|
!byte 10
|
|
|
|
!raw "ACTION.GR/"
|
|
|
|
|
2018-10-28 21:20:48 +00:00
|
|
|
kDemoDirectory
|
2019-06-22 19:50:24 +00:00
|
|
|
!byte 5
|
|
|
|
!raw "DEMO/"
|
2018-10-28 21:20:48 +00:00
|
|
|
|
2019-01-08 19:10:26 +00:00
|
|
|
kGameDirectory
|
2019-06-22 19:50:24 +00:00
|
|
|
!byte 2
|
|
|
|
!raw "X/"
|
2019-10-09 04:25:10 +00:00
|
|
|
kGameDirectoryLen = 3 ; we need this elsewhere
|
2019-01-08 19:10:26 +00:00
|
|
|
|
2018-10-29 23:23:43 +00:00
|
|
|
kFXDirectory
|
2019-06-22 19:50:24 +00:00
|
|
|
!byte 3
|
|
|
|
!raw "FX/"
|
2018-10-29 23:23:43 +00:00
|
|
|
|
2021-10-13 22:58:45 +00:00
|
|
|
kPrelaunchIndexFile
|
|
|
|
!byte 13
|
|
|
|
!raw "PRELAUNCH.IDX"
|
|
|
|
|
2021-10-21 17:04:01 +00:00
|
|
|
kPrelaunchFulFile=kTotalDataFile
|
2019-09-15 02:57:52 +00:00
|
|
|
|
|
|
|
kStandardPrelaunch
|
|
|
|
!byte 8
|
|
|
|
!raw "STANDARD"
|
|
|
|
|
2019-09-21 22:11:52 +00:00
|
|
|
kGlobalPrefsFilename
|
|
|
|
!byte 10
|
|
|
|
!raw "PREFS.CONF"
|
|
|
|
|
2021-10-13 02:55:41 +00:00
|
|
|
kAttractModeIndexFile
|
|
|
|
!byte 11
|
|
|
|
!raw "ATTRACT.IDX"
|
|
|
|
|
|
|
|
kMiniAttractIndexFile
|
|
|
|
!byte 15
|
|
|
|
!raw "MINIATTRACT.IDX"
|
2019-09-21 22:11:52 +00:00
|
|
|
|
2021-10-21 17:04:01 +00:00
|
|
|
kAttractModeFulFile=kTotalDataFile
|
2021-10-12 23:37:45 +00:00
|
|
|
|
2021-10-13 02:55:41 +00:00
|
|
|
kAttractModeSlideshowIndexFile
|
|
|
|
!byte 13
|
|
|
|
!raw "SLIDESHOW.IDX"
|
2019-09-21 22:04:38 +00:00
|
|
|
|
2021-10-21 17:04:01 +00:00
|
|
|
kAttractModeSlideshowFulFile=kTotalDataFile
|
2021-10-13 02:55:41 +00:00
|
|
|
|
|
|
|
kFXIndexFile
|
|
|
|
!byte 6
|
|
|
|
!raw "FX.IDX"
|
2019-09-21 22:04:38 +00:00
|
|
|
|
2021-10-21 17:04:01 +00:00
|
|
|
kFXFile=kTotalDataFile
|
2021-10-13 02:55:41 +00:00
|
|
|
|
|
|
|
kDFXIndexFile
|
|
|
|
!byte 7
|
|
|
|
!raw "DFX.IDX"
|
2021-10-08 06:28:11 +00:00
|
|
|
|
2021-10-13 02:55:41 +00:00
|
|
|
kGameHelpIndexFile
|
|
|
|
!byte 12
|
|
|
|
!raw "GAMEHELP.IDX"
|
|
|
|
|
2021-10-21 17:04:01 +00:00
|
|
|
kGameHelpFile=kTotalDataFile
|
2021-10-08 06:28:11 +00:00
|
|
|
|
2021-10-19 23:39:57 +00:00
|
|
|
kSHRArtworkIndexFile
|
|
|
|
!byte 11
|
|
|
|
!raw "ARTWORK.IDX"
|
|
|
|
|
2021-10-21 17:04:01 +00:00
|
|
|
kSHRArtworkDataFile=kTotalDataFile
|
2021-10-19 23:39:57 +00:00
|
|
|
|
2019-09-21 22:04:38 +00:00
|
|
|
kCreditsFile
|
|
|
|
!byte 7
|
2019-09-21 22:11:52 +00:00
|
|
|
!raw "CREDITS"
|
|
|
|
|
2019-12-20 15:25:30 +00:00
|
|
|
kHelpBackgroundFile
|
2019-09-26 17:46:13 +00:00
|
|
|
!byte 4
|
|
|
|
!raw "HELP"
|
|
|
|
|
2019-12-20 15:25:30 +00:00
|
|
|
kHelpTextFile
|
|
|
|
!byte 8
|
|
|
|
!raw "HELPTEXT"
|
|
|
|
|
2019-09-21 22:11:52 +00:00
|
|
|
kTitleFile
|
|
|
|
!byte 5
|
|
|
|
!raw "TITLE"
|
|
|
|
|
|
|
|
kCoverFile
|
|
|
|
!byte 5
|
|
|
|
!raw "COVER"
|
2019-09-21 22:04:38 +00:00
|
|
|
|
|
|
|
kCoverFadeFile
|
|
|
|
!byte 9
|
2019-09-21 22:11:52 +00:00
|
|
|
!raw "COVERFADE"
|
|
|
|
|
|
|
|
kGRFizzleFile
|
|
|
|
!byte 9
|
|
|
|
!raw "GR.FIZZLE"
|
|
|
|
|
|
|
|
kSFXFizzleFile
|
|
|
|
!byte 10
|
|
|
|
!raw "SHR.FIZZLE"
|
2020-03-14 02:04:03 +00:00
|
|
|
|
|
|
|
kDecrunchFile
|
|
|
|
!byte 8
|
|
|
|
!raw "DECRUNCH"
|
2020-06-15 16:44:46 +00:00
|
|
|
|
|
|
|
kJoystickFile
|
|
|
|
!byte 8
|
|
|
|
!raw "JOYSTICK"
|
2021-10-23 04:53:23 +00:00
|
|
|
|
|
|
|
kSearchIndexFile
|
|
|
|
!byte 12
|
|
|
|
!raw "SEARCH"
|
|
|
|
gSearchHasJoystick
|
|
|
|
!raw "_"
|
|
|
|
gSearchHas128K
|
|
|
|
!raw "_"
|
|
|
|
!raw ".IDX"
|