From 8f9f81078b4e5cef5920d75827a2a12dd9bff97e Mon Sep 17 00:00:00 2001 From: Antoine Vignau <34219772+antoinevignau@users.noreply.github.com> Date: Wed, 20 Nov 2024 19:03:55 +0100 Subject: [PATCH] v1.6 Suffix check for big disk images loading --- mountit/MI.EQUATES.S | 2 + mountit/MI.MAIN.S | 107 +++++++++++++++++++++++++++++++------------ mountit/MOUNTIT.PO | Bin 819200 -> 819200 bytes 3 files changed, 79 insertions(+), 30 deletions(-) diff --git a/mountit/MI.EQUATES.S b/mountit/MI.EQUATES.S index fcd1a40..94a65f9 100644 --- a/mountit/MI.EQUATES.S +++ b/mountit/MI.EQUATES.S @@ -33,7 +33,9 @@ sizePATH = 128 ; set GS/OS path length to N bytes dftCHAR = $83EC ; default characteristics dftVERSION = $1200 ; v1.2.0 + dftDEV525 = $0014 ; device ID for 5.25 disks +dftDEVHDD = $0013 ; device ID for Hard disk drive (generic) dftDEV35 = $0003 ; device ID for 3.5 disks drvrDiskSwitch = $002E diff --git a/mountit/MI.MAIN.S b/mountit/MI.MAIN.S index b86ad04..f0edcd3 100644 --- a/mountit/MI.MAIN.S +++ b/mountit/MI.MAIN.S @@ -1,8 +1,8 @@ *-------------------------------------- * -* Mount Disk Images 1.5 +* Mount Disk Images 1.6 * -* (c) Brutal Deluxe, 2011-2022 +* (c) Brutal Deluxe, 2011-2024 * lst off @@ -13,6 +13,8 @@ mx %00 *-------------------------------------- +* v1.6 - AV 202411 +* Really support .PO/.2mg of any size (in RAM) use MI.Equates @@ -395,38 +397,83 @@ handleERR1 rts * X=1: PO * X=2: 2MG -checkFORMAT lda proEOF ; check we have a valid disk... - ora proEOF+2 - bne cf0 - sec - rts +checkFORMAT lda proEOF ; check we have a valid disk... + ora proEOF+2 + bne cf0 + sec + rts -cf0 ldx #0 - ldy #dftDEV525 - cmp #$3002 ; 140KB - $0002 v $3000 : PO/DSK - beq cf1 - inx - ldy #dftDEV35 - cmp #$800c ; 800KB - $000c v $8000 : PO - beq cf1 - inx - cmp #$804c ; 800KB - $000c v $8040 : 2MG - beq cf1 - ldy #dftDEV525 - cmp #$3042 ; 140KB - $0002 v $3040 : 2MG - beq cf1 +cf0 ldx #cDSK + ldy #dftDEV525 + cmp #$3002 ; 140KB - $0002 v $3000 : PO/DSK 0/5.25" + beq cf1 - ldy #dftDEV35 - and #$0040 ; it is a 2MG image - bne cf1 ; of whatever size - dex ; or force a PO/DSK format - ; it expands the possibilities + ldx #cPO + ldy #dftDEV35 + cmp #$800c ; 800KB - $000c v $8000 : PO 1/3.5" + beq cf1 -cf1 stx theFORMAT ; 0-1: PO/DSK image, 2: 2MG image - sty theDEVID ; 0 for 5.25, 3 for 3.5 disks + ldx #c2MG + cmp #$804c ; 800KB - $000c v $8040 : 2MG 2/3.5" + beq cf1 -cf2 clc - rts + ldy #dftDEV525 + cmp #$3042 ; 140KB - $0002 v $3040 : 2MG 2/5.25" + beq cf1 + +* ldy #dftDEV35 +* and #$0040 ; it is a 2MG image +* bne cf1 ; of 800k size + + jsr checkSUFFIX ; v1.6 - check suffix of path + bcs cf2 ; not a .2MG nor .PO + +cf1 stx theFORMAT ; 0-1: PO/DSK image, 2: 2MG image + sty theDEVID ; $14 for 5.25, $03 for 3.5 disks, $13 for HDD + clc +cf2 rts + +*-------------------------------------- +* +* check suffix of path to disk image +* + +checkSUFFIX lda [Arrivee] + tay + lda [Arrivee],y + and #$5f5f + cmp #'MG' + bne cs_po + dey + dey + lda [Arrivee],y + cmp #'.2' + bne cs_po + + ldx #c2MG ; set 2mg of any size + ldy #dftDEVHDD + clc + rts + +cs_po lda [Arrivee] + tay + lda [Arrivee],y + and #$5f5f + cmp #'PO' + bne cs_ko + dey + lda [Arrivee],y + and #$5fff + cmp #'.P' + bne cs_ko + + ldx #cPO ; set PO of any size + ldy #dftDEVHDD + clc + rts + +cs_ko sec + rts *-------------------------------------- * diff --git a/mountit/MOUNTIT.PO b/mountit/MOUNTIT.PO index 576747f681a1978a917a2c82ac621181280f01a3..6e5c92d7f56f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