Article View: comp.sys.amiga.tech
Article #9320Re: Chip RAM
From: Carolyn Scheppner CATS
Date: Tue, 19 Jul 1988 16:44
Date: Tue, 19 Jul 1988 16:44
63 lines
3062 bytes
3062 bytes
In article <4811@killer.UUCP> ltf@killer.UUCP (Lance Franklin) writes:
>
>[RE TypeOfMem() function] ... I just now checked in the
>Developer's Ref Guide and found it, evidently a part of the exec.library...
>could you describe the function for me? Or tell me where I can find a
>description?
TypeOfMem(address)
a1
Described in the 1.2 Exec autodocs (as in the 1.2 Native Developer Update
disk set available from CATS for $20 US [+$5 shipping outside US]).
>I was looking to create a quick and easy function that would check a passed
>address (and size) of a structure and pass me back the original address (if
>the structure is already in CHIP ram, or allocate the space in CHIP ram, copy
>the structure into it and pass me back its address, keeping track of the
>CHIP ram allocated so I can free it at the program's exit. TypeOfMem() sounds
>like just what I need to test the structures present location.
I thought I saw a couple of those come by here just recently.
Here's what I would try, off the top of my head (ie non-tested :-)
- set up a null RememberKey (intuition thing)
struct Remember *greallockey = NULL; /* Graphics realloc key */
struct Remember **grkeyaddr = &greallockey; /* we need addr of key */
- pass your function address,size,and grkeyaddr
maybeAlloc(addr,size,keyaddr)
ULONG addr, size;
struct Remember **keyaddr;
{
ULONG newaddr;
if(TypeOfMem(addr) & MEMF_CHIP) return(addr);
else if(newaddr=AllocRemember(keyaddr,size,MEMF_CHIP))
{
CopyMem(addr,newaddr,size);
return(newaddr);
}
else return(0);
}
- In your cleanup (after you are sure you are not displaying any
of those images anymore).
if(greallockey) FreeRemember(grkeyaddr,TRUE);
>> Oh I'm a numberjack and I'm OK, I code all night and I work all day...
>I Code B-Trees, I wear a dress, suspenders and a bra...
>On Wednesdays I go Shopping, buy cokes and more twinkies!
I like it.
--
==========================================================================
Carolyn Scheppner -- CATS Commodore Amiga Technical Support
PHONE 215-431-9180 UUCP ...{uunet,allegra,rutgers}!cbmvax!carolyn
I am fully operational and all of my circuits are funcTiOnINg pperrf...
==========================================================================
Technical Details
Message-ID:
<4283@cbmvax.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!cbmvax!carolynReferences:
<3150@polya.Stanford.EDU> <6428@well.UUCP> <2242@sugar.UUCP> <735@applix.UUCP> <11717@agate.BERKELEY.EDU> <2327@antique.UUCP> <737@applix.UUCP> <2333@antique.UUCP> <4790@killer.UUCP> <4266@cbmvax.UUCP> <4270@cbmvax.UUCP> <4811@killer.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cbmvax!carolyn From: carolyn@cbmvax.UUCP (Carolyn Scheppner CATS) Newsgroups: comp.sys.amiga.tech Subject: Re: Chip RAM Message-ID: <4283@cbmvax.UUCP> Date: 19 Jul 88 16:44:12 GMT References: <3150@polya.Stanford.EDU> <6428@well.UUCP> <2242@sugar.UUCP> <735@applix.UUCP> <11717@agate.BERKELEY.EDU> <2327@antique.UUCP> <737@applix.UUCP> <2333@antique.UUCP> <4790@killer.UUCP> <4266@cbmvax.UUCP> <4270@cbmvax.UUCP> <4811@killer.UUCP> Reply-To: carolyn@cbmvax.UUCP (Carolyn Scheppner CATS) Organization: Commodore Technology, West Chester, PA Lines: 63