Commit df2541fb authored by Ben Avison's avatar Ben Avison
Browse files

Changes for RISC OS 5.

Detail:
  * Merged in RISCOS Ltd change: module no longer fails to intialise if no
    CDROMs are configured. This, along with their equivalent change in
    CDFS, allows the number of CDROMs to be configured up from 0 from the
    command line
  * Moved resources here from CDFSResources - allows tokenisation
  * Uses objasm and shared makefiles
  * 32-bit compatible
Admin:
  Not tested.

Version 2.37. Tagged as 'CDFSDriver-2_37'
parent 4b0d4bf7
......@@ -22,69 +22,15 @@
# 25-May-94 AMcC Created.
# 23-Feb-95 AMcC Resources now copied to CDFSRes
# 29-Nov-95 RWB Added install: option
# 05-Nov-02 BJGA Now uses shared makefiles
#
# Paths
#
EXP_HDR = <export$dir>
#
# Generic options:
#
MKDIR = cdir
AS = aasm
CP = copy
RM = remove
STRIP = stripdepnd
CFLAGS = -c -depend !Depend -IC:
AFLAGS = -depend !Depend -Stamp -quit -module
CPFLAGS = ~cfr~v
#
# Program specific options:
#
COMPONENT = CDFSDriver
EXPORTS = ${EXP_HDR}.CDROM ${EXP_HDR}.CDErrors
SOURCE = s.Main
TARGET = rm.CDFSDriver
RDIR = Resources
LDIR = ${RDIR}.${LOCALE}
CDFSRES = <src$dir>.OS_Core.FileSys.CDFS.CDFSRes
RESDIR = ${CDFSRES}.Resources.${Locale}.Resources.CDFSDriver.${COMPONENT}
#
# Generic rules:
#
rom: ${TARGET}
@echo ${COMPONENT}: rom module built
export: ${EXPORTS}
@echo ${COMPONENT}: export complete
install_rom: ${TARGET}
${CP} ${TARGET} ${INSTDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: rom module installed
resources:
@echo ${COMPONENT}: Resources are in CDFSRes
install: ${TARGET}
${CP} ${TARGET} ${INSTDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: module installed
clean:
${RM} ${TARGET}
${STRIP}
@echo ${COMPONENT}: cleaned
${TARGET}: ${SOURCE}
${AS} ${AFLAGS} -To $@ -From ${SOURCE}
${EXP_HDR}.CDROM: hdr.CDROM
${CP} hdr.CDROM $@ ${CPFLAGS}
COMPONENT = CDFSDriver
HEADER1 = CDROM
HEADER2 = CDErrors
RESFSDIR = ${RESDIR}.CDFSDriver.${TARGET}
ROM_SOURCE = Main.s
${EXP_HDR}.CDErrors: hdr.CDErrors
${CP} hdr.CDErrors $@ ${CPFLAGS}
include StdTools
include AAsmModule
# Dynamic dependencies:
......@@ -14,3 +14,4 @@
|
Dir <Obey$Dir>
amu_machine clean
stripdepnd
| Copyright 2002 Tematic 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 export
#{DictTokens}
NoConfD:No CD ROM drives configured
NoAlign:Area not word aligned
DrvNSup:CD-ROM drive not supported
ModNSup:CD mode not supported
CntPlay:Cannot play that data
DrvEmpt:CD-ROM drive empty
NoDrive:No CD-ROM drive present
BadMode:Bad addressing mode
BadMins:Bad minutes
BadSecs:Bad seconds
BadBlks:Bad blocks
PhysBad:Physical block bad
DLocked:CD-ROM drive drawer locked
BadData:Data in wrong mode
NoSubCh:Sub-channel not supported
BadDvID:Bad device id
BadCard:Bad card number
BadLUNN:Bad LUN number
NotAudi:Not an audio track
BadDisc:Compact disc is faulty
BadAddr:Not an addressable block
NotSupp:Drive does not support that
DrNPres:Soft-load driver not present
SWINSup:Soft-load driver does not support this CD_ SWI
NoMoreD:No more drivers can be added
NotRegd:Not registered
UnkCDOp:Unknown CD operation
;
; This file is automatically maintained by srccommit, do not edit manually.
; Last processed by srccommit version: 1.68.
;
GBLS Module_MajorVersion
GBLA Module_Version
GBLS Module_MinorVersion
GBLS Module_Date
GBLS Module_FullVersion
GBLS Module_ApplicationDate2
GBLS Module_ApplicationDate4
GBLS Module_ApplicationDate
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "2.36"
Module_Version SETA 236
Module_MajorVersion SETS "2.37"
Module_Version SETA 237
Module_MinorVersion SETS ""
Module_Date SETS "07 Dec 2000"
Module_ApplicationDate2 SETS "07-Dec-00"
Module_ApplicationDate4 SETS "07-Dec-2000"
Module_Date SETS "06 Nov 2002"
Module_ApplicationDate SETS "06-Nov-02"
Module_ComponentName SETS "CDFSDriver"
Module_ComponentPath SETS "RiscOS/Sources/HWSupport/CD/CDFSDriver"
Module_FullVersion SETS "2.36"
Module_HelpVersion SETS "2.36 (07 Dec 2000)"
Module_FullVersion SETS "2.37"
Module_HelpVersion SETS "2.37 (06 Nov 2002)"
END
/* (2.36)
/* (2.37)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.68.
*
*/
#define Module_MajorVersion_CMHG 2.36
#define Module_MajorVersion_CMHG 2.37
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 07 Dec 2000
#define Module_Date_CMHG 06 Nov 2002
#define Module_MajorVersion "2.36"
#define Module_Version 236
#define Module_MajorVersion "2.37"
#define Module_Version 237
#define Module_MinorVersion ""
#define Module_Date "07 Dec 2000"
#define Module_Date "06 Nov 2002"
#define Module_ApplicationDate2 "07-Dec-00"
#define Module_ApplicationDate4 "07-Dec-2000"
#define Module_ApplicationDate "06-Nov-02"
#define Module_ComponentName "CDFSDriver"
#define Module_ComponentPath "RiscOS/Sources/HWSupport/CD/CDFSDriver"
#define Module_FullVersion "2.36"
#define Module_HelpVersion "2.36 (07 Dec 2000)"
#define Module_FullVersion "2.37"
#define Module_HelpVersion "2.37 (06 Nov 2002)"
#define Module_LibraryVersionInfo "2:37"
......@@ -37,17 +37,6 @@ CDFSDriverErrorNumber SETA CDFSDriverErrorNumber + 1
ALIGN
MEND
; *******************************************
; *** Clear overflow flag - will set nzCv ***
; *******************************************
; Note: (AMcC 02-Feb-95)
; Not the same as CLRV Macro in Global Hdr CPU.Generic26
;
MACRO
$label CLV $cond
$label EORVSS pc, pc, # Overflow_Flag
MEND
; **********************************************************
; This will print a message if 'debug' = ON.
; **********************************************************
......@@ -127,4 +116,40 @@ $label [ debug=ON
]
MEND
MACRO
$label SWIExitVC $cond
$label [ "$cond"<>"AL" :LAND: "$cond"<>""
DCI &1A000002 :EOR: Cond_$cond ; branch over on opposite condition
]
CMP pc, pc
Pull "r0-r11, pc", EQ
Pull "r0-r11, pc",, ^
MEND
MACRO
$label SWIExitVS $cond
$label [ "$cond"<>"AL" :LAND: "$cond"<>""
DCI &1A000004 :EOR: Cond_$cond ; branch over on opposite condition
]
TEQ PC, PC
MSREQ CPSR_f, #Z_bit :OR: V_bit
Pull "r0-r11, pc", EQ
Pull "r0-r11, r14"
ORRS pc, r14, #V_bit
MEND
MACRO
$label VCLEAR $cond
$label CMP$cond R0, #0
MEND
MACRO
$label VSET $cond
$label [ "$cond"<>"AL" :LAND: "$cond"<>""
DCI &1A000001 :EOR: Cond_$cond ; branch over on opposite condition
]
CMP R0, #&80000000
CMNVC R0, #&80000000
MEND
END
......@@ -74,7 +74,7 @@ hostvdu * ON ; debug to host
debug * OFF ; prints debugging information
commanddebug * OFF ; Keeps a list of SWI's called
CheckConfiguredDrives * ON ; don't start up if no drives configured
CheckConfiguredDrives * OFF ; don't start up if no drives configured
;------------------------------------------------------------------
......
......@@ -61,14 +61,21 @@
cd_bytecopyinternal ROUT
STASH "r0-r11, r14"
BL cd_bytecopycommon
GRAB "r0-r11, pc"
cd_bytecopy
BL cd_bytecopycommon
SWIExitVC
cd_bytecopycommon
Push "r14"
;--------------------------
; Any bytes to copy ?
;--------------------------
TEQ r3, #0
Pull "r0-r11, pc", EQ, ^
Pull "pc", EQ
;--------------------------
......@@ -103,7 +110,7 @@ MovByt25
BGE MovByt25 ; do another 8 words
CMP r3, #-8 * 4 ; Quick test rather that chaining down
Pull "r0-r11, pc", EQ, ^ ; finished
Pull "pc", EQ ; finished
MovByt30
......@@ -114,7 +121,7 @@ MovByt30
LDMIA r1!, { r0, r4 - r5, r14 } ; NB. Order ! (?)
STMIA r2!, { r0, r4 - r5, r14 }
Pull "r0-r11, pc", EQ, ^ ; finished
Pull "pc", EQ ; finished
SUB r3, r3, #4 * 4
......@@ -127,7 +134,7 @@ MovByt40
LDMIA r1!, { r0, r14 } ; NB. Order ! (?)
STMIA r2!, { r0, r14 }
Pull "r0-r11, pc", EQ, ^ ; finished
Pull "pc", EQ ; finished
SUB r3, r3, #2 * 4
......@@ -140,7 +147,7 @@ MovByt50
LDR r0, [ r1 ], #4
STR r0, [ r2 ], #4
Pull "r0-r11, pc", EQ, ^ ; finished
Pull "pc", EQ ; finished
SUB r3, r3, #1 * 4
......@@ -148,7 +155,7 @@ MovByt50
MovByt60
ADDS r3, r3, #1*4 - 0*4 ; No more to do ?
Pull "r0-r11, pc", EQ, ^ ; finished
Pull "pc", EQ ; finished
LDR r0, [ r1 ] ; store remaining 1,2 or 3 bytes
......@@ -161,7 +168,7 @@ MovByt70
SUBS r3, r3, #1
BGT MovByt70
Pull "r0-r11, pc",,^ ; finished
Pull "pc" ; finished
......@@ -172,7 +179,7 @@ MovByt100
LDRB r0, [ r1 ], #1
STRB r0, [ r2 ], #1
SUBS r3, r3, #1
Pull "r0-r11, pc", EQ, ^ ; finished
Pull "pc", EQ ; finished
TST r2, #3
BNE MovByt100
......@@ -236,7 +243,7 @@ MovByt225
BGE MovByt225 ; do another 8 words
CMP r3, #-8 * 4 ; Quick test
Pull "r0-r11, pc", EQ, ^
Pull "pc", EQ
MovByt230
......@@ -258,7 +265,7 @@ MovByt230
STMIA r2!, { r0, r4 - r6 }
Pull "r0-r11, pc", EQ, ^
Pull "pc", EQ
SUB r3, r3, #4*4
MOV r0, r14, LSR r12 ; keep r0 prepared
......@@ -278,7 +285,7 @@ MovByt240
STMIA r2!, { r0, r4 }
Pull "r0-r11, pc", EQ, ^
Pull "pc", EQ
SUB r3, r3, #2*4
......@@ -295,7 +302,7 @@ MovByt250
STR r0, [ r2 ], #4
Pull "r0-r11, pc", EQ, ^
Pull "pc", EQ
SUB r3, r3, #1*4
MOV r0, r14, LSR r12 ; keep r0 prepared
......@@ -304,7 +311,7 @@ MovByt250
MovByt260
ADDS r3, r3, #1*4 - 0*4
Pull "r0-r11, pc", EQ, ^
Pull "pc", EQ
LDR r14, [ r1 ] ; store remaining 1..3 bytes
ORR r0, r0, r14, LSL r11
......@@ -317,7 +324,7 @@ MovByt270
SUBS r3, r3, #1
BGT MovByt270
Pull "r0-r11, pc",,^
Pull "pc"
......
......@@ -77,9 +77,9 @@ cd_version ROUT
;
;-----------------------------------------------------------------------------------------------
Pull "r0-r11, r14"
ADR r0, VersionMessage
BICS pc, r14, #Overflow_Flag
STR r0, [sp, #0*4]
SWIExitVC
VersionMessage DCD Module_Version
= "$Module_FullVersion", " CD_SWI control module by Eesox", 0
......@@ -95,9 +95,9 @@ cd_lasterror ROUT
;
;-----------------------------------------------------------------------------------------------
Pull "r0-r11, r14"
LDR r0, LastErrorNumber
BICS pc, r14, #Overflow_Flag
STR r0, [sp, #0*4]
SWIExitVC
......@@ -201,7 +201,7 @@ cd_readdata ROUT
Pull "r1-r5"
Pull "r0-r11, pc", VC, ^
SWIExitVC VC
LDR r6, [ r0 ]
......@@ -297,7 +297,7 @@ cd_seekto ROUT
Pull "r1-r2"
Pull "r0-r11, pc", VC, ^
SWIExitVC VC
;-----------------------------------------------
; If the error is 'Busy' because playing audio
......@@ -352,7 +352,7 @@ cd_inquiry ROUT
BVS error_handler
Pull "r0-r11, pc",, ^
SWIExitVC
;-----------------------------------------------------------------------------------------------
cd_discused ROUT
......@@ -422,7 +422,7 @@ cd_discused ROUT
TEQ r0, #MSFFormat
STRNE r2, [ r1 ]
Pull "r0-r11, pc", NE, ^
SWIExitVC NE
......@@ -440,7 +440,7 @@ cd_discused ROUT
; save the important bits in the users area
STR r1, [ r3 ]
Pull "r0-r11, pc",, ^
SWIExitVC
;-----------------------------------------------------------------------------------------------
cd_driveready ROUT
......@@ -468,9 +468,9 @@ cd_driveready ROUT
SWI XSCSI_Op
Pull "r0-r11, r14", VC
MOVVC r0, #0
BICVCS pc, r14, #Overflow_Flag
STRVC r0, [sp, #0*4]
SWIExitVC VC
;------------------------------------------
; If UnitAttention then update disc changed
......@@ -483,9 +483,9 @@ cd_driveready ROUT
BEQ error_handler
;------------------------------------------
Pull "r0-r11, r14"
MOV r0, #1
BICS pc, r14, #Overflow_Flag
STR r0, [sp, #0*4]
SWIExitVC
;-----------------------------------------------------------------------------------------------
cd_stopdisc ROUT
......@@ -514,7 +514,7 @@ cd_stopdisc ROUT
BVS error_handler
Pull "r0-r11, pc",, ^
SWIExitVC
;-----------------------------------------------------------------------------------------------
......@@ -543,7 +543,7 @@ cd_opendrawer ROUT
SWI XSCSI_Op
Pull "r0-r11, pc", VC, ^
SWIExitVC VC
;--------------------------------------------------
; If Illegal Request then the drawer must be locked
......@@ -572,7 +572,7 @@ cd_converttolba ROUT
STR r1, [ r13, #4 ]
Pull "r0-r11, pc",, ^
SWIExitVC
;-----------------------------------------------------------------------------------------------
......@@ -592,7 +592,7 @@ cd_converttomsf ROUT
STR r1, [ r13, #4 ]
Pull "r0-r11, pc",, ^
SWIExitVC
;-----------------------------------------------------------------------------------------------
......@@ -624,9 +624,9 @@ cd_drivestatus ROUT
; Everything OK
;---------------
Pull "r0-r11, r14", VC
MOVVC r0, #1
BICVCS pc, r14, #Overflow_Flag
STRVC r0, [sp, #0*4]
SWIExitVC VC
;---------------------
; What error occured ?
......@@ -637,25 +637,25 @@ cd_drivestatus ROUT
LDR r14, =NotReady
SUBS r14, r1, r14
SUBNES r14, r14, #&201d0 - NotReady ; Unknown error
Pull "r0-r11, r14", EQ
MOVEQ r0, #4
BICEQS pc, r14, #Overflow_Flag
STREQ r0, [sp, #0*4]
SWIExitVC EQ
; Busy
LDR r14, =Busy
TEQ r1, r14
LDRNE r14, =NoSense
TEQNE r1, r14
Pull "r0-r11, r14", EQ
MOVEQ r0, #2
BICEQS pc, r14, #Overflow_Flag
STREQ r0, [sp, #0*4]
SWIExitVC EQ
; No drive - unavailable
LDR r14, =TimeoutSelection
TEQ r1, r14
Pull "r0-r11, r14", EQ
MOVEQ r0, #8
BICEQS pc, r14, #Overflow_Flag
STREQ r0, [sp, #0*4]
SWIExitVC EQ
;-----------------
; Some other error
......@@ -691,7 +691,7 @@ cd_control ROUT
BVS error_handler
Pull "r0-r11, pc",, ^
SWIExitVC
;-----------------------------------------------------------------------------------------------
......@@ -717,7 +717,7 @@ cd_reset ROUT
BVS error_handler
Pull "r0-r11, pc",, ^
SWIExitVC
;-----------------------------------------------------------------------------------------------
......@@ -758,12 +758,10 @@ cd_checkdrive ROUT
;-------------------------
Pull "r0-r11, r14"
MOVVC r0, #0
MOVVS r0, #15
BICS pc, r14, #Overflow_Flag
STR r0, [sp, #0*4]
SWIExitVC
;-----------------------------------------------------------------------------------------------
cd_readuserdata ROUT
......@@ -1011,9 +1009,7 @@ RUDP_LastBlock
Push "r0-r4"
CLV
MOVS r9, r2
SUBS r9, r2, #0 ; clears V, also equivalent to CMP r2, #0
MOV r0, # LBAFormat
MOV r1, r4
......@@ -1096,8 +1092,7 @@ RUDP_LastBlock
]
Pull "r0-r11, r14"
BICS pc, r14, #Overflow_Flag
SWIExitVC
......@@ -1166,8 +1161,7 @@ cd_seekuserdata_plain ROUT
; Byte offset of less than 2048 means it must be in the first block
;-------------------------------------------------------------------
CMP r2, # USERDATA__MODE2FORM1
Pull "r0-r11, r14", LT
BICLTS pc, r14, #Overflow_Flag
SWIExitVC LT
;---------------------------------------------
......@@ -1193,8 +1187,7 @@ cd_seekuserdata_plain ROUT
STR r1, [ r13, # 4*1 ]
STR r2, [ r13, # 4*2 ]
Pull "r0-r11, r14"
BICS pc, r14, #Overflow_Flag
SWIExitVC
......
......@@ -41,13 +41,12 @@ ConvertToLBA ROUT
;
;----------------------------------------------------------------------------------------------
BIC r14, r14, #Overflow_Flag
;--------------------------------------------------
; If already in LBA format then exit straight away
;--------------------------------------------------
TEQ r0, #LBAFormat
MOVEQS pc, r14
CMP r0, #LBAFormat
MOVEQ pc, r14 ; V clear