diff --git a/src/id/d5d5f7.a b/src/id/d5d5f7.a new file mode 100644 index 0000000..648e6ea --- /dev/null +++ b/src/id/d5d5f7.a @@ -0,0 +1,34 @@ +;------------------------------- +; IDD5D5F7 +; Identify specific version of DOS 3.3 bootloader +; shared by all disks that use the D5D5F7 check. +; Note: this detection pattern makes no logical +; sense; it just happens to be a useful filter for +; the D5D5F7 patcher to use later. It filters out +; about 2/3 of disks on which I've never seen a +; D5D5F7 protection check, so we can save time by +; not doing full-track searches on those disks. +; +; in: $0800..$08FF contains T00,S00 +; IDDOS33 returned success +; out: C clear if specific version of DOS 3.3 bootloader found +; C set otherwise +; X,Y preserved +; all other flags and registers clobbered +;------------------------------- +!zone { +IDD5D5F7 + lda $084C + cmp #$08 + bne .no + lda $08B0 + cmp #$B6 + bne .no + lda $08D0 + cmp #$20 + bne .no + clc + !byte $24 +.no sec + rts +} diff --git a/src/id/inspect0.a b/src/id/inspect0.a index 368e81d..de0ce4b 100755 --- a/src/id/inspect0.a +++ b/src/id/inspect0.a @@ -22,6 +22,7 @@ IDBootloader sta gIsEA sta gIsEEEF sta gIsMECCFastloader + sta gPossibleD5D5F7 lda #$00 sta gLastTrack ; @@ -50,10 +51,14 @@ IDBootloader ; Exit via custom trace function if found. ; jsr IDDOS33 - bcs + + bcs .notdos33 lda #TRUE sta gIsBoot0 - jsr IDDiversi + jsr IDD5D5F7 + bcs + + lda #TRUE + sta gPossibleD5D5F7 ++ jsr IDDiversi bcc .diversi jsr IDPronto bcc .pronto @@ -71,7 +76,8 @@ IDBootloader ; early to munge the nibble tables used by the drive firmware. ; Exit via custom trace function if found. ; -+ jsr ID8b3 +.notdos33 + jsr ID8b3 bcs + lda #s_jsr8b3 jsr PrintByID diff --git a/src/passport.a b/src/passport.a index 345f527..bcad9e9 100755 --- a/src/passport.a +++ b/src/passport.a @@ -157,6 +157,7 @@ FirstMover !source "id/quickdos.a" !source "id/diversidos.a" !source "id/prontodos.a" + !source "id/d5d5f7.a" !source "print.a" !source "compare.a" !source "modify.a" @@ -806,6 +807,10 @@ gIsMECCFastloader !byte FALSE ; 0=true, 1=false ; reset before each operation ; set in IDBootloader() after reading T00,S00 +gPossibleD5D5F7 + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in IDBootloader() after reading T00,S00 gOnAClearDayYouCanReadForever !byte FALSE ; 0=true, 1=false ; retry reads with a captured RWTS forever, diff --git a/src/patchers/d5d5f7.a b/src/patchers/d5d5f7.a index 949a98c..f5ef80c 100755 --- a/src/patchers/d5d5f7.a +++ b/src/patchers/d5d5f7.a @@ -2,11 +2,37 @@ ; #D5D5F7 ; nibble count with weird bitstream ; involving $D5 and $F7 as delimiters -; e.g. NoteCard Maker, many Mindplay titles -; (Ace Detective, Robomath, Fraction-oids) +; +; Ace Detective +; Cat 'N Mouse +; Cotton Tales +; Dyno-Quest +; Easy Street +; Fraction-oids +; Math Magic +; RoboMath +; Sum Ducks +; NoteCard Maker ;------------------------------- !zone { - ldy #$20 +; +; always run on Pascal disks +; + lda gIsPascal + beq + +; +; if DOS 3.3-shaped bootloader, only run if we found +; specific markers on T00,S00 earlier that are shared +; by all the samples I have that use this protection. +; (This filter is subject to revision if we find +; additional samples.) +; + lda gIsBoot0 + bne .exit + lda gPossibleD5D5F7 + bne .exit + ++ ldy #$20 jsr SearchTrack !byte $BD,$8C,$C0; LDA $C08C,X !byte $10,$FB ; BPL -$FB