Commit 069303ab authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Update to use some of the exported FileCore headers.

There are still a large number of local copies that should be visited, but this change at least allows it to assemble again FileCore-3_45.
Tungsten and IOMD variants assemble, but others untested.

Version 3.41. Tagged as 'ADFS-3_41'
parent 6589f4d7
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "3.40"
Module_Version SETA 340
Module_MajorVersion SETS "3.41"
Module_Version SETA 341
Module_MinorVersion SETS ""
Module_Date SETS "07 Aug 2011"
Module_ApplicationDate SETS "07-Aug-11"
Module_Date SETS "14 Oct 2011"
Module_ApplicationDate SETS "14-Oct-11"
Module_ComponentName SETS "ADFS"
Module_ComponentPath SETS "castle/RiscOS/Sources/FileSys/ADFS/ADFS"
Module_FullVersion SETS "3.40"
Module_HelpVersion SETS "3.40 (07 Aug 2011)"
Module_FullVersion SETS "3.41"
Module_HelpVersion SETS "3.41 (14 Oct 2011)"
END
/* (3.40)
/* (3.41)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 3.40
#define Module_MajorVersion_CMHG 3.41
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 07 Aug 2011
#define Module_Date_CMHG 14 Oct 2011
#define Module_MajorVersion "3.40"
#define Module_Version 340
#define Module_MajorVersion "3.41"
#define Module_Version 341
#define Module_MinorVersion ""
#define Module_Date "07 Aug 2011"
#define Module_Date "14 Oct 2011"
#define Module_ApplicationDate "07-Aug-11"
#define Module_ApplicationDate "14-Oct-11"
#define Module_ComponentName "ADFS"
#define Module_ComponentPath "castle/RiscOS/Sources/FileSys/ADFS/ADFS"
#define Module_FullVersion "3.40"
#define Module_HelpVersion "3.40 (07 Aug 2011)"
#define Module_LibraryVersionInfo "3:40"
#define Module_FullVersion "3.41"
#define Module_HelpVersion "3.41 (14 Oct 2011)"
#define Module_LibraryVersionInfo "3:41"
......@@ -158,10 +158,10 @@ ATAPIOp_EntryR1 * 4
AND LR,R7,#WinIDEDirectionMask ; direction bits
TEQS LR,#WinIDEDirectionWrite ; write?
LDREQ R6,[R9,#WinIDEWritePtr] ; if write, R6 -> write code
MOVEQ R1,#WriteSecsOp ; R1 = write sectors
MOVEQ R1,#DiscOp_WriteSecs ; R1 = write sectors
TEQS LR,#WinIDEDirectionRead ; else read?
LDREQ R6,[R9,#WinIDEReadPtr] ; if read, R6 -> read code
MOVEQ R1,#ReadSecsOp ; R1 = read sectors
MOVEQ R1,#DiscOp_ReadSecs ; R1 = read sectors
; If data transfer requested, validate buffer address, install transfer
; code and set R1 -> buffer
......
......@@ -252,8 +252,8 @@ DrvFlags # 4
ResetChangedByStep bit 3
ResetChangedByWrite bit 4
QuadDrv bit 5 ;set if quad
ASSERT Drv_EmptyWorks = bit6
ASSERT Drv_ChangedWorks = bit7
ASSERT MiscOp_PollChanged_EmptyWorks_Flag = bit6
ASSERT MiscOp_PollChanged_ChangedWorks_Flag = bit7
HeadPosition # 4
PositionUnknown * bit31
DrvSequenceNum # 4
......
......@@ -1139,7 +1139,7 @@ WinMount ROUT
; error may also need to include it and that is best done in the
; driver.
MOV R1,#ReadSecsOp :OR: NoEscape ; read sectors
MOV R1,#DiscOp_ReadSecs :OR: DiscOp_Op_IgnoreEscape_Flag ; read sectors
MOV R6,#NIL ; no defect list yet
MOVCS LR,#&FF ; if ST506, say no disc specified
......
......@@ -691,10 +691,10 @@ DoSwiIDEUserOp ROUT
AND LR,R7,#WinIDEDirectionMask ; direction bits
TEQS LR,#WinIDEDirectionWrite ; write?
LDREQ R6,[R9,#WinIDEWritePtr] ; if write, R6 -> write code
MOVEQ R1,#WriteSecsOp ; R1 = write sectors
MOVEQ R1,#DiscOp_WriteSecs ; R1 = write sectors
TEQS LR,#WinIDEDirectionRead ; else read?
LDREQ R6,[R9,#WinIDEReadPtr] ; if read, R6 -> read code
MOVEQ R1,#ReadSecsOp ; R1 = read sectors
MOVEQ R1,#DiscOp_ReadSecs ; R1 = read sectors
; If data transfer requested, validate buffer address, install transfer
; code and set R1 -> buffer
......@@ -1385,7 +1385,7 @@ WinIDEJmpTableSize * (.-%BT10)/4
; Opcode not in table
; Check for specify
TEQS R0,#SpecifyOp ; specify
TEQS R0,#DiscOp_Specify ; specify
MOVNE R0,#BadParmsErr ; if not, error
BLEQ WinIDEOpSpecify ; if so, do it
......
......@@ -2782,11 +2782,11 @@ WinIDEInstallTransferCode ROUT
; check that this op really does need data transfer code
AND R0,R1,#OpMask ; get opcode
TEQS R0,#WriteTrkOp ; format?
MOVEQ R0,#WriteSecsOp ; if so, treat as write
TEQS R0,#DiscOp_WriteTrk ; format?
MOVEQ R0,#DiscOp_WriteSecs ; if so, treat as write
TEQS R0,#ReadSecsOp ; is it read ?
TEQNES R0,#WriteSecsOp ; if not, is it write ?
TEQS R0,#DiscOp_ReadSecs ; is it read ?
TEQNES R0,#DiscOp_WriteSecs ; if not, is it write ?
MOVNE PC,LR ; if not needed, return
; this op *does* need transfer code
......@@ -2811,7 +2811,7 @@ WinIDEInstallTransferCode ROUT
; Copy new code into RAM.
ADDR R10,LowCodeLocation ; R10 -> where code will go
TEQS R0,#ReadSecsOp
TEQS R0,#DiscOp_ReadSecs
baddr R9,ALowReadCodeStart,EQ ; R9 -> code to copy
baddr R9,ALowWriteCodeStart,NE
ADDEQ LR,R10,#ALowReadCodeSize ; R10 = start + len
......
......@@ -377,7 +377,7 @@ RetryFloppyOp ROUT
STRB R0, MotorTimer
LDRB LR, [R6, #DrvFlags] ;IF disc changed doesn't work
TSTS LR, #Drv_ChangedWorks
TSTS LR, #MiscOp_PollChanged_ChangedWorks_Flag
BNE %FT10
LDRB LR, DiscLatchCopy ;AND motor is off
TSTS LR, #MotorBit
......@@ -1432,7 +1432,7 @@ SelectFloppy ROUT
DrvRecPtr R0, R1
LDRB LR, [R0,#DrvFlags] ;if disc changed doesn't work inc seq num
TSTS LR, #Drv_ChangedWorks
TSTS LR, #MiscOp_PollChanged_ChangedWorks_Flag
LDREQ LR, [R0,#DrvSequenceNum]
ADDEQ LR, LR, #1
STREQ LR, [R0,#DrvSequenceNum]
......@@ -1682,16 +1682,16 @@ OldDoPollChanged ROUT
DREG r6, "ADFS internal sequence number "
]
TSTS R5, #Drv_ChangedWorks ; Does disk change work?
MOVNE R3, #Drv_Changed ; Yes then assume changed
MOVEQ R3, #Drv_MaybeChanged ; Else maybe changed
TSTS R5, #MiscOp_PollChanged_ChangedWorks_Flag ; Does disk change work?
MOVNE R3, #MiscOp_PollChanged_Changed_Flag ; Yes then assume changed
MOVEQ R3, #MiscOp_PollChanged_MaybeChanged_Flag ; Else maybe changed
TEQS R2, R6 ; Out of sequence?
MOVEQ R3, #Drv_NotChanged ; No then not changed
MOVEQ R3, #MiscOp_PollChanged_NotChanged_Flag ; No then not changed
MOV R2, R6 ; Return our sequence number
B %FT20
10
ORR R5, R5, #Drv_ChangedWorks :OR: Drv_EmptyWorks
ORR R5, R5, #MiscOp_PollChanged_ChangedWorks_Flag :OR: MiscOp_PollChanged_EmptyWorks_Flag
ADD R2, R6, #1
STR R2, [R4,#DrvSequenceNum]
......@@ -1763,11 +1763,11 @@ OldDoPollChanged ROUT
ORREQ R5, R5, #ResetChangedByStep
18
MOVEQ R3, #Drv_Changed
MOVNE R3, #Drv_Empty
MOVEQ R3, #MiscOp_PollChanged_Changed_Flag
MOVNE R3, #MiscOp_PollChanged_Empty_Flag
STRB R5, [R4,#DrvFlags]
20
AND LR, R5, #Drv_ChangedWorks :OR: Drv_EmptyWorks
AND LR, R5, #MiscOp_PollChanged_ChangedWorks_Flag :OR: MiscOp_PollChanged_EmptyWorks_Flag
ORR R3, R3, LR
CMPS R8, #1
......
......@@ -1349,8 +1349,8 @@ FlpEmpty
LDRB R1, FlpDrvNum ; Get current drive
DrvRecPtr R0, R1
LDR R1, [R0, #DrvFlags] ; Get drive flags
BIC R1, R1, #Drv_Ready+Drv_MaybeChanged+Drv_Changed+Drv_NotChanged
ORR R1, R1, #Drv_Empty ; Set Empty bit
BIC R1, R1, #MiscOp_PollChanged_Ready_Flag+MiscOp_PollChanged_MaybeChanged_Flag+MiscOp_PollChanged_Changed_Flag+MiscOp_PollChanged_NotChanged_Flag
ORR R1, R1, #MiscOp_PollChanged_Empty_Flag ; Set Empty bit
STR R1, [R0, #DrvFlags] ; Update flags
MOV R1, #DriveEmptyErr
......@@ -1393,14 +1393,14 @@ FlpEmpty
LDRB R0, FlpDrvNum ; Get current drive
DrvRecPtr R1, R0
LDR R2, [R1, #DrvFlags] ; Get drive flags
ORR R2, R2, #Drv_Ready ; Set ready bit
ORR R2, R2, #MiscOp_PollChanged_Ready_Flag ; Set ready bit
TSTS R2, #Drv_ChangedWorks ; Changed works?
TSTNES R2, #Drv_NotChanged ; And not changed?
TSTS R2, #MiscOp_PollChanged_ChangedWorks_Flag ; Changed works?
TSTNES R2, #MiscOp_PollChanged_NotChanged_Flag ; And not changed?
BLNE FlpGetDskChng ; Yes read disk changed status (->R0)
TSTNES R0, #FlpDIRchanged ; And disk changed?
BICNE R2, R2, #Drv_NotChanged ; Yes, reset not changed
ORRNE R2, R2, #Drv_Changed ; And show changed
BICNE R2, R2, #MiscOp_PollChanged_NotChanged_Flag ; Yes, reset not changed
ORRNE R2, R2, #MiscOp_PollChanged_Changed_Flag ; And show changed
MOVNE LR, #PositionUnknown ; And set position unknown
STRNE LR, [R1, #HeadPosition] ; And force restore
......@@ -1471,14 +1471,14 @@ FlpDriveReady ROUT
LDRB R0, FlpDrvNum ; Get current drive
DrvRecPtr R1, R0
LDR R0, [R1, #DrvFlags] ; Get drive flags
TSTS R0, #Drv_ChangedWorks ; Changed works?
TSTNES R0, #Drv_NotChanged ; And not changed?
TSTS R0, #MiscOp_PollChanged_ChangedWorks_Flag ; Changed works?
TSTNES R0, #MiscOp_PollChanged_NotChanged_Flag ; And not changed?
BLNE FlpGetDskChng ; Yes read disk changed status (->R0)
TSTNES R0, #FlpDIRchanged ; And disk changed?
BEQ %FT05 ; No then jump
BIC R0, R0, #Drv_NotChanged
ORR R0, R0, #Drv_Empty ; Show drive empty, but ready!?
BIC R0, R0, #MiscOp_PollChanged_NotChanged_Flag
ORR R0, R0, #MiscOp_PollChanged_Empty_Flag ; Show drive empty, but ready!?
STR R0, [R1, #DrvFlags] ; Update flags
MOV R1, #DriveEmptyErr
......@@ -1558,15 +1558,15 @@ FlpDriveChange ROUT
LDRB LR, FlpDrvNum ; Get last drive selected
DrvRecPtr R2, LR ; Get last drive record
LDR R0, [R2, #DrvFlags] ; Get drive flags
TSTS R0, #Drv_Empty ; Currently empty?
TSTS R0, #MiscOp_PollChanged_Empty_Flag ; Currently empty?
BEQ %FT05 ; No then jump
BIC R0, R0, #Drv_Empty ; Reset empty
TSTS R0, #Drv_ChangedWorks ; Changed works?
ORRNE R0, R0, #Drv_Changed ; Yes then disk changed
ORREQ R0, R0, #Drv_MaybeChanged ; Else maybe changed
BIC R0, R0, #MiscOp_PollChanged_Empty_Flag ; Reset empty
TSTS R0, #MiscOp_PollChanged_ChangedWorks_Flag ; Changed works?
ORRNE R0, R0, #MiscOp_PollChanged_Changed_Flag ; Yes then disk changed
ORREQ R0, R0, #MiscOp_PollChanged_MaybeChanged_Flag ; Else maybe changed
05 BIC LR, R0, #Drv_Ready ; Reset drive ready
05 BIC LR, R0, #MiscOp_PollChanged_Ready_Flag ; Reset drive ready
STR LR, [R2, #DrvFlags] ; Update current drive flags
CMPS R1, #3 ; Drive deselect?
......@@ -1576,18 +1576,18 @@ FlpDriveChange ROUT
BHI %FT20 ; And jump
DrvRecPtr R2, R1 ; Get new drive record
TSTS R0, #Drv_Ready ; Current drive ready?
TSTS R0, #MiscOp_PollChanged_Ready_Flag ; Current drive ready?
LDR R0, [R2, #DrvFlags]
ORRNE R0, R0, #Drv_Ready ; Yes, new drive is ready
ORRNE R0, R0, #MiscOp_PollChanged_Ready_Flag ; Yes, new drive is ready
MOV LR, #FlpEmptyTimer ; IP timeout
STRNEB LR, FlpMotorTimer ; And reset empty timeout
BNE %FT10 ; And jump, no state change
; Current drive is not ready so startup drive motor
TSTS R0, #Drv_ChangedWorks ; Changed works?
BICEQ R0, R0, #Drv_NotChanged ; No then reset not changed
ORREQ R0, R0, #Drv_MaybeChanged ; And set maybe changed
TSTS R0, #MiscOp_PollChanged_ChangedWorks_Flag ; Changed works?
BICEQ R0, R0, #MiscOp_PollChanged_NotChanged_Flag ; No then reset not changed
ORREQ R0, R0, #MiscOp_PollChanged_MaybeChanged_Flag ; And set maybe changed
STREQ R0, [R2, #DrvFlags] ; And save drive flags
CMPS R1, #1 ; Drives 0/1?
......@@ -1602,7 +1602,7 @@ FlpDriveChange ROUT
; Check if restore required on new drive
10 TSTS R0, #Drv_Changed+Drv_MaybeChanged ; Disk changed?
10 TSTS R0, #MiscOp_PollChanged_Changed_Flag+MiscOp_PollChanged_MaybeChanged_Flag ; Disk changed?
[ F ; Include to force restore on drive change
LDREQ LR, FlpDrvNum ; Get last drive
......
......@@ -1101,12 +1101,12 @@ FlpHandlerData ROUT
MOV LR, #FlpPhaseDrv ; Next phase is awaiting drive ready
STRB LR, [R2, #FlpDCBphase] ; Update phase
TSTS R0, #Drv_Empty+Drv_Ready ; Drive empty or ready?
TSTS R0, #MiscOp_PollChanged_Empty_Flag+MiscOp_PollChanged_Ready_Flag ; Drive empty or ready?
BNE %FT15
RestPSR R4,,c ; No then restore regs and wait
Pull "R0,R1,R4,PC"
15 TSTS R0, #Drv_Empty ; Drive empty?
15 TSTS R0, #MiscOp_PollChanged_Empty_Flag ; Drive empty?
BEQ %FT18
MOV R0, #0 ; Yes then no data transferred
......@@ -1802,7 +1802,7 @@ FlpHandlerData_SeekFault
; Step in 2 tracks and retry operation
LDR R0, [R1, #DrvFlags]
TSTS R0, #Drv_40Track ; 40 track?
TSTS R0, #MiscOp_PollChanged_40Track_Flag ; 40 track?
MOVNE R0, #TrksPerSide/2 ; Yes, max track = tracks per side /2
MOVEQ R0, #TrksPerSide ; Else max track
ADD LR, LR, #2 ; Try track+2
......@@ -2732,10 +2732,10 @@ FlpHandlerReadID ROUT
MOV LR, #FlpPhaseDrv ; Next phase is awaiting drive ready
STRB LR, [R2, #FlpDCBphase] ; Update phase
TSTS R0, #Drv_Empty+Drv_Ready ; Drive empty or ready?
TSTS R0, #MiscOp_PollChanged_Empty_Flag+MiscOp_PollChanged_Ready_Flag ; Drive empty or ready?
Pull "R0,R1,PC",EQ ; No then restore regs and wait
TSTS R0, #Drv_Empty ; Drive empty?
TSTS R0, #MiscOp_PollChanged_Empty_Flag ; Drive empty?
MOVNE R0, #DriveEmptyErr ; Yes, drive empty error
BLNE FlpDqDCB ; then terminate DCB (R0,R2->)
Pull "R0,R1,LR"
......@@ -3037,10 +3037,10 @@ FlpHandlerSeek ROUT
Pull "R0,R1,LR",EQ
BEQ %FT20 ; Yes then jump
TSTS R0, #Drv_Empty+Drv_Ready ; Drive empty or ready?
TSTS R0, #MiscOp_PollChanged_Empty_Flag+MiscOp_PollChanged_Ready_Flag ; Drive empty or ready?
Pull "R0,R1,PC",EQ ; No then restore regs and wait
TSTS R0, #Drv_Empty ; Drive empty?
TSTS R0, #MiscOp_PollChanged_Empty_Flag ; Drive empty?
MOVNE R0, #DriveEmptyErr ; Yes, drive empty error
BLNE FlpDqDCB ; then terminate DCB (R0,R2->)
Pull "R0,R1,LR"
......@@ -3235,9 +3235,9 @@ FlpHandlerDrv ROUT
BLEQ FlpGetDrvStatus ; No, then get status
Pull "R0,R1,PC",EQ ; And restore regs and exit
TSTS R0, #Drv_Ready ; Drive ready?
TSTS R0, #MiscOp_PollChanged_Ready_Flag ; Drive ready?
BNE %FT15 ; Yes then jump
TSTS R0, #Drv_Empty ; Drive empty?
TSTS R0, #MiscOp_PollChanged_Empty_Flag ; Drive empty?
BLNE FlpGetDrvStatus ; Yes then get status
Pull "R0,R1,PC",NE ; and exit
......@@ -3261,7 +3261,7 @@ FlpHandlerDrv ROUT
MOV LR, #FlpPhaseDrv ; Phase is awaiting drive ready
STRB LR, [R2, #FlpDCBphase] ; Update command phase
TSTS R0, #Drv_Ready ; Drive ready?
TSTS R0, #MiscOp_PollChanged_Ready_Flag ; Drive ready?
Pull "R0,R1,LR"
MOVEQ PC, LR ; No then wait exit
......@@ -3329,8 +3329,8 @@ FlpHandlerDrv ROUT
[ Debug10
DLINE "DskChng Reset"
]
BIC R0, R0, #Drv_MaybeChanged+Drv_NotChanged+Drv_Empty+Drv_Ready
ORR R0, R0, #Drv_ChangedWorks+Drv_Changed ; Show changed works
BIC R0, R0, #MiscOp_PollChanged_MaybeChanged_Flag+MiscOp_PollChanged_NotChanged_Flag+MiscOp_PollChanged_Empty_Flag+MiscOp_PollChanged_Ready_Flag
ORR R0, R0, #MiscOp_PollChanged_ChangedWorks_Flag+MiscOp_PollChanged_Changed_Flag ; Show changed works
STR R0, [R1, #DrvFlags] ; Update drive flags
BL FlpGetDrvStatus ; Get drive status
......@@ -3343,20 +3343,20 @@ FlpHandlerDrv ROUT
[ T
; Report empty whenever disk changed won't clear
BIC R0, R0, #Drv_NotChanged+Drv_Changed+Drv_MaybeChanged ; Reset not changed
ORR R0, R0, #Drv_Empty ; Set drive empty
BIC R0, R0, #MiscOp_PollChanged_NotChanged_Flag+MiscOp_PollChanged_Changed_Flag+MiscOp_PollChanged_MaybeChanged_Flag ; Reset not changed
ORR R0, R0, #MiscOp_PollChanged_Empty_Flag ; Set drive empty
STR R0, [R1, #DrvFlags] ; And update drive flags
|
; Report empty only when disk changed works but won't clear
TSTS R0, #Drv_ChangedWorks ; Does change work?
BICNE R0, R0, #Drv_NotChanged+Drv_Changed ; Yes reset not changed
ORRNE R0, R0, #Drv_Empty ; And set drive empty
TSTS R0, #MiscOp_PollChanged_ChangedWorks_Flag ; Does change work?
BICNE R0, R0, #MiscOp_PollChanged_NotChanged_Flag+MiscOp_PollChanged_Changed_Flag ; Yes reset not changed
ORRNE R0, R0, #MiscOp_PollChanged_Empty_Flag ; And set drive empty
STRNE R0, [R1, #DrvFlags] ; And update drive flags
]
[ Debug10
TSTS R0, #Drv_Empty
TSTS R0, #MiscOp_PollChanged_Empty_Flag
BEQ %FT40
DLINE "DskChng not reset, drive empty"
40
......@@ -3411,17 +3411,17 @@ FlpGetDrvStatus ROUT ; Get drives status
DrvRecPtr R1, LR ; R1-> drive record
LDR LR, [R1, #DrvFlags] ; Get drive flags
TSTS R0, #FlpHiDensity ; Hi density?
ORRNE LR, LR, #Drv_HiDensity ; Yes set hi density bit
BICEQ LR, LR, #Drv_HiDensity ; Else reset hi density bit
ORREQ LR, LR, #Drv_DensityWorks ; And show density works
ORRNE LR, LR, #MiscOp_PollChanged_HiDensity_Flag ; Yes set hi density bit
BICEQ LR, LR, #MiscOp_PollChanged_HiDensity_Flag ; Else reset hi density bit
ORREQ LR, LR, #MiscOp_PollChanged_DensityWorks_Flag ; And show density works
LDR R0, [R2, #FlpDCBresults+4] ; Get drive state on entry
STR LR, [R2, #FlpDCBresults+4] ; Return them
; Get disk changed state
TSTS LR, #Drv_MaybeChanged+Drv_Changed ; Maybe/is changed?
BICNE LR, LR, #Drv_MaybeChanged+Drv_Changed ; Yes then reset is/maybe
ORRNE LR, LR, #Drv_NotChanged ; and set not changed
TSTS LR, #MiscOp_PollChanged_MaybeChanged_Flag+MiscOp_PollChanged_Changed_Flag ; Maybe/is changed?
BICNE LR, LR, #MiscOp_PollChanged_MaybeChanged_Flag+MiscOp_PollChanged_Changed_Flag ; Yes then reset is/maybe
ORRNE LR, LR, #MiscOp_PollChanged_NotChanged_Flag ; and set not changed
STR LR, [R1, #DrvFlags] ; Update drive flags
; Restore drive state
......@@ -3429,12 +3429,12 @@ FlpGetDrvStatus ROUT ; Get drives status
[ Debug10
DREG R0,"Drive state was:"
]
AND R0, R0, #Drv_Ready+Drv_Empty
TEQS R0, #Drv_Ready ; Was drive ready?
AND R0, R0, #MiscOp_PollChanged_Ready_Flag+MiscOp_PollChanged_Empty_Flag
TEQS R0, #MiscOp_PollChanged_Ready_Flag ; Was drive ready?
BEQ %FT10 ; Yes then jump, leave drive on
ANDS R1, LR, #Drv_Ready+Drv_Empty ; Drive now not ready nor empty?
TEQNES R1, #Drv_Ready+Drv_Empty ; Or changed not reset?
ANDS R1, LR, #MiscOp_PollChanged_Ready_Flag+MiscOp_PollChanged_Empty_Flag ; Drive now not ready nor empty?
TEQNES R1, #MiscOp_PollChanged_Ready_Flag+MiscOp_PollChanged_Empty_Flag ; Or changed not reset?
BNE %FT05 ; No then jump
; Turn off drives that are neither ready nor empty or won't reset changed
......@@ -3447,7 +3447,7 @@ FlpGetDrvStatus ROUT ; Get drives status
; Set timeout for drive off for empty or ready drives
05 TSTS LR, #Drv_Ready ; Is drive ready?
05 TSTS LR, #MiscOp_PollChanged_Ready_Flag ; Is drive ready?
MOVNE LR, #1
STRNEB LR, FlpDriveIP ; Yes, then turn off in 1 rev
MOVEQ LR, #5 ; Else set small timeout
......
......@@ -229,8 +229,8 @@ FlpInit ROUT
MOV R0, #3 ; Max drive number
DrvRecPtr R1, R0 ; R1-> drive record
MOV LR, #Drv_EmptyWorks + Drv_MaybeChanged
ORR LR, LR, #Drv_ReadyWorks
MOV LR, #MiscOp_PollChanged_EmptyWorks_Flag + MiscOp_PollChanged_MaybeChanged_Flag
ORR LR, LR, #MiscOp_PollChanged_ReadyWorks_Flag
05 STR LR, [R1, #DrvFlags] ; Update drive record
SUB R1, R1, #SzDrvRec ; Next drive record
SUBS R0, R0, #1 ; Decr loop counter
......@@ -337,7 +337,7 @@ FlpInit ROUT
TSTS LR, #bit4 ; Track 0?
]
LDRNE LR, [R0, #DrvFlags] ; Yes, get drive flags
ORRNE LR, LR, #Drv_40Track ; And set 40 track bit
ORRNE LR, LR, #MiscOp_PollChanged_40Track_Flag ; And set 40 track bit
STRNE LR, [R0, #DrvFlags] ; And save it
[ Debug
BEQ %FT20
......@@ -877,7 +877,7 @@ FlpBuildDCB ROUT
; Get data rate from disk record
MOV R6, R0 ; Save '765 command code
TEQS R8, #WriteTrkOp ; Format track? (never in background)
TEQS R8, #DiscOp_WriteTrk ; Format track? (never in background)
TEQEQS R3, #0 ; And buffer address 0?
LDREQB LR, [R4, #DoFormatDensity] ; Yes, get density from format spec
LDRNEB LR, [R5, #Density] ; Else get density from disk rec
......@@ -912,10 +912,10 @@ FlpBuildDCB ROUT
LDRB LR, [R1, LR] ; Map logical to physical drive
DrvRecPtr R1, LR ; Get-> drive record
LDR LR, [R1, #DrvFlags] ; Get drive flags
TSTS LR, #Drv_DensityWorks ; Media ID works?
TSTS LR, #MiscOp_PollChanged_DensityWorks_Flag ; Media ID works?
BEQ %FT10 ; No, then jump
TSTS LR, #Drv_HiDensity ; Is disc hi density?
TSTS LR, #MiscOp_PollChanged_HiDensity_Flag ; Is disc hi density?
MOVEQ R0, #BadParmsErr ; No then bad parameters
BEQ %FT90 ; Error exit
10
......@@ -927,7 +927,7 @@ FlpBuildDCB ROUT
; Check for MultiFS style write track
TEQS R8, #WriteTrkOp ; Format track?
TEQS R8, #DiscOp_WriteTrk ; Format track?
TEQEQS R3, #0 ; And buffer address 0?
BEQ %FT60 ; Yes then jump, MultiFS format
......@@ -972,15 +972,18 @@ FlpBuildDCB ROUT
CMPNES R6, R4 ; No, want less than remaining track?
MOVHI R6, R4 ; Yes, transfer less
AND LR, R8, #OpMask
CMPS LR, #ReadSecsOp ; Read or verify?
CMPS LR, #DiscOp_ReadSecs ; Read or verify?
ORRLS R6, R6, #FlpDCBread ; Yes then set read bit
MOVLO LR, #&FF ; Verify?, set verify flag
MOVEQ LR, #0 ; Else set read flag
STRLSB LR, [R7, #FlpDCBcdb+9] ; Pass flag
AND LR, R8, #OpMask
CMPS LR, #Param3Op ; Data transfer op?
ASSERT DiscOp_Verify < DiscOp_ReadTrk
ASSERT DiscOp_ReadSecs < DiscOp_ReadTrk
ASSERT DiscOp_WriteSecs < DiscOp_ReadTrk
CMPS LR, #DiscOp_ReadTrk ; Data transfer op?
ORRLO R6, R6, #FlpDCBscatter ; Yes then use scatter list
TEQS R8, #ReadTrkOp ; Read track ID's?
TEQS R8, #DiscOp_ReadTrk ; Read track ID's?
MOVEQ R6, #64*4 ; Yes maximum 64 ID's
ORREQ R6, R6, #FlpDCBread ; And read
STR R3, [R7, #FlpDCBbuffer] ; Pass buffer/scatter ptr
......@@ -996,7 +999,7 @@ FlpBuildDCB ROUT
LDRB LR, [R1, LR] ; Map logical to physical drive
DrvRecPtr R1, LR ; Get-> drive record
LDR LR, [R1, #DrvFlags] ; Get drive flags
TSTS LR, #Drv_40Track ; 40 track drive?
TSTS LR, #MiscOp_PollChanged_40Track_Flag ; 40 track drive?
MOVEQ R1, #TrksPerSide ; No, then default tracks per side
MOVNE R1, #40 ; Else 40 tracks per side
Push "R1" ; Save tracks/drive
......@@ -1058,7 +1061,7 @@ FlpBuildDCB ROUT
; Verify takes Sector Count in place of DTL
LDRB LR, [R7, #FlpDCBcdb]
ASSERT VerifyOp = 0
ASSERT DiscOp_Verify = 0
TSTS R8, #OpMask
MOVNE LR, #&ff ; DTL= &ff
BNE %FT45
......@@ -1078,7 +1081,7 @@ FlpBuildDCB ROUT
; Complete the DCB
AND LR, R8, #OpMask
CMPS LR, #ReadTrkOp ; Read track?
CMPS LR, #DiscOp_ReadTrk ; Read track?
MOVEQ LR, #2 ; Yes, 2 byte ReadID command
MOVLO LR, #9 ; 9 bytes for read/write sectors
MOVHI LR, #6 ; Else 6 byte format track
......@@ -1087,7 +1090,7 @@ FlpBuildDCB ROUT
MOV R0, #0 ; No error
STR R0, [R7, #FlpDCBpost] ; No post routine
CMPS R8, #WriteTrkOp ; Write track?
CMPS R8, #DiscOp_WriteTrk ; Write track?
BNE %FT90 ; No then jump
......@@ -1187,7 +1190,7 @@ FlpBuildDCB ROUT
; Check for double stepping
TSTS R1, #FormatDoubleStep ; Double stepping?
TSTS R1, #FormatOptDoubleStep ; Double stepping?
BEQ %FT70 ; No then jump
MOV LR, R2, LSR #(32-3) ; Get drive number
......@@ -1195,7 +1198,7 @@ FlpBuildDCB ROUT
LDRB LR, [R1, LR] ; Map logical to physical drive
DrvRecPtr R1, LR ; Get-> drive record
LDR LR, [R1, #DrvFlags] ; Get drive flags
TSTS LR, #Drv_40Track ; 40 track drive?
TSTS LR, #MiscOp_PollChanged_40Track_Flag ; 40 track drive?
ADDEQ R0, R0, R0 ; No, then double track no.
70 STRB R0, [R7, #FlpDCBtrack] ; Set track # for implied seek
......@@ -1638,7 +1641,7 @@ FlpLowDataPost ROUT
LDR R0, =OpMask :OR: BackgroundOp
AND R0, R6, R0 ; Get opcode
TEQS R0, #VerifyOp ; Verify? (never background)
TEQS R0, #DiscOp_Verify ; Verify? (never background)
LDREQB LR, FloppyDefectRetries ; Yes get verify retries
LDRNEB LR, FloppyRetries ; Else normal retries
STRB LR, [R1, #FlpDCBretries] ; Write retries
......@@ -1780,7 +1783,10 @@ FlpLowLevel ROUT
STMEQIA R7, {R3,R4} ; And set up a scatter list
AND LR, R6, #OpMask
CMPS LR, #Param3Op ; Data transfer op?
ASSERT DiscOp_Verify < DiscOp_ReadTrk
ASSERT DiscOp_ReadSecs < DiscOp_ReadTrk
ASSERT DiscOp_WriteSecs < DiscOp_ReadTrk
CMPS LR, #DiscOp_ReadTrk ; Data transfer op?
MOVLO R3, R7 ; Yes, R3-> scatter list
; Setup DCB for required operation
......@@ -1802,15 +1808,18 @@ FlpLowLevel ROUT
; Submit DCB for processing
AND R0, R6, #OpMask ; Get opcode
TEQS R0, #VerifyOp ; Verify?
TEQS R0, #DiscOp_Verify ; Verify?
LDREQB LR, FloppyDefectRetries ; Yes get verify retries
LDRNEB LR, FloppyRetries ; Else normal retries
TEQS R0, #RestoreOp ; Restoring?
TEQS R0, #DiscOp_Restore ; Restoring?
TEQEQS LR, #0 ; And no retries
MOVEQ LR, #1 ; Then force at least 1
STRB LR, [R1, #FlpDCBretries] ; Set retries
CMPS R0, #Param3Op ; Data transfer operation?
ASSERT DiscOp_Verify < DiscOp_ReadTrk
ASSERT DiscOp_ReadSecs < DiscOp_ReadTrk
ASSERT DiscOp_WriteSecs < DiscOp_ReadTrk
CMPS R0, #DiscOp_ReadTrk ; Data transfer operation?
baddr LR, FlpLowDataPost, LO ; Yes then data post
baddr LR, FlpLowNdataPost, HS ; Else nondata post
STR LR, [R1, #FlpDCBpost] ; Save-> post routine
......@@ -2062,12 +2071,12 @@ MountBufferSize * 512
LDR r4, <