diff --git a/src/compare.a b/src/compare.a index 4101d26..bc59303 100755 --- a/src/compare.a +++ b/src/compare.a @@ -17,6 +17,38 @@ WILDCARD = $97 ; all other registers and flags clobbered ;------------------------------- SearchTrack +;set end point for the search + + lda #BASEPAGE+$10 + sta .endvalue+1 + lda #BASEPAGE + bne SearchSectors + +;------------------------------- +; SearchSector subroutine +; written by qkumba +; same as SearchTrack, but for a single sector +; in: A = sector address +; Y = string length +; stack = string to find +; out: C clear if string found +; or set if not found +; If C is clear, then +; X = starting offset where string was found +; all other registers and flags clobbered +;------------------------------- + +SearchSector +;set end point for the search + + tax + inx + stx .endvalue+1 + +; set high part of initial search position + +SearchSectors + sta search+2 pla sta match_buffer1+1 sta match_all+1 @@ -60,11 +92,6 @@ plus01 inc match_all+2 plus02 -; set high part of initial search position - - lda #BASEPAGE - sta search+2 - lda #gRWTSParams - jsr $2E2 - pla - sta gTrack + ;special case check + + ldx $2E2 + cpx #$48 ;PHA + beq + + jsr $2FC + jmp ++ + + ;regular dispatch ++ + jsr $2E2 + +++ ;re-enable decoding lda #$20 sta $BE40 + ;detect read failure + + bcc + + dec .retrycount + bne .retry + lda #s_optbad ; say read failure + jsr PrintByID ; but can't quit from here + pla + sta gTrack +.notable + pla + pla + jmp .exit + ++ + pla + sta gTrack + ;disable redirection pla @@ -95,8 +142,8 @@ _optimum - .tblsel1 ldx $D100,y -.swapbase2 - lda ($D110-$96)-$16,x +.swapbase3 + lda $D1D1,x asl asl asl @@ -105,8 +152,8 @@ _optimum dey .tblsel2 ldx $D100,y -.swapbase3 - ora ($D110-$96)-$16,x +.swapbase4 + ora $D1D1,x sty $2C ldy $26 sta $300,y @@ -128,13 +175,19 @@ _optimum ;read IOB with replaced page -.swapbase4 +.swapbase5 lda $D16D,x sta .address+1 + lda gTrack + beq .reread1 + .jmpexit2 jmp .exit +.retrycount + !byte $D1 + ;track 0, find the region with replaced page .reread1 diff --git a/src/strings/en.a b/src/strings/en.a index 7bfafd1..014a10e 100755 --- a/src/strings/en.a +++ b/src/strings/en.a @@ -192,7 +192,7 @@ StringTable ; can be set directly before calling PrintByID. ; .header - !text "Passport by 4am 2017-03-04",00 + !text "Passport by 4am 2017-03-08",00 .mainmenu !text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D !text " "