Commit 4555b88f authored by Ben Avison's avatar Ben Avison
Browse files

Changes for RISC OS 5.

Detail:
  * Merged in RISCOS Ltd's changes - just an Ursula service call table, and
    added fast reject code, which was missing for some reason
  * Moved resources here from CDFSResources. Allows tokenisation to happen.
    Also taken the opportunity to remove the separate sprite files in
    Resources:$.Resources.CDFSFiler, since they've been in the Wimp ROM sprites
    for ages; CDFSFiler will now ignore them even if they are present
  * Uses objasm and shared makefiles
  * 32-bit compatible
Admin:
  Not tested.

Version 2.42. Tagged as 'CDFSFiler-2_42'
parent b90d0bc5
......@@ -14,3 +14,4 @@
|
Dir <Obey$Dir>
amu_machine clean
stripdepnd
......@@ -21,53 +21,13 @@
# ---- ---- -----------
# 25-May-94 AMcC Created.
# 27-Feb-95 AMcC Resources now copied to CDFSRes
# 05-Nov-02 BJGA Rewritten to use shared makefiles
#
#
# Program specific options:
#
COMPONENT = CDFSFiler
SOURCE = s.CDFSFiler
TARGET = rm.CDFSFiler
RDIR = Resources
LDIR = ${RDIR}.${LOCALE}
RESDIR = ^.CDFSRes.Resources.${Locale}.Resources.${COMPONENT}
#
# 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
#
# Generic rules:
#
rom: ${TARGET}
@echo ${COMPONENT}: rom module built
export:
@echo ${COMPONENT}: export complete
install_rom: ${TARGET}
${CP} ${TARGET} ${INSTDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: rom module installed
resources:
@echo ${COMPONENT}: Resources are in CDFSRes
clean:
${RM} ${TARGET}
${STRIP}
@echo ${COMPONENT}: cleaned
RESOURCEEXTRA = resources_templates
${TARGET}: ${SOURCE}
${AS} ${AFLAGS} -To $@ -From ${SOURCE}
include StdTools
include AAsmModule
# Dynamic dependencies:
Banner:CDFS Filer
T00:CDFS::n
M00:Dismount
M01/T01:Configure
M02:Share
M03:Volume...
M10/T03:Buffers
M11/T04:Drives
T02:Share style
M20:Not shared
M21:Shared...
M30:None
M31:8K
M32:16K
M33:32K
M34:64K
M35:128K
M36:256K
M37:512K
BNK:
#{HelpTokens}
CDI:\TCD-ROM drive %0 icon.|M\Sdisplay the root directory.
DIS:\Sdismount the disc.
CON:\Ralter the CDFS configuration.
BUF:\Ralter the CDFS buffer size.
SHR:\Rshare the disc
DRV:\Ralter the number of CD-ROM drives.
CBF:\Sto alter the CDFS buffer size.
CDR:Enter the new number of drives and press Return.
NSH:Click to unshare the disc
SHP:Click to share the disc
VOL:Change the maximum volume level.
#{DictTokens}
NoDrive:No CD-ROM drive present
;
; 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.41"
Module_Version SETA 241
Module_MajorVersion SETS "2.42"
Module_Version SETA 242
Module_MinorVersion SETS ""
Module_Date SETS "30 Nov 2000"
Module_ApplicationDate2 SETS "30-Nov-00"
Module_ApplicationDate4 SETS "30-Nov-2000"
Module_Date SETS "05 Nov 2002"
Module_ApplicationDate SETS "05-Nov-02"
Module_ComponentName SETS "CDFSFiler"
Module_ComponentPath SETS "RiscOS/Sources/FileSys/CDFS/CDFSFiler"
Module_FullVersion SETS "2.41"
Module_HelpVersion SETS "2.41 (30 Nov 2000)"
Module_FullVersion SETS "2.42"
Module_HelpVersion SETS "2.42 (05 Nov 2002)"
END
/* (2.41)
/* (2.42)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.68.
*
*/
#define Module_MajorVersion_CMHG 2.41
#define Module_MajorVersion_CMHG 2.42
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 30 Nov 2000
#define Module_Date_CMHG 05 Nov 2002
#define Module_MajorVersion "2.41"
#define Module_Version 241
#define Module_MajorVersion "2.42"
#define Module_Version 242
#define Module_MinorVersion ""
#define Module_Date "30 Nov 2000"
#define Module_Date "05 Nov 2002"
#define Module_ApplicationDate2 "30-Nov-00"
#define Module_ApplicationDate4 "30-Nov-2000"
#define Module_ApplicationDate "05-Nov-02"
#define Module_ComponentName "CDFSFiler"
#define Module_ComponentPath "RiscOS/Sources/FileSys/CDFS/CDFSFiler"
#define Module_FullVersion "2.41"
#define Module_HelpVersion "2.41 (30 Nov 2000)"
#define Module_FullVersion "2.42"
#define Module_HelpVersion "2.42 (05 Nov 2002)"
#define Module_LibraryVersionInfo "2:42"
......@@ -60,8 +60,6 @@
; ReportError
;**************************************************************************
Module_BaseAddr
GET Hdr:ListOpts
GET Hdr:Macros
GET Hdr:System
......@@ -180,7 +178,6 @@ icb_validation # 1 ; "S" for validation string
icb_drivetype # 12 ; first byte is "h" or "f"
^ 0
icb_drivenumber # 4 ; ":nn",0
ALIGN
; format of disc name blocks (fixed size, held in main workspace)
......@@ -306,9 +303,9 @@ driveno * m_cdromdisc + m_title + :LEN:"CDFS:"
; Module header
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
LEADR Module_LoadAddr
AREA |CDFSFiler$$Code|, CODE, READONLY, PIC
ASSERT (.=Module_BaseAddr)
Module_BaseAddr
DCD CDFSFiler_Start -Module_BaseAddr
DCD CDFSFiler_Init -Module_BaseAddr
......@@ -326,6 +323,7 @@ driveno * m_cdromdisc + m_title + :LEN:"CDFS:"
|
DCD 0
]
DCD CDFSFiler_ModuleFlags -Module_BaseAddr
CDFSFiler_HelpString
DCB "CDFSFiler"
......@@ -354,6 +352,9 @@ CDFSFiler_Banner DCB "CDFS Filer", 0
ALIGN
CDFSFiler_ModuleFlags
DCD ModuleFlag_32bit
CDFSFiler_CommandTable
; Name Max Min Flags
......@@ -368,11 +369,13 @@ CDFSFiler_StarCommand
; This is now in the Resources FS
;-----------------------------------------------
[ {FALSE}
[ Module_Version > 201
spritefile = "IconSprites <CDFSFiler$Path>Sprites", 0
spritefile = "IconSprites CDFSFiler:Sprites", 0
|
spritefile = "IconSprites CDFS::29.$.SPRITES", 0
]
]
ALIGN
;-----------------------------------------------
......@@ -385,7 +388,7 @@ spritefile = "IconSprites CDFS::29.$.SPRITES", 0
[ Module_Version > 201
CDFSFiler_Init ENTRY "r1-r5"
CDFSFiler_Init Entry "r1-r5"
; initialise CDFSFiler$Path if not already done
......@@ -404,10 +407,7 @@ CDFSFiler_Init ENTRY "r1-r5"
MOVEQ r3, #0
MOVEQ r4, #VarType_String
SWIEQ XOS_SetVarVal
EXIT VS
EXITS
EXIT
Path DCB "CDFSFiler$Path"
DCB 0
......@@ -425,7 +425,7 @@ PathDefault DCB "Resources:$.Resources.CDFSFiler."
[ Module_Version > 201
Desktop_CDFSFiler_Code ENTRY
Desktop_CDFSFiler_Code Entry
Debug startup, "Desktop_CDFSFiler_Code"
......@@ -461,7 +461,7 @@ ErrorBlock_CantStartCDFSFiler
| ; Old way
Desktop_CDFSFiler_Code ENTRY
Desktop_CDFSFiler_Code Entry
LDR r14, [r12]
CMP r14, #0
......@@ -474,7 +474,8 @@ Desktop_CDFSFiler_Code ENTRY
SWIEQ XOS_Module
01
ADR r0, ErrorBlock_CantStartCDFSFiler
SETV
CMP r0, #&80000000
CMNVC r0, #&80000000 ; SETV
EXIT
ErrorBlock_CantStartCDFSFiler
......@@ -490,13 +491,37 @@ ErrorBlock_CantStartCDFSFiler
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ServiceTable
DCD 0
DCD ServiceUrsula - Module_BaseAddr
DCD Service_Reset
DCD Service_StartFiler
DCD Service_StartedFiler
DCD Service_FilerDying
[ Module_Version > 201
DCD Service_MessageFileClosed
]
DCD 0
DCD ServiceTable - Module_BaseAddr
CDFSFiler_Service ROUT
MOV r0,r0
TEQ r1, #Service_Reset
[ Module_Version > 201
TEQNE r1, #Service_MessageFileClosed
]
TEQNE r1, #Service_FilerDying
TEQNE r1, #Service_StartFiler
TEQNE r1, #Service_StartedFiler
MOVNE pc, lr
ServiceUrsula
TEQ r1, #Service_Reset ; &27
BEQ CDFSFiler_Service_Reset
[ Module_Version > 201
TEQ r1, #Service_MessageFileClosed
TEQ r1, #Service_MessageFileClosed ; &5e
BEQ CDFSFiler_Service_MessageFileClosed
]
......@@ -511,7 +536,7 @@ CDFSFiler_Service ROUT
; Drop through to...
CDFSFiler_Service_StartedFiler ENTRY
CDFSFiler_Service_StartedFiler Entry
Debug startup, "CDFSFiler_Service_StartedFiler"
......@@ -522,7 +547,7 @@ CDFSFiler_Service_StartedFiler ENTRY
EXIT
CDFSFiler_Service_StartFiler ENTRY "r0-r3"
CDFSFiler_Service_StartFiler Entry "r0-r3"
Debug startup, "CDFSFiler_Service_StartFiler"
......@@ -561,7 +586,7 @@ CDFSFiler_Service_StartFiler ENTRY "r0-r3"
MOV pc, lr
CDFSFiler_Service_Reset ENTRY "r0-r6"
CDFSFiler_Service_Reset Entry "r0-r6"
LDR r2, [r12] ; cancel 'don't start' flag
CMP r2, #0
......@@ -573,15 +598,15 @@ CDFSFiler_Service_Reset ENTRY "r0-r6"
STRGT r0, mytaskhandle
BLGT freeworkspace
EXITS ; Sorry, but no can do errors here
EXIT
[ Module_Version > 201
CDFSFiler_Service_MessageFileClosed ENTRY "r0-r2,r12"
CDFSFiler_Service_MessageFileClosed Entry "r0-r2,r12"
LDR r12, [r12] ; are we active?
CMP r12, #0
EXITS LE
EXIT LE
Debug service,"Service_MessageFileClosed r0=",r0
......@@ -596,19 +621,20 @@ CDFSFiler_Service_MessageFileClosed ENTRY "r0-r2,r12"
STRB r2, [r1]
]
EXITS
EXIT
]
LTORG
CDFSFiler_Die ROUT
CDFSFiler_Service_FilerDying ENTRY "r0-r6"
CDFSFiler_Service_FilerDying Entry "r0-r6"
LDR wp, [r12]
BL freeworkspace
EXITS ; Sorry, but no can do errors here
CMP r0, #0 ; Sorry, but no can do errors here
EXIT
......@@ -726,7 +752,7 @@ w_volume DCB "Configure",0,0,0
; r5 -> name of relevant entry
; r6 = position to search from
load_template ENTRY , 16 ; 16 bytes of stack for name
load_template Entry , 16 ; 16 bytes of stack for name
MOV lr, sp
Push "r1, r2"
MOV r1, lr
......@@ -803,9 +829,10 @@ CDFSFiler_Start ROUT
; ADRL r2, spritefile
; SWI XWimp_SpriteOp
[ {FALSE} ; don't do this, they've been in the Wimp's ROM sprite pool for yonks
addr r0, spritefile
SWI XOS_CLI
]
BL SetUpIconBar
BVS ErrorAbort ; frees workspace but marks it invalid
......@@ -883,7 +910,8 @@ TemplateErrorAbort
Push "r0"
SWI XWimp_CloseTemplate
Pull "r0"
SETV
CMP r0, #&80000000
CMNVC r0, #&80000000 ; SETV
B ErrorAbort
01
......@@ -962,7 +990,7 @@ event_key_pressed
TEQ r0, #13
BEQ GoShare_disc
ENTRY ; Otherwise, process key.
Entry ; Otherwise, process key.
SWI XWimp_ProcessKey
EXIT
......@@ -982,7 +1010,7 @@ event_key_pressed
; Out all regs may be corrupted - going back to PollWimp
event_mouse_click ENTRY
event_mouse_click Entry
LDMIA r1, {r0-r4} ; set mousex, mousey, buttonstate
ADR r14, mousedata ; windowhandle, iconhandle
......@@ -1386,7 +1414,7 @@ get_volume_level
CMP r2, r0
MOVGT r0, r2
CLRV
CMP r0, #0 ; CLRV
Pull "r1-r7, pc"
......@@ -1441,7 +1469,7 @@ set_volume_level
SWI XCD_SetAudioParms
SVL_End
CLRV
CMP r0, #0 ; CLRV
Pull "r0-r7, pc"
......@@ -1463,8 +1491,8 @@ FilerOpenDirCommand DCB "%Filer_OpenDir ",0
[ Module_Version >= 213
photo_disc_sprite = "Spcddisc", 0
audio_disc_sprite = "Sacddisc", 0
ALIGN
]
ALIGN
click_select_iconbar ROUT
......@@ -1593,7 +1621,7 @@ click_select_iconbar ROUT
SWI XHourglass_Off
CLRV
CMP r0, #0 ; CLRV
[ {FALSE}
; No longer store the error on the stack.
......@@ -1613,7 +1641,8 @@ not_audio ; - so must be an error
|
Pull "r0"
]
SETV
CMP r0, #&80000000
CMNVC r0, #&80000000 ; SETV
EXIT
| ; old boring way
......@@ -1631,9 +1660,9 @@ photocd_filename = ".$.PHOTO_CD.INFO/PCD", 0
[ ReadCDIDiscs
CDI_filename = ".$.MPEGAV", 0
ALIGN
]
ALIGN
open_dir
......@@ -1820,7 +1849,7 @@ change_icon_sprite ROUT
; In r0 = message action
; r1 -> media name
messagetoFiler ENTRY
messagetoFiler Entry
SUB sp, sp, #256 ; make temp frame for message
STR r0, [sp, #message_action]
......@@ -1917,7 +1946,7 @@ Sharemodule DCB "ShareFS" ; module for sparrow share modu
; Entry: R4 = icon handle (in icon bar)
; Exit: R1 --> drive spec for this drive
matchdriveicon ENTRY "r2"
matchdriveicon Entry "r2"
Debug menus,"matchdriveicon"
......@@ -1954,7 +1983,8 @@ matchdriveicon ENTRY "r2"
BL lookuperror
|
ADR r0, err_noicon ; OLD way of erroring
SETV ;
CMP r0, #&80000000
CMNVC r0, #&80000000 ; SETV
]
EXIT
......@@ -1982,7 +2012,7 @@ err_noicon
; A menu is created with the title above the x,y values you feed it, with
; the top left hand corner being at the x,y position
CreateMenu ENTRY "r2, r3"
CreateMenu Entry "r2, r3"
STR r1, menuhandle
LDR r2, mousex
......@@ -2047,7 +2077,7 @@ mv_configure DCB "A1234567890", 0 ; allow numbers only
; New way of making international menus - RISC OS 3 ONLY
;--------------------------------------------------------------
CopyMenus ENTRY "r1-r11"
CopyMenus Entry "r1-r11"
Debug menus,"CopyMenus"
......@@ -2064,9 +2094,7 @@ CopyMenus ENTRY "r1-r11"
ADRVCL r2, ram_menustart
MOVVC r3, #ram_menuend-ram_menustart
SWIVC XMessageTrans_MakeMenus
EXIT VS
EXITS
EXIT ; return current V bit
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;
......@@ -2077,7 +2105,7 @@ CopyMenus ENTRY "r1-r11"
; Out all regs may be corrupted - going back to PollWimp
event_menu_select ENTRY
event_menu_select Entry
MOV r2, r1 ; r2 -> menu selection list
LDR r1, menuhandle ; r1 = menu handle
......@@ -2092,14 +2120,14 @@ event_menu_select ENTRY
LDRNE R1, menuhandle
SWINE XWimp_CreateMenu ; here we go again!
EXITS
EXIT
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; In r1 = menu handle
; r2 -> list of selections
DecodeMenu ENTRY
DecodeMenu Entry
decodelp
LDR r14, [r2], #4 ; r1 = selection no
......@@ -2215,7 +2243,7 @@ GCV_LookupError
GCV_Error
MOV r1, #2_010 ; Cancel button
BL ReportError
CLRV
CMP r0, #0 ;CLRV
EXIT
go_cd_dismount
......@@ -2324,7 +2352,7 @@ gocommand_window
; In r1 -> "CDFS::discname"
; Out dismounted, and any dirs 'CDFS::discname' closed
dismountit ENTRY "r1"
dismountit Entry "r1"
LDR r0, =Message_FilerCloseDir
BL messagetoFiler
......@@ -2354,7 +2382,7 @@ dismountit ENTRY "r1"
; Out [userdata..] = "CDFS:<command> <drive no>"
; r1 -> terminator (drive number inserted at [r1,#-2])
copycommand ENTRY
copycommand Entry
ADRL r1, userdata
ADR r2, CDFScolon
BL strcpy_advance
......@@ -2662,17 +2690,18 @@ delete_entry ; delete the entry in sharecd file when
03
EXIT
check_access ENTRY
check_access Entry
checkac Accpath, #17
CMP r0, #2
BLEQ check_sharefile
EXITS
CMP r0, #0 ; CLRV
EXIT
check_sharefile ENTRY
check_sharefile Entry
checkac fname1, #17
CMP r0, #1
BLEQ issue_shares
EXITS
EXIT
Dpath DCB "<AccessCD$dir>"
DCB 0
......@@ -2701,7 +2730,7 @@ fname1 DCB "<AccessCDS$dir>.sharecd"
LTORG
GoShare_disc
ENTRY
Entry
checkac Accpath, #17
CMP r0, #2
BNE %FT03
......@@ -2953,7 +2982,7 @@ GoShare_disc
EXIT
issue_shares ENTRY "r0-r12"
issue_shares Entry "r0-r12"
createf fname1, #&43
MOV r7, r0
MOV r4, #&0A
......@@ -3025,7 +3054,7 @@ issue_shares ENTRY "r0-r12"
MOV r1, r7
SWI XOS_Find
EXITS
EXIT
dotdollar1 DCB "." ; share $ with ...
dollar1 DCB "$", 0 ; directory title
......@@ -3035,7 +3064,7 @@ drivecd DCB "CDFS::"
DCB 0
ALIGN
unshare_previous ENTRY "r0-r12"
unshare_previous Entry "r0-r12"
MOV r6, #" "
MOV r3, #0 ; initialize buffer to 0
ADRL r9, m_tempdisc
......@@ -3139,9 +3168,9 @@ unshare_previous ENTRY "r0-r12"
BLVS ReportError
BVS ErrorAbort ; error from reporterror!
EXITS
EXIT
strcmp ENTRY
strcmp Entry
01 LDRB r10, [r1], #1
LDRB r14, [r5], #1
CMP r10, #0
......@@ -3154,13 +3183,13 @@ strcmp ENTRY
BEQ %BT01
MOV r2, #1
99
EXITS