Path: chuka.playstation.co.uk!news From: 101655.153@compuserve.com Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: Tim's work...But what is a Ira's *.dat file? Date: Thu, 14 May 1998 22:14:15 GMT Organization: PlayStation Net Yaroze (SCEE) Lines: 44 Message-ID: <35686c5a.4112960@news.playstation.co.uk> References: <355157b3.45616485@news.scea.sony.com> NNTP-Posting-Host: ld12-242.lon.compuserve.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Newsreader: Forte Agent 1.5/16.451 zain@niagara.com (Zain Dinath) wrote: >I got the Tim files to load properly. It seems that you cannot just >place tim files in the VRAM arbitrarily. THe code reads the file at a >specific point and only there. I had to move the tim file around using >TimTool until the PSX displayed it correctly. Has anyone else had to >do this? Does anyone know why I can't place Tim files in the VRAM >anywhere I want? Does this have anything to do with texture pages? Any >comments would be appreciated. In a word, yes. I haven't seen Ira's code but I'm guessing it's not too dissimilar from 2d*.zip files in the demos section. There's two issues: 1) Tim images have to be at the (x,y) coordinate in the frame buffer that your code expects. If the tim is at the wrong location random junk will be used instead (sometimes by chance you'll see part of the tim image you want being used because tim and sprite regions happen to overlap) 2) the basic pipeline of displaying Tim files as sprites is,as I remember it ( it's been a while since I looked at this ): Tim from PC (siocons)-> PSX RAM (LoadImage)-> frame buffer (x, y) (GetTPage)-> Texture Page (set GSSprite TPage member)-> Sprite (GsSortSprite) -> Ordering Table (DrawOt and DispBuf) -> image on TV screen(!) If your tim is not aligned to integral mulitples of 64 in the x direction and 256 int y direction then you'll need to set the sprite member u and v that define an offset in the texture page. I have some font drawing code that demonstrates this. It takes a Fastgraph FGF font file and dynamically converts it to a 4-bit CLUT image in the frame with transparent background and non-transparent characters. The fgf_printc() function draws a string by repeatedy using a single GsSprite with different u and v Texture Page offsets. A cool way of having coloured without using up more frame buffer space is to change the GsSprite members R,G,B each time you need a new colour. I should mention that sprites are limited in size to 256 x 256 pixels. If you need bigger sprite you'll need to use multiple sprites, or you could use MoveImage instead of using sprites.