Commit 92870ae9 authored by Robert Sprowson's avatar Robert Sprowson Committed by ROOL
Browse files

[464] Restore documented enumeration SWI behaviour

SCSI_Partitions 1 was changed in SCSIFS 1.34 to tie new significance to R2, which was previously undefined. Thus any clients of this subreason failed in various amusing ways (the ticket references SystemDisc and Fat32Formatte, and inspection of HForm suggests this would have altered behaviour because BASIC zeros unused registers).

Since the only client of this extension is the SCSI specific PartMan, and the module already has a variety of assembly time switches in order to complete the other half of the dialogue to work out which partition is which, just make the significant R2 depend on that switch too. Therefore the previously documented SWI behaviour is restored otherwise.

Also, tidy the docs up, and paste those tidied docs into the relevant place in the sources.

Version 1.36. Tagged as 'SCSIFS-1_36'
parent 4283a9df
......@@ -5,26 +5,26 @@ SWI SCSIFS_Partitions &40995
On entry
R0 = reason code
others depend on reason
Reason code: 0:Set Sector offset for drive N
R0 = 0
Reason code 0 = Set Sector offset for drive N
R1 = Drive number (0..7)
R2 = Sector offset to base of image
This offset is zero by default. It may be changed by this SWI
at any time, but changing this value after mounting the disc
is usually not wise!
Reason code: 1:Enquire SCSIFS disc number
R0 = 1
Reason code 1 = Enquire SCSIFS disc number
R1 = Drive number (0..7)
[ PartitionManager
R2 = Sector offset to base of image
returns
]
returns
R2 = SCSIFS disc icon (0..7), or -1 if none
Reason code: 2:Enquire Drive number and offset
R0 = 1
Reason code 2 = Enquire Drive number and offset
R1 = SCSIFS disc number (0..7)
returns
returns
R1 = Drive number (0..7)
R2 = Sector offset to base of image
......
;
; This file is automatically maintained by srccommit, do not edit manually.
; Last processed by srccommit version: 1.1.
;
GBLS Module_MajorVersion
GBLA Module_Version
......@@ -10,14 +9,12 @@
GBLS Module_ApplicationDate
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.35"
Module_Version SETA 135
Module_MajorVersion SETS "1.36"
Module_Version SETA 136
Module_MinorVersion SETS ""
Module_Date SETS "20 Jul 2018"
Module_ApplicationDate SETS "20-Jul-18"
Module_Date SETS "19 Aug 2020"
Module_ApplicationDate SETS "19-Aug-20"
Module_ComponentName SETS "SCSIFS"
Module_ComponentPath SETS "castle/RiscOS/Sources/FileSys/SCSIFS/SCSIFS"
Module_FullVersion SETS "1.35"
Module_HelpVersion SETS "1.35 (20 Jul 2018)"
Module_FullVersion SETS "1.36"
Module_HelpVersion SETS "1.36 (19 Aug 2020)"
END
/* (1.35)
/* (1.36)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.35
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 20 Jul 2018
#define Module_MajorVersion_CMHG 1.36
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 19 Aug 2020
#define Module_MajorVersion "1.35"
#define Module_Version 135
#define Module_MajorVersion "1.36"
#define Module_Version 136
#define Module_MinorVersion ""
#define Module_Date "20 Jul 2018"
#define Module_Date "19 Aug 2020"
#define Module_ApplicationDate "20-Jul-18"
#define Module_ApplicationDate "19-Aug-20"
#define Module_ComponentName "SCSIFS"
#define Module_ComponentPath "castle/RiscOS/Sources/FileSys/SCSIFS/SCSIFS"
#define Module_FullVersion "1.35"
#define Module_HelpVersion "1.35 (20 Jul 2018)"
#define Module_LibraryVersionInfo "1:35"
#define Module_FullVersion "1.36"
#define Module_HelpVersion "1.36 (19 Aug 2020)"
#define Module_LibraryVersionInfo "1:36"
......@@ -445,57 +445,68 @@ DoSwiTestReady
CLRV
Pull "R1,R2,PC"
[ AllowPartitions
[ AllowPartitions
; On entry
; R0 = reason code
; Reason code: 0 = Sector offset for drive 1 in R1 is in R2
; R1 = Drive number (0..7)
; R2 = sector offset to base of image
; This offset is zero by default. It may be changed by this swi
; at any time, but changing this value after mounting the disc
; is usually not wise!
;
; Reason code: 1 = report SCSIFS disc number
; returns
; R2 = SCSIFS disc icon (0..7), or -1 if none
; others depend on reason
;
DoSWIPartitions ROUT
Push "R1,R2,LR"
TEQ R0, #0 ; set partition base
TEQ R0, #0
BNE %ft1
; Reason code 0 = Set Sector offset for drive N
; R1 = Drive number (0..7)
; R2 = Sector offset to base of image
CMP R1, #MaxDriveNo-1
Pull "R1,R2,PC", HI
ADD LR, SB, R1, LSL #2 ; word offset
STR R2, [LR, #:INDEX:PartitionBaseAdd-:INDEX:SCSIFSWorkBase] ; remember
Pull "R1,R2,PC"
1
TEQ R0, #1 ; report icon used
BNE %FT6 ; report ID and offset for icon
TEQ R0, #1
BNE %FT6
; Reason code 1 = report SCSIFS disc number
; R1 = Drive number (0..7)
[ PartitionManager
; R2 = Sector offset to base of image
]
; returns
; R2 = SCSIFS disc icon (0..7), or -1 if none
Push "R3,R4,R5"
MOV R2, #MaxDriveNo-1
LDR R5, [SP, #4*4] ; retrieve R2 off stack
[ PartitionManager
LDR R5, [SP, #4*4] ; retrieve R2 off stack
]
2
DrvRecPtr R4, R2
LDRB R3, [R4, #:INDEX:DevNo]
TEQ R3, R1
[ PartitionManager
BNE %ft4
ADD LR, SB, R2, LSL #2 ; word offset
LDR LR, [LR, #:INDEX:PartitionBaseAdd-:INDEX:SCSIFSWorkBase] ;
TEQ LR, R5
BEQ %ft3 ; same start sector too
TEQ LR, R5 ; same start sector too?
]
BEQ %ft5
4
SUBS R2,R2,#1
BGE %bt2
3
5
Pull "R3,R4,R5"
STR R2,[R13, #4] ; update R2 return value
Pull "R1,R2,PC"
6
TEQ R0, #2 ; report id & offset for icon
TEQ R0, #2
Pull "R1,R2,PC",NE
; Reason code 2 = Enquire Drive number and offset
; R1 = SCSIFS disc number (0..7)
; returns
; R1 = Drive number (0..7)
; R2 = Sector offset to base of image
Push "R3,R4,R5"
DrvRecPtr R4, R1
......@@ -506,7 +517,7 @@ DoSWIPartitions ROUT
Pull "R3,R4,R5"
ADD sp, sp, #4*2 ; forget stored r1 and r2
Pull "PC"
]
]
; >>>>>>>>
; SwiEntry
......
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