Path: chuka.playstation.co.uk!news From: "Steve Dunn" Newsgroups: scee.yaroze.programming.codewarrior Subject: Re: MWDebugIO Date: Wed, 1 Jul 1998 18:02:48 +0100 Organization: Backroom Software Ltd. Lines: 68 Message-ID: <6ndqd5$sub14@chuka.playstation.co.uk> References: <359A3B82.2267A83D@easynet.co.uk> <359A43E3.CD8101E3@hinge.mistral.co.uk> <359A4F13.6927AD1A@easynet.co.uk> NNTP-Posting-Host: userk173.uk.uudial.com X-Newsreader: Microsoft Outlook Express 4.72.2106.4 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Just a 'wild' (very wild) thought, don't know if it'll work or not... use __declspec( bss ) for all 'disposable' C structs created with bin2hex, and then use __declspec( sbss ) for the rest of the unitialised data... For instance... __declspec(bss) char c[]={"1234567890"} ; (this would be the tim file as an array) __declspec(sbss) int nLives ; Next thing to do is load all the disposable stuff into VRAM that's contained in the bss section and (here comes the main bit I'm not sure about) tell the psx that the heap starts at the 'start' of the bss section. Something like this... InitHeap( _fbss, newheapsize ) ; Another 'possible' alternative is to shuffle everything around (data, sdata, sbss, and bss), so that '.data' is at the end, then init your heap all over it when you've finished loading what was in it. Look in __rts_info_t__.h. There lots of interesting pointers in there. As I said, just a thought. Someones soon gonna come along and tell me I'm talking a load of sh!t :) Steve Philip Gooch wrote in message <359A4F13.6927AD1A@easynet.co.uk>... > > >Craig Graham wrote: > >> Philip Gooch wrote: >> >> > But, I don't know how to free up this memory afterwards. Because it's >> > not dynamically allocated, free(p) won't work, will it? Do I just set p >> > to NULL? Have I answered my own question? >> >> To get back the memory used for TIM's you've loaded into VRAM already,what >> you can do is organise all such 'disposable' TIM's to be AFTER your >> code and other data. Then, you can re-initialise the malloc system after >> loading >> the TIM's to the VRAM so that you will get the memory back for use >> at runtime... >> >> (yes, I'm aware that most people don't do this and put their graphics data >> before >> the code in memory - well, you don't get the memory back to the heap if you >> do it that way) >> > >Thanks Craig. And if storing my TIM as static data in an array (using Steve >Dunn's bin2hex program), how can I free up the memory taken up by the array >afterwards? > >Thanks in advance > >Phil >