Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: Elliott Lee Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: General question. Date: Thu, 07 May 1998 17:07:28 -0700 Organization: Cisco Systems Lines: 84 Message-ID: <35524CC0.B7F2B618@netmagic.net> References: <3551E529.39700A51@chowfam.demon.co.uk> <6isrju$aek3@chuka.playstation.co.uk> <35520452.5385308E@netmagic.net> <35521703.6AC7A819@chowfam.demon.co.uk> Reply-To: tenchi@cisco.com NNTP-Posting-Host: dhcp-e-39-237.cisco.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.03 [en] (Win95; U) James Chow wrote: > Elliott Lee wrote: > > Mark Wilson wrote: > > > >I was wondering if all TIMs have to loaded into main memory > > > >first then copied over using LoadImage or is it possible to > > > >load them directly into the VRAM? > > [...] > > > Once TIMs have been transferred into the frame buffer, then generally > > > speaking you don't need them anymore in the main memory any more. This space > > > could then be used for your program's data. > > > > > How do you free the space used up by the TIMs after transferring them > to VRAM? > But they weren't malloc'ed in the first place. They were just put there. Like Mark Wilson said, just allocate a buffer. I don't think you have to clear it because it will get overwritten. I like to make a general- purpose buffer: char *workbuf; workbuf = malloc( 65536u ); if( workbuf==0 ) // fail on malloc? exit(0); Now see below. > > > > Extending this: take all your TIMs, compress them into 1 data file, > > upload that to the Yaroze, extract each TIM 1 by 1 into a spare memory > > scratchpad and upload them to the frame buffer. It'll let you save > > tons of space with those large 16-bit/24-bit images. > > > > How? > Can you give me a suitable algorithm? > > Cheers. > -- > jc Assume that you've got your images compressed in a PKZIP-like archive and it's sitting in memory at 0x80140000. Assume that you have been given a compression/decompression library. Then you could do something like: #define TIM_PACK_ADDR 0x8014000 int i; char *workbuf; // get some space for extraction workbuf = malloc( 65536u ); if( workbuf==0 ) // fail on malloc? exit(0); for( i=0; i