Path: chuka.playstation.co.uk!news From: "Kezza aol.com"> Newsgroups: scee.yaroze.programming.2d_graphics,scee.yaroze.beginners Subject: Re: Trying to display a sprite Date: Sat, 27 Mar 1999 01:06:14 +0000 Organization: StreetWise Consulting Limited. Lines: 73 Message-ID: <7dhavb$lmc8@chuka.playstation.co.uk> References: <7av5sm$9po1@chuka.playstation.co.uk> <7av7s5$8jb8@scea> <7avh7s$9po2@chuka.playstation.co.uk> <7avte3$8jb9@scea> Reply-To: "swiseltd@ aol.com" <"remove no spam"> NNTP-Posting-Host: 98CC2486.ipt.aol.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.51 [en] (Win98; I) X-Accept-Language: en Xref: chuka.playstation.co.uk scee.yaroze.programming.2d_graphics:920 scee.yaroze.beginners:756 Hmmm, Just a guess from a total novice, but maybe +1 and +4 are worked out by the compiler to fit into the same 4-byte boundary, and therefor the same physical memory address? -Kezza http://www.netyaroze-europe.com/~kmillar Charles Nicholson wrote: > heh... funny. I've been looking through all my code (just to double check > at the chance of sounding like a fool), and it all has the sprite address + > 1 inside the cast. Go figure- seems to work fine for me... :) > > ah well. > -charles > > Peter Dollochan wrote in message <7avh7s$9po2@chuka.playstation.co.uk>... > >Hi all > > > >I think the addition is carried out before the cast so keep the +4 or it'll > >break :) apart from that Scott is right after the first draw your blank out > >the sprite and clut.. > > > > > >Pete. > > > > > >Charles Nicholson wrote in message <7av7s5$8jb8@scea>... > >>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 > >> > >> > >> > > > >