Re: A83: Re: Where is...


[Prev][Next][Index][Thread]

Re: A83: Re: Where is...




On 17-Oct-98, Jkhum98@aol.com wrote:


>In a message dated 10/17/98 12:05:16 PM, lairfight@softhome.net writes:

>>If you only need the memory as long as the program is running (which is
>>often the case), you can just use an insertmem/delmem pair, inserting
>>memory at the end of your program. Then have a label at the end of the
>>program, and use it to address the allocated memory.

>I don't quite understand this... You have to be reading this data for
>_Somewhere_ and if I'm not talking about external files, then wouldn't the
>data just be located under a label in a series of ".db"s at the end of your
>program, and then it just takes a process to read this data how ever... Why
>are you needing to put this into RAM again, Phelan? How will it save memory,
>if its already there in your program...? Linus, what's an example program,
>that I can see what your talking about, with this insertmem/delmem stuff?
>--Jason K.

Well, I don't wanna give away the source code for RiDE... but I use it in
there. =) Like this; I need a buffer 48*64 bytes big, to hold intermediate
graphics when calculating the effects. When I start the program, this area of
memory could contain garbage. So having it inside the program would just
increase the program size by 3k! Safe ram areas? Too small. Therefore, the
last line in the program is:

chunky:

and then the file ends. One of the first things I do is inserting 48*64 bytes
here, like this:

ld hl,48*64
ld de,chunky
call _INSERTMEM    ; actually I do some _ERRNOTENOUGHMEM stuff aswell.

Then I can use chunky as a memory pointer that's pointing to 3k of newly
allocated, free ram. And before I quit the program, I do like this:

ld hl,48*64
ld de,chunky
call _DELMEM

Linus


References: