4cade/src/prodos.path.a

147 lines
2.8 KiB
Plaintext
Raw Normal View History

2018-09-13 09:53:04 -04:00
;license:MIT
;(c) 2018-9 by 4am
2018-09-13 09:53:04 -04:00
;
; ProDOS - functions for constructing and passing around ProDOS pathnames
;
; Public functions
; - SetPath
2018-09-13 09:53:04 -04:00
; - AddToPath
;
2018-12-29 13:29:17 -05:00
kHGRTitleDirectory
!byte 10
!raw "TITLE.HGR/"
2019-02-08 20:48:07 -05:00
kDHGRTitleDirectory
!byte 11
!raw "TITLE.DHGR/"
2018-10-28 14:04:52 -04:00
2018-12-29 13:29:17 -05:00
kHGRActionDirectory
!byte 11
!raw "ACTION.HGR/"
2018-12-29 13:29:17 -05:00
2019-02-08 20:48:07 -05:00
kDHGRActionDirectory
!byte 12
!raw "ACTION.DHGR/"
2018-09-13 09:53:04 -04:00
kGRActionDirectory
!byte 10
!raw "ACTION.GR/"
2019-01-13 18:55:40 -05:00
kSHRArtworkDirectory
!byte 12
!raw "ARTWORK.SHR/"
2019-01-13 18:55:40 -05:00
2019-06-26 22:51:34 -04:00
kMiniAttractDirectory
!byte 8
!raw "ATTRACT/"
2018-10-27 18:47:27 -04:00
kAttractModeSlideshowDirectory
!byte 3
!raw "SS/"
2018-10-27 18:47:27 -04:00
2018-10-28 17:20:48 -04:00
kDemoDirectory
!byte 5
!raw "DEMO/"
2018-10-28 17:20:48 -04:00
2019-01-08 14:10:26 -05:00
kGameDirectory
!byte 2
!raw "X/"
2019-01-08 14:10:26 -05:00
kFXDirectory
!byte 3
!raw "FX/"
2019-09-14 22:57:52 -04:00
kPrelaunchDirectory
!byte 10
!raw "PRELAUNCH/"
kStandardPrelaunch
!byte 8
!raw "STANDARD"
2019-09-21 18:11:52 -04:00
kGlobalPrefsFilename
!byte 10
!raw "PREFS.CONF"
kAttractModeConfFile
!byte 12
!raw "ATTRACT.CONF"
2019-09-21 18:04:38 -04:00
kFXConfFile
!byte 7
2019-09-21 18:11:52 -04:00
!raw "FX.CONF"
2019-09-21 18:04:38 -04:00
kDFXConfFile
!byte 8
2019-09-21 18:11:52 -04:00
!raw "DFX.CONF"
2019-09-21 18:04:38 -04:00
kCreditsFile
!byte 7
2019-09-21 18:11:52 -04:00
!raw "CREDITS"
kHelpFile
!byte 4
!raw "HELP"
2019-09-21 18:11:52 -04:00
kTitleFile
!byte 5
!raw "TITLE"
kCoverFile
!byte 5
!raw "COVER"
2019-09-21 18:04:38 -04:00
kCoverFadeFile
!byte 9
2019-09-21 18:11:52 -04:00
!raw "COVERFADE"
kGRFizzleFile
!byte 9
!raw "GR.FIZZLE"
kSFXFizzleFile
!byte 10
!raw "SHR.FIZZLE"
2019-09-21 18:04:38 -04:00
2018-09-13 09:53:04 -04:00
;------------------------------------------------------------------------------
2019-06-18 22:40:17 -04:00
; SetPath/AddToPath
2018-09-13 09:53:04 -04:00
; append a length-prefixed string to gPathname
2019-06-18 22:40:17 -04:00
; SetPath will reset the path first
2018-09-13 09:53:04 -04:00
;
; 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
2019-09-09 14:11:49 -04:00
; $02/$03 (PTR/PTR+1) clobbered
; MAX clobbered
2018-09-13 09:53:04 -04:00
; gPathname updated with concatenated length-prefixed string
;------------------------------------------------------------------------------
2019-06-18 22:40:17 -04:00
SetPath
2019-09-09 14:11:49 -04:00
kRootDirectory=*+1
ldx #0
stx gPathname
2019-06-18 22:40:17 -04:00
; execution falls through here
2018-09-13 09:53:04 -04:00
AddToPath
2019-09-09 14:11:49 -04:00
+STAY PTR
2018-09-13 09:53:04 -04:00
ldy #0
2019-09-09 14:11:49 -04:00
lda (PTR),y ; length of this segment
beq @done
2018-09-13 09:53:04 -04:00
tay
iny
sty MAX
2019-09-23 17:01:42 -07:00
ldx gPathname ; current pathname length
2018-09-13 09:53:04 -04:00
ldy #$01
2019-09-09 14:11:49 -04:00
- lda (PTR),y
2018-09-13 09:53:04 -04:00
sta gPathname+1,x
inx
iny
cpy MAX
2018-09-13 09:53:04 -04:00
bcc -
stx gPathname
2019-09-23 17:01:42 -07:00
@done
2018-09-13 09:53:04 -04:00
rts
2019-09-25 20:01:59 -07:00
!if >kTitleFile != >kCoverFile {
!error ">kTitleFile != >kCoverFile, uncomment LoadTitleOffscreen block in ui.offscreen and disable this check"
}