Commit 073ebc25 authored by Ben Avison's avatar Ben Avison Committed by ROOL
Browse files

Enable modulewrapped applications to use ResGen

This utilises a weak symbol import so that if the symbol `Resources` resolves
at link time, it is called to discover the address of the resource file data
block(s) to be installed in ResourceFS. If this fails, it drops back to using
the `s.ResFiles` source file as previously, thereby ensuring compatibility
with components that have not yet been converted to use ResGen.

Since `Resources` is the default area name (and thus discovery function name)
used for ResGen in the shared makefiles, this makes it as simple as possible
to utilise it.

Version 6.08. Tagged as 'RISC_OSLib-6_08'
parent fa89c230
......@@ -9,12 +9,12 @@
GBLS Module_ApplicationDate
GBLS Module_HelpVersion
GBLS Module_ComponentName
Module_MajorVersion SETS "6.07"
Module_Version SETA 607
Module_MajorVersion SETS "6.08"
Module_Version SETA 608
Module_MinorVersion SETS ""
Module_Date SETS "06 Jul 2020"
Module_ApplicationDate SETS "06-Jul-20"
Module_Date SETS "05 Sep 2020"
Module_ApplicationDate SETS "05-Sep-20"
Module_ComponentName SETS "RISC_OSLib"
Module_FullVersion SETS "6.07"
Module_HelpVersion SETS "6.07 (06 Jul 2020)"
Module_FullVersion SETS "6.08"
Module_HelpVersion SETS "6.08 (05 Sep 2020)"
END
/* (6.07)
/* (6.08)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 6.07
#define Module_MajorVersion_CMHG 6.08
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 06 Jul 2020
#define Module_Date_CMHG 05 Sep 2020
#define Module_MajorVersion "6.07"
#define Module_Version 607
#define Module_MajorVersion "6.08"
#define Module_Version 608
#define Module_MinorVersion ""
#define Module_Date "06 Jul 2020"
#define Module_Date "05 Sep 2020"
#define Module_ApplicationDate "06-Jul-20"
#define Module_ApplicationDate "05-Sep-20"
#define Module_ComponentName "RISC_OSLib"
#define Module_FullVersion "6.07"
#define Module_HelpVersion "6.07 (06 Jul 2020)"
#define Module_LibraryVersionInfo "6:7"
#define Module_FullVersion "6.08"
#define Module_HelpVersion "6.08 (05 Sep 2020)"
#define Module_LibraryVersionInfo "6:8"
......@@ -42,6 +42,7 @@
IMPORT |_clib_initialisemodule|
IMPORT |_clib_entermodule|
IMPORT |_clib_finalisemodule|
IMPORT |Resources| [WEAK]
^ 0
old_exit_handler # 4
......@@ -607,9 +608,10 @@ ModuleWrap_Init
; If there are NO instantiations yet, this must be the first
[ :LNOT::DEF:FilerAct
BL countinstantiations
ADRLT r0, resourcefsfiles
SWILT XResourceFS_RegisterFiles ; ignore errors
CLRV ; (ResourceFS may not yet be present)
BGE %FT01
BL find_resources
SWI XResourceFS_RegisterFiles ; ignore errors
01 CLRV ; (ResourceFS may not yet be present)
]
Pull "pc"
......@@ -632,8 +634,10 @@ ModuleWrap_Die
Push "lr"
[ :LNOT::DEF:FilerAct
BL countinstantiations ; LT => we're the only one
ADRLT r0, resourcefsfiles
SWILT XResourceFS_DeregisterFiles
BGE %FT01
BL find_resources
SWI XResourceFS_DeregisterFiles
01
]
CLRV
Pull "pc"
......@@ -760,11 +764,23 @@ svc_reset4
[ :LNOT::DEF:FilerAct
svc_resourcefsstarting
Push "r0, lr"
ADR r0, resourcefsfiles
BL find_resources
MOV lr, pc ; lr -> return address
MOV pc, r2 ; r2 -> code to call
Pull "r0, pc" ; (r3 = workspace pointer)
find_resources
Push "r1-r3, r12, lr"
LDR r0, resgen_resources
TEQ r0, #0 ; weak symbol not defined
ADREQ r0, resourcefsfiles
MOVNE lr, pc
MOVNE pc, r0
Pull "r1-r3, r12, pc"
resgen_resources
DCD |Resources|
resourcefsfiles
GetRoundObjAsm SETS " GET s.ResFiles"
|
......
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