From 4a34da4f2d620b8c3aaf7a5c026f991b9951f25c Mon Sep 17 00:00:00 2001
From: Kevin Bracey <kbracey@gitlab.riscosopen.org>
Date: Thu, 1 Oct 1998 07:42:53 +0000
Subject: [PATCH] Following changes folded in from the start of the Ursula
 branch:

CPU type messages internationalised.
"Unknown OS_PlatformFeatures reason code" internationalised.
RunningOnEmul flag tweaked.
MorrisIDString conditional removed.
New modules added to SWI list at the end of the chain, on grounds that
the first-registered modules are probably more important.
*ChangeDynamicArea moved into UtilityModule from TaskManager.

Version 4.65. Tagged as 'Kernel-4_65'
---
 Resources/UK/CmdHelp        | Bin 10246 -> 10546 bytes
 Resources/UK/Messages       |  18 +++-
 Resources/UK/Omega/Messages |  12 ++-
 VersionASM                  |   6 +-
 VersionNum                  |  12 +--
 s/GetAll                    |   5 +-
 s/Kernel                    |  12 ++-
 s/ModHand                   |  20 +++-
 s/NewReset                  |  36 +++++--
 s/TMOSHelp                  |  18 ++++
 s/Utility                   | 189 ++++++++++++++++++++++++++++++------
 11 files changed, 262 insertions(+), 66 deletions(-)

diff --git a/Resources/UK/CmdHelp b/Resources/UK/CmdHelp
index b2fb718a99ddf8be7ec5be1f6608e259a7efeb48..fd9ce0d1a5cf314eef84317f79b32d7bbd05ce37 100644
GIT binary patch
delta 304
zcmZvWL2AN47=;CQp5lS7B=!JOgkX?@1SHe0LKc4~zfB-B6EY)pT8cZ5;5o!zuxZ+b
zM0bzx!F%6vb4kvh!^5&5{l<~kq)Hh!Okbm?m*;pHh4bl62dXObZs7`sEk77$+vTm%
z4w7WS0j#%<6>Qy<jzR5WfFz8OmsSQ)Cf`+m7^HI?tZbMy6f4tsID^-AnjLoa!(b%-
wO@!Bu_H*1ZN@uI~T>Q#B>P5QFGNd!no%diuYGwOu9EUw5I-zU$T@O!_AIH~dqyPW_

delta 12
TcmdlK)E2OzntAhbmTnaQBt``m

diff --git a/Resources/UK/Messages b/Resources/UK/Messages
index 484def0..a063655 100644
--- a/Resources/UK/Messages
+++ b/Resources/UK/Messages
@@ -12,13 +12,13 @@ Extn:(Extn ROM %0)
 Modules:No. Position Workspace Name
 Number:(Number)
 Macro:(Macro)
-Result:Result is %0, value : 
+Result:Result is %0, value :
 Integer:an integer
 String:a string
 ROMMTitle:No. Position|IModule Name|I|IVersion|IStatus|M|J
 SYSROM:System ROM
-EXTROM:Extn ROM 
-PODROM:Podule 
+EXTROM:Extn ROM
+PODROM:Podule
 Active:Active
 Dormant:Dormant
 Unplugged:Unplugged
@@ -158,4 +158,14 @@ CTail1:|J|MWhere:|J|MD is a decimal number, a hexadecimal number preceded by &,|
 CTail2:by digits in the given base.|J|MItems within [ ] are optional.|J|MUse *Status to display the current settings.|J|M
 Zonk:Unknown OS_ScreenMode reason code
 SNoMask:Mask or Palette operations not supported in this display depth
-BadVIDCDiv:Bad VIDC divider value.
+BadVIDCDiv:Bad VIDC divider value
+BadPlatReas:Unknown OS_PlatformFeatures reason code
+
+600:ARM 600 Processor
+610:ARM 610 Processor
+700:ARM 700 Processor
+710:ARM 710 Processor
+7500:ARM 7500 Processor
+7500FE:ARM 7500FE Processor
+810:ARM 810 Processor
+SA110:StrongARM Processor
diff --git a/Resources/UK/Omega/Messages b/Resources/UK/Omega/Messages
index 9264eb0..7cc1e3c 100644
--- a/Resources/UK/Omega/Messages
+++ b/Resources/UK/Omega/Messages
@@ -158,4 +158,14 @@ CTail1:|J|MWhere:|J|MD is a decimal number, a hexadecimal number preceded by &,|
 CTail2:by digits in the given base.|J|MItems within [ ] are optional.|J|MUse *Status to display the current settings.|J|M
 Zonk:Unknown OS_ScreenMode reason code
 SNoMask:Mask or Palette operations not supported in this display depth
-BadVIDCDiv:Bad VIDC divider value.
+BadVIDCDiv:Bad VIDC divider value
+BadPlatReas:Unknown OS_PlatformFeatures reason code
+
+600:ARM 600 Processor
+610:ARM 610 Processor
+700:ARM 700 Processor
+710:ARM 710 Processor
+7500:ARM 7500 Processor
+7500FE:ARM 7500FE Processor
+810:ARM 810 Processor
+SA110:StrongARM Processor
diff --git a/VersionASM b/VersionASM
index cd16481..e6320a9 100644
--- a/VersionASM
+++ b/VersionASM
@@ -5,8 +5,8 @@
 			GBLA    Module_Version
 			GBLS	Module_MinorVersion
 			GBLS	Module_Date
-Module_MajorVersion	SETS    "4.64"
-Module_Version          SETA    464
+Module_MajorVersion	SETS    "4.65"
+Module_Version          SETA    465
 Module_MinorVersion	SETS	""
-Module_Date		SETS    "30 Sep 1998"
+Module_Date		SETS    "01 Oct 1998"
 		        END
diff --git a/VersionNum b/VersionNum
index e11d9d1..d9fb4d6 100644
--- a/VersionNum
+++ b/VersionNum
@@ -1,14 +1,14 @@
-/* (4.64)
+/* (4.65)
  *
  * This file is automatically maintained by srccommit, do not edit manually.
  *
  */
-#define Module_MajorVersion_CMHG     	4.64
+#define Module_MajorVersion_CMHG     	4.65
 #define Module_MinorVersion_CMHG	
-#define Module_Date_CMHG      		30 Sep 1998
+#define Module_Date_CMHG      		01 Oct 1998
 
-#define Module_MajorVersion     	"4.64"
-#define Module_Version                  464
+#define Module_MajorVersion     	"4.65"
+#define Module_Version                  465
 #define Module_MinorVersion		""
-#define Module_Date      		"30 Sep 1998"
+#define Module_Date      		"01 Oct 1998"
 
diff --git a/s/GetAll b/s/GetAll
index 4592466..773e80b 100644
--- a/s/GetAll
+++ b/s/GetAll
@@ -42,7 +42,7 @@
 
 ;whether compiling to run on (Risc PC) emulator
                 GBLL    RunningOnEmul
-RunningOnEmul   SETL    {FALSE} :LAND: STB
+RunningOnEmul   SETL    {FALSE} :LAND::LNOT: STB
 
 ; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ; now the conditional flags for the version we want
@@ -353,9 +353,6 @@ ARM810_POST            SETL {FALSE} :LAND: ARM810support
 VCOstartfix     SETL    {TRUE}
 
 
-                GBLL    MorrisIDString           ;whether printed CPU string includes 7500/7500FE recognition
-MorrisIDString  SETL    {TRUE} :LAND: StrongARM  ;printed CPU type only implemented if StrongARM true
-
  [ StrongARM
  ! 0," ______________________________________________________"
  ! 0,"|                                                      |"
diff --git a/s/Kernel b/s/Kernel
index 506b230..3446ae9 100644
--- a/s/Kernel
+++ b/s/Kernel
@@ -1417,12 +1417,18 @@ platfeat_irqinsert
 
 75      ;Get here if the service call isn't claimed.
         ADR     R0,platfeaterror
+    [ International
+        BL      TranslateError
+    ]
         B       SLVK_SetV
 
- ! 0,"amg: renaissance. WARNING! StrongARM conditional code has non-internationalised errors"
 platfeaterror
-        DCD     0
-        DCB     "bad OS_PlatformFeatures reason code",0
+        &       0
+    [ International
+        =       "BadPlatReas", 0
+    |
+        =       "Unknown OS_PlatformFeatures reason code", 0
+    ]
         ALIGN
   ]
 
diff --git a/s/ModHand b/s/ModHand
index f053ec8..f5917ff 100644
--- a/s/ModHand
+++ b/s/ModHand
@@ -1928,6 +1928,9 @@ CallInit         ROUT
         BNE     %FT03
 
   ; the module really does have a SWI chunk. Add node to hashtable.
+  ; KJB - after v3.71 add new modules at end, on grounds that first-registered
+  ; modules are probably more important. Exception is when a second module wants
+  ; an already used SWI chunk - it should get priority.
 
         MOV     R4, R0
         MOV     R11, R1
@@ -1937,10 +1940,19 @@ CallInit         ROUT
         STR     R9,  [R2, #ModSWINode_MListNode]
         STR     R4,  [R2, #ModSWINode_CallAddress]
         STR     R11, [R2, #ModSWINode_Number]
-        ModSWIHashvalOffset R11
-        LDR     R6, [R11, #ModuleSWI_HashTab]!  ;  link into table.
-        STR     R6, [R2, #ModSWINode_Link]
-        STR     R2, [R11]
+        ModSWIHashval R3,R11
+	LDR	R4, [R3]
+  	B	%FT09
+   ; top of loop: R4 = node under consideration, R3 = pointer to this node from previous
+08	LDR	R14, [R4, #ModSWINode_Number]
+	TEQ	R11, R14			; if numbers match, jump to end. This also sets
+	BEQ	%FT10				;     the new node's link to this node
+	ADD	R3, R4, #ModSWINode_Link	; update R3 to this node's link
+	LDR	R4, [R3] 			; and move R4 to next node
+09	TEQ	R4, #0
+	BNE	%BT08				; if no next node, exit loop and tack on new one
+10	STR	R4, [R2, #ModSWINode_Link]
+        STR     R2, [R3]
 
 03  ; now prepared to look at module
 
diff --git a/s/NewReset b/s/NewReset
index 4a5e324..757707e 100644
--- a/s/NewReset
+++ b/s/NewReset
@@ -2266,7 +2266,7 @@ SkipHardResetPart2                      ; code executed on all types of reset
 
  [ StrongARM
   [ STB
-   ! 0,"Printing of processor type disabled - 7500/FE weren't included"
+   ! 0,"Printing of processor type disabled"
   |
         ;Print the processor type
         MOV     r0, #0
@@ -2274,8 +2274,15 @@ SkipHardResetPart2                      ; code executed on all types of reset
         TEQ     r0, #255
         BEQ     %FT01
         ADR     r1, processor_names
+      [ International
+        ADD     r0, r1, r0, LSL #3
+	BL	Write0_Translated
+	SWI	XOS_NewLine
+	SWI	XOS_NewLine
+      |
         ADD     r0, r1, r0, LSL #5
         SWI     XOS_Write0
+      ]
    ]
  ]
 
@@ -2414,6 +2421,24 @@ MonitorKeypadTable      ; internal key number, CMOS bits
    ! 0,"Disabling Processor ID display"
   |
 processor_names
+   [ International
+        =	"600", 0
+	ALIGN	8
+	=	"610", 0
+	ALIGN	8
+	=	"700", 0
+	ALIGN	8
+	=	"710", 0
+	ALIGN	8
+	=	"810", 0
+	ALIGN	8
+	=	"SA110", 0
+	ALIGN	8
+	=	"7500", 0
+	ALIGN	8
+	=	"7500FE", 0
+	ALIGN	8
+   |
         DCB     "ARM 600 Processor",10,13,10,0
         ALIGN 32
         DCB     "ARM 610 Processor",10,13,10,0
@@ -2426,12 +2451,11 @@ processor_names
         ALIGN 32
         DCB     "StrongARM Processor",10,13,10,0
         ALIGN 32
- [ MorrisIDString
         DCB     "ARM 7500 Processor",10,13,10,0
         ALIGN 32
         DCB     "ARM 7500FE Processor",10,13,10,0
         ALIGN 32
- ]
+   ]
         ; type, internal type, features
   ]
 cputable
@@ -2447,10 +2471,8 @@ cputable
    ;value for 3.70
         DCD &a100,5,2_11111
  ]
- [ MorrisIDString
         DCD &7500,6,0
         DCD &7501,7,0
- ]
         DCD -1
  ]
 
@@ -2461,7 +2483,6 @@ MessageFileName DCB     "Resources:$.Resources.Kernel.Messages",0
 
  [ StrongARM
 Processor_Type
-   [ MorrisIDString
         MOV     r0,#IOMD_Base
         LDRB    r1,[r0,#IOMD_ID0]
         CMP     r1,#&E7
@@ -2476,15 +2497,12 @@ Processor_Type
         ORREQ   r0,r0,#&0001            ; AA means 7500FE - mark as 7501
         BEQ     PT_lookup
 PT_RiscPC
-   ]
         ReadCop  R0,CR_ID               ; see data sheets for values
         ; ARM 600 funny
         TST     R0,#&f000
         MOVEQ   R0,R0, LSL #4
         AND     R0,R0,#&ff00
-   [ MorrisIDString
 PT_lookup
-   ]
         ADR     R1,cputable
 66
         LDR     R2,[R1],#4
diff --git a/s/TMOSHelp b/s/TMOSHelp
index 82300e7..cbe7ccd 100644
--- a/s/TMOSHelp
+++ b/s/TMOSHelp
@@ -767,6 +767,20 @@ Help_Help
       ;=   "List all the filing system-specific commands",13
       ;=   "Modules", 9, 9, "List the module titles",13
       ;=   "Syntax", 9, 9, "Explain the syntax message format",0
+
+ChangeDynamicArea_Help
+      ;=   "Allows the size of the font cache, system sprite area,"
+     =  "Allows",TokenEscapeChar,Token2,"size of",TokenEscapeChar,Token2
+     =  "font cache, system ",TokenEscapeChar,Token31," area, RAM "
+     =  TokenEscapeChar,Token39,", module area",TokenEscapeChar,Token16
+     =  "screen memory",TokenEscapeChar,Token40,"be set up.", 13
+      ;=   " RAM disc, module area and screen memory to be set up.",13
+ChangeDynamicArea_Syntax
+      ;=   "Syntax: *",TokenEscapeChar,Token0
+     =  TokenEscapeChar,Token30,"-FontSize <n>[K]] [-SpriteSize <n>[K"
+     =  "]] [-RamFsSize <n>[K]] [-RMASize <n>[K]] [-ScreenSize <n>[K]]",  0
+      ;=   " [-FontSize <n>[K]] [-SpriteSize <n>[K]] [-RamFsSize <n>[K]]"
+      ;=   " [-RMASize <n>[K]] [-ScreenSize <n>[K]]", 0
  |
 Break_Help      DCB     "HUTMBRK", 0
 Reset_Help      DCB     "HUTMRES", 0
@@ -863,6 +877,10 @@ TV_Syntax       DCB     "SUTMTV", 0
 Type_Help       DCB     "HUTMTYP", 0
 Type_Syntax     DCB     "SUTMTYP", 0
 Help_Help       DCB     "HUTMHLP", 0
+ChangeDynamicArea_Help
+                DCB     "HUTMCDA", 0
+ChangeDynamicArea_Syntax
+                DCB     "SUTMCDA", 0
  ]
 
 modules_help1   DCB     "HUTMMOD", 0
diff --git a/s/Utility b/s/Utility
index e2b8e22..3de951f 100644
--- a/s/Utility
+++ b/s/Utility
@@ -142,38 +142,39 @@ UtilModTitle =  "UtilityModule", 0
 UtilHelpStr  =  "MOS Utilities", 9, "$VersionNo", 0
 
 UtilHelpTab
-           Command   Break,       0,  0, International_Help   ; just help
-           Command   Configure, 255,  0, Help_Is_Code_Flag :OR: International_Help
-           Command   Commands,    0,  0, Help_Is_Code_Flag :OR: International_Help
-           Command   Echo,      255,  0, International_Help
-           Command   Error,     255,  1, International_Help
-           Command   Eval,      255,  1, International_Help
-           Command   FileCommands,0,  0, Help_Is_Code_Flag :OR: International_Help
-           Command   GOS,         0,  0, International_Help
-           Command   IF,        255,  2, International_Help
-           Command   Ignore,      1,  0, International_Help
-           Command   Modules,     0,  0, Help_Is_Code_Flag :OR: International_Help
-           Command   PowerOn,     0,  0, International_Help   ; just help
-           Command   Reset,       0,  0, International_Help   ; just help
-           Command   RMClear,     0,  0, International_Help
-           Command   RMEnsure,  255,  2, International_Help
-           Command   RMFaster,    1,  1, International_Help
-           Command   RMInsert,    2,  1, International_Help
-           Command   RMKill,      1,  1, International_Help
-           Command   RMLoad,    255,  1, International_Help
-           Command   RMReInit,  255,  1, International_Help
-           Command   RMRun,     255,  1, International_Help
-           Command   RMTidy,      0,  0, International_Help
-           Command   ROMModules,  0,  0, International_Help
-           Command   Set,       255,  2, International_Help
-           Command   SetEval,   255,  2, International_Help
-           Command   SetMacro,  255,  2, International_Help
-           Command   Show,        1,  0, International_Help   ; *show = *show *
-           Command   Status,    255,  0, International_Help
-           Command   Syntax,      0,  0, International_Help
-           Command   Time,        0,  0, International_Help
-           Command   Unplug,      2,  0, International_Help
-           Command   Unset,       1,  1, International_Help
+           Command   Break,              0,  0, International_Help   ; just help
+           Command   ChangeDynamicArea,255,  0, International_Help
+           Command   Configure,        255,  0, Help_Is_Code_Flag :OR: International_Help
+           Command   Commands,           0,  0, Help_Is_Code_Flag :OR: International_Help
+           Command   Echo,             255,  0, International_Help
+           Command   Error,            255,  1, International_Help
+           Command   Eval,             255,  1, International_Help
+           Command   FileCommands,       0,  0, Help_Is_Code_Flag :OR: International_Help
+           Command   GOS,                0,  0, International_Help
+           Command   IF,               255,  2, International_Help
+           Command   Ignore,             1,  0, International_Help
+           Command   Modules,            0,  0, Help_Is_Code_Flag :OR: International_Help
+           Command   PowerOn,            0,  0, International_Help   ; just help
+           Command   Reset,              0,  0, International_Help   ; just help
+           Command   RMClear,            0,  0, International_Help
+           Command   RMEnsure,         255,  2, International_Help
+           Command   RMFaster,           1,  1, International_Help
+           Command   RMInsert,           2,  1, International_Help
+           Command   RMKill,             1,  1, International_Help
+           Command   RMLoad,           255,  1, International_Help
+           Command   RMReInit,         255,  1, International_Help
+           Command   RMRun,            255,  1, International_Help
+           Command   RMTidy,             0,  0, International_Help
+           Command   ROMModules,         0,  0, International_Help
+           Command   Set,              255,  2, International_Help
+           Command   SetEval,          255,  2, International_Help
+           Command   SetMacro,         255,  2, International_Help
+           Command   Show,               1,  0, International_Help   ; *show = *show *
+           Command   Status,           255,  0, International_Help
+           Command   Syntax,             0,  0, International_Help
+           Command   Time,               0,  0, International_Help
+           Command   Unplug,             2,  0, International_Help
+           Command   Unset,              1,  1, International_Help
            =   0
 
 Configure_Syntax     * Module_BaseAddr
@@ -752,4 +753,128 @@ GOS_Code
         SWI     XOS_Module
         Pull    pc
 
+; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+; ChangeDynamicArea - moved here from the Task Manager as embedded devices
+; tend not to have the Task Manager
+; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+rmaarea         *       1               ; RMA area
+screenarea      *       2               ; screen area
+spritearea      *       3               ; sprite area
+fontarea        *       4               ; font cache dynamic area number
+ramfsarea       *       5               ; RAM disc area
+
+                ^       0
+vec_fontsize    #       4               ; fields in output vector
+vec_spritesize  #       4
+vec_ramfssize   #       4
+vec_rmasize	#	4
+vec_screensize	#	4
+ss_outputvec    *       &100
+
+Keydef  DCB     "FontSize/K,SpriteSize/K,RamFsSize/K,RMASize/K,ScreenSize/K"
+        DCB     0
+        ALIGN
+
+; NB: R12 -> private word (don't use workspace, as it may not be present)
+
+ChangeDynamicArea_Code  ROUT
+        Push    "R11,LR"
+        MOV     R11,sp                  ; remember stack for later
+;
+        SUB     sp,sp,#ss_outputvec     ; local workspace
+;
+; scan the comand line by calling OS_ReadArgs
+;
+        MOV     R1,R0                   ; R1 = input string
+        ADR     R0,Keydef               ; R0 = key defion string
+        MOV     R2,sp                   ; R2 = output vector
+        MOV     R3,#ss_outputvec        ; R3 = max output vector length
+        SWI     XOS_ReadArgs
+;
+; scan the resulting vector for known fields
+;
+        MOVVC   R0,#rmaarea
+        LDRVC   R1,[sp,#vec_rmasize]
+        BLVC    changeR0R1              ; R0 = area number, R1 = size required
+
+        MOVVC   R0,#screenarea
+        LDRVC   R1,[sp,#vec_screensize]
+        BLVC    changeR0R1              ; R0 = area number, R1 = size required
+
+        MOVVC   R0,#fontarea
+        LDRVC   R1,[sp,#vec_fontsize]
+        BLVC    changeR0R1              ; R0 = area number, R1 = size required
+
+        MOVVC   R0,#spritearea
+        LDRVC   R1,[sp,#vec_spritesize]
+        BLVC    changeR0R1              ; R0 = area number, R1 = size required
+
+        MOVVC   R0,#ramfsarea           ; NB: do RAMFS last so others get done if it fails
+        LDRVC   R1,[sp,#vec_ramfssize]
+        BLVC    changeR0R1              ; R0 = area number, R1 = size required
+
+        MOV     sp,R11                  ; restore stack
+        Pull    "R11,PC"
+
+; In    R0 = dynamic area number
+;       R1 -> string specifying size required (<=0 => don't bother)
+; Out   calls OS_ChangeDynamicArea, which gives Service_MemoryMoved
+;       this is intercepted, and sets [memoryupdated]
+;       this causes a pollword event:
+;           which calls set_memory for all memory slots
+;           if the RAM disc slot size changes to/from 0
+;               [ramfsflag] is set
+;               unless dragging the ram slot bar:
+;                   reramfsfiler re-ialises the RAMFSFiler
+;                   otherwise it waits till the bar is dropped
+
+changeR0R1      ROUT
+        Push    "R0-R3,LR"
+
+        CMP     R1,#0
+        Pull    "R0-R3,PC",LE
+
+        SWI     XOS_ReadDynamicArea     ; R1 = current size of area
+        MOVVC   R3,R1
+
+        LDRVC   R1,[sp,#1*4]
+        BLVC    getK                    ; R1 = new amount required
+
+        LDRVC   R0,[sp,#0*4]
+        SUBVC   R1,R1,R3                ; R1 = change required
+        SWIVC   XOS_ChangeDynamicArea
+
+        STRVS   R0,[sp]
+        Pull    "R0-R3,PC"
+
+
+; In    R1 --> string
+; Out   R1 = parameter value (number)
+; Errors: "Bad number"
+;
+
+getK    ROUT
+        Push    "R2-R3,LR"
+;
+        MOV     R0,#10
+        SWI     XOS_ReadUnsigned
+        Pull    "R2-R3,PC",VS
+;
+        LDRB    R3,[R1]                 ; if terminator is "K" or "k",
+        UpperCase R3, R14
+        TEQ     R3,#"K"
+        ADDEQ   R1,R1,#1
+        MOVEQ   R2,R2,LSL #10           ; multiply by 1024
+;
+        LDRB    R14,[R1]                ; check terminator
+        RSBS    R14,R14,#" "+1          ; ensure GT set if OK
+        ADRLEL  R0,ErrorBlock_BadNumb   ; "Number not recognised"
+      [ International
+        BLLE    TranslateError
+      ]
+;
+        MOVVC   R1,R2                   ; R1 = answer
+        Pull    "R2-R3,PC"
+
         END
-- 
GitLab