v1.3 w/formatting options

This commit is contained in:
Antoine Vignau 2023-07-12 08:58:35 +02:00
parent b3a7a637a8
commit 6bf32beab0
4 changed files with 836 additions and 521 deletions

View File

@ -16,6 +16,8 @@
* v1.2 (202307) - AV
* Uses disk insertion status
*
* v1.3 (202307) - AV
* Formatting options
mx %00
rel
@ -23,7 +25,8 @@
dsk ASSDDriver
use AS.EQUATES.S
use 4/Sch.Macs
use 4/Util.Macs
*-----------------------------------
@ -33,6 +36,7 @@
maxIMAGES = 1 ; no more than N images
blockSIZE = 512 ; ProDOS 8 block size
maxBLOCKS = $ffffffff ; that is a huge number of blocks
maxBLOCKP = 65536 ; 65536 blocks for ProDOS 8
* 0 0000
* 3 0011 not speed dependent
@ -99,6 +103,21 @@ DStartup
lda #1 ; we're on
sta fgSTARTED
sep #$30
ldx #0
]lp lda proDEVNAME+3,x
sta MyDevName+1,x
inx
cpx #9
bcc ]lp
stx MyDevName
rep #$30
PushWord #0
PushLong #myTASK
_SchAddTask
pla
rts
*
@ -237,7 +256,7 @@ DStatus1 asl
tblSTATUS da SGetStatus ; GetDeviceStatus
da SGet ; GetConfigParameters
da SGet ; GetWaitStatus
da SGet ; GetFormatOptions
da SGetFormatOptions ; GetFormatOptions
da SNada ; GetPartitionMap
SNada rts
@ -280,6 +299,24 @@ SGet lda #0 ; GetConfigParameters
sta transferCount
rts
*----------- GetFormatOptions
SGetFormatOptions
lda requestCount ; check size of buffer
cmp #formatOptionsTableEnd-formatOptionsTable
bcc SGetFormat1
ldy #0 ; and move data
]lp lda formatOptionsTable,y
sta [statusListPtr],y
iny
iny
cpy #formatOptionsTableEnd-formatOptionsTable
bcc ]lp
sty transferCount ; save size
SGetFormat1 rts
*
* Driver_Control
*
@ -304,11 +341,11 @@ DControl2 asl
rts
tblCONTROL da CNada ; 0 ResetDevice
da CNada ; 1 FormatDevice
da CFormatDevice ; 1 FormatDevice
da CNada ; 2 EjectMedium
da CSet ; 3 SetConfigParameters
da CSet ; 4 SetWaitStatus
da CSet ; 5 SetFormatOptions
da CSetFormatOptions ; 5 SetFormatOptions
da CNada ; 6 AssignPartitionOwner
da CNada ; 7 ArmSignal
da CNada ; 8 DisarmSignal
@ -316,6 +353,38 @@ tblCONTROL da CNada ; 0 ResetDevice
CNada rts
*----------- FormatDevice
CFormatDevice
lda fgFORMAT ; if 1, the Format call
bne CFormat1 ; was already called
rts
CFormat1 rts
*----------- SetFormatOptions
CSetFormatOptions
lda [controlListPtr]
beq CSFO9 ; empty option is not ours
cmp #3 ; 1-2 only
bcs CSFO9
cmp #1
bne CSFOHFS
ldx #^maxBLOCKS ; it is 1, default values for HFS
ldy #maxBLOCKS
bra CSFOAll
CSFOHFS ldx #^maxBLOCKP ; it is 2, default values for ProDOS
ldy #maxBLOCKP
CSFOAll sty fBlockCount
stx fBlockCount+2
CSFO9 rts
*----------- SetConfigParameters / SetWaitStatus
CSet lda [controlListPtr] ; SetConfigParameters
@ -400,9 +469,83 @@ checkSWITCHED
cs1 clc
rts
*---------------------------- Check RAMDISK was init'ed
myTASK PushLong #proVOLUME
PushWord #$2008
jsl GSOS2
bcc myTASK1
PushLong #proFORMAT
PushWord #$2024
jsl GSOS2
lda #1 ; tell the driver we've been there
stal fgFORMAT ; a format will now be a real format
lda #$4000 ; no more silent formatting
stal proFORMAT+14
myTASK1 rtl
*---------------------------- GS/OS
proVOLUME dw 2
adrl proDEVNAME
adrl outVOLNAME
proFORMAT dw 5 ; +00
adrl proDEVNAME ; +02
adrl proVOLNAME ; +06
dw 6 ; +10
dw 6 ; +12 - Default is ProDOS
dw $2000 ; +14 - Cant rename, can change selection, silent formatting
proDEVNAME strl '.ASSDDevice'
proVOLNAME strl ':AppleSSD'
outVOLNAME dw 36 ; (word) output buffer
ds 34 ; (word) strl + (array) string
*----------------------------
formatOptionsTable
* 8 bytes
dw 2 ; numOptions
dw 2 ; numDisplayed
dw 1 ; recommendedOption
dw 1 ; currentOption
* 16 bytes
dw 1 ; formatOptionNum
dw 0 ; linkRefNum
dw %0000_1101 ; flags 1101 - GB size - Apple format
adrl maxBLOCKS ; blockCount is the max for HFS
dw blockSIZE ; blockSize is 512 bytes
dw 0 ; interleaveFactor
dw 32 ; mediaSize 11 - GB size
* 16 bytes
dw 2 ; formatOptionNum
dw 0 ; linkRefNum
dw %0000_1001 ; flags 1001 - MB size - Apple format
adrl maxBLOCKP ; blockCount is 65536 for ProDOS 8
dw blockSIZE ; blockSize is 512 bytes for ProDOS 8
dw 0 ; interleaveFactor
dw 32 ; mediaSize 10 - MB size
formatOptionsTableEnd
*--- Default formatting options
fBlockCount adrl maxBLOCKS ; 65536
*----------------------------
fgSTARTED ds 2 ; 0: not started, 1: started
fgFORMAT ds 2 ; 0: GS/OS Format never called, 1 instead
errCODE ds 2
thePAGE ds 4 ; page to read/write: $hh/ll00
nbPAGES ds 2 ; number of blockSIZEP pages to copy
@ -410,9 +553,10 @@ nbPAGES ds 2 ; number of blockSIZEP pages to copy
MyDIB ds 4 ; +00 pointer to the next DIB
adrl entryPOINT ; +04 driver entry point
dw dftCHAR ; +08 characteristics
ds 4 ; +0A block count
str 'ASSDDevice' ; +0E device name
ds 21 ; 32 - 11 = 21
adrl maxBLOCKS ; +0A block count
MyDevName ds 32 ; +0E device name
* str 'ASSDDevice' ; +0E device name
* ds 21 ; 32 - 11 = 21
dw dftSLOT ; +2E slot number
dw dftUNIT ; +30 unit number
dw dftVERSION ; +32 version

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.