diff --git a/src/4cade.a b/src/4cade.a index de9eaf298..5b60999c2 100644 --- a/src/4cade.a +++ b/src/4cade.a @@ -91,7 +91,6 @@ ResetVector ; 6 bytes, copied to $100 !source "src/ui.attract.hgr.a" ; \__ execution falls through !source "src/ui.font.a" ; / - !source "src/prodos.path.a" !source "src/ui.overlay.a" !source "src/ui.offscreen.a" !source "src/ui.attract.mode.a" @@ -125,6 +124,8 @@ gGamesListStore SwitchToBank2 +READ_RAM2_WRITE_RAM2 rts + !source "src/prodos.path.a" ; paths end up on the same page + ; MachineStatus (label is in constants.a so prelaunchers can use it) ; 7 6 5 4 3 2 1 0 ; | | | | | | | +- bit 0 reserved diff --git a/src/constants.a b/src/constants.a index c6a5348d3..288db4124 100644 --- a/src/constants.a +++ b/src/constants.a @@ -9,7 +9,7 @@ ; D000..E611 - persistent data structures (per-game cheat categories, ; gGlobalPrefsStore, gGamesListStore) ; ...unused... -; ECBB..FFF9 - main program code +; ECC8..FFF9 - main program code ; FFFA..FFFF - NMI, reset, IRQ vectors ; ; LC RAM BANK 2 diff --git a/src/prodos.path.a b/src/prodos.path.a index 3026db67c..cf7a59724 100644 --- a/src/prodos.path.a +++ b/src/prodos.path.a @@ -8,6 +8,43 @@ ; - 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 + +STAY 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 + kHGRTitleDirectory !byte 10 !raw "TITLE.HGR/" @@ -108,40 +145,3 @@ kGRFizzleFile kSFXFizzleFile !byte 10 !raw "SHR.FIZZLE" - -;------------------------------------------------------------------------------ -; 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 - +STAY 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 diff --git a/src/ui.offscreen.a b/src/ui.offscreen.a index 8cf28d5f4..9de73883b 100644 --- a/src/ui.offscreen.a +++ b/src/ui.offscreen.a @@ -46,10 +46,8 @@ OffscreenPage = * + 1 ; out: all flags and registers clobbered ;------------------------------------------------------------------------------ LoadTitleOffscreen - +LDADDR kTitleFile - bne LoadOffscreenFromAY ; Always branches, because Y is loaded - ; last with the high byte of the address, - ; which is never 0. I miss my 65c02. + lda #kCoverFile ; all of these are on the same page !byte $00 + !byte $FD ; SMC rts diff --git a/src/ui.search.mode.a b/src/ui.search.mode.a index 8106c3e8d..ebbe98d60 100644 --- a/src/ui.search.mode.a +++ b/src/ui.search.mode.a @@ -73,9 +73,6 @@ InputKeyDispatch jsr IsSearchKey beq .foundSearchKey ldx #kInputError - +HIDE_NEXT_2_BYTES -.IsArrow - ldx #kInputBrowse !if kInputSearch > 0 { +HIDE_NEXT_2_BYTES .foundSearchKey @@ -121,8 +118,9 @@ SearchMode ; we want to switch to Browse Mode with the keyboard still hot so ; that mode finds and dispatches the arrow key. + ldx #kInputBrowse jsr IsUpDownOrRightArrow - beq .IsArrow + beq .InputDispatch bit CLEARKBD ldy #kNumBrowseKeys @@ -134,16 +132,15 @@ SearchMode bne .InputDispatch ; always branches OnClear - ldx InputLength + ldx #1 ; Esc with input clears the input + ldy InputLength bne + jmp CoverFade ; Esc with no input transitions to ; mega attract mode OnBack ldx InputLength beq OnError - +HIDE_NEXT_2_BYTES -+ ldx #1 ; Esc with input clears the input - dex ++ dex stx InputLength bpl OnInputChanged ; always branches