From 1d7e3bd1b9b836defee026b08612110eb4a76a62 Mon Sep 17 00:00:00 2001 From: 4am Date: Mon, 9 Sep 2019 14:11:49 -0400 Subject: [PATCH] refactor SetPath slightly --- src/prodos.path.a | 11 +++++++---- src/ui.attract.shr.a | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/prodos.path.a b/src/prodos.path.a index 4b8fb7d38..721f140d3 100644 --- a/src/prodos.path.a +++ b/src/prodos.path.a @@ -60,28 +60,31 @@ kFXDirectory ; 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 -; $00/$01 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 - +STAY $00 + +STAY PTR ldx gPathname ; current pathname length ldy #0 - lda ($00),y ; length of this segment + lda (PTR),y ; length of this segment + beq @done tay iny sty @len ldy #$01 -- lda ($00),y +- lda (PTR),y sta gPathname+1,x inx iny @len=*+1 cpy #$FD ; SMC bcc - +@done stx gPathname rts diff --git a/src/ui.attract.shr.a b/src/ui.attract.shr.a index 058cf6bac..553b795a0 100644 --- a/src/ui.attract.shr.a +++ b/src/ui.attract.shr.a @@ -68,7 +68,7 @@ kSFXFizzleFile ; $2000..$5FFF/aux clobbered ;------------------------------------------------------------------------------ .SHRArtworkCallback - +STAY PTR + +STAY SAVE lda KBD bpl + @@ -81,7 +81,7 @@ kSFXFizzleFile ; load SHR artwork at $2000/main (not aux) +LDADDR kSHRArtworkDirectory jsr SetPath - +LDAY PTR + +LDAY SAVE jsr AddToPath jsr LoadFile