Commit 46989188 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Change to RMA shrinkage in *ICONSPRITES pre Medusa

On completing the sprite area merge the Wimp would try to minimise the RMA by -256MB (to account for the fact that during the merge the RMA is enlarged to hold both the existing sprites and the new ones to be merged, in the case of duplicates).
However, this meant that the common construct

  IconSprites MySprites
  Run MyApp

where MyApp wanted to use more than a teaspoon of RMA would fail due to the lack of free pool and that the RMA can't be resized when an application is running as a result.

Now, the Wimp notes the free space in the RMA, does the -256MB shrink, then ensures there's still the same free space after the event (ie. overall it may have grown by the size of any extra sprites added during the command).
Tested on RISC OS 3.10.

Version 5.26. Tagged as 'Wimp-5_26'
parent a30a2489
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.25"
Module_Version SETA 525
Module_MajorVersion SETS "5.26"
Module_Version SETA 526
Module_MinorVersion SETS ""
Module_Date SETS "06 May 2013"
Module_ApplicationDate SETS "06-May-13"
Module_Date SETS "09 May 2013"
Module_ApplicationDate SETS "09-May-13"
Module_ComponentName SETS "Wimp"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Wimp"
Module_FullVersion SETS "5.25"
Module_HelpVersion SETS "5.25 (06 May 2013)"
Module_FullVersion SETS "5.26"
Module_HelpVersion SETS "5.26 (09 May 2013)"
/* (5.25)
/* (5.26)
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
#define Module_MajorVersion_CMHG 5.25
#define Module_MajorVersion_CMHG 5.26
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 06 May 2013
#define Module_Date_CMHG 09 May 2013
#define Module_MajorVersion "5.25"
#define Module_Version 525
#define Module_MajorVersion "5.26"
#define Module_Version 526
#define Module_MinorVersion ""
#define Module_Date "06 May 2013"
#define Module_Date "09 May 2013"
#define Module_ApplicationDate "06-May-13"
#define Module_ApplicationDate "09-May-13"
#define Module_ComponentName "Wimp"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Wimp"
#define Module_FullVersion "5.25"
#define Module_HelpVersion "5.25 (06 May 2013)"
#define Module_LibraryVersionInfo "5:25"
#define Module_FullVersion "5.26"
#define Module_HelpVersion "5.26 (09 May 2013)"
#define Module_LibraryVersionInfo "5:26"
......@@ -2853,9 +2853,16 @@ greys_16
; tries "<filename>23" if hi-res mono, and/or "<filename>22" if 2x2 OS units
Push "R7-R8,LR"
Push "R7-R9,LR"
LDR wsptr,[R12]
[ :LNOT: Medusa
Push "R0"
MOV R0,#ModHandReason_RMADesc
SWI XOS_Module
MOV R9,R3 ; how much free RMA there was before merging
Pull "R0"
MOV R8,R0 ; R8 -> original filename
MOV R5,R0 ; R5 = position at which to insert system variable
01 LDRB LR,[R0],#1 ; skip leading space
......@@ -2933,7 +2940,7 @@ IconSprites_Code
TEQ R3,R8 ; were we trying with the system variable inserted?
ADDNE SP,SP,R7 ; yes, so junk stack frame
BEQ %FT05 ; no, and an error, so give up
BEQ %FT95 ; no, and an error, so give up
MOV R3,R8 ; yes, and an error, so try again without the system variable
B %BT01
......@@ -2949,14 +2956,16 @@ IconSprites_Code
[ :LNOT: Medusa ; Medusa uses DA
; this merge bumps the RMA up, compress it again just in case.
MOV R0,#1 ; The merge might have bumped up the RMA while both sets of sprites
MOV R1,#-&10000000 ; were loaded. Try and shrink RMA.
SWI XOS_ChangeDynamicArea ; -256M will give "Unable to move memory"
MOV R0,#1
MOV R1,#-&10000000 ; try and shrink RMA
SWI XOS_ChangeDynamicArea
CLRV ; may cause an error, but ok.
MOV R1,R9 ; Put back the same amount of free space as on entry
SWI XOS_ChangeDynamicArea ; May fail if APPSPACE is in use, that's ok.
Pull "R7-R8,PC"
Pull "R7-R9,PC"
IconThemeSysVar = "<Wimp$IconTheme>"
IconThemeSysVarLen * . - IconThemeSysVar
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