Commit 452bbb0b authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Internationalised

In addition
 - simplify WrDec to just use OS_ConvertCardinal1 hence not need a division routine
 - change the Hide check to at least use Choices: correctly, if you must
 - macros Text and baddr eliminated

Tested in an OMAP3 ROM build.

Version 1.28. Tagged as 'SCSIFS-1_28'
parent 3b0a2e9a
;>HelpText
HelpSCSI
[ international_help
SCSI_Help DCB "HFS", 0
SCSI_Syntax DCB "SFS", 0
[ DoBuffering
SCSIFSBuffers_Help DCB "HBu", 0
SCSIFSBuffers_Syntax DCB "SBu", 0
]
SCSIFSDirCache_Help DCB "HDC", 0
SCSIFSDirCache_Syntax DCB "SDC", 0
[ :LNOT:HotPlug
[ FloppySupport
SCSIFSFloppies_Help DCB "HFl", 0
SCSIFSFloppies_Syntax DCB "SFl", 0
]
SCSIFSDiscs_Help DCB "HDi", 0
SCSIFSDiscs_Syntax DCB "SDi", 0
]
SCSIFSDrive_Help DCB "HDr", 0
SCSIFSDrive_Syntax DCB "SDr", 0
|
SCSI_Help
= "*"
= TokenEscapeChar,Token0
= " selects the SCSIFS as the current filing system.",13
SynSCSI
SCSI_Syntax
= "Syntax: *"
= TokenEscapeChar,Token0
= 0
[ DoBuffering
ConHelpSCSIFSbuffers
[ DoBuffering
SCSIFSBuffers_Help
= "*Configure "
= TokenEscapeChar,Token0
= " sets the number of extra 1024 byte file buffers taken by the SCSIFS to speed up operations on open files. A value of 1 selects the default number of buffers for the RAM size, and 0 disables fast buffering.",13
ConSynSCSIFSbuffers
SCSIFSBuffers_Syntax
= "Syntax: *Configure "
= TokenEscapeChar,Token0
= " <buffers>",0
]
]
ConHelpSCSIFSDirCache
SCSIFSDirCache_Help
= "*Configure "
= TokenEscapeChar,Token0
= " sets the size of the directory cache (in Kbytes) used by the SCSIFS. A value of 0 selects a default value which depends on RAM size.",13
ConSynSCSIFSDirCache
SCSIFSDirCache_Syntax
= "Syntax: *Configure "
= TokenEscapeChar,Token0
= " <size>[K]",0
ConHelpSCSIFSdrive
= "*Configure "
= TokenEscapeChar,Token0
= " sets the value the default drive is initialised to for SCSIFS.",13
ConSynSCSIFSdrive
= "Syntax: *Configure "
= TokenEscapeChar,Token0
= " <drive>",0
[ FloppySupport
ConHelpSCSIFSFloppies
[ :LNOT:HotPlug
[ FloppySupport
SCSIFSFloppies_Help
= "*Configure "
= TokenEscapeChar,Token0
= " sets the number of SCSI discs attached.",13
ConSynSCSIFSFloppies
SCSIFSFloppies_Syntax
= "Syntax: *Configure "
= TokenEscapeChar,Token0
= " <SCSI discs>",0
ConHelpSCSIFSdiscs
]
SCSIFSDiscs_Help
= "*Configure "
= TokenEscapeChar,Token0
= " sets the number of SCSI discs attached.",13
ConSynSCSIFSdiscs
SCSIFSDiscs_Syntax
= "Syntax: *Configure "
= TokenEscapeChar,Token0
= " <SCSI discs>",0
|
ConHelpSCSIFSdiscs
]
SCSIFSDrive_Help
= "*Configure "
= TokenEscapeChar,Token0
= " sets the number of SCSI discs attached.",13
ConSynSCSIFSdiscs
= " sets the value the default drive is initialised to for SCSIFS.",13
SCSIFSDrive_Syntax
= "Syntax: *Configure "
= TokenEscapeChar,Token0
= " <SCSI discs>",0
= " <drive>",0
]
ALIGN
LNK s.ScsiFs50
LNK MsgCode.s
......@@ -36,8 +36,7 @@ EXPORTS = hdr.SCSIFSErr ${C_EXP_HDR}.SCSIFSErr
TOKHELPSRC = ${TOKENSOURCE}
HELPSRC = HelpText
ROM_SOURCE = s.Hdr_fst
RESOURCES = No
ROM_SOURCE = Hdr_fst.s
include StdTools
include AAsmModule
......
#{DictTokens}
DrvUnK:Disc drive not known
SSNSpt:Sector size not supported
BadSTy:Bad SCSI device type
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.27"
Module_Version SETA 127
Module_MajorVersion SETS "1.28"
Module_Version SETA 128
Module_MinorVersion SETS ""
Module_Date SETS "23 Aug 2013"
Module_ApplicationDate SETS "23-Aug-13"
Module_Date SETS "06 Oct 2013"
Module_ApplicationDate SETS "06-Oct-13"
Module_ComponentName SETS "SCSIFS"
Module_ComponentPath SETS "castle/RiscOS/Sources/FileSys/SCSIFS/SCSIFS"
Module_FullVersion SETS "1.27"
Module_HelpVersion SETS "1.27 (23 Aug 2013)"
Module_FullVersion SETS "1.28"
Module_HelpVersion SETS "1.28 (06 Oct 2013)"
END
/* (1.27)
/* (1.28)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.27
#define Module_MajorVersion_CMHG 1.28
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 23 Aug 2013
#define Module_Date_CMHG 06 Oct 2013
#define Module_MajorVersion "1.27"
#define Module_Version 127
#define Module_MajorVersion "1.28"
#define Module_Version 128
#define Module_MinorVersion ""
#define Module_Date "23 Aug 2013"
#define Module_Date "06 Oct 2013"
#define Module_ApplicationDate "23-Aug-13"
#define Module_ApplicationDate "06-Oct-13"
#define Module_ComponentName "SCSIFS"
#define Module_ComponentPath "castle/RiscOS/Sources/FileSys/SCSIFS/SCSIFS"
#define Module_FullVersion "1.27"
#define Module_HelpVersion "1.27 (23 Aug 2013)"
#define Module_LibraryVersionInfo "1:27"
#define Module_FullVersion "1.28"
#define Module_HelpVersion "1.28 (06 Oct 2013)"
#define Module_LibraryVersionInfo "1:28"
......@@ -27,6 +27,8 @@ IntEscapeErr * &80
GET Hdr:FileCoreErr
GET Hdr:SCSIFSErr
BadDriveErrBlk MakeErrorBlock SCSIFSBadDrive
MakeInternatErrorBlock SCSIFSBadDrive,,DrvUnK
MakeInternatErrorBlock SCSIFSSectorSizeNotSupported,,SSNSpt
MakeInternatErrorBlock SCSIFSBadSCSIType,,BadSTy
END
......@@ -78,26 +78,6 @@ bits8 SETA $const :AND: ( &FF :SHL: ( bit+8 ) )
MEND
;put address of $dest in $reg
; MACRO
;$lab addr $reg,$dest,$cond
; ASSERT $reg<>PC
; ASSERT ($dest-{PC}-8)<&10000
;$lab ADD$cond $reg,PC,#($dest-{PC}-8) :AND: &FF
; ADD$cond $reg,$reg,#($dest-{PC}-4) :AND: &FF00
; MEND
GBLA boff
MACRO
$lab baddr $reg,$dest,$cond
ASSERT $reg<>PC
boff SETA {PC}+8-($dest)
ASSERT boff<&10000
$lab Try8 SUB$cond,$reg,PC,(boff)
MEND
;put absolute address of $sboff in $reg
MACRO
$lab sbaddr $reg,$sboff,$cond
......@@ -105,13 +85,6 @@ $lab Try8 ADD$cond,$reg,SB,(:INDEX:$sboff)
MEND
MACRO
$l Text $str
$l = "$str",0
ALIGN
MEND
MACRO
$lab aw $size ;allocate word aligned
ASSERT {VAR} :MOD: 4=0
......
......@@ -17,6 +17,7 @@
GET Hdr:ListOpts
GET Hdr:Macros
GET Hdr:System
GET Hdr:Proc
GET Hdr:CMOS
GET Hdr:HighFSI
GET Hdr:FSNumbers
......@@ -29,6 +30,7 @@
GET Hdr:UpCall
GET Hdr:NewErrors
GET Hdr:MsgTrans
GET Hdr:ResourceFS
GET Hdr:SCSI
GET Hdr:SCSIErr
GET Hdr:OSRSI6
......
; Copyright 2013 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.
;
; >MsgCode
TTL "Message file handling code"
; CopyError
; ---------
; Translate an error block, with no substituted parameter.
; Entry: R0 = error block containing the token
; Exit : R0 = translated error block or another error (token no found etc.)
; VS
CopyError
Entry "r1-r7"
MOV r4, #0
B %FT10
; CopyErrorOne
; ------------
; Translate an error block, with one substituted parameter.
; Entry: R0 = error block containing the token
; R1 = %0 parameter to substitute
; Exit : R0 = translated error block or another error (token no found etc.)
; VS
CopyErrorOne
ALTENTRY
MOV r4, r1 ; Move input %0
10
BL OpenMsgFile ; Ensure file is open
EXIT VS ; Return the error
ADR r1, MsgFileBlock ; Messages file handle
MOV r2, #0 ; Use MessageTrans buffer
MOV r5, #0 ; No %1
MOV r6, #0 ; No %2
MOV r7, #0 ; No %3
SWI XMessageTrans_ErrorLookup ; Always sets the V flag
EXIT
ScsiMsgFileName
DCB "Resources:$.Resources.SCSIFS.Messages", 0
ALIGN
; OpenMsgFile
; -----------
; Open the messages file if it is closed.
; Entry: nothing
; Exit : R0 = pointer to error block if VS
OpenMsgFile
Entry "r0-r2"
LDR r1, MsgFileOpen
TEQ r1, #0 ; Check the open flag
EXIT NE ; Return - it is open
ADR r0, MsgFileBlock ; Messages file handle
ADR r1, ScsiMsgFileName ; Messages filename
MOV r2, #0 ; Buffer in RMA/access direct
SWI XMessageTrans_OpenFile
STRVS r0, [sp] ; Return the error
EXIT VS
MOV r1, #1
STR r1, MsgFileOpen ; Flag the file as open
EXIT
[ standalone
MsgFileReg
Entry "r0"
ADR r0, MsgFileResArea
SWI XResourceFS_RegisterFiles
EXIT
MsgFileDereg
Entry "r0"
ADR r0, MsgFileResArea
SWI XResourceFS_DeregisterFiles
EXIT
MsgFileResArea
ResourceFile $MergedMsgs, Resources.SCSIFS.Messages
DCD 0
]
LNK ScsiFs50.s
......@@ -23,6 +23,10 @@ $num FSErr $name, $str
; Define all the errors that FileCore generates for the FS
GET FileCoreErr
; Define additional FS errors
72 FSErr SectorSizeNotSupported, Sector size not supported
76 FSErr BadSCSIType, Bad SCSI device type
; File footer
= 10, " END", 10
......
......@@ -61,6 +61,14 @@ AllowPartitions SETL {TRUE}
GBLL Ejecting
Ejecting SETL {FALSE}
[ :LNOT: :DEF: standalone
GBLL standalone
standalone SETL {FALSE} ; Build-in Messages file and i/f to ResourceFS
]
[ :LNOT: :DEF: international_help
GBLL international_help
international_help SETL {TRUE} ; Default to RISC OS 3.60+ internationalisation
]
GBLL Dev
Dev SETL test_version
......@@ -200,43 +208,42 @@ Service_SCSIDetached * &20103
Service_SCSIMounting * &20104
]
AREA |!!!Module|, CODE, READONLY
ORG 0
org
AREA |!!!SCSIFSModule|, CODE, READONLY, PIC
ENTRY
;Module Header
ASSERT {PC}-org=0
; Module Header
Module_BaseAddr
DCD 0 ; no start entry
DCD InitEntry ; initialisation entry
DCD DieEntry
DCD ServiceEntry
DCD ScsiFsTitle
DCD ScsiFsHelpString
DCD ComTab
DCD InitEntry - Module_BaseAddr
DCD DieEntry - Module_BaseAddr
DCD ServiceEntry - Module_BaseAddr
DCD ScsiFsTitle - Module_BaseAddr
DCD ScsiFsHelpString - Module_BaseAddr
DCD ComTab - Module_BaseAddr
DCD SCSIFSSWI_Base
DCD SwiEntry
DCD SwiNames
DCD SwiEntry - Module_BaseAddr
DCD SwiNames - Module_BaseAddr
DCD 0 ; no SWI name decoding code
DCD 0
DCD ModFlags
ASSERT {PC}-org=52
[ international_help
DCD ScsiMsgFileName - Module_BaseAddr
|
DCD 0 ; no international help
]
DCD ModFlags - Module_BaseAddr
ASSERT {PC} - Module_BaseAddr = 52
ScsiFsBootText
DCB "Acorn " ; includes ScsiTitle
ScsiFsTitle
Text "SCSIFS"
DCB "SCSIFS", 0
ALIGN
DieTitle
DCB "FileCore%"
CreateTitle
Text "SCSI"
DCB "SCSI", 0
ALIGN
ScsiFsHelpString
DCB "SCSIFS",9,9
......@@ -391,6 +398,9 @@ ScatterData a4 4 ;New Length (=Old Length rounded up
WriteScatBlk a4 6*4 ;Here is the scatter special block
]
MsgFileOpen a4 4
MsgFileBlock a4 4*4
[ HotPlug
AttCBCount # 1
DetCBCount # 1
......
......@@ -193,37 +193,6 @@ SetVOnR0
]
; ======
; Divide
; ======
; entry: R0=Numerator, R1=Denominator
; exit: R0=Result, R1=Remainder
Divide ROUT
Push "R2,LR"
MOV LR, R1 ; temp = den
CMPS LR, R0, LSR #1 ; shift temp left unless it would be > num
10
MOVLS LR, LR, LSL #1
CMPLS LR, R0, LSR #1
BLS %BT10
MOV R2, #0 ; init result
20
CMPS R0, LR ; if subtraction possible
SUBCS R0, R0, LR ; do it
ADC R2, R2, R2 ; shift bit into result
MOV LR, LR, LSR #1 ; move temp right
CMPS LR, R1 ; loop if not done
BHS %BT20
MOV R1, R0 ; mod
MOV R0, R2 ; div
Pull "R2,PC"
; =============
; ReadCMOSflags
; =============
......@@ -416,8 +385,8 @@ ParseAnyDrive ROUT
]
Pull "PC",CS
10
baddr R0, BadDriveErrBlk
BL SetV
ADRL R0, ErrorBlock_SCSIFSBadDrive
BL CopyError
Pull "PC"
......@@ -432,22 +401,16 @@ ParseAnyDrive ROUT
; exit if error V set, R0 result
WrDec ROUT
Push "R0,R1,LR"
MOV R1, #10
BL Divide ; (R0,R1->R0,R1)
TEQS R0, #0
BEQ %FT10
BL WrDec ; (R0->R0,V)
B %FT20
10
MOV R0, #" "
SWI XOS_WriteC ; (R0->R0,V)
20
ADDVC R0,R1,#"0"
SWIVC XOS_WriteC ; (R0->R0,V)
95
Push "R0-R2,LR"
MOV R2, #4 ; Temporary buffer size
SUB SP, SP, R2
MOV R1, SP
SWI XOS_ConvertCardinal1
SWIVC XOS_WriteI+' '
SWIVC XOS_Write0
ADD SP, SP, #4
STRVS R0,[SP]
Pull "R0,R1,PC"
Pull "R0-R2,PC"
[ AutoDetect
MapDevToDrv ROUT
......@@ -622,7 +585,7 @@ CDB_Inquiry
; check if this drive is 'disabled'. A drive is 'disabled' if its
; inquiry string from offset 8 to offset 31 inclusive matches one
; in file Boot:Choices.SCSIFS.Hide
; in file Choices:SCSIFS.Hide
; otherwise it is allowed.
; in : R1=driveID
; out: EQ if not allowed, else NE
......@@ -645,22 +608,13 @@ CheckDriveAllowed ROUT
TEQ R4, #0
BNE CDANotAllowed ; wont allow if no full enquiry response
Push "R3"
ADR R0, BootPath
MOV R1, R3
MOV r2, #-1
MOV R3, #0
MOV R4, #0
SWI XOS_ReadVarVal ; does it exist?
TEQ R2, #0
Pull "R3", EQ ; no
BEQ CDAAllowed
; the Boot: path exists.. look for our choices.Hide file
MOV R0, #&4f ; 4f open R/O no path
MOV R0, #&4f ; 4f open R/O no path, error if a dir or not exist
ADRL R1, ChoicesHide
SWI XOS_Find
; choices didnt open
Pull "R3", VS ; no
BVS CDAAllowed
SWI XOS_Find ; look for our choices.Hide file
ADDVS SP, SP, #4 ; junk stacked R3
BVS CDAAllowed ; choices didnt open
MOV R1, R0 ; file handle
lp0 MOV R0, #4 ; use current pointer
......@@ -710,12 +664,12 @@ cmpr LDR R0, [R2], #-4 ; compare strings
; match found
MOV R0, #0
SWI XOS_Find ; close the file again
Pull "R3"
ADD SP, SP, #4 ; junk stacked R3
B CDANotAllowed
goteof MOV R0, #0
SWI XOS_Find ; close the file again
Pull "R3"
ADD SP, SP, #4 ; junk stacked R3
CDAAllowed
ADD SP, SP, #36 + 44
......@@ -727,10 +681,8 @@ CDANotAllowed
TEQ R0, R0
Pull "R0-R5,R8,PC" ; exit EQ.. not allowed
BootPath
DCB "Boot$Path",0
ChoicesHide
DCB "Boot:Choices.SCSIFS.Hide",0
DCB "Choices:SCSIFS.Hide",0
ALIGN
]
......
......@@ -364,28 +364,17 @@ Examine
96 ;Return error - NotWinnie
ADD SP,SP,#16
Pull "R1,R2"
ADR R0,err_NotWinnie
BL SetV
ADRL R0, ErrorBlock_SCSIFSBadSCSIType
BL CopyError
B %BT95
97 ;Return error - BadBlockSize
ADD SP,SP,#16
Pull "R1,R2"
ADR R0,err_BadBlockSize
BL SetV
ADRL R0, ErrorBlock_SCSIFSSectorSizeNotSupported
BL CopyError
B %BT95
err_NotWinnie
DCD 42 ; >>>>Proper number
DCB "Bad SCSI device type",0
ALIGN
err_BadBlockSize
DCD 43 ; >>>>Proper number
DCB "Bad block size, must be 256/512/1024",0
ALIGN
[ FloppySupport
; ===========
......@@ -443,7 +432,7 @@ DiscString
DoPollPeriod
Push "LR"
MOV R5, #PollPeriod
baddr R6, DiscString
ADR R6, DiscString
Pull "PC"
; =======
......
......@@ -20,10 +20,10 @@ FSCreateBlock
DCB EjectBit+CreateFlag_FixedDiscPollChangeSupport
DCB (CreateFlag_DriveStatusWorks:SHR:8)+(BigBit:SHR:8)+(NewErrorBit:SHR:8)
DCB 0,fsnumber_SCSIFS
DCD CreateTitle ; >>>RCM was ScsiFsTitle
DCD ScsiFsBootText