mirror of
https://github.com/a2-4am/passport.git
synced 2025-01-11 16:30:22 +00:00
add support for Milliken protection
This commit is contained in:
parent
6e67b30b5b
commit
804d31e1f5
47
src/id/milliken.a
Normal file
47
src/id/milliken.a
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
;-------------------------------
|
||||||
|
; IDMilliken
|
||||||
|
; identify Milliken protection routine
|
||||||
|
; in late-stage boot
|
||||||
|
;
|
||||||
|
; in: $B600..$BFFF contains RWTS that can read this disk
|
||||||
|
; $B747..$B749 contains "JMP $9B03"
|
||||||
|
; out: C clear if Milliken protection routine found
|
||||||
|
; C set otherwise
|
||||||
|
; all registers clobbered
|
||||||
|
; all other flags clobbered
|
||||||
|
;-------------------------------
|
||||||
|
!zone {
|
||||||
|
IDMilliken
|
||||||
|
; protection routine starts on T00,S0A (by this point we've
|
||||||
|
; already identified a marker on T00,S01 that strongly
|
||||||
|
; suggests the presence of this routine, so it's worth
|
||||||
|
; doing an extra disk read here to be sure)
|
||||||
|
lda #$00
|
||||||
|
sta gTrack
|
||||||
|
lda #$0A
|
||||||
|
sta gSector
|
||||||
|
clc
|
||||||
|
adc #BASEPAGE
|
||||||
|
sta gAddress+1
|
||||||
|
jsr ReadSector
|
||||||
|
bcs .exit
|
||||||
|
|
||||||
|
IDMilliken1
|
||||||
|
; variant 1 (seen in Gulp and Frenzy, Tangram Puzzler)
|
||||||
|
lda #$0A
|
||||||
|
ldx #$03
|
||||||
|
ldy #$0E
|
||||||
|
jsr compare
|
||||||
|
!byte $A9,$AE,$8D,$00,$04,$4C,$99,$AD
|
||||||
|
!byte $AE,$F8,$05,$BD,$89,$C0
|
||||||
|
bcc .exit
|
||||||
|
|
||||||
|
; variant 2 (seen in The Writing Workshop)
|
||||||
|
ldy #$0B
|
||||||
|
jsr compare
|
||||||
|
!byte $A9,$AE,$8D,$00,$04,$AE,$F8,$05
|
||||||
|
!byte $BD,$89,$C0
|
||||||
|
|
||||||
|
.exit
|
||||||
|
rts
|
||||||
|
}
|
@ -54,6 +54,7 @@ TraceDOS33b
|
|||||||
|
|
||||||
TraceDOS33c
|
TraceDOS33c
|
||||||
lda $08FE ; 2nd-level trace callback is here
|
lda $08FE ; 2nd-level trace callback is here
|
||||||
|
sta .x6+1
|
||||||
clc
|
clc
|
||||||
adc #$02
|
adc #$02
|
||||||
_Inspect1a
|
_Inspect1a
|
||||||
@ -124,8 +125,24 @@ _Inspect1a
|
|||||||
ldy #$03
|
ldy #$03
|
||||||
jsr CompareMemory
|
jsr CompareMemory
|
||||||
!byte $AE,$E8,$1F
|
!byte $AE,$E8,$1F
|
||||||
bcs +
|
bcs .x6
|
||||||
jmp UseUniversal ; give up tracing; this RWTS is unsupported
|
jmp UseUniversal ; give up tracing; this RWTS is unsupported
|
||||||
|
;
|
||||||
|
; Check for Milliken protection routine in late-stage boot
|
||||||
|
; (affects readable/ignoreable sector map, so must ID now)
|
||||||
|
;
|
||||||
|
.x6 lda #$FF ; check for "JMP $9B03" at $B747
|
||||||
|
ldx #$47
|
||||||
|
ldy #$03
|
||||||
|
jsr CompareMemory
|
||||||
|
!byte $4C,$03,$9B
|
||||||
|
bcs +
|
||||||
|
jsr IDMilliken
|
||||||
|
bcs +
|
||||||
|
lda #s_milliken
|
||||||
|
jsr PrintByID
|
||||||
|
lda #$80
|
||||||
|
sta T02S05
|
||||||
+ jmp ADStyle ; use this RWTS to read the disk
|
+ jmp ADStyle ; use this RWTS to read the disk
|
||||||
|
|
||||||
; TODO this doesn't belong here
|
; TODO this doesn't belong here
|
||||||
|
@ -94,7 +94,7 @@ flag = $FF ; byte
|
|||||||
}
|
}
|
||||||
|
|
||||||
; Application constants (not zero addresses)
|
; Application constants (not zero addresses)
|
||||||
RELBASE = $6600 ; address to move Passport code
|
RELBASE = $6500 ; address to move Passport code
|
||||||
; so that it's out of the way
|
; so that it's out of the way
|
||||||
LOWPOINT = $4300 ; lowest available address for code
|
LOWPOINT = $4300 ; lowest available address for code
|
||||||
BASEPAGE = $10 ; Special Delivery tracer assumes
|
BASEPAGE = $10 ; Special Delivery tracer assumes
|
||||||
@ -149,6 +149,7 @@ FirstMover
|
|||||||
!source "id/encode44.a"
|
!source "id/encode44.a"
|
||||||
!source "id/encode53.a"
|
!source "id/encode53.a"
|
||||||
!source "id/ea.a"
|
!source "id/ea.a"
|
||||||
|
!source "id/milliken.a"
|
||||||
!source "print.a"
|
!source "print.a"
|
||||||
!source "compare.a"
|
!source "compare.a"
|
||||||
!source "modify.a"
|
!source "modify.a"
|
||||||
@ -690,6 +691,7 @@ _applyToT00
|
|||||||
!source "patchers/nibtable.a"
|
!source "patchers/nibtable.a"
|
||||||
!source "patchers/diskvol.a"
|
!source "patchers/diskvol.a"
|
||||||
!source "patchers/c9ff.a"
|
!source "patchers/c9ff.a"
|
||||||
|
!source "patchers/milliken.a"
|
||||||
_applyToAll
|
_applyToAll
|
||||||
!source "patchers/universale7.a"
|
!source "patchers/universale7.a"
|
||||||
!source "patchers/runhello.a"
|
!source "patchers/runhello.a"
|
||||||
|
23
src/patchers/milliken.a
Normal file
23
src/patchers/milliken.a
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
;-------------------------------
|
||||||
|
; #MILLIKEN
|
||||||
|
; Milliken protection routine on T00,S0A
|
||||||
|
; does a fake drive speed check then
|
||||||
|
; a nibble check
|
||||||
|
; e.g. Gulp and Frenzy, Tangram Puzzler,
|
||||||
|
; The Writing Workshop, Math Sequences
|
||||||
|
;-------------------------------
|
||||||
|
!zone {
|
||||||
|
_milliken
|
||||||
|
jsr IDMilliken1
|
||||||
|
bcs .exit
|
||||||
|
lda #$01
|
||||||
|
ldx #$48
|
||||||
|
ldy #$02
|
||||||
|
jsr compare ; and T00,S01,$48 ==
|
||||||
|
!byte $03,$9B
|
||||||
|
bcs .exit
|
||||||
|
ldy #$02
|
||||||
|
jsr modify ; then set T00,S01,$48 =
|
||||||
|
!byte $84,$9D
|
||||||
|
.exit
|
||||||
|
}
|
@ -37,44 +37,46 @@ InitSectorMap
|
|||||||
; (this is the default value for all sectors)
|
; (this is the default value for all sectors)
|
||||||
;-------------------------------
|
;-------------------------------
|
||||||
sectormap
|
sectormap
|
||||||
T00 !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
|
T00 !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
|
||||||
T00S09 !byte $FF
|
T00S09 !byte $FF
|
||||||
T00S0A !byte $FF
|
T00S0A !byte $FF
|
||||||
!byte $FF,$FF,$FF,$FF,$FF
|
!byte $FF,$FF,$FF,$FF,$FF
|
||||||
T01 !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
|
T01 !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
|
||||||
T01S0F !byte $FF
|
T01S0F !byte $FF
|
||||||
T02 !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
|
T02 !byte $FF,$FF,$FF,$FF,$FF
|
||||||
T03 !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
|
T02S05 !byte $FF
|
||||||
T04 !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
|
!byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
|
||||||
T05 !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
|
T03 !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
|
||||||
T06 !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
|
T04 !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$F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F,$FF,$FF,$FF,$FF,$FF,$FF,$FF
|
T20 !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
|
||||||
T22S0F !byte $FF
|
T21 !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
|
||||||
|
T22 !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
|
||||||
|
T22S0F !byte $FF
|
||||||
|
@ -90,7 +90,8 @@ s_eatrk6 = $47
|
|||||||
s_eeef = $48
|
s_eeef = $48
|
||||||
s_poke = $49
|
s_poke = $49
|
||||||
s_bootcounter = $4A
|
s_bootcounter = $4A
|
||||||
STRINGCOUNT = $4B
|
s_milliken = $4B
|
||||||
|
STRINGCOUNT = $4C
|
||||||
|
|
||||||
!zone {
|
!zone {
|
||||||
StringTable
|
StringTable
|
||||||
@ -169,6 +170,7 @@ StringTable
|
|||||||
!word .eeef
|
!word .eeef
|
||||||
!word .poke
|
!word .poke
|
||||||
!word .bootcounter
|
!word .bootcounter
|
||||||
|
!word .milliken
|
||||||
;
|
;
|
||||||
; Text can contain substitution strings, which
|
; Text can contain substitution strings, which
|
||||||
; are replaced by current values at runtime. Each
|
; are replaced by current values at runtime. Each
|
||||||
@ -194,7 +196,7 @@ StringTable
|
|||||||
; can be set directly before calling PrintByID.
|
; can be set directly before calling PrintByID.
|
||||||
;
|
;
|
||||||
.header
|
.header
|
||||||
!text "Passport by 4am 2017-04-03",00
|
!text "Passport by 4am 2017-04-04",00
|
||||||
.mainmenu
|
.mainmenu
|
||||||
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
|
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
|
||||||
!text " "
|
!text " "
|
||||||
@ -432,4 +434,7 @@ StringTable
|
|||||||
.bootcounter
|
.bootcounter
|
||||||
!text "T%t,S%0 Original disk destroys itself",$8D
|
!text "T%t,S%0 Original disk destroys itself",$8D
|
||||||
!text "after a limited number of boots.",$8D,$00
|
!text "after a limited number of boots.",$8D,$00
|
||||||
|
.milliken
|
||||||
|
!text "T00,S0A Found Milliken protection check",$8D
|
||||||
|
!text "T02,S05 might be unreadable",$8D,00
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user