Path: chuka.playstation.co.uk!news From: James Shaughnessy Newsgroups: scee.yaroze.beginners Subject: Re: GpuPacketArea query. Date: Sat, 27 Jun 1998 10:49:07 +0100 Organization: Bacardi Ferrari V12 Lines: 36 Message-ID: <3594C013.116@manc.u-net.com> References: <35557807.6E248247@chowfam.demon.co.uk> <3558DF85.7C89DA42@ndirect.co.uk> <3559D87E.D5C1EBD1@chowfam.demon.co.uk> NNTP-Posting-Host: manc.u-net.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.0 (Win95; I) James Chow wrote: > Why does, declaring any of the following > PACKET GpuPktArea[2][31]; or > PACKET GpuPktArea[2][63]; or > PACKET GpuPktArea[2][255]; or > PACKET GpuPktArea[2][511]; or > PACKET GpuPktArea[2][1023]; > (...you get the idea...) > lock up the program? Why do you choose 2^n-1? Why not just 2^n, or 2^(n-1)? Are you not supposed to long word align your arrays and structures? (Using padding variables/even addresses as necessary) I guess it's okay to just make it even (ie word aligned) in the case of the PACKET array because it is 2-dimesional - gpupacket[2][n] - which naturally will longword align even if n is only word aligned. If you see what I mean. Anyways, I think the problem here is not so much that the PACKET array is an odd size or whatever, but that the next structure is not aligned and so cannot be accessed, which is possibly your GsLINE variable or whatever (even if you only have 1 line of code the psxlib stuff will slap something there), and it is THIS which is causing the crash. Of course, I could be totally wrong :) Jim PS I still use the old formula for packet space: PACKET GpuPacketArea[2][NUM_SPRITES*sizeof(GsSPRITE)]; "sizeof(GsSPRITE)" is a macro unless I'm very much mistaken. Usually when I don't allow enough for NUM_SPRITES I get wierd effects like flickering sprites. It is amazingly difficult to actually get the PlayStaion to crash, I find! -- ----------------------------------------- James Shaughnessy james@manc.u-net.com http://www.netyaroze-europe.com/~shaughnj -----------------------------------------