freeing memory

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
ssj4goku128
Insane DCEmu
Insane DCEmu
Posts: 290
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Wed Oct 17, 2001 7:44 pm
Has thanked: 0
Been thanked: 0

freeing memory

Post by ssj4goku128 »

I am unsure if I am doing this right, but I want to clear the screen and the vram completely, but I was wondering if the following method would work?

Code: Select all

free(vram_s); //I know one line, but hey.
or is there another way
"So I gotta be carefull, can't let tha evil of tha money trap me
so when ya see me #@#$%
ya better holla at me "

Tupac Shakur[1971-1996]
Makaveli[1996-????]
User avatar
toastman
Iron Fist of Justice
Iron Fist of Justice
Posts: 4933
Joined: Sat Nov 10, 2001 3:08 am
Location: New Orleans
Has thanked: 0
Been thanked: 0
Contact:

Post by toastman »

memset(vram_s, 0, SCREEN_WIDTH * SCREEN_HEIGHT * 8);

Will also work.
There's probably a few other ways as well. Like using store queues or some such that will net you some better performance.


Isn't there a specific function that does this though?
No signature.
Rand Linden
bleemcast! Creator
bleemcast! Creator
Posts: 882
Joined: Wed Oct 17, 2001 7:44 pm
Location: Los Angeles, CA
Has thanked: 0
Been thanked: 0
Contact:

Post by Rand Linden »

The only time you'll "need" to clear the screen is when writing directly to the frame buffer -- and only if you're not using the 3D hardware.

Rand.
BlackAura
DC Developer
DC Developer
Posts: 9951
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Post by BlackAura »

If you want to clear everything in vram, just do this:

Code: Select all

vid_empty();
That simply erases the contents of vram, including the frame buffer, and anything else that's stored there.

Just think if that's really what you want to do. Chances are it isn't.
Rand Linden
bleemcast! Creator
bleemcast! Creator
Posts: 882
Joined: Wed Oct 17, 2001 7:44 pm
Location: Los Angeles, CA
Has thanked: 0
Been thanked: 0
Contact:

Post by Rand Linden »

If all you want to do is clear the screen, you can do it quickly by rendering without sending any polygons down.

Rand.
ssj4goku128
Insane DCEmu
Insane DCEmu
Posts: 290
Joined: Wed Oct 17, 2001 7:44 pm
Has thanked: 0
Been thanked: 0

Post by ssj4goku128 »

actually, that is what I wanted to do[just for exitting completely]. Thanks :)
"So I gotta be carefull, can't let tha evil of tha money trap me
so when ya see me #@#$%
ya better holla at me "

Tupac Shakur[1971-1996]
Makaveli[1996-????]
Rand Linden
bleemcast! Creator
bleemcast! Creator
Posts: 882
Joined: Wed Oct 17, 2001 7:44 pm
Location: Los Angeles, CA
Has thanked: 0
Been thanked: 0
Contact:

Post by Rand Linden »

That's what I figured you were doing :-)

Hence the "nice, fast, easy" solution.

Best,

Rand.
Post Reply