2017-01-08 03:35:35 +00:00
|
|
|
;-------------------------------
|
|
|
|
; IDMECC
|
|
|
|
; identify MECC custom bootloader
|
|
|
|
; note: there are several MECC RWTSes that share
|
2017-02-21 17:05:23 +00:00
|
|
|
; the same early bootloader, so further checks
|
|
|
|
; are required to distinguish between them after
|
|
|
|
; this function matches
|
2017-01-08 03:35:35 +00:00
|
|
|
;
|
2021-06-19 23:42:56 +00:00
|
|
|
; in: track buffer contains T00,S00
|
|
|
|
; A = 0
|
2021-06-20 04:18:55 +00:00
|
|
|
; X = 0
|
2021-06-19 23:42:56 +00:00
|
|
|
; out: C clear if MECC bootloader was found
|
|
|
|
; C set if not found
|
|
|
|
; A = 0
|
|
|
|
; X = 0
|
|
|
|
; all other registers & flags clobbered
|
2017-01-08 03:35:35 +00:00
|
|
|
;-------------------------------
|
2021-06-19 23:42:56 +00:00
|
|
|
!macro IDMECC {
|
2017-01-08 03:35:35 +00:00
|
|
|
ldy #$17
|
|
|
|
jsr compare
|
2017-01-24 00:57:43 +00:00
|
|
|
!byte $01,$4C,$1A,$08,$17,$0F,$00,$00
|
|
|
|
!byte $0D,$0B,$09,$07,$05,$03,$01,$0E
|
|
|
|
!byte $0C,$0A,$08,$06,$04,$02,$0F
|
2021-06-19 23:42:56 +00:00
|
|
|
; passport-test-suite/Clock Works v1.0.woz [C=0] matches
|
2017-03-29 13:01:33 +00:00
|
|
|
}
|
|
|
|
|
2017-01-08 03:35:35 +00:00
|
|
|
;-------------------------------
|
2017-02-21 17:05:23 +00:00
|
|
|
; IDMECC1
|
|
|
|
; identify MECC bootloader variant #1
|
|
|
|
; (labeled "M8" on original disks)
|
2017-01-08 03:35:35 +00:00
|
|
|
;
|
2017-02-21 17:05:23 +00:00
|
|
|
; in: track buffer contains all of track 0
|
2017-01-08 03:35:35 +00:00
|
|
|
; out: C clear if MECC "M8" bootloader was found
|
|
|
|
; C set if not found
|
|
|
|
; all other flags clobbered
|
|
|
|
; all registers clobbered
|
|
|
|
;-------------------------------
|
2017-01-24 00:57:43 +00:00
|
|
|
!zone {
|
2017-02-21 17:05:23 +00:00
|
|
|
IDMECC1
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #$0B
|
|
|
|
ldx #$02
|
|
|
|
ldy #$06
|
|
|
|
jsr compare ; IF T00,S0B,$02 ==
|
|
|
|
!byte $BD,$8C,$C0,$10,$FB,$C9
|
2017-02-20 21:32:35 +00:00
|
|
|
bcs .exit
|
2021-07-10 00:08:27 +00:00
|
|
|
ldx #$89
|
|
|
|
jsr compare ; AND T00,S0B,$89 ==
|
|
|
|
!byte $BD,$8C,$C0,$10,$FB,$C9
|
|
|
|
bcs .exit
|
2017-01-08 03:35:35 +00:00
|
|
|
ldx #$09
|
|
|
|
ldy #$09
|
|
|
|
jsr compare ; AND T00,S0B,$09 ==
|
|
|
|
!byte $D0,$EF,$EA,$BD,$8C,$C0,$10,$FB
|
|
|
|
!byte $C9
|
2017-02-20 21:32:35 +00:00
|
|
|
bcs .exit
|
2017-01-08 03:35:35 +00:00
|
|
|
ldx #$90
|
|
|
|
jsr compare ; AND T00,S0B,$90 ==
|
|
|
|
!byte $D0,$F4,$EA,$BD,$8C,$C0,$10,$FB
|
|
|
|
!byte $C9
|
2017-02-20 21:32:35 +00:00
|
|
|
bcs .exit
|
2017-01-08 03:35:35 +00:00
|
|
|
ldx #$9A
|
|
|
|
jsr compare ; AND T00,S0B,$9A ==
|
|
|
|
!byte $D0,$F2,$EA,$BD,$8C,$C0,$10,$FB
|
|
|
|
!byte $C9
|
2021-07-10 00:14:08 +00:00
|
|
|
ldx #$13
|
|
|
|
iny
|
|
|
|
jsr compare ; AND T00,S0B,$13 ==
|
|
|
|
!byte $D0,$E5,$A0,$03,$BD,$8C,$C0,$10
|
|
|
|
!byte $FB,$C9
|
|
|
|
bcs .exit
|
2017-02-20 21:32:35 +00:00
|
|
|
.exit
|
2019-05-07 01:24:29 +00:00
|
|
|
rts ; passport-test-suite/Coordinate Math v1.0.woz [C=0] matches
|
2017-01-08 03:35:35 +00:00
|
|
|
|
2017-02-21 17:05:23 +00:00
|
|
|
foundmecc1
|
2017-01-08 03:35:35 +00:00
|
|
|
;
|
2017-02-21 17:12:45 +00:00
|
|
|
; We found a MECC bootloader. Now we create
|
2017-01-08 03:35:35 +00:00
|
|
|
; 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.
|
|
|
|
;
|
|
|
|
lda #$00
|
|
|
|
sta modsrc
|
|
|
|
lda #$0B
|
|
|
|
clc
|
|
|
|
adc #BASEPAGE
|
|
|
|
sta modsrc+1
|
|
|
|
ldy #$08
|
|
|
|
lda (modsrc),y
|
|
|
|
lsr
|
2017-08-15 21:17:14 +00:00
|
|
|
sta UNIV_A1
|
2017-01-08 03:35:35 +00:00
|
|
|
ldy #$12
|
|
|
|
lda (modsrc),y
|
2017-08-15 21:17:14 +00:00
|
|
|
sta UNIV_A2
|
2017-01-08 03:35:35 +00:00
|
|
|
ldy #$1D
|
|
|
|
lda (modsrc),y
|
2017-08-15 21:17:14 +00:00
|
|
|
sta UNIV_A3
|
2017-01-08 03:35:35 +00:00
|
|
|
ldy #$8F
|
|
|
|
lda (modsrc),y
|
2017-08-15 21:17:14 +00:00
|
|
|
sta UNIV_D1
|
2017-01-08 03:35:35 +00:00
|
|
|
ldy #$99
|
|
|
|
lda (modsrc),y
|
2017-08-15 21:17:14 +00:00
|
|
|
sta UNIV_D2
|
2017-01-08 03:35:35 +00:00
|
|
|
ldy #$A3
|
|
|
|
lda (modsrc),y
|
2017-08-15 21:17:14 +00:00
|
|
|
sta UNIV_D3
|
2017-01-08 03:35:35 +00:00
|
|
|
jmp ADStyle
|
2017-01-24 00:57:43 +00:00
|
|
|
}
|
2017-01-08 03:35:35 +00:00
|
|
|
|
|
|
|
;-------------------------------
|
2017-02-21 17:05:23 +00:00
|
|
|
; IDMECC2
|
|
|
|
; identify MECC bootloader variant #2
|
|
|
|
; (labeled "M7" on original disks)
|
2017-01-08 03:35:35 +00:00
|
|
|
;
|
2017-02-21 17:05:23 +00:00
|
|
|
; in: track buffer contains all of track 0
|
2017-01-08 03:35:35 +00:00
|
|
|
; out: C clear if MECC "M7" bootloader was found
|
|
|
|
; C set if not found
|
|
|
|
; all other flags clobbered
|
|
|
|
; all registers clobbered
|
|
|
|
;-------------------------------
|
2017-01-24 00:57:43 +00:00
|
|
|
!zone {
|
2017-02-21 17:05:23 +00:00
|
|
|
IDMECC2
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #$07
|
2017-02-21 17:05:23 +00:00
|
|
|
IDMECC4a
|
2017-01-08 03:35:35 +00:00
|
|
|
ldx #$7D
|
|
|
|
ldy #$06
|
|
|
|
jsr compare ; IF T00,S07,$7D ==
|
|
|
|
!byte $BD,$8C,$C0,$10,$FB,$C9
|
2017-02-20 21:32:35 +00:00
|
|
|
bcs .exit
|
2017-01-08 03:35:35 +00:00
|
|
|
ldx #$0F
|
|
|
|
jsr compare ; and T00,S07,$0F ==
|
|
|
|
!byte $BD,$8C,$C0,$10,$FB,$49
|
2017-02-20 21:32:35 +00:00
|
|
|
bcs .exit
|
2017-01-08 03:35:35 +00:00
|
|
|
ldx #$18
|
2021-07-10 00:14:08 +00:00
|
|
|
iny
|
2017-01-08 03:35:35 +00:00
|
|
|
jsr compare ; and T00,S07,$18 ==
|
|
|
|
!byte $EA,$BD,$8C,$C0,$10,$FB,$C9
|
2017-02-20 21:32:35 +00:00
|
|
|
bcs .exit
|
2021-07-10 00:14:08 +00:00
|
|
|
ldx #$84
|
|
|
|
iny
|
|
|
|
iny
|
|
|
|
jsr compare ; AND T00,S07,$84 ==
|
|
|
|
!byte $D0,$F0,$EA,$BD,$8C,$C0,$10,$FB,$C9
|
|
|
|
bcs .exit
|
|
|
|
ldx #$8E
|
|
|
|
iny
|
|
|
|
jsr compare ; and T00,S07,$8E ==
|
|
|
|
!byte $D0,$F2,$A0,$03,$BD,$8C,$C0,$10,$FB,$C9
|
|
|
|
bcs .exit
|
2017-01-08 03:35:35 +00:00
|
|
|
ldx #$20
|
|
|
|
jsr compare ; and T00,S07,$20 ==
|
|
|
|
!byte $D0,$F2,$A0,$56,$BD,$8C,$C0,$10,$FB,$C9
|
2017-02-20 21:32:35 +00:00
|
|
|
.exit
|
2017-01-08 03:35:35 +00:00
|
|
|
rts
|
|
|
|
|
2017-02-21 17:05:23 +00:00
|
|
|
foundmecc2
|
2017-01-08 03:35:35 +00:00
|
|
|
;
|
2017-02-21 17:12:45 +00:00
|
|
|
; We found a MECC bootloader. Now we create
|
2017-01-08 03:35:35 +00:00
|
|
|
; 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.
|
|
|
|
;
|
|
|
|
lda #$07
|
2017-02-21 17:05:23 +00:00
|
|
|
foundmecc4a
|
2017-01-08 03:35:35 +00:00
|
|
|
clc
|
2019-05-07 01:24:29 +00:00
|
|
|
adc #BASEPAGE ; passport-test-suite/Clock Works v1.0.woz [C=0] reaches here
|
2017-01-08 03:35:35 +00:00
|
|
|
sta modsrc+1
|
2017-02-21 17:05:23 +00:00
|
|
|
lda #$00
|
|
|
|
sta modsrc
|
2017-01-08 03:35:35 +00:00
|
|
|
ldy #$83
|
|
|
|
lda (modsrc),y
|
|
|
|
lsr
|
2017-08-15 21:17:14 +00:00
|
|
|
sta UNIV_A1
|
2017-01-08 03:35:35 +00:00
|
|
|
ldy #$8D
|
|
|
|
lda (modsrc),y
|
2017-08-15 21:17:14 +00:00
|
|
|
sta UNIV_A2
|
2017-01-08 03:35:35 +00:00
|
|
|
ldy #$98
|
|
|
|
lda (modsrc),y
|
2017-08-15 21:17:14 +00:00
|
|
|
sta UNIV_A3
|
2017-01-08 03:35:35 +00:00
|
|
|
ldy #$15
|
|
|
|
lda (modsrc),y
|
2017-08-15 21:17:14 +00:00
|
|
|
sta UNIV_D1
|
2017-01-08 03:35:35 +00:00
|
|
|
ldy #$1F
|
|
|
|
lda (modsrc),y
|
2017-08-15 21:17:14 +00:00
|
|
|
sta UNIV_D2
|
2017-01-08 03:35:35 +00:00
|
|
|
ldy #$2A
|
|
|
|
lda (modsrc),y
|
2017-08-15 21:17:14 +00:00
|
|
|
sta UNIV_D3
|
2017-01-08 03:35:35 +00:00
|
|
|
jmp ADStyle
|
2017-01-24 00:57:43 +00:00
|
|
|
}
|
2017-02-20 21:32:35 +00:00
|
|
|
|
|
|
|
;-------------------------------
|
2017-02-21 17:05:23 +00:00
|
|
|
; IDMECC3
|
|
|
|
; identify MECC bootloader (M7 variant
|
|
|
|
; found in Word Muncher v1.1 and others)
|
2017-02-20 21:32:35 +00:00
|
|
|
;
|
2017-02-21 17:05:23 +00:00
|
|
|
; in: track buffer contains all of track 0
|
|
|
|
; out: C clear if this MECC bootloader variant was found
|
2017-02-20 21:32:35 +00:00
|
|
|
; C set if not found
|
|
|
|
; all other flags clobbered
|
|
|
|
; all registers clobbered
|
|
|
|
;-------------------------------
|
|
|
|
!zone {
|
2017-02-21 17:05:23 +00:00
|
|
|
IDMECC3
|
2017-02-20 21:32:35 +00:00
|
|
|
lda #$0A
|
|
|
|
ldx #$E2
|
|
|
|
ldy #$06
|
|
|
|
jsr compare ; IF T00,S0A,$E2 ==
|
|
|
|
!byte $BD,$8C,$C0,$10,$FB,$C9
|
|
|
|
bcs .exit
|
|
|
|
ldx #$E9
|
|
|
|
ldy #$09
|
|
|
|
jsr compare ; AND T00,S0A,$E9 ==
|
|
|
|
!byte $D0,$EF,$EA,$BD,$8C,$C0,$10,$FB,$C9
|
|
|
|
bcs .exit
|
|
|
|
ldx #$F3
|
2021-07-10 00:14:08 +00:00
|
|
|
iny
|
2017-02-20 21:32:35 +00:00
|
|
|
jsr compare ; and T00,S0A,$F3 ==
|
|
|
|
!byte $D0,$F2,$A0,$03,$BD,$8C,$C0,$10,$FB,$C9
|
|
|
|
bcs .exit
|
|
|
|
lda #$0B
|
|
|
|
ldx #$69
|
|
|
|
ldy #$06
|
|
|
|
jsr compare ; and T00,S0B,$69 ==
|
|
|
|
!byte $BD,$8C,$C0,$10,$FB,$C9
|
|
|
|
bcs .exit
|
|
|
|
ldx #$70
|
|
|
|
ldy #$09
|
|
|
|
jsr compare ; and T00,S0B,$70 ==
|
|
|
|
!byte $D0,$F4,$EA,$BD,$8C,$C0,$10,$FB,$C9
|
|
|
|
bcs .exit
|
|
|
|
ldx #$7A
|
|
|
|
jsr compare ; and T00,S0B,$7A ==
|
|
|
|
!byte $D0,$F2,$EA,$BD,$8C,$C0,$10,$FB,$C9
|
|
|
|
.exit
|
2019-05-07 01:24:29 +00:00
|
|
|
rts ; passport-test-suite/Number Munchers v1.0.woz [C=0] matches
|
2017-02-20 21:32:35 +00:00
|
|
|
|
2017-02-21 17:05:23 +00:00
|
|
|
foundmecc3
|
2017-02-20 21:32:35 +00:00
|
|
|
;
|
2017-02-21 17:05:23 +00:00
|
|
|
; We found a MECC bootloader. Now we create
|
2017-02-20 21:32:35 +00:00
|
|
|
; 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.
|
|
|
|
;
|
|
|
|
lda #$00
|
|
|
|
sta modsrc
|
|
|
|
lda #$0A
|
|
|
|
clc
|
|
|
|
adc #BASEPAGE
|
|
|
|
sta modsrc+1
|
|
|
|
ldy #$E8
|
|
|
|
lda (modsrc),y
|
|
|
|
lsr
|
2017-08-15 21:17:14 +00:00
|
|
|
sta UNIV_A1
|
2017-02-20 21:32:35 +00:00
|
|
|
ldy #$F2
|
|
|
|
lda (modsrc),y
|
2017-08-15 21:17:14 +00:00
|
|
|
sta UNIV_A2
|
2017-02-20 21:32:35 +00:00
|
|
|
ldy #$FD
|
|
|
|
lda (modsrc),y
|
2017-08-15 21:17:14 +00:00
|
|
|
sta UNIV_A3
|
2017-02-20 21:32:35 +00:00
|
|
|
inc modsrc+1
|
|
|
|
ldy #$6F
|
|
|
|
lda (modsrc),y
|
2017-08-15 21:17:14 +00:00
|
|
|
sta UNIV_D1
|
2017-02-20 21:32:35 +00:00
|
|
|
ldy #$79
|
|
|
|
lda (modsrc),y
|
2017-08-15 21:17:14 +00:00
|
|
|
sta UNIV_D2
|
2017-02-20 21:32:35 +00:00
|
|
|
ldy #$83
|
|
|
|
lda (modsrc),y
|
2017-08-15 21:17:14 +00:00
|
|
|
sta UNIV_D3
|
2017-02-20 21:32:35 +00:00
|
|
|
jmp ADStyle
|
|
|
|
}
|
2017-02-21 17:05:23 +00:00
|
|
|
|
|
|
|
;-------------------------------
|
|
|
|
; IDMECC4
|
|
|
|
; identify MECC bootloader variant #4
|
2017-02-21 17:12:45 +00:00
|
|
|
; (labeled "M8" on original disks)
|
2017-02-21 17:05:23 +00:00
|
|
|
; same as variant #2 but everything is
|
|
|
|
; on T00,S08 instead of T00,S07
|
|
|
|
;
|
|
|
|
; in: track buffer contains all of track 0
|
|
|
|
; out: C clear if MECC bootloader was found
|
|
|
|
; C set if not found
|
|
|
|
; all other flags clobbered
|
|
|
|
; all registers clobbered
|
|
|
|
;-------------------------------
|
|
|
|
!zone {
|
|
|
|
IDMECC4
|
|
|
|
lda #$08
|
|
|
|
jmp IDMECC4a
|
|
|
|
|
|
|
|
foundmecc4
|
|
|
|
;
|
|
|
|
; We found a MECC 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.
|
|
|
|
;
|
|
|
|
lda #$08
|
2019-05-07 01:24:29 +00:00
|
|
|
jmp foundmecc4a ; passport-test-suite/Conquering Whole Numbers v1.1.woz [Z=0] reaches here
|
2017-02-21 17:05:23 +00:00
|
|
|
}
|