mirror of
https://github.com/a2-4am/passport.git
synced 2025-01-11 16:30:22 +00:00
Merge pull request #19 from peterferrie/master
support more Optimum titles, support Realm of Impossibility
This commit is contained in:
commit
8b7ac1fbee
@ -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 #<cont_search-branch_cont-2
|
||||
sta branch_cont+1
|
||||
|
||||
@ -131,7 +158,8 @@ match_size2
|
||||
check_end
|
||||
inc search+2
|
||||
ldx search+2
|
||||
cpx #BASEPAGE+$10
|
||||
.endvalue
|
||||
cpx #$D1
|
||||
bne check_byte1
|
||||
ldx #<all_done_set-branch_cont-2
|
||||
stx branch_cont+1
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -10,19 +10,20 @@
|
||||
_optimum
|
||||
lda gIsOptimum
|
||||
bne .jmpexit1
|
||||
lda gTrack
|
||||
beq .jmpreread
|
||||
ldy #15
|
||||
jsr SearchTrack
|
||||
!byte $A2,$00 ;LDX #$00
|
||||
!byte $A0,$00 ;LDY #$00
|
||||
!byte $BD,$21,$03 ;LDA $0321,X
|
||||
!byte $BD,WILDCARD,$03 ;LDA $03xx,X
|
||||
!byte $E8 ;INX
|
||||
!byte $85,WILDCARD ;STA $xx
|
||||
!byte $BD,$21,$03 ;LDA $0321,X
|
||||
!byte $BD,WILDCARD,$03 ;LDA $03xx,X
|
||||
!byte $E8 ;INX
|
||||
!byte $85 ;STA $xx
|
||||
bcc +
|
||||
lda gTrack
|
||||
beq .jmpreread
|
||||
|
||||
.jmpexit1
|
||||
jmp .exit
|
||||
|
||||
@ -31,47 +32,93 @@ _optimum
|
||||
|
||||
+ pha
|
||||
adc #BASEPAGE
|
||||
sta .swapbase1+2
|
||||
sta .swapbase2+2
|
||||
tay
|
||||
sbc #0
|
||||
sta .swapbase1+1
|
||||
txa
|
||||
pha
|
||||
dey
|
||||
sty .swapbase4+2
|
||||
dey
|
||||
sty .swapbase2+2
|
||||
sty .swapbase3+2
|
||||
ldy #$B5
|
||||
-
|
||||
sty .swapbase5+2
|
||||
|
||||
.swapbase1
|
||||
lda #$D1
|
||||
ldy #5
|
||||
jsr SearchSector
|
||||
!byte $00,$07,$08,$09,$01
|
||||
bcs .notable
|
||||
txa
|
||||
sbc #($96+$17)
|
||||
sta .swapbase3+1
|
||||
sta .swapbase4+1
|
||||
lda .swapbase1+1
|
||||
sbc #0
|
||||
sta .swapbase3+2
|
||||
sta .swapbase4+2
|
||||
ldy #0
|
||||
-
|
||||
.swapbase2
|
||||
lda $D100,y
|
||||
sta $2D8,y
|
||||
dey
|
||||
cpy #$FF
|
||||
iny
|
||||
bne -
|
||||
|
||||
;disable decoding because using the real version
|
||||
;would corrupt the text screen
|
||||
|
||||
lda #$2C
|
||||
sta $BE40
|
||||
|
||||
;read T01S0F, remains encoded at $BB00-BC55
|
||||
lda #2
|
||||
sta .retrycount
|
||||
|
||||
lda gTrack
|
||||
pha
|
||||
lda #1
|
||||
sta gTrack
|
||||
|
||||
;disable decoding because using the real version
|
||||
;would corrupt the text screen
|
||||
|
||||
.retry
|
||||
lda #$2C
|
||||
sta $BE40
|
||||
|
||||
;read T01S0F, remains encoded at $BB00-BC55
|
||||
|
||||
ldy #<gRWTSParams
|
||||
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
|
||||
|
@ -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 " "
|
||||
|
Loading…
x
Reference in New Issue
Block a user