Commit 3b0a2e9a authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Sources lined up to be more readable

One pass through AsmTidy, then a manual inspection.
Builds binary identical version. No tagged.
parent 59434ba5
| Copyright 2012 Castle Technology Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine gpa_debug THROWBACK=-throwback
......@@ -18,9 +18,9 @@
applyfix $number,$state,$description
GBLL fix_$number
fix_$number SETL $state
[ fix_$number
[ fix_$number
! 0,"Apply fix $number $description"
]
]
MEND
; ----------------------------------------------------------
......@@ -35,8 +35,8 @@ fix_$number SETL $state
applyfix 3,{TRUE}, Ignore 'Recovered error' messages
applyfix 10,{TRUE},Support for floppies
applyfix 10,{TRUE}, Support for floppies
applyfix 11,{TRUE}, Do not let SCSIDriver source padding data
LNK s.ScsiFs00
LNK ScsiFs00.s
......@@ -41,4 +41,4 @@ test_version SETL {FALSE}
GBLA max_fix
max_fix SETA 11
LNK s.Fixes
LNK Fixes.s
......@@ -65,14 +65,14 @@ Ejecting SETL {FALSE}
Dev SETL test_version
;Debug message switches
[ Dev
[ Dev
GBLL Debug
Debug SETL {TRUE}
GBLL SpoolOff
SpoolOff SETL {FALSE} ; True to disable spooling for debug messages
GBLL IrqDebug
IrqDebug SETL {FALSE}
]
]
GBLL Debug1
GBLL Debug2
......@@ -85,11 +85,11 @@ IrqDebug SETL {FALSE}
MACRO
$a switch $b
[ Dev
[ Dev
$a SETL $b
|
|
$a SETL {FALSE}
]
]
MEND
Debug1 switch {FALSE} ;Init/Die/Service entries
......@@ -141,34 +141,33 @@ EscapeBit bit 6 ;escape if this bit set in ESC_Status
K * 1024
M * K*K
[ BigDisc
[ BigDisc
BigBit * CreateFlag_BigDiscSupport
NewErrorBit * CreateFlag_NewErrorSupport
|
|
BigBit * 0
NewErrorBit * 0
]
]
[ Ejecting
[ Ejecting
EjectBit * CreateFlag_FloppyEjects
|
|
EjectBit * 0
]
]
;Register allocation
SB RN 12
StkPtr RN 13
LF * 10
CR * 13
LF * 10
CR * 13
DeleteChar * 127
PollPeriod * 100 ;centi seconds between upcalls when disc changed works
ASSERT EscapeBit=&40
ASSERT EscapeBit=&40
AltDefectBit bit 4 ;use alternative defect map, winnies only
ScatterBit bit 5
......@@ -191,15 +190,15 @@ CMOSflags # 1
; b7 unused
FileCMOS # 1 ;number of additional file cache buffers
DirCMOS # 1 ;dir cache size
[ :LNOT: BigDisc
[ :LNOT: BigDisc
MapSizeCMOS # 4 ;map sizes of discs in units of 256 bytes
]
]
Service_SCSIAttached * &20102
Service_SCSIDetached * &20103
[ AllowPartitions
[ AllowPartitions
Service_SCSIMounting * &20104
]
]
AREA |!!!Module|, CODE, READONLY
......@@ -211,41 +210,41 @@ org
;Module Header
ASSERT {PC}-org=0
& 0 ;no start entry
& InitEntry ;initialisation entry
& DieEntry
& ServiceEntry
& ScsiFsTitle
& ScsiFsHelpString
& ComTab
& SCSIFSSWI_Base
& SwiEntry
& SwiNames
& 0 ;no SWI name decoding code
& 0
& ModFlags
DCD 0 ; no start entry
DCD InitEntry ; initialisation entry
DCD DieEntry
DCD ServiceEntry
DCD ScsiFsTitle
DCD ScsiFsHelpString
DCD ComTab
DCD SCSIFSSWI_Base
DCD SwiEntry
DCD SwiNames
DCD 0 ; no SWI name decoding code
DCD 0
DCD ModFlags
ASSERT {PC}-org=52
ScsiFsBootText
= "Acorn " ;includes AdfsTitle
DCB "Acorn " ; includes ScsiTitle
ScsiFsTitle
Text "SCSIFS"
DieTitle
= "FileCore%"
DCB "FileCore%"
CreateTitle
Text "SCSI"
ScsiFsHelpString
= "SCSIFS",9,9
[ Dev
= " DEVELOPMENT VERSION",0
|
= Module_MajorVersion," (",Module_Date,")",0
]
DCB "SCSIFS",9,9
[ Dev
DCB " DEVELOPMENT VERSION",0
|
DCB Module_MajorVersion," (",Module_Date,")",0
]
ALIGN
LTORG
......@@ -257,7 +256,7 @@ ModFlags
; Disc Record
^ 0
^ 0
;
SectorSize # 1 ;log2 sector size
SecsPerTrk # 1
......@@ -269,7 +268,7 @@ Density # 1 ;1/2/4 single double quad
LinkBits # 1
BitSize # 1 ;log2 bytes for each bit in map, 0 for old format
RAskew # 1 ;track to track sector skew for random access
;file allocation
;file allocation
BootOpt # 1 ;boot option for this disc
LowSector # 1
......@@ -295,8 +294,8 @@ OldDirFlag bit 7 ;set <=> old small dirs
;entries below must be valid even when disc rec is not in use
Priority # 1 ;0 DISC REC UNUSED
;1 to # floppies -> floppy priority level
;&FF good winnie
;1 to # floppies -> floppy priority level
;&FF good winnie
DiscsDrv # 1 ;0-7 => drive in, 8 => not in drive, OR DISC REC UNUSED
DiscUsage # 1 ;tasks using this disc, if >0 disc cant be forgotten
SzDiscRec # 0
......@@ -311,15 +310,15 @@ DefDiscRecEnd * &00080000
; Drive Record
^ 0
^ 0
DrvFlags # 1
LostUnitAtn bit 0
DrvFlags # 1
LostUnitAtn bit 0
;ResetChangedByStep bit 3
;ResetChangedByWrite bit 4
;QuadDrv bit 5 ;set if quad
ASSERT MiscOp_PollChanged_EmptyWorks_Flag = bit6
ASSERT MiscOp_PollChanged_ChangedWorks_Flag = bit7
ASSERT MiscOp_PollChanged_EmptyWorks_Flag = bit6
ASSERT MiscOp_PollChanged_ChangedWorks_Flag = bit7
DevNo # 3
;HeadPosition # 4
......@@ -362,194 +361,52 @@ DefectEndMark bit 29
MaxStruc * 64
ASSERT SzDiscRec<=MaxStruc
^ 0
^ 0
# SzDefectList-MaxStruc-4
ParkDiscAdd # 4
; OLD FS MAP
^ 0
FreeStart # 82*3 ;table of free space start sectors
EndSpaceList # 0
# 1 ;reserved
OldName0 # 5 ; RETRO DEFINITION
OldSize # 3 ;size in sectors
Check0 # 1 ;checksum on sector 0
FreeLen # 82*3 ;table of free space lengths
OldName1 # 5 ; RETRO DEFINITION
OldId # 2 ;disc id
OldBoot # 1 ;boot option
FreeEnd # 1 ;ptr to end of free space list
Check1 # 1 ;checksum on sector 1
ASSERT {VAR}=&200
; New map
^ 0
ZoneCheck # 1
FreeLink # 2 ;15 bit free space start link
CrossCheck # 1 ;EORing this byte for all zones should yield &FF
DummyLenBit bit 31 ;always set
ZoneDiscRecSz * 60 ;reserve additional bytes
ASSERT ZoneDiscRecSz>=SzDiscRec
ZoneHead # ZoneDiscRecSz
Zone0Bits * ZoneDiscRecSz*8
;zones are followed in RAM by table of one byte of flags per zone
ZoneValid bit 0
ZoneCompacted bit 1
; Dir entry
^ 0
NameLen * 10
DirObName # NameLen
DirLoad # 4
DirExec # 4
DirLen # 4
DirIndDiscAdd # 3
OldDirObSeq # 1
OldDirEntrySz * {VAR}
ASSERT OldDirEntrySz=26
NewDirAtts * OldDirObSeq
ReadBit * 1
WriteBit * 2
IntLockedBit * 4 ;the locked bit is held in bit 2 internally
ExtLockedBit * 8 ;but is returned in bit 3 externally
DirBit * 8
NewDirEntrySz * {VAR}
; Directory Start
^ 0
StartMasSeq # 1
StartHugo # 4
DirFirstEntry # 0
; Old Directory End
^ 0
# -1
DirCheckByte # 0 ;RETRO DEFINITION was reserved
# -4
EndHugo # 0
# -1
EndMasSeq # 0
# -14 ;reserved
DirTitleSz * 19
# -DirTitleSz
OldDirTitle # 0
# -3
OldDirParent # 0
# -NameLen
OldDirName # 0
# -1
OldDirLastMark # 0 ;dummy last entry marker
; New Directory End
^ 0
# -1
ASSERT DirCheckByte=@
# -4
ASSERT EndHugo=@
# -1
ASSERT EndMasSeq=@
# -NameLen
NewDirName # 0
# -DirTitleSz
NewDirTitle # 0
# -3
NewDirParent # 0
# -1 ;reserved
# -1 ;reserved
# -1
NewDirLastMark # 0 ;dummy last entry marker
OldDirSize * &500
NewDirSize * &800
OldDirTabSz * (OldDirSize-DirFirstEntry+OldDirLastMark)
NewDirTabSz * (NewDirSize-DirFirstEntry+NewDirLastMark)
ASSERT OldDirTabSz :MOD: OldDirEntrySz = 0
ASSERT NewDirTabSz :MOD: NewDirEntrySz = 0
OldDirEntries * OldDirTabSz / OldDirEntrySz
NewDirEntries * NewDirTabSz / NewDirEntrySz
ASSERT OldDirEntries=47
ASSERT NewDirEntries=77
;Filing system control reason codes
FscAddFs * 12
FscSelectFs * 14
FscRemoveFs * 16
FscAdd2ndFs * 17
FscReadFileType * 18
;MAIN WORKSPACE ALLOCATION
^ 0, SB
SCSIFSWorkBase # 0
Padding # 4 ;>>>RCM stop 'sbaddr R7, BlockSizes-4' in ScsiFs15 from failing
BlockSizes a4 4 ;log to base two of block size for device or 0 if not
;mounted yet
[ :LNOT: BigDisc
^ 0, SB
SCSIFSWorkBase # 0
Padding # 4 ;>>>RCM stop 'sbaddr R7, BlockSizes-4' in ScsiFs15 from failing
BlockSizes a4 4 ;log to base two of block size for device or 0 if not
;mounted yet
[ :LNOT: BigDisc
MapSizes a4 4
]
]
FileCorePrivate a4 4
WinnieCallAfter a4 4
[ BigDisc
[ BigDisc
FCFeatures a4 4
FC_Big * bit0
FC_NewErrors * bit1
]
[ AllowPartitions
]
[ AllowPartitions
PartitionBaseAdd a4 4*8
]
[ UseSpecialScatterBlk
]
[ UseSpecialScatterBlk
ScatterFlag a4 4 ;Are we converting a save to use scatterblk ?
ScatterData a4 4 ;New Length (=Old Length rounded up to next block)
WriteScatBlk a4 6*4 ;Here is the scatter special block
]
]
[ HotPlug
[ HotPlug
AttCBCount # 1
DetCBCount # 1
Dieing # 1
myalign # 1
]
]
;Low level workspace
Winnies # 1
[ FloppySupport:LOR:AutoDetect
[ FloppySupport:LOR:AutoDetect
Floppies # 1
# 2
# 2
DrvRecs # SzDrvRec*8
]
]
[ UseSpecialScatterBlk
[ UseSpecialScatterBlk
; Block of 0's used for padding writes in special scatter blocks
; Previously SCSIFS used to just source the padding data from &00000000, but
; (a) that's not very nice
......@@ -557,7 +414,7 @@ DrvRecs # SzDrvRec*8
; (c) other alternative locations (e.g. start of RMA) could contain sensitive information the user doesn't want storing to disc
; So as a compromise, sacrifice some RMA to give us a nice safe buffer to use, at least for devices with standard block sizes.
PaddingBlock # 512
]
]
WorkSize # 0
ALIGN
......@@ -593,51 +450,51 @@ CTL_BACKGROUND EQU &01 :SHL: 29
;
CTL_cnvt EQU 21 ;Shift (left) factor
[ AutoDetect
[ AutoDetect
MACRO
$lab mapDrvToDevLo $rd, $rs, $rdr
[ "$rdr" = ""
AND $rd, $rs, #&FF
[ "$rdr" = ""
AND $rd, $rs, #&FF
DrvRecPtr $rd, $rd
ASSERT DevNo :AND: 3 = 1
LDR $rd, [$rd, #DevNo :AND::NOT:3]
|
LDR $rd, [$rdr, #DevNo :AND::NOT:3]
]
MOV $rd, $rd, ASR #8
ASSERT DevNo :AND: 3 = 1
LDR $rd, [$rd, #DevNo :AND::NOT:3]
|
LDR $rd, [$rdr, #DevNo :AND::NOT:3]
]
MOV $rd, $rd, ASR #8
MEND
MACRO
$lab mapDevToDrvLo $rd, $rs
ASSERT $rd = R1
ASSERT $rs = R1
ASSERT $rd = R1
ASSERT $rs = R1
$lab BIC R1, R1, #&FF000000
BL MapDevToDrv
BL MapDevToDrv
MEND
|
|
MACRO
$lab mapDrvToDevLo $rd, $rs
[ fix_2
[ fix_2
$lab EOR $rd, $rs, #4
|
|
$lab BIC $rd, $rs, #4 ;map drives 4 to 7 to devices 0 to 3
]
]
MEND
MACRO
$lab mapDevToDrvLo $rd, $rs
[ fix_2
[ fix_2
$lab EOR $rd, $rs, #4
|
|
$lab ORR $rd, $rs, #4 ;map drives 4 to 7 to devices 0 to 3
]
]
MEND
MACRO
$lab mapDrvToDevImm $rd, $im
$lab MOV $rd, $im :EOR: 4
MEND
]
]
LNK s.ScsiFs05
LNK ScsiFs05.s
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment