From 92d75cee108dd5605cb36b6a9a59a31e1c659f12 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Mon, 20 Feb 2017 16:50:38 -0800 Subject: [PATCH 1/2] support more Optimum titles --- src/compare.a | 40 ++++++++++++--- src/passport.a | 2 +- src/patchers/optimum.a | 109 ++++++++++++++++++++++++++++++----------- 3 files changed, 116 insertions(+), 35 deletions(-) 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 From ec9d512062e7c61d12a11b3b91a3f966ca8b7fec Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Wed, 8 Mar 2017 07:28:30 -0800 Subject: [PATCH 2/2] support Realm of Impossibility --- src/passport.a | 2 +- src/patchers/ea.a | 21 ++++++++++++++++++++- src/strings/en.a | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/passport.a b/src/passport.a index a884a01..e33a7ed 100755 --- a/src/passport.a +++ b/src/passport.a @@ -94,7 +94,7 @@ flag = $FF ; byte } ; Application constants (not zero addresses) -RELBASE = $6700 ; address to move Passport code +RELBASE = $6600 ; address to move Passport code ; so that it's out of the way LOWPOINT = $4300 ; lowest available address for code BASEPAGE = $10 ; Special Delivery tracer assumes diff --git a/src/patchers/ea.a b/src/patchers/ea.a index 6605e38..a2f72e6 100644 --- a/src/patchers/ea.a +++ b/src/patchers/ea.a @@ -298,12 +298,31 @@ _ea !byte $18 ;CLC !byte $E9,$00 ;SBC #$00 !byte $48 ;PHA - bcs .exit + bcs + inx ldy #1 jsr modify !byte $E8 ;new checksum value for eor ++ ldy #14 + jsr SearchTrack + !byte $AD,$00,$05 + !byte $A2,$FF + !byte $5D,$00,$05 + !byte $CA + !byte $D0,$FA + !byte $C9,$A0 + !byte $F0 + bcs .exit + pha + txa + adc #12 + tax + pla + ldy #1 + jsr modify + !byte $A1 ;new checksum value for eor + .dostitles lda gIsBoot0 bne .exit 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 " "