Path: chuka.playstation.co.uk!news From: ScoTT Campbell Newsgroups: scee.yaroze.programming.2d_graphics,scee.yaroze.beginners Subject: Re: Trying to display a sprite Date: Wed, 24 Feb 1999 00:31:16 +0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 52 Message-ID: <36D34854.92429E91@escotia.freeserve.co.uk> References: <7av5sm$9po1@chuka.playstation.co.uk> <7av7s5$8jb8@scea> NNTP-Posting-Host: modem-90.icehockey.dialup.pol.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en Xref: chuka.playstation.co.uk scee.yaroze.programming.2d_graphics:897 scee.yaroze.beginners:719 I don't know whether Charles' advice has worked but I know I certainly use (u_long*)(spriteAdd+4) without problems. If you are using Ira Rainey's sprite rather than your own, unless you've modified it with timTool or similar then you are loading it into the double buffers and then overwriting it. This is because Ira used NTSC and put the sprite into the space below the buffers, rather than to the side. Of course there is no space below the buffers when you use PAL. Solution: Move the sprite somewhere safe using timTool. I spent AGES working this out when I first got my Yaroze. I hope this helps. If you've got access to siocons there's a bare bones sprite display demo an my site too. ScoTT Charles Nicholson wrote: > Umm... most of it looks pretty good- You might want to change the line in > InitSprite() that calls GsGetTimInfo though... > > Your first parameter, "(u_long *)(spriteAdd + 4)" should probably be changed > to > "(u_long *)(spriteAdd + 1)". > > The information that GetTimInfo needs is actually 4 bytes in from the > header. Since you're casting spriteAdd to a u_long, it will multiply any > addition you do (in this case +4) by the size of a u_long. The final offset > calculated (in bytes, not dwords) by "(u_long *)(spriteAdd + 4)" is 16 bytes > into spriteAdd. (u_long *)(spriteAdd + 1) will give you the proper 4 byte > advancement. > > This was a real pain for me too... :) > > hope i helped. > -charles > > >I've just typed out the code at the end of Ira Rainey's tutorial (typed, > not > >copied and pasted, to try and gain some experience, and extra knowledge > from > >doing so. However, I've compiled, and attempted to run, it flashes > something > >very quickly on the screen, and then the screen goes blank, with the thick > >black strips at the top and bottom. Anyway, I've attached the code, so if > >anyone has the chance to look at it, and tell me what's been copied > >incorrectly, or what's in the wrong order, etc. I would be very thankful. > > > >Rikki