mirror of
https://github.com/a2-4am/passport.git
synced 2024-12-22 04:29:59 +00:00
shave some bytes
This commit is contained in:
parent
aabfb0118a
commit
479100ef9f
14
src/id/555.a
14
src/id/555.a
@ -2,11 +2,10 @@
|
||||
; ID555
|
||||
; identify 555 bootloader
|
||||
;
|
||||
; in: track buffer contains T00,S00
|
||||
; out: C clear if 555 bootloader found
|
||||
; C set otherwise
|
||||
; all registers clobbered
|
||||
; all other flags clobbered
|
||||
; in: track buffer contains T00,S00
|
||||
; out: C clear if 555 bootloader found
|
||||
; C set otherwise
|
||||
; all registers & flags clobbered
|
||||
;
|
||||
; tested with
|
||||
; - Addition Magician
|
||||
@ -33,7 +32,7 @@
|
||||
; - Temple of Apshai
|
||||
; - Trap-a-Zoid
|
||||
;-------------------------------
|
||||
ID555
|
||||
!macro ID555 {
|
||||
lda #8
|
||||
ldy #22
|
||||
jsr SearchSector
|
||||
@ -48,4 +47,5 @@ ID555
|
||||
!byte $C8 ; INY
|
||||
!byte $C4,WILDCARD ; CPY $xx
|
||||
!byte $90,$EF ; BCC *-$0F
|
||||
rts
|
||||
; passport-test-suite/Jumpman.woz [C=0] matches
|
||||
}
|
||||
|
@ -12,7 +12,8 @@
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; IDDOS33 returned success
|
||||
; A = 0
|
||||
; out: A,Y preserved
|
||||
; out: A = 0
|
||||
; Y preserved
|
||||
; all other flags and registers clobbered
|
||||
;-------------------------------
|
||||
!macro IDD5D5F7 {
|
||||
|
@ -2,21 +2,20 @@
|
||||
; IDDatasoft
|
||||
; identify Datasoft encrypted bootloader
|
||||
;
|
||||
; in: track buffer contains T00,S00
|
||||
; out: C clear if Datasoft encrypted bootloader found
|
||||
; C set otherwise
|
||||
; all registers clobbered
|
||||
; all other flags clobbered
|
||||
;
|
||||
; tested with
|
||||
; - Tomahawk
|
||||
; - Video Title Shop
|
||||
; in: track buffer contains T00,S00
|
||||
; A = 0
|
||||
; X = 0
|
||||
; out: C clear if Datasoft encrypted bootloader found
|
||||
; C set otherwise
|
||||
; A = 0
|
||||
; X = 0
|
||||
; all other registers & flags clobbered
|
||||
;-------------------------------
|
||||
!macro IDDatasoft {
|
||||
lda #$00
|
||||
tax
|
||||
ldy #$08
|
||||
jsr compare
|
||||
!byte $01,$4C,$7E,$08,$04,$8A,$0C,$B8
|
||||
!byte $01
|
||||
!byte $4C,$7E,$08
|
||||
!byte $04,$8A,$0C,$B8
|
||||
; passport-test-suite/Tomahawk.woz [C=0] matches
|
||||
}
|
||||
|
@ -2,18 +2,20 @@
|
||||
; IDDavid
|
||||
; identify David-DOS bootloader
|
||||
;
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; out: C clear if David-DOS bootloader found
|
||||
; C set otherwise
|
||||
; all registers clobbered
|
||||
; all other flags clobbered
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; A = 0
|
||||
; X = 0
|
||||
; out: C clear if David-DOS bootloader found
|
||||
; C set otherwise
|
||||
; A = 0
|
||||
; X = 0
|
||||
; all other registers & flags clobbered
|
||||
;-------------------------------
|
||||
!macro IDDavid {
|
||||
lda #$00
|
||||
ldx #$01
|
||||
ldy #$06
|
||||
jsr compare ; if T00,S00,$01 ==
|
||||
jsr compare ; if T00,S00,$00 ==
|
||||
!byte $01
|
||||
!byte $A5,$27 ; LDA $27
|
||||
!byte $C9,$09 ; CMP #$09
|
||||
!byte $D0,$17 ; BNE +$17
|
||||
@ -23,5 +25,7 @@
|
||||
!byte $A2,WILDCARD ; LDX #$**
|
||||
!byte $BD,WILDCARD,$08; LDA $08**,X
|
||||
!byte $9D
|
||||
@notDavid ; passport-test-suite/Horses.woz [C=0] matches
|
||||
; passport-test-suite/Horses.woz [C=0] matches
|
||||
tax
|
||||
@notDavid
|
||||
}
|
||||
|
@ -2,11 +2,11 @@
|
||||
; IDDinkeyDOS
|
||||
; identify Dinkey-DOS by filename in ProDOS catalog
|
||||
;
|
||||
; in: track buffer contains T00,S0B
|
||||
; out: C clear if Dinkey-DOS found
|
||||
; C set otherwise
|
||||
; all registers clobbered
|
||||
; all other flags clobbered
|
||||
; in: track buffer contains T00,S0B
|
||||
; out: C clear if Dinkey-DOS found
|
||||
; C set otherwise
|
||||
; A = #$0B
|
||||
; all other registers & flags clobbered
|
||||
;-------------------------------
|
||||
!macro IDDinkeyDOS {
|
||||
lda #$0B
|
||||
|
45
src/id/dos32.a
Normal file
45
src/id/dos32.a
Normal file
@ -0,0 +1,45 @@
|
||||
;-------------------------------
|
||||
; IDDOS32
|
||||
;
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; A = 0
|
||||
; X = 0
|
||||
; out: C clear if hybrid DOS 3.2/3.3 bootloader found
|
||||
; C set otherwise
|
||||
; A = 0
|
||||
; X = 0
|
||||
; all other registers & flags clobbered
|
||||
;-------------------------------
|
||||
!macro IDDOS32 {
|
||||
ldy #$0F
|
||||
jsr compare ; if T00,S00,$00 =
|
||||
!byte $01
|
||||
!byte $A0,$0F ; LDY #$0F
|
||||
!byte $B9,$00,$08; LDA $0800,Y
|
||||
!byte $99,$00,$02; STA $0200,Y
|
||||
!byte $C8 ; INY
|
||||
!byte $D0,$F7 ; BNE -
|
||||
!byte $4C,$0F,$02; JMP $020F
|
||||
bcs +
|
||||
ldx #$33
|
||||
ldy #$08
|
||||
jsr compare ; and T00,S00,$33 =
|
||||
!byte $A6,$2B ; LDX $2B
|
||||
!byte $20,$5D,$02; JSR $025D
|
||||
!byte $4C,$D1,$02; JMP $02D1
|
||||
bcs +
|
||||
ldx #$F4
|
||||
ldy #$08
|
||||
jsr compare ; and T00,S00,$F4 =
|
||||
!byte $CC,$00,$03; CPY $0300
|
||||
!byte $D0,$03 ; BNE +
|
||||
!byte $4C,$3B,$02; JMP $023B
|
||||
bcs +
|
||||
ldx #$45
|
||||
ldy #$03
|
||||
jsr compare ; and T00,S00,$45 =
|
||||
!byte $4C,$01,$03; JMP $0301
|
||||
tax
|
||||
+
|
||||
}
|
44
src/id/dos32lo.a
Normal file
44
src/id/dos32lo.a
Normal file
@ -0,0 +1,44 @@
|
||||
;-------------------------------
|
||||
; IDDOS32LO
|
||||
; detect earlier variant of hybrid bootloader that loads into
|
||||
; low memory ($3600) then relocates to the top of main memory
|
||||
; after loading DOS
|
||||
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; A = 0
|
||||
; X = 0
|
||||
; out: C clear if low DOS 3.2/3.3 bootloader found
|
||||
; C set otherwise
|
||||
; A = 0
|
||||
; X = 0
|
||||
; all other registers & flags clobbered
|
||||
;-------------------------------
|
||||
!macro IDDOS32LO {
|
||||
ldy #$0F
|
||||
jsr compare
|
||||
!byte $01
|
||||
!byte $A2,$00 ; LDX #$00
|
||||
!byte $BD,$00,$08; LDA $0800,X
|
||||
!byte $9D,$00,$02; STA $0200,X
|
||||
!byte $E8 ; INX
|
||||
!byte $D0,$F7 ; BNE -
|
||||
!byte $4C,$0F,$02; JMP $020F
|
||||
bcs +
|
||||
ldx #$2F
|
||||
ldy #$08
|
||||
jsr compare
|
||||
!byte $A6,$2B ; LDX $2B
|
||||
!byte $20,$5D,$02; JSR $025D
|
||||
!byte $20,$D1,$02; JSR $02D1
|
||||
bcs +
|
||||
ldx #$41
|
||||
ldy #$03
|
||||
jsr compare
|
||||
!byte $4C,$01,$03; JMP $0301
|
||||
bcc +
|
||||
ldx #$37
|
||||
jsr compare
|
||||
!byte $4C,$01,$03; JMP $0301
|
||||
+ tax
|
||||
}
|
@ -5,7 +5,6 @@
|
||||
;
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; A = 0
|
||||
; X = 0
|
||||
; out: C clear if traceable DOS 3.3-style bootloader found
|
||||
; C set otherwise
|
||||
@ -20,6 +19,7 @@ IDDOS33
|
||||
; Must weed out some Infocom and TLC disks that would
|
||||
; load over program space and crash.
|
||||
;
|
||||
txa
|
||||
ldy $08FE
|
||||
cpy #$B6
|
||||
beq @ok08FE ; passport-test-suite/Binomial Multiplication.woz [Z=1] here, loads at $B600
|
||||
|
@ -2,28 +2,26 @@
|
||||
; IDHolle
|
||||
; identify Dav Holle's encrypted bootloader
|
||||
;
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; out: C clear if Holle bootloader found
|
||||
; C set otherwise
|
||||
; all registers clobbered
|
||||
; all other flags clobbered
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; A = 0
|
||||
; X = 0
|
||||
; out: C clear if Holle bootloader found
|
||||
; C set otherwise
|
||||
; A = 0
|
||||
; X = 0
|
||||
; all other registers & flags clobbered
|
||||
;-------------------------------
|
||||
!zone {
|
||||
IDHolle
|
||||
lda #$00
|
||||
tax
|
||||
ldy #(@searchend-@searchstart)
|
||||
!macro IDHolle {
|
||||
ldy #$10
|
||||
jsr compare ; if T00,S00,$00 ==
|
||||
@searchstart
|
||||
!byte $01
|
||||
CLD
|
||||
BIT $C081
|
||||
LDA #$60
|
||||
EOR $FF58
|
||||
@hang BNE @hang
|
||||
STA $03F3
|
||||
SEI
|
||||
@searchend
|
||||
rts ; passport-test-suite/Crime Wave.woz [C=0] matches
|
||||
!byte $D8 ; CLD
|
||||
!byte $2C,$81,$C0; BIT $C081
|
||||
!byte $A9,$60 ; LDA #$60
|
||||
!byte $4D,$58,$FF; EOR $FF58
|
||||
!byte $D0,$FE ; BNE
|
||||
!byte $8D,$F3,$03; STA $03F3
|
||||
!byte $78
|
||||
; passport-test-suite/Crime Wave.woz [C=0] matches
|
||||
}
|
||||
|
@ -78,24 +78,35 @@ IDBootloader
|
||||
ldx #BASEPAGE
|
||||
ldy #$01
|
||||
jsr CopyMemory ; exits with X=0
|
||||
txa ; A=0
|
||||
;
|
||||
; Try to identify DOS 3.3-shaped bootloader.
|
||||
; Exit via custom trace function if found.
|
||||
; (in X=0; out A=0)
|
||||
;
|
||||
jsr IDDOS33
|
||||
bcs .notdos33
|
||||
lda #TRUE
|
||||
sta gIsBoot0
|
||||
sta gIsBoot0 ; A = 0 (TRUE)
|
||||
;
|
||||
; Try to identify specific DOS 3.3-shaped bootloader
|
||||
; that may imply a D5D5F7 whole-track protection.
|
||||
; (in A=0; out A=0)
|
||||
;
|
||||
+IDD5D5F7
|
||||
;
|
||||
; Try to identify Diversi-DOS
|
||||
; (in A=0; out A=0)
|
||||
;
|
||||
+IDDiversi
|
||||
ldx #s_diversidos
|
||||
bcc .printdos
|
||||
;
|
||||
; Try to identify Pronto-DOS
|
||||
; (in A=0; out A=0)
|
||||
;
|
||||
+IDPronto
|
||||
ldx #s_prontodos
|
||||
bcc .printdos
|
||||
ldx #s_dosb0
|
||||
|
||||
.printdos
|
||||
stx +
|
||||
jsr PrintByID
|
||||
@ -103,35 +114,37 @@ IDBootloader
|
||||
jmp TraceDOS33
|
||||
.notdos33
|
||||
;
|
||||
; Try to identify a variant bootloader that calls to $08B3
|
||||
; early to munge the nibble tables used by the drive firmware.
|
||||
; Exit via custom trace function if found.
|
||||
;
|
||||
+ID8b3
|
||||
bcs .not8b3
|
||||
jsr PrintByID
|
||||
!byte s_jsr8b3
|
||||
sta gIs8b3
|
||||
jmp Trace8B3
|
||||
.not8b3
|
||||
;
|
||||
; Try to identify Laureate Learning Systems bootloader.
|
||||
; Exit via custom trace function if found.
|
||||
; (in A=0; out A=0)
|
||||
;
|
||||
+IDLaureate
|
||||
bcs .notLaureate
|
||||
jsr PrintByID
|
||||
!byte s_laureate
|
||||
lda #TRUE
|
||||
sta gIsLaureate
|
||||
sta gIsLaureate ; A = 0 (TRUE)
|
||||
lda #$0B
|
||||
jsr PrereadT00Partial
|
||||
bcs .notLaureate
|
||||
jmp TraceLaureate
|
||||
.notLaureate
|
||||
;
|
||||
; Try to identify a variant bootloader that calls to $08B3
|
||||
; early to munge the nibble tables used by the drive firmware.
|
||||
; Exit via custom trace function if found.
|
||||
; (in A=0; out A=0,X=0)
|
||||
;
|
||||
+ID8b3
|
||||
bcs .not8b3
|
||||
jsr PrintByID
|
||||
!byte s_jsr8b3
|
||||
sta gIs8b3 ; A = 0 (TRUE)
|
||||
jmp Trace8B3
|
||||
.not8b3
|
||||
;
|
||||
; Try to identify all the different MECC fastloader variants.
|
||||
; Exit via custom trace function if found.
|
||||
; (in A=0,X=0; out A=0,X=0)
|
||||
;
|
||||
+IDMECC
|
||||
bcs .notmecc
|
||||
@ -163,8 +176,103 @@ IDBootloader
|
||||
jmp foundmecc4
|
||||
.notmecc
|
||||
;
|
||||
; Try to identify encrypted Datasoft bootloader
|
||||
; (in A=0,X=0; out A=0,X=0)
|
||||
;
|
||||
+IDDatasoft
|
||||
bcs .notDatasoft
|
||||
jsr PrintByID
|
||||
!byte s_datasoftb0
|
||||
sta gIsDatasoft ; A = 0 (TRUE)
|
||||
; /!\ execution falls through here
|
||||
.notDatasoft
|
||||
;
|
||||
; Try to identify RDOS 16-sector bootloader
|
||||
; (in A=0,X=0; out A=0,X=0)
|
||||
;
|
||||
+IDRDOS16
|
||||
bcs .notRDOS16
|
||||
jsr PrintByID
|
||||
!byte s_rdos
|
||||
; /!\ execution falls through here
|
||||
.notRDOS16
|
||||
;
|
||||
; David-DOS II
|
||||
; (in A=0,X=0; out A=0,X=0)
|
||||
;
|
||||
+IDDavid
|
||||
bcs .notDavid
|
||||
jsr PrintByID
|
||||
!byte s_daviddos
|
||||
sta gIsDavidDOS ; A = 0 (TRUE)
|
||||
; /!\ execution falls through here
|
||||
.notDavid
|
||||
;
|
||||
; TSR bootloader
|
||||
; (in A=0,X=0; out A=0,X=0)
|
||||
;
|
||||
+IDTSR
|
||||
bcs .notTSR
|
||||
jsr PrintByID
|
||||
!byte s_tsr
|
||||
sta gIsTSR ; A = 0 (TRUE)
|
||||
; /!\ execution falls through here
|
||||
.notTSR
|
||||
;
|
||||
; Micrograms bootloader
|
||||
; (in A=0,X=0; out A=0,X=0)
|
||||
;
|
||||
+IDMicrograms
|
||||
bcs .notMicrograms
|
||||
jsr PrintByID
|
||||
!byte s_micrograms
|
||||
; /!\ execution falls through here
|
||||
.notMicrograms
|
||||
;
|
||||
; Quick-DOS
|
||||
; (in A=0,X=0; out A=0,X=0)
|
||||
;
|
||||
+IDQuickDOS
|
||||
bcs .notQuickDOS
|
||||
jsr PrintByID
|
||||
!byte s_quickdos
|
||||
; /!\ execution falls through here
|
||||
.notQuickDOS
|
||||
;
|
||||
; Dav Holle encrypted bootloader
|
||||
; (in A=0,X=0; out A=0,X=0)
|
||||
;
|
||||
+IDHolle
|
||||
bcs .notHolle
|
||||
jsr PrintByID
|
||||
!byte s_holle
|
||||
sta gIsHolle ; A = 0 (TRUE)
|
||||
; /!\ execution falls through here
|
||||
.notHolle
|
||||
;
|
||||
; Try to identify Electronic Arts bootloader.
|
||||
; Exit via custom trace function if found.
|
||||
; (in A=0,X=0; out A=0,X=0)
|
||||
;
|
||||
+IDEA
|
||||
bcs .notEA
|
||||
jmp foundea
|
||||
.notEA
|
||||
;
|
||||
; Try to identify hybrid 16-/13-sector bootloader.
|
||||
; Exit via custom trace function if found.
|
||||
; (in A=0,X=0; out A=0,X=0)
|
||||
;
|
||||
+IDDOS32
|
||||
bcs .notDOS32
|
||||
jsr PrintByID
|
||||
!byte s_dos32b0
|
||||
jmp TraceDOS32
|
||||
.notDOS32
|
||||
;
|
||||
; Try to identify DOS 3.3P (Special Delivery) bootloader.
|
||||
; Exit via custom trace function if found.
|
||||
; (in A=0,X=0; out A=0,X=0)
|
||||
;
|
||||
+IDSpecDel
|
||||
bcs .notSpecialDelivery
|
||||
@ -173,24 +281,10 @@ IDBootloader
|
||||
jmp TraceSpecDel
|
||||
.notSpecialDelivery
|
||||
;
|
||||
; Try to identify Electronic Arts bootloader.
|
||||
; Try to identify hybrid 16-/13-sector bootloader (variant
|
||||
; that loads into $3600 then relocates).
|
||||
; Exit via custom trace function if found.
|
||||
;
|
||||
+IDEA
|
||||
bcs .notEA
|
||||
jmp foundea
|
||||
.notEA
|
||||
;
|
||||
; Try to identify hybrid 16-/13-sector bootloader on
|
||||
; DOS 3.2 disks.
|
||||
; Exit via custom trace function if found.
|
||||
;
|
||||
+IDDOS32
|
||||
bcs .notDOS32
|
||||
jsr PrintByID
|
||||
!byte s_dos32b0
|
||||
jmp TraceDOS32
|
||||
.notDOS32
|
||||
; (in A=0,X=0; out A=0,X=0)
|
||||
+IDDOS32LO
|
||||
bcs .notDOS32LO
|
||||
jsr PrintByID
|
||||
@ -198,8 +292,48 @@ IDBootloader
|
||||
jmp TraceDOS32LO
|
||||
.notDOS32LO
|
||||
;
|
||||
; ProDOS (all versions)
|
||||
; (in A=0,X=0; out none [after jsr IDVolumeName])
|
||||
;
|
||||
+IDProDOS
|
||||
bcs .notProDOS
|
||||
jsr PrintByID
|
||||
!byte s_prodosb0
|
||||
sta gIsProDOS ; A = 0 (TRUE)
|
||||
jsr IDVolumeName
|
||||
; /!\ execution falls through here because Dinkey-DOS disks are also ProDOS
|
||||
.notProDOS
|
||||
;
|
||||
; Dinkey-DOS (ProDOS file structure with DOS 3.3-ish RWTS in language card)
|
||||
; detectable now because IDVolumeName just read the first sector of the
|
||||
; volume directory into memory so we can look for a unique filename
|
||||
; (in none; out none)
|
||||
;
|
||||
+IDDinkeyDOS
|
||||
bcs .notDinkey
|
||||
sta gDisplayBytes ; A = #$0B
|
||||
jsr PrintByID
|
||||
!byte s_dinkeydos
|
||||
lda #TRUE
|
||||
sta gIsDinkeyDOS
|
||||
; /!\ execution falls through here to save bytes (no other IDs will match)
|
||||
.notDinkey
|
||||
;
|
||||
; Apple Pascal (all versions)
|
||||
; (in none; out none [after jsr IDVolumeName])
|
||||
;
|
||||
+IDPascal
|
||||
bcs .notPascal
|
||||
jsr PrintByID
|
||||
!byte s_pascalb0
|
||||
sta gIsPascal ; A = 0 (TRUE)
|
||||
jsr IDVolumeName
|
||||
; /!\ execution falls through here
|
||||
.notPascal
|
||||
;
|
||||
; Try to identify Interplay bootloader.
|
||||
; Exit via custom trace function if found.
|
||||
; (in none; out none)
|
||||
;
|
||||
+IDAdvent
|
||||
bcs .notInterplay
|
||||
@ -209,6 +343,7 @@ IDBootloader
|
||||
; Try to detect whether there is code in the boot sector
|
||||
; that loads 4-and-4-encoded data. This is an early escape
|
||||
; hatch for disks that will fail later anyway.
|
||||
; (in none; out none)
|
||||
;
|
||||
+IDEncoded44
|
||||
bcs .not44
|
||||
@ -223,6 +358,7 @@ IDBootloader
|
||||
; (the universal RWTS only works on 6-and-2 encoded data), so
|
||||
; this serves as an early escape hatch for disks that will
|
||||
; fail later anyway.
|
||||
; (in none; out none)
|
||||
;
|
||||
+IDEncoded53
|
||||
bcs .not53
|
||||
@ -231,124 +367,10 @@ IDBootloader
|
||||
jmp TheEnd
|
||||
.not53
|
||||
;
|
||||
; ProDOS (all versions)
|
||||
; 5-5-5 spiral bootloader
|
||||
; (in none; out none)
|
||||
;
|
||||
+IDProDOS
|
||||
bcs .notProDOS
|
||||
jsr PrintByID
|
||||
!byte s_prodosb0
|
||||
lda #TRUE
|
||||
sta gIsProDOS
|
||||
jsr IDVolumeName
|
||||
; /!\ execution falls through here because Dinkey-DOS disks are also ProDOS
|
||||
.notProDOS
|
||||
;
|
||||
; Dinkey-DOS (ProDOS file structure with DOS 3.3-ish RWTS in language card)
|
||||
; detectable now because IDVolumeName just read the first sector of the
|
||||
; volume directory into memory so we can look for a unique filename
|
||||
;
|
||||
+IDDinkeyDOS
|
||||
bcs .notDinkey
|
||||
lda #$0B
|
||||
sta gDisplayBytes
|
||||
jsr PrintByID
|
||||
!byte s_dinkeydos
|
||||
lda #TRUE
|
||||
sta gIsDinkeyDOS
|
||||
; /!\ execution falls through here to save bytes (no other IDs will match)
|
||||
.notDinkey
|
||||
;
|
||||
; Apple Pascal (all versions)
|
||||
;
|
||||
+IDPascal
|
||||
bcs .notPascal
|
||||
jsr PrintByID
|
||||
!byte s_pascalb0
|
||||
lda #TRUE
|
||||
sta gIsPascal
|
||||
jsr IDVolumeName
|
||||
; /!\ execution falls through here to save bytes (no other IDs will match)
|
||||
.notPascal
|
||||
;
|
||||
; David-DOS II
|
||||
;
|
||||
+IDDavid
|
||||
bcs .notDavid
|
||||
jsr PrintByID
|
||||
!byte s_daviddos
|
||||
lda #TRUE
|
||||
sta gIsDavidDOS
|
||||
; /!\ execution falls through here to save bytes (no other IDs will match)
|
||||
.notDavid
|
||||
;
|
||||
; Encrypted Datasoft bootloader
|
||||
;
|
||||
+IDDatasoft
|
||||
bcs .notDatasoft
|
||||
jsr PrintByID
|
||||
!byte s_datasoftb0
|
||||
lda #TRUE
|
||||
sta gIsDatasoft
|
||||
; /!\ execution falls through here to save bytes (no other IDs will match)
|
||||
.notDatasoft
|
||||
;
|
||||
; TSR bootloader
|
||||
;
|
||||
+IDTSR
|
||||
bcs .notTSR
|
||||
jsr PrintByID
|
||||
!byte s_tsr
|
||||
lda #TRUE
|
||||
sta gIsTSR
|
||||
; /!\ execution falls through here to save bytes (no other IDs will match)
|
||||
.notTSR
|
||||
;
|
||||
; Micrograms bootloader
|
||||
; (just for display)
|
||||
;
|
||||
+IDMicrograms
|
||||
bcs .notMicrograms
|
||||
jsr PrintByID
|
||||
!byte s_micrograms
|
||||
; /!\ execution falls through here to save bytes (no other IDs will match)
|
||||
.notMicrograms
|
||||
;
|
||||
; Quick-DOS
|
||||
; (just for display)
|
||||
;
|
||||
+IDQuickDOS
|
||||
bcs .notQuickDOS
|
||||
jsr PrintByID
|
||||
!byte s_quickdos
|
||||
; /!\ execution falls through here to save bytes (no other IDs will match)
|
||||
.notQuickDOS
|
||||
;
|
||||
; RDOS (16-sector)
|
||||
; (just for display)
|
||||
;
|
||||
+
|
||||
+IDRDOS16
|
||||
bcs .notRDOS16
|
||||
jsr PrintByID
|
||||
!byte s_rdos
|
||||
; /!\ execution falls through here to save bytes (no other IDs will match)
|
||||
.notRDOS16
|
||||
;
|
||||
; Dav Holle encrypted bootloader
|
||||
; (will be decrypted and patched)
|
||||
;
|
||||
jsr IDHolle
|
||||
bcs .notHolle
|
||||
jsr PrintByID
|
||||
!byte s_holle
|
||||
lda #TRUE
|
||||
sta gIsHolle
|
||||
; /!\ execution falls through here to save bytes (no other IDs will match)
|
||||
.notHolle
|
||||
;
|
||||
; 555 bootloader
|
||||
;
|
||||
jsr ID555
|
||||
+ID555
|
||||
bcs .not555
|
||||
lda #0
|
||||
sta gDisplayBytes
|
||||
|
@ -9,15 +9,10 @@
|
||||
; out: C clear if this bootloader was found
|
||||
; C set otherwise
|
||||
; A = 0
|
||||
; X = 0
|
||||
; all other registers & flags clobbered
|
||||
;-------------------------------
|
||||
!macro ID8b3 {
|
||||
tax
|
||||
ldy #$08
|
||||
jsr compare
|
||||
!byte $01,$20,$B3,$08,$D0,$19,$EA,$A5
|
||||
bcs +
|
||||
|
||||
ldx #$B3
|
||||
ldy #$14
|
||||
jsr compare
|
||||
@ -25,6 +20,11 @@
|
||||
!byte $A9,$1C,$8D,$CC,$03
|
||||
!byte $A9,$00,$8D,$D5,$03
|
||||
!byte $A9,$37,$8D,$A3,$03
|
||||
tax
|
||||
bcs +
|
||||
ldy #$08
|
||||
jsr compare
|
||||
!byte $01,$20,$B3,$08,$D0,$19,$EA,$A5
|
||||
; passport-test-suite/Ardy The Aardvark.woz [C=0] matches
|
||||
+
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
;
|
||||
; in: track buffer contains T00,S00
|
||||
; A = 0
|
||||
; X = 0
|
||||
; out: C clear if MECC bootloader was found
|
||||
; C set if not found
|
||||
; A = 0
|
||||
@ -15,7 +16,6 @@
|
||||
; all other registers & flags clobbered
|
||||
;-------------------------------
|
||||
!macro IDMECC {
|
||||
tax
|
||||
ldy #$17
|
||||
jsr compare
|
||||
!byte $01,$4C,$1A,$08,$17,$0F,$00,$00
|
||||
|
@ -2,17 +2,19 @@
|
||||
; IDMicrograms
|
||||
; identify Micrograms bootloader
|
||||
;
|
||||
; in: track buffer contains T00,S00
|
||||
; out: C clear if Micrograms bootloader was found
|
||||
; C set if not found
|
||||
; all other flags clobbered
|
||||
; all registers clobbered
|
||||
; in: track buffer contains T00,S00
|
||||
; A = 0
|
||||
; X = 0
|
||||
; out: C clear if Micrograms bootloader was found
|
||||
; C set if not found
|
||||
; A = 0
|
||||
; X = 0
|
||||
; all other registers & flags clobbered
|
||||
;-------------------------------
|
||||
!macro IDMicrograms {
|
||||
lda #$00
|
||||
ldx #$01
|
||||
ldy #$0A
|
||||
ldy #$0B
|
||||
jsr compare
|
||||
!byte $01
|
||||
!byte $A5,$27
|
||||
!byte $C9,$09
|
||||
!byte $D0,$12
|
||||
@ -23,5 +25,7 @@
|
||||
ldy #$02
|
||||
jsr compare
|
||||
!byte $4C,$00
|
||||
; passport-test-suite/Shapes and Patterns.woz [C=0] matches
|
||||
tax
|
||||
@notMicrograms
|
||||
}
|
||||
|
@ -2,12 +2,15 @@
|
||||
; IDPascal
|
||||
; identify Apple Pascal bootloader
|
||||
;
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; out: C clear if Apple Pascal bootloader found
|
||||
; C set otherwise
|
||||
; all registers clobbered
|
||||
; all other flags clobbered
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; A = 0
|
||||
; X = 0
|
||||
; out: C clear if Apple Pascal bootloader found
|
||||
; C set otherwise
|
||||
; A = 0
|
||||
; X = 0
|
||||
; all other registers & flags clobbered
|
||||
;-------------------------------
|
||||
!macro IDPascal {
|
||||
;
|
||||
|
@ -2,12 +2,15 @@
|
||||
; IDProDOS
|
||||
; identify ProDOS bootloader
|
||||
;
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; out: C clear if ProDOS bootloader found
|
||||
; C set otherwise
|
||||
; all registers clobbered
|
||||
; all other flags clobbered
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; A = 0
|
||||
; X = 0
|
||||
; out: C clear if ProDOS bootloader found
|
||||
; C set otherwise
|
||||
; A = 0
|
||||
; X = 0
|
||||
; all other registers & flags clobbered
|
||||
;-------------------------------
|
||||
!macro IDProDOS {
|
||||
; Some disks jump to $08FF at $0804 (SOS entry point).
|
||||
@ -15,8 +18,6 @@
|
||||
; ProDOS (e.g. 1-2-3 Sequence Me, Alge-Blaster Plus,
|
||||
; Dazzle Draw, SuperPrint II). All of these variants
|
||||
; will match.
|
||||
lda #$00
|
||||
tax
|
||||
ldy #$05
|
||||
jsr compare ; if T00,S00,$00 ==
|
||||
!byte $01
|
||||
|
@ -2,18 +2,20 @@
|
||||
; IDQuickDOS
|
||||
; identify Quick-DOS bootloader
|
||||
;
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; out: C clear if Quick-DOS bootloader found
|
||||
; C set otherwise
|
||||
; all registers clobbered
|
||||
; all other flags clobbered
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; A = 0
|
||||
; X = 0
|
||||
; out: C clear if Quick-DOS bootloader found
|
||||
; C set otherwise
|
||||
; A = 0
|
||||
; X = 0
|
||||
; all other registers & flags clobbered
|
||||
;-------------------------------
|
||||
!macro IDQuickDOS {
|
||||
lda #$00
|
||||
ldx #$01
|
||||
ldy #$0A
|
||||
ldy #$0B
|
||||
jsr compare ; if T00,S00,$01 ==
|
||||
!byte $01
|
||||
!byte $A5,$27 ; LDA $27
|
||||
!byte $C9,$09 ; CMP #$09
|
||||
!byte $D0,$27 ; BNE +$27
|
||||
|
@ -2,16 +2,17 @@
|
||||
; IDRDOS16
|
||||
; identify RDOS 16-sector bootloader
|
||||
;
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; out: C clear if RDOS 16-sector bootloader found
|
||||
; C set otherwise
|
||||
; all registers clobbered
|
||||
; all other flags clobbered
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; A = 0
|
||||
; X = 0
|
||||
; out: C clear if RDOS 16-sector bootloader found
|
||||
; C set otherwise
|
||||
; A = 0
|
||||
; X = 0
|
||||
; all other registers & flags clobbered
|
||||
;-------------------------------
|
||||
!macro IDRDOS16 {
|
||||
lda #$00
|
||||
tax
|
||||
ldy #$0E
|
||||
jsr compare ; if T00,S00,$00 ==
|
||||
!byte $01
|
@ -3,93 +3,6 @@
|
||||
; that boots automatically on 16-sector drives
|
||||
; e.g. many early disks from Edu-Ware, Hartley, DLM, Milliken
|
||||
|
||||
;-------------------------------
|
||||
; IDDOS32
|
||||
;
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; A = 0
|
||||
; X = 0
|
||||
; out: C clear if hybrid DOS 3.2/3.3 bootloader found
|
||||
; C set otherwise
|
||||
; all other registers & flags clobbered
|
||||
;-------------------------------
|
||||
!macro IDDOS32 {
|
||||
ldy #$0F
|
||||
jsr compare ; if T00,S00,$00 =
|
||||
!byte $01
|
||||
!byte $A0,$0F ; LDY #$0F
|
||||
!byte $B9,$00,$08; LDA $0800,Y
|
||||
!byte $99,$00,$02; STA $0200,Y
|
||||
!byte $C8 ; INY
|
||||
!byte $D0,$F7 ; BNE -
|
||||
!byte $4C,$0F,$02; JMP $020F
|
||||
bcs +
|
||||
ldx #$33
|
||||
ldy #$08
|
||||
jsr compare ; and T00,S00,$33 =
|
||||
!byte $A6,$2B ; LDX $2B
|
||||
!byte $20,$5D,$02; JSR $025D
|
||||
!byte $4C,$D1,$02; JMP $02D1
|
||||
bcs +
|
||||
ldx #$F4
|
||||
ldy #$08
|
||||
jsr compare ; and T00,S00,$F4 =
|
||||
!byte $CC,$00,$03; CPY $0300
|
||||
!byte $D0,$03 ; BNE +
|
||||
!byte $4C,$3B,$02; JMP $023B
|
||||
bcs +
|
||||
ldx #$45
|
||||
ldy #$03
|
||||
jsr compare ; and T00,S00,$45 =
|
||||
!byte $4C,$01,$03; JMP $0301
|
||||
+
|
||||
}
|
||||
|
||||
;-------------------------------
|
||||
; IDDOS32LO
|
||||
; detect earlier variant of hybrid bootloader that loads into
|
||||
; low memory ($3600) then relocates to the top of main memory
|
||||
; after loading DOS
|
||||
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; out: C clear if low DOS 3.2/3.3 bootloader found
|
||||
; C set otherwise
|
||||
; all other registers & flags clobbered
|
||||
;-------------------------------
|
||||
!macro IDDOS32LO {
|
||||
lda #$00
|
||||
tax
|
||||
ldy #$0F
|
||||
jsr compare
|
||||
!byte $01
|
||||
!byte $A2,$00 ; LDX #$00
|
||||
!byte $BD,$00,$08; LDA $0800,X
|
||||
!byte $9D,$00,$02; STA $0200,X
|
||||
!byte $E8 ; INX
|
||||
!byte $D0,$F7 ; BNE -
|
||||
!byte $4C,$0F,$02; JMP $020F
|
||||
bcs +
|
||||
ldx #$2F
|
||||
ldy #$08
|
||||
jsr compare
|
||||
!byte $A6,$2B ; LDX $2B
|
||||
!byte $20,$5D,$02; JSR $025D
|
||||
!byte $20,$D1,$02; JSR $02D1
|
||||
bcs +
|
||||
ldx #$41
|
||||
ldy #$03
|
||||
jsr compare
|
||||
!byte $4C,$01,$03; JMP $0301
|
||||
bcc +
|
||||
ldx #$37
|
||||
ldy #$03
|
||||
jsr compare
|
||||
!byte $4C,$01,$03; JMP $0301
|
||||
+
|
||||
}
|
||||
|
||||
;-------------------------------
|
||||
; TraceDOS32/TraceDOS32LO
|
||||
; set up boot trace to capture 13-sector RWTS
|
||||
|
@ -8,6 +8,7 @@
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; A = 0
|
||||
; X = 0
|
||||
; out: C clear if Special Delivery bootloader found
|
||||
; C set otherwise
|
||||
; A = 0
|
||||
@ -15,7 +16,6 @@
|
||||
; all other registers & flags clobbered
|
||||
;-------------------------------
|
||||
!macro IDSpecDel {
|
||||
tax
|
||||
ldy #$08
|
||||
jsr compare
|
||||
!byte $02
|
||||
|
36
src/id/tsr.a
36
src/id/tsr.a
@ -2,32 +2,32 @@
|
||||
; IDTSR
|
||||
; identify TSR bootloader
|
||||
;
|
||||
; in: track buffer contains T00,S00
|
||||
; out: C clear if TSR bootloader found
|
||||
; C set otherwise
|
||||
; all registers clobbered
|
||||
; all other flags clobbered
|
||||
;
|
||||
; tested with
|
||||
; - Dawn Patrol
|
||||
; - Dungeon
|
||||
; - Theseus and the Minotaur
|
||||
; in: track buffer contains T00,S00
|
||||
; A = 0
|
||||
; X = 0
|
||||
; out: C clear if TSR bootloader found
|
||||
; C set otherwise
|
||||
; A = 0
|
||||
; X = 0
|
||||
; all other registers & flags clobbered
|
||||
;-------------------------------
|
||||
!macro IDTSR {
|
||||
lda #$00
|
||||
ldy #$05
|
||||
jsr compare
|
||||
!byte $01
|
||||
!byte $A5,$27
|
||||
!byte $C9,$09
|
||||
bcs @notTSR
|
||||
ldx #$FE
|
||||
ldy #$02
|
||||
jsr compare
|
||||
!byte $B0,$0F
|
||||
bcs @notTSR
|
||||
ldx #$1C
|
||||
ldy #$03
|
||||
iny
|
||||
jsr compare
|
||||
!byte $20,$B3,$08
|
||||
bcs @notTSR
|
||||
ldx #$01
|
||||
ldy #$04
|
||||
jsr compare
|
||||
!byte $A5,$27,$C9,$09
|
||||
@notTSR ; passport-test-suite/Dawn Patrol.woz [C=0] matches
|
||||
; passport-test-suite/Dawn Patrol.woz [C=0] matches
|
||||
@notTSR
|
||||
tax
|
||||
}
|
||||
|
@ -3,16 +3,11 @@
|
||||
; identify and print volume name if found
|
||||
; (ProDOS and Pascal supported)
|
||||
;
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; gIsProDOS or gIsPascal is true
|
||||
; out: C clear if disk volume name was found and printed
|
||||
; C set otherwise
|
||||
; oVerflow always clear
|
||||
; all registers clobbered
|
||||
; all other flags clobbered
|
||||
; in: $0800..$08FF contains T00,S00
|
||||
; first page of track buffer also contains T00,S00
|
||||
; gIsProDOS or gIsPascal is true
|
||||
; out: all registers & flags clobbered
|
||||
;-------------------------------
|
||||
!zone {
|
||||
IDVolumeName
|
||||
; read T00,S0B (volume key block)
|
||||
ldx #$00
|
||||
@ -25,7 +20,7 @@ IDVolumeName
|
||||
sta gAddress+1
|
||||
sta cmp1+1
|
||||
jsr ReadSectorXY
|
||||
bcs .error
|
||||
bcs .exit
|
||||
|
||||
lda gIsPascal
|
||||
beq .pascal
|
||||
@ -34,7 +29,7 @@ IDVolumeName
|
||||
ldy #$04
|
||||
lda (cmp1), y
|
||||
cmp #$F1
|
||||
bcc .error
|
||||
bcc .exit
|
||||
and #$0F
|
||||
tax
|
||||
lda #$05
|
||||
@ -45,12 +40,12 @@ IDVolumeName
|
||||
ldy #$02
|
||||
lda (cmp1), y
|
||||
cmp #$06
|
||||
bne .error
|
||||
bne .exit
|
||||
ldy #$06
|
||||
lda (cmp1), y
|
||||
beq .error
|
||||
beq .exit
|
||||
cmp #$08
|
||||
bcs .error ; passport-test-suite/Notecard Maker.woz [C=0] reaches here
|
||||
bcs .exit ; passport-test-suite/Notecard Maker.woz [C=0] reaches here
|
||||
tax
|
||||
lda #$07
|
||||
sta .offset+1
|
||||
@ -81,16 +76,9 @@ IDVolumeName
|
||||
ldy #$06
|
||||
jsr compare
|
||||
!byte $4C,$4F,$57,$44,$4F,$53
|
||||
bcs +
|
||||
bcs .exit
|
||||
lda #TRUE
|
||||
sta gIsLowDOS
|
||||
lda #kSectorOptional
|
||||
sta T00S0C
|
||||
+
|
||||
clc
|
||||
!byte $24 ; hide next SEC
|
||||
.error
|
||||
sec
|
||||
clv
|
||||
rts
|
||||
}
|
||||
.exit rts
|
||||
|
@ -53,9 +53,11 @@ NonRelocatable
|
||||
!source "id/bootfailure.a"
|
||||
!source "id/trace33p.a"
|
||||
!source "id/dos33.a"
|
||||
!source "id/dos32.a"
|
||||
!source "id/dos32lo.a"
|
||||
!source "id/prodos.a"
|
||||
!source "id/pascal.a"
|
||||
!source "id/rdos.a"
|
||||
!source "id/rdos16.a"
|
||||
!source "id/jsr8b3.a"
|
||||
!source "id/mecc.a"
|
||||
!source "id/datasoft.a"
|
||||
|
Loading…
Reference in New Issue
Block a user