From c210b256709ed71bbbf36ad130f3f83c8d9c469d Mon Sep 17 00:00:00 2001
From: Andrew Hodgkinson <ahodgkin@gitlab.riscosopen.org>
Date: Fri, 28 Apr 2000 14:35:45 +0000
Subject: [PATCH] Extensions to modulewrap.s.

Detail:
  UsePathForHelpMessages switch added - if the symbol is defined, Messages
  are obtained from <AppName>:Messages, requiring an <AppName>$Path system
  variable. Previously, they were always fetched from Resources which is
  only correct if the module is in ROM. This only influences the ability to
  give sensible *help output for *help Desktop_<AppName>. In addition, KJB
  added code to export the module private word pointer as
  'module_private_word_ptr'.
Admin:
  Tested inside PlugPlay RAM module build.

Version 5.05. Tagged as 'RISC_OSLib-5_05'
---
 VersionASM   |  8 ++++----
 VersionNum   | 14 +++++++-------
 s/modulewrap | 18 ++++++++++++++++++
 3 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/VersionASM b/VersionASM
index dac7aaf..d904cc7 100644
--- a/VersionASM
+++ b/VersionASM
@@ -6,9 +6,9 @@
                         GBLS    Module_MinorVersion
                         GBLS    Module_Date
                         GBLS    Module_FullVersion
-Module_MajorVersion     SETS    "5.04"
-Module_Version          SETA    504
+Module_MajorVersion     SETS    "5.05"
+Module_Version          SETA    505
 Module_MinorVersion     SETS    ""
-Module_Date             SETS    "10 Apr 2000"
-Module_FullVersion      SETS    "5.04"
+Module_Date             SETS    "28 Apr 2000"
+Module_FullVersion      SETS    "5.05"
                         END
diff --git a/VersionNum b/VersionNum
index 91bcdaf..e9833ee 100644
--- a/VersionNum
+++ b/VersionNum
@@ -1,15 +1,15 @@
-/* (5.04)
+/* (5.05)
  *
  * This file is automatically maintained by srccommit, do not edit manually.
  *
  */
-#define Module_MajorVersion_CMHG        5.04
+#define Module_MajorVersion_CMHG        5.05
 #define Module_MinorVersion_CMHG        
-#define Module_Date_CMHG                10 Apr 2000
+#define Module_Date_CMHG                28 Apr 2000
 
-#define Module_MajorVersion             "5.04"
-#define Module_Version                  504
+#define Module_MajorVersion             "5.05"
+#define Module_Version                  505
 #define Module_MinorVersion             ""
-#define Module_Date                     "10 Apr 2000"
+#define Module_Date                     "28 Apr 2000"
 
-#define Module_FullVersion              "5.04"
+#define Module_FullVersion              "5.05"
diff --git a/s/modulewrap b/s/modulewrap
index a2a6908..26863cc 100644
--- a/s/modulewrap
+++ b/s/modulewrap
@@ -19,6 +19,8 @@
 ; Changes: PJC: 15-Aug-91: Fixed Application_Code so that if an error occurs when
 ;                          Filer_Action executes the wimpslot command, R0 isn't corrupted
 ;                          Also added "GET Hdr:Variables"
+;        ADH: 28-Apr-2000: UsePathForHelpMessages switch added - makes RAM modules work;
+;                          exports private word pointer as 'module_private_word_ptr'.
 
         GET     s.AppName             ; defines the name of this module
 
@@ -116,7 +118,11 @@ Application_Help
   ]
  |
   [ International_Help <> 0
+   [ :DEF: UsePathForHelpMessages
+Message_FileName        DCB     ApplicationName,":Messages",0
+   |
 Message_FileName        DCB     "Resources:Resources.",ApplicationName,".Messages",0
+   ]
 Application_Syntax      DCB     ApplicationName,"Syntax",0
 Application_Help        DCB     ApplicationName,"Help",0
   |
@@ -453,6 +459,12 @@ ModuleWrap_Start ROUT
 
         MOV     r12, r1
 
+        ; put a copy of the private word into the data for the
+        ; app to get hold of if necessary
+        LDR     lr, module_private_word_ptr_adcon
+        LDR     r0, [sl, #-536]
+        STR     r12, [lr, r0]
+
         ; call the application
         BL      |_clib_entermodule|
 
@@ -757,4 +769,10 @@ $GetRoundObjAsm
         DCD     0                       ; provide terminator automatically
  ]
 
+        AREA    ModuleWrapData,DATA
+
+        EXPORT  module_private_word_ptr
+module_private_word_ptr
+        DCD     0
+
         END
-- 
GitLab