Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: daverh@ix.netcom.com (David Hathaway) Newsgroups: scea.yaroze.programming.2d_graphics Subject: Re: Help! Lockup on load. Date: Tue, 26 Aug 1997 21:35:30 GMT Organization: SCEA News Server Lines: 53 Message-ID: <5tvi0m$pn84@scea> References: <5tsgpp$m6f2@scea> NNTP-Posting-Host: pas-ca10-23.ix.netcom.com X-Newsreader: Forte Free Agent 1.0.82 daverh@ix.netcom.com (David Hathaway) wrote: >HELP!!! I have the following code in my program: > enum > { > SPRITE1, > SPRITE2, > SPRITE3, > SPRITE4, > SPRITE5, > SPRITE6, > SPRITE7, > SPRITE8, > //SPRITE9, > NUMBER_OF_SPRITES > }; > unsigned long TIM_ADDRESS[NUMBER_OF_SPRITES]; >Everything works fine UNTIL I uncomment SPRITE9, then the program no >longer loads. It downloads to the Yaroze but never starts up. I have >a printf as the first line of code in my program, but it never shows >up on my PC: > printf("Starting program.\n"); >Anyone have any ideas? This is a very strange bug. I've been trying >to debug it, but I can't seem to get the debugger working either >(packet errors). >Thanks, > Dave >p.s. I also tried using #DEFINEs instead of enums and got the same >results. I figured it out myself by comparing a 'good' version of my program's mapfile with a 'bad' version. In the 'good' version the array wasn't listed at all. In the 'bad' version it was put in a section called "COMMON". Why did the compiler/linker do this just because I added elements to the array, I just don't know. The 'fix' for this problem is to simply make the array static. Dave