Commit d87b51c6 authored by Jeffrey Lee's avatar Jeffrey Lee Committed by ROOL

Support over 2GB of RAM

Where supported, use Wimp_Extend 15 to read the amount of free memory
(in units of pages), in order to avoid hitting the 2GB limit imposed by
the byte-based Wimp_SlotSize.

Text buffer also enlarged, to avoid it overflowing once we have machines
with 10GB or more.

Version 0.08. Tagged as 'MemNow-0_08'
parent 8b937419
/* (0.07)
/* (0.08)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.07
#define Module_MajorVersion_CMHG 0.08
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 06 Mar 2015
#define Module_Date_CMHG 19 Jan 2020
#define Module_MajorVersion "0.07"
#define Module_Version 7
#define Module_MajorVersion "0.08"
#define Module_Version 8
#define Module_MinorVersion ""
#define Module_Date "06 Mar 2015"
#define Module_Date "19 Jan 2020"
#define Module_ApplicationDate "06-Mar-15"
#define Module_ApplicationDate "19-Jan-20"
#define Module_ComponentName "MemNow"
#define Module_ComponentPath "castle/RiscOS/Sources/Apps/Diversions/MemNow"
#define Module_FullVersion "0.07"
#define Module_HelpVersion "0.07 (06 Mar 2015)"
#define Module_LibraryVersionInfo "0:7"
#define Module_FullVersion "0.08"
#define Module_HelpVersion "0.08 (19 Jan 2020)"
#define Module_LibraryVersionInfo "0:8"
......@@ -29,12 +29,23 @@ maxbuf%=800:@%=5
DIM buffer% maxbuf%,endbuf% -1:curbuf%=buffer%
REM Adapt to the longest possible display on this memory controller
SYS"OS_ReadMemMapInfo" TO P%,N%
maxlen%=LEN(STR$((P% DIV1024)*N%))
DIM MemText% 8, MemValid% 4
$MemText%="128000":$MemValid%=FNmsg_0("Border")
Q%!0=-1:Q%!4=0:Q%!8=0:Q%!12=(maxlen%*16)+34:Q%!16=68:Q%!20=&1700313D:Q%!24=MemText%:Q%!28=MemValid%:Q%!32=8
SYS"OS_ReadMemMapInfo" TO PageSize%,N%
maxlen%=LEN(STR$((PageSize% DIV1024)*N%))
DIM MemText% 12, MemValid% 4
REM Try using Wimp_Extend 15 to avoid Wimp_SlotSize 2GB limit
XWimp_Extend%=&600FB
SYS XWimp_Extend%,15,,-1 TO ,,FreeMem%;flags%
IF (flags% AND 1)<>0 OR FreeMem%=-1 THEN
SYS "Wimp_SlotSize",-1,-1 TO ,,FreeMem%
MemScale=1/1024
ELSE
MemScale=PageSize%/1024
ENDIF
FreeMem%=MemScale*FreeMem%
$MemText%=STR$(FreeMem%)
$MemValid%=FNmsg_0("Border")
Q%!0=-1:Q%!4=0:Q%!8=0:Q%!12=(maxlen%*16)+34:Q%!16=68:Q%!20=&1700313D:Q%!24=MemText%:Q%!28=MemValid%:Q%!32=12
SYS "Wimp_CreateIcon",,Q% TO BarIcon%
PROCTemplateInit:PROCTemplateLoad
......@@ -47,9 +58,6 @@ PROCset_string(ProgInfo%,3,FNmsg_0("_Author"))
PROCset_string(ProgInfo%,4,FNmsg_0("_Version"))
ReOpenBeforePoll%=0
SYS "Wimp_SlotSize",-1,-1 TO ,,FreeMem%
$MemText% = STR$(FreeMem%>>>10)
Q%!0=-1:Q%!4=BarIcon%:Q%!8=0:Q%!12=0:SYS "Wimp_SetIconState",,Q%
end% =FALSE
REPEAT
......@@ -71,8 +79,12 @@ PROCmsg_end
END
DEFPROCnull
SYS "Wimp_SlotSize",-1,-1 TO ,,t%
t%=t%>>>10:REM Into unsigned kB
IF MemScale>1 THEN
SYS XWimp_Extend%,15 TO ,,t%
ELSE
SYS "Wimp_SlotSize",-1,-1 TO ,,t%
ENDIF
t%=MemScale*t%:REM Into unsigned kB
$MemText%=STR$(t%)
IF t%>=16 THEN
REM Update number if value changed since last check
......
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