mirror of
https://github.com/a2-4am/passport.git
synced 2024-12-22 04:29:59 +00:00
support Interplay Advent games
side A only for now
This commit is contained in:
parent
8ec251bd87
commit
b012d335e5
71
src/id/advent.a
Normal file
71
src/id/advent.a
Normal file
@ -0,0 +1,71 @@
|
||||
;-------------------------------
|
||||
; IDAdvent
|
||||
; identify Interplay custom bootloader
|
||||
;
|
||||
; in: track buffer contains T00,S00
|
||||
; out: C clear if Interplay bootloader was found
|
||||
; C set if not found
|
||||
; all other flags clobbered
|
||||
; all registers clobbered
|
||||
;
|
||||
; module by qkumba
|
||||
;-------------------------------
|
||||
IDAdvent
|
||||
lda #BASEPAGE
|
||||
ldy #33
|
||||
jsr SearchSector
|
||||
!byte $2C,$83,$C0 ;BIT $C083
|
||||
!byte $2C,$83,$C0 ;BIT $C083
|
||||
!byte $A9,$FF ;LDA #$FF
|
||||
!byte $8D,$00,$E0 ;STA $E000
|
||||
!byte $EE,$00,$E0 ;INC $E000
|
||||
!byte $D0,WILDCARD ;BNE $+xx
|
||||
!byte $A2,$00 ;LDX #$00
|
||||
!byte $BD,WILDCARD,$08 ;LDA $08xx,X
|
||||
!byte $F0,$06 ;BEQ $+8
|
||||
!byte $9D,$D8,$07 ;STA $07D8,X
|
||||
!byte $E8 ;INX
|
||||
!byte $D0,$F5 ;BNE $-8
|
||||
!byte $A6,$2B ;LDX $2B
|
||||
!byte $4C,$00 ;JMP $xx00
|
||||
rts
|
||||
|
||||
foundadvent
|
||||
;
|
||||
; We found an Interplay bootloader. Now we create
|
||||
; an RWTS that can read the rest of the disk.
|
||||
; Starting with our built-in RWTS, we modify address
|
||||
; and data prologues based on the parameters of the
|
||||
; original disk.
|
||||
;
|
||||
!zone {
|
||||
lda #s_advent
|
||||
jsr PrintByID
|
||||
jsr CopyUniversal
|
||||
|
||||
;hook read address prologue
|
||||
lda #<.checktrk
|
||||
sta $BDC5
|
||||
lda #>.checktrk
|
||||
sta $BDC6
|
||||
jmp ADStyle
|
||||
|
||||
.prologtbl1
|
||||
!byte $96, $97, $9A, $9B, $9D, $9E, $9F, $A6
|
||||
!byte $ED, $EE, $EF, $F2, $F3, $F4, $F5, $F6
|
||||
|
||||
.prologtbl2
|
||||
!byte $ED, $EE, $EF, $F2, $F3, $F4, $FF, $F7
|
||||
!byte $96, $A6, $AA, $D5, $DF, $EA, $AE, $FE
|
||||
|
||||
.checktrk
|
||||
lda gTrack
|
||||
beq +
|
||||
and #$0f
|
||||
tay
|
||||
lda .prologtbl1, y
|
||||
sta UNIV_A2
|
||||
lda .prologtbl2, y
|
||||
sta UNIV_A3
|
||||
+ jmp $B944
|
||||
}
|
@ -140,6 +140,13 @@ IDBootloader
|
||||
bcs +
|
||||
jmp foundea
|
||||
;
|
||||
; Try to identify Interplay bootloader.
|
||||
; Exit via custom trace function if found.
|
||||
;
|
||||
+ jsr IDAdvent
|
||||
bcs +
|
||||
jmp foundadvent
|
||||
;
|
||||
; Try to identify hybrid 16-/13-sector bootloader on
|
||||
; DOS 3.2 disks.
|
||||
; Exit via custom trace function if found.
|
||||
|
@ -108,6 +108,7 @@ AnalyzeT00
|
||||
!source "../patchers/dos32.a"
|
||||
!source "../patchers/dos32dlm.a"
|
||||
!source "../patchers/microfun.a"
|
||||
!source "../patchers/advent.a"
|
||||
|
||||
;add only above this line
|
||||
rts
|
||||
|
@ -147,6 +147,7 @@ FirstMover
|
||||
!source "id/micrograms.a"
|
||||
!source "id/volumename.a"
|
||||
!source "id/dinkeydos.a"
|
||||
!source "id/advent.a"
|
||||
!source "print.a"
|
||||
!source "compare.a"
|
||||
!source "modify.a"
|
||||
|
80
src/patchers/advent.a
Normal file
80
src/patchers/advent.a
Normal file
@ -0,0 +1,80 @@
|
||||
;-------------------------------
|
||||
; #Advent
|
||||
; patched RWTS
|
||||
;
|
||||
; Borrowed Time
|
||||
; Mindshadow
|
||||
; Tracer Sanction
|
||||
;
|
||||
; module by qkumba
|
||||
;-------------------------------
|
||||
!zone {
|
||||
clc
|
||||
.again php
|
||||
ldy #29
|
||||
jsr SearchTrack
|
||||
!byte $F0,$10 ;BEQ $+12
|
||||
!byte $29,$0F ;AND #$0F
|
||||
!byte $A8 ;TAY
|
||||
!byte $B9,WILDCARD,WILDCARD ;LDA $xxxx,Y
|
||||
!byte $8D,WILDCARD,WILDCARD ;STA $xxxx
|
||||
!byte $B9,WILDCARD,WILDCARD ;LDA $xxxx,Y
|
||||
!byte $8D,WILDCARD,WILDCARD ;STA $xxxx
|
||||
!byte $60 ;RTS
|
||||
!byte $A9,$AA ;LDA #$AA
|
||||
!byte $8D,WILDCARD,WILDCARD ;STA $xxxx
|
||||
!byte $A9,$96 ;LDA #$96
|
||||
!byte $8D,WILDCARD,WILDCARD ;STA $xxxx
|
||||
!byte $60 ;RTS
|
||||
bcs .pop
|
||||
ldy #1
|
||||
jsr modify
|
||||
!byte $10 ;BEQ -> BPL
|
||||
ldy #23
|
||||
jsr SearchTrack
|
||||
!byte $A4,WILDCARD ;LDY $xx
|
||||
!byte $BD,$8C,$C0 ;LDA $C08C,X
|
||||
!byte $10,$FB ;BPL $-3
|
||||
!byte $D9,WILDCARD,WILDCARD ;CMP $xxxx,Y
|
||||
!byte $D0,$AB ;BNE $-53
|
||||
!byte $EA ;NOP
|
||||
!byte $BD,$8C,$C0 ;LDA $C08C,X
|
||||
!byte $10,$FB ;BPL $-3
|
||||
!byte $D9,WILDCARD,WILDCARD ;CMP $xxxx,Y
|
||||
!byte $D0,$A0 ;BNE $-5E
|
||||
bcs .pop
|
||||
pha
|
||||
txa
|
||||
adc #7
|
||||
tax
|
||||
pla
|
||||
adc #0
|
||||
pha
|
||||
txa
|
||||
adc #11
|
||||
sta .patch+1
|
||||
pla
|
||||
tay
|
||||
adc #0
|
||||
pha
|
||||
tya
|
||||
ldy #3
|
||||
jsr modify
|
||||
!byte $C9,$DE ;CMP #$DE
|
||||
!byte $EA ;NOP
|
||||
pla
|
||||
.patch
|
||||
ldx #0
|
||||
ldy #3
|
||||
jsr modify
|
||||
!byte $C9,$AA ;CMP #$AA
|
||||
!byte $EA ;NOP
|
||||
plp
|
||||
bcs .exit
|
||||
sec
|
||||
jmp .again
|
||||
|
||||
.pop
|
||||
plp
|
||||
.exit
|
||||
}
|
@ -115,6 +115,7 @@ StringTable
|
||||
!word .trillium
|
||||
!word .tamper
|
||||
!word .microfun
|
||||
!word .advent
|
||||
;
|
||||
; Text can contain substitution strings, which
|
||||
; are replaced by current values at runtime. Each
|
||||
@ -140,7 +141,7 @@ StringTable
|
||||
; can be set directly before calling PrintByID.
|
||||
;
|
||||
.header
|
||||
!text "Passport by 4am 2018-05-08",$00
|
||||
!text "Passport by 4am 2018-05-25",$00
|
||||
.mainmenu
|
||||
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
|
||||
!text " "
|
||||
@ -436,4 +437,6 @@ StringTable
|
||||
!text "T%t,S%0 Found anti-tamper check",$8D,$00
|
||||
.microfun
|
||||
!text "T%t,S%0 Found Micro Fun protection check",$00
|
||||
.advent
|
||||
!text "T%t,S%0 Found Interplay protection check",$00
|
||||
}
|
||||
|
@ -103,4 +103,5 @@ s_dinkeydos = $61
|
||||
s_trillium = $62
|
||||
s_tamper = $63
|
||||
s_microfun = $64
|
||||
STRINGCOUNT = $65
|
||||
s_advent = $65
|
||||
STRINGCOUNT = $66
|
||||
|
Loading…
Reference in New Issue
Block a user