| >ConfMemory
|
| ACORN TEST SOFTWARE (c) Acorn Computers Ltd 1991.
|
| *********************** CHANGE LIST *************************************
|                                                                        
| Vers  Date            Name    Comment                                 
| ----- ----------      ---     -------------------------------------------
| 1.00  07-Oct-91       BAR     Initial writing.
| 1.01  16-Oct-91       BAR     Change alise for LOADing and KILLing the
|                               MemAlloc modules. Add line to set
|                               memallockill to be 0.
| 1.02  30-Oct-91       BAR     Add code to set the wimpslot, min, max
|                               and next sizes
| 1.03  13-Nov-91       BAR     Add code to set error vars. if we failed
|                               to get some extra memory. Only operates on
|                               calls to memalloc. Add var to say we have
|                               set the memory. Add lines to set the size
|                               of RAMFS (for use on OS < RO3.00). Add lines
|                               to unset the vars and alias used. Add lines
|                               to set the 'New..' vars if not set. Add echo
|                               'config memory'.
| 1.04  20-Nov-91       DB      Correct spelling of requirements.
| 
| This program is designed to change the size of certain dynamic memory
| areas :- Screen and system sizes and the RMA Free size. The program uses
| the module MemAlloc to assist in the job.
|
| If one of the memory allocations failes then an error flag is set and a
| message shown. If the error flag is set then the program produces an error
| stoping exicution.
|
ECHO Configuring the Memory requirements.
|
| Check to see if all the reqd. vars are set, if not set to -99
*IF "<NewRMAFree>"     = "" THEN *seteval NewRMAFree -99
*IF "<NewSystemSize>"  = "" THEN *seteval NewSystemSize -99
*IF "<NewScreenSize>"  = "" THEN *seteval NewScreenSize -99
*IF "<MinWimpSlot>"    = "" THEN *seteval MinWimpSlot -99
*IF "<MaxWimpSlot>"    = "" THEN *seteval MaxWimpSlot -99
*IF "<NextWimpSlot>"   = "" THEN *seteval NextWimpSlot -99
*IF "<NewRAMFSSize>"   = "" THEN *seteval NewRAMFSSize -99
|
| Define the error variables to be ok.
*seteval rmafreeerror 0
*seteval systemerror  0
*seteval screenerror  0
*seteval RAMFSerror   0
|
*set alias$memallocload *RMEnsure MemAlloc 0.11 RMLoad <test$path>MemAlloc
*set alias$memallockill *RMKill MemAlloc
*seteval memallockill 0
|
| Set the size of the wimpslot, min, max or next.
*IF <MinWimpSlot>   >= 0 THEN *set alias$minwimpslot wimpslot -min <MinWimpSlot>K
*IF <MinWimpSlot>   >= 0 THEN *minwimpslot
|
*IF <MaxWimpSlot>   >= 0 THEN *set alias$maxwimpslot wimpslot -max <MaxWimpSlot>K
*IF <MaxWimpSlot>   >= 0 THEN *maxwimpslot
|
*IF <NextWimpSlot>  >= 0 THEN *set alias$nextwimpslot wimpslot -next <NextWimpSlot>K
*IF <NextWimpSlot>  >= 0 THEN nextwimpslot
|
| Configure the RMA Free size, if required.
*IF <NewRMAFree>    >= 0 THEN *set alias$setrmafree RMAFree <NewRMAFree> *seteval rmafreeerror 1
*IF <NewRMAFree>    >= 0 THEN *memallocload
*IF <NewRMAFree>    >= 0 THEN *seteval memallockill 1
*IF <NewRMAFree>    >= 0 THEN *setrmafree
*IF <rmafreeerror>  >= 1 THEN Echo Unable to get <NewRMAFree>K free in the RMA
|
| Configure the System Size, if required.
*IF <NewSystemSize> >= 0 THEN *set alias$setsystemsize *SystemSize <NewSystemSize> *seteval systemerror 1
*IF <NewSystemSize> >= 0 THEN *memallocload
*IF <NewSystemSize> >= 0 THEN *seteval memallockill 1
*IF <NewSystemSize> >= 0 THEN *setsystemsize
*IF <systemerror>   >= 1 THEN Echo Unable to set the System Size to <NewSystemSize>K
|
| Configure the Screen Size, if required.
*IF <NewScreenSize> >= 0 THEN *set alias$setscreensize *ScreenSize <NewScreenSize> *seteval screenerror 1
*IF <NewScreenSize> >= 0 THEN *memallocload
*IF <NewScreenSize> >= 0 THEN *seteval memallockill 1
*IF <NewScreenSize> >= 0 THEN *setscreensize
*IF <screenerror>   >= 1 THEN Echo Unable to set the Screen Size to <NewScreenSize>K
|
| Configure the RAM Disc Size, if required.
| This code is available for use on OS < RO3.00
*IF <NewRAMFSSize>  >= 0 THEN *set alias$setRAMFSsize *RAMFSSize <NewRAMFSSize> *seteval RAMFSerror 1
*IF <NewRAMFSSize>  >= 0 THEN *memallocload
*IF <NewRAMFSSize>  >= 0 THEN *seteval memallockill 1
*IF <NewRAMFSSize>  >= 0 THEN *setRAMFSsize
*IF <RAMFSerror>    >= 1 THEN Echo Unable to set the RAM Disc Size to <NewRAMFSSize>K
|
*IF <memallockill>   = 1 THEN *memallockill
|
| If there was an error then panic and stop.
*IF <rmafreeerror> >=1 OR <systemerror> >=1 OR <screenerror> >=1 OR <RAMFSerror> >=1 THEN ERROR 0 !!! STOP !!! Unable to adjust memory.
|
| Unset the vars used.
*unset NewRMAFree
*unset NewSystemSize
*unset NewScreenSize
*unset MinWimpSlot
*unset MaxWimpSlot
*unset NextWimpSlot
*unset NewRAMFSSize
*unset memallockill
*unset rmafreeerror
*unset systemerror
*unset screenerror
*unset RAMFSerror
|
| Unset the aliase used.
*unset alias$memallocload
*unset alias$memallockill
*unset alias$minwimpslot
*unset alias$maxwimpslot
*unset alias$nextwimpslot
*unset alias$setrmafree
*unset alias$setsystemsize
*unset alias$setscreensize
*unset alias$setRAMFSsize
|
| Set a var saying we have done the memory configuration.
| This is used to stop us re-calling the file again.
*SET doneconfigmemory 1
