[futurebasic] RE: [FB] LowMem accessors (was Gestalt question)

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2000 : Group Archive : Group : All Groups

From: "Brian J. Hughes" <BrianHughes@...>
Date: Mon, 3 Apr 2000 17:02:57 -0700
At 7:13 PM -0400 on 4/3/00, Edwards, Waverly wrote:


>I havent used codewarrior in some time.  I think the older versions have a
>file call lowmem.h that has an implementation to access most if not all the
>low memory addresses.  If someone has that file, it would be most beneficial
>to the group if we translated it, getting everyone up to date on how to
>access these memory address the not so new way.
>

It's funny you should mention that.  I used your example program 
Toolbox Helper to convert the Universal Headers files that I have 
with my copy of CodeWarrior.  It produced the file LowMem.tlbx with 
this for the rom function:

TOOLBOX FN LMGetROMBase () = Ptr `0x2EB8,0x02AE

TOOLBOX LMSetROMBase (Ptr) `0x21DF,0x02AE

I had recently downloaded the latest Universal Headers and found that 
the ToolBox Helper choked on a few files.  It terminated on files 
larger than ~200k in size.  I tried increasing memory but it didn't 
help.

I didn't need to use them though.  I tried Bill Michael's System info 
program, he had asked for volunteers to try on their machines.  I 
found that he had commented out this code.  I uncommented it, 
compiled in FB^3 and it worked fine as is:

--------
LONG IF gestaltResponse& = 406  'was 512
PRINT "ROM Subversion =";
PRINT HEX$({[_romBase] + &H12})
'below for FB^3
toolbox FN LMGetROMBase = pointer ` 0x2EB8, 0x02AE
DIM romSubVersion as unsigned short
romSubVersion = {FN LMGetROMBase + 0x12}
PRINT "ROM subversion: " HEX$(romSubVersion)
'
PRINT "(Original G3 is V4.0 F2, Blue & White V4.5 F1, iMacs V4,5 F2.)"
END IF
---------

Only works with FB^3, I'd guess.  You can't add ToolBox functions to 
FBII can you?

Brian Hughes