Commit 9b938c91 authored by Neil Turton's avatar Neil Turton
Browse files

Version Spin_merge taken

parent cfce572c
......@@ -743,6 +743,13 @@ MountDiscOnDrive ROUT
ASSERT DiscId :MOD: 4 = 0
ASSERT DiscName = DiscId + 2
STR lr, [r5, #DiscId]
[ BigDisc
STR lr, [r5,#DiscSize2]
[ BigShare
STR lr, [r5,#ShareSize]
]
]
; Set up a sensible pre-guess at the RootDir
[ DebugL
......@@ -761,11 +768,6 @@ MountDiscOnDrive ROUT
; as a hack to try to get floppies to mount - set DiscSize2 to 0
[ BigDisc
MOV lr, #0
STR lr, [r5,#DiscSize2]
]
; Mount the disc
Push "r2,r4"
MOVS r2, r1, ASL #(32-3)
......
......@@ -893,9 +893,10 @@ FindErrBlock ROUT
LDRVCB lr, FS_Id
ORRVC r1, r1, lr, ASL #8
BICVC r1, r1, #&ff000000
LDRVC lr, [sp, #20]
ANDVC lr, lr, #MaxDiscErr :SHL: 24
ORRVC r1, r1, lr
LDRVC lr, [sp, #40]
; ANDVC lr, lr, #MaxDiscErr :SHL: 24
LDRB lr, [lr, #0]
ORRVC r1, r1, lr, LSL #24
ADDVC r4, sp, #4
MOVVC r5, sp
ADDVC r6, sp, #8
......
......@@ -1033,6 +1033,51 @@ DiscAddToMapPtr ROUT
]
Pull "R0,R1,R3,PC"
; ===================
; ByteDiscAddToMapPtr
; ===================
;entry
; R0 disc address
; R10 ->map start
;exit
; R11 offset in map
; LR zone number
ByteDiscAddToMapPtr ROUT
Push "R0,R1,R3,LR"
[ DebugE
DREG R0, "ByteDiscAddToMapPtr(disc add:",cc
DREG R10, ", map:",cc
DLINE ")"
]
MOV R3, R0
BIC R0, R0, #DiscBits
LDRB R1, [R10,#ZoneHead+BitSize] ;scale from bytes to map bits
MOV R0, R0, LSR R1
ADD R0, R0, #Zone0Bits ;adjust for zone 0
LDRB R1, [R10,#ZoneHead+SectorSize]
MOV R3, #8
MOV R1, R3, LSL R1 ;total bits in a zone map
LDR R3, [R10,#ZoneHead+ZoneSpare-2]
MOV R3, R3, LSR #16
SUB R1, R1, R3 ;map bits actually used in a zone map
MOV R11,R0
BL Divide ;(R0,R1->R0,R1)
MOV LR, R0 ;zone
MLA R11,R3, R0, R11 ;add zone*spare, for non map bits
ADD R11,R11,#ZoneHead*8
[ DebugE
Push "R0"
DREG R11, "<-ByteDiscAddToMapPtr(map ptr:",cc
MOV R0, LR
DREG R0, "zone:",cc
DLINE ")"
Pull "R0"
]
Pull "R0,R1,R3,PC"
; =================
; CritInitReadNewFs
......
......@@ -44,7 +44,7 @@ EnsureFSLock ROUT
01
MOV r2, r2, LSR #29 ; get drive number
CMP r2, #4
CLRV
MOV r0,r0
Pull "r1,r2,pc",LO ; not hard disc - ignore
SWI &44781+(1:SHL:17) ; get the lock status
......@@ -691,10 +691,10 @@ DoSwiFloppyStructure ROUT
Push "R0-R11,LR"
[ Debug2
wrhex R0
wrhex R1
wrhex R2
mess ,">DoSwiFloppyStructure",NL
DREG R0, "", cc
DREG R1, ", ", cc
DREG R2, " ", cc
DLINE ">DoSwiFloppyStructure"
]
LDMIA SP, {R3,R4,R8,R9}
CMPS R8, #OldMapFlag
......@@ -707,7 +707,7 @@ DoSwiFloppyStructure ROUT
;BUILD OLD MAP
[ Debug2
mess ,"build old map",NL
DLINE "build old map"
]
ADDEQ LR, R1, #NewDirSize
ADDHI LR, R1, #OldDirSize
......@@ -772,7 +772,7 @@ DoSwiFloppyStructure ROUT
;BUILD NEW MAP
40
[ Debug2
mess ,"build new map",NL
DLINE "build new map"
]
ADD LR, R1, #NewDirSize
STR LR, [SP, #3*4] ;exit R3
......@@ -809,21 +809,18 @@ DoSwiFloppyStructure ROUT
BL WrLenBits ;(R0,R1,R10)
MOV R3, R11 ;init free start
[ BigDisc
LDR R0, [R4, #DiscSize]
Push "R1"
LDRB R1, [R10, #ZoneHead+SectorSize]
MOV R0, R0, LSR R1
RSB R1, R1, #32
LDR LR, [R4, #DiscSize2]
ORR R0, R0, LR, LSL R1
Pull "R1"
|
LDR R0, [R4, #DiscSize]
]
SUB R0, R0, #1
[ BigDisc
BL ByteDiscAddToMapPtr ;(R0,R10->R11,LR) (to fix RAMFS discs coming out truncated)
|
BL DiscAddToMapPtr ;(R0,R10->R11,LR)
]
ADD R2, R11,#1 ;disc end map ptr
BL AllocBitWidth ;(R10->LR)
SUB R5, LR, #1
BIC R2, R2, R5
......@@ -899,7 +896,7 @@ DoSwiFloppyStructure ROUT
;BUILD ROOT DIRECTORY
60
[ Debug2
mess ,"build $",NL
DLINE "build $"
]
LDR R2, [R4, #RootDir]
TSTS R8, #OldMapFlag
......
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