Path: chuka.playstation.co.uk!news From: Philip Gooch Newsgroups: scee.yaroze.beginners Subject: Re: Still strugglin' with the basics: broken sprite code (long) Date: Thu, 16 Jul 1998 15:22:12 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 38 Message-ID: <35AE0C94.1D8D32A3@easynet.co.uk> References: <35AD6DE7.11E5@funnytown.com> NNTP-Posting-Host: 193.131.140.246 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.05 [en] (Win95; I) Gerrit Goossen wrote: > >What happens is that when I run the program I get the Yaroze boot-up > screen, then the screen flashes briefly before returning to the boot- > >up screen. > > > >What's weird is that in Codewarrior, if I change my data address > >in Linker Settings from the default 0x00000000 to 0x80140000, I get a > >very large (700K) executable, except this time the screen goes black >and I get a line of garbage along the bottom. > > Maybe some techies have a different opinion, but it's probably a wise > idea to leave the data address at 0L and let the linker figure things > out for you? > > As for what's going wrong, have you explored the Metrowerks debugger at > all? There's a handy panel that will let you back-trace through the > stack which can help you figure out which function is dying. > > BTW, I agree with Alex; If you backtrack a bit I'm sure you'll find > "GsSortFastSprite" is dying because your OTTags are stored locally and > disappearing before you use 'em. Of course because it's such a small > app., the code *might* still run fine if nothing writes over where the > local variables "used" to exist. (I guess CW does a little more clean-up > than GCC :) > > - Gerrit Cheers Gerrit I haven't made much use of the debugger. I'll be sure to start using now. The stack trace facility sounds useful. I must admit I'm not very up on what goes on under the hood in terms of how and where storage space is allocated. Some people have suggested using malloc() to dynamically allocate memory from the heap for all the ordering table-related stuff, rather than using arrays. If you know what you're doing (unlike me!) this sounds like a good approach. Phil