GP32 Weird Crashing Problem


z80hastings

Still Fresh
Joined
Apr 13, 2004
Messages
4
Website
Visit site
Hi, come across a very weird problem; not sure whats causing it - so wondered if anyone else come across a similar problem? Ive been working on a game in C, testing using GeePee32 and then on a real GP32. Everything working perfectly (devkitadv / GP32 Ide).. Then I added a title page function and keeps crashing both the emulator and real GP32; ive removed the call to this function and many others - still crashing :( Had a similar problem few years ago on GameBoy project - that turned out to be a setting somewhere about size of code which Id exceeded. Any ideas? Pretty difficult to give example code, as Ive said removed / commented out all functions, some functions, etc, etc - still same problem.
 
Yeh :( tried compilling an older 'hello world' project too - that works fine. Even tried removing a lot of code and bitmap arrays/etc to reduce size see if that solves it - no luck yet.
 
It could be a buffer overrun somewhere which didn't show before, but after adding new code variables get moved around in the data section and now it may be showing itself.

The most useful debugging function I've come up with so far, is one that just prints a specified line of text at the top of the screen and waits for you to press a button. Then you whack a load of calls to this function in your code and eventually you can see where it is crashing.
 
Robert_John_Shepherd posted on Apr 28 2004 at 10:22 AM said:
The most useful debugging function I've come up with so far, is one that just prints a specified line of text at the top of the screen and waits for you to press a button.
I hear that! Though, I must say that mine prints at the BOTTOM of the screen. So, who wins there?

Just as Robert sayd, make a function to print to the screen, and then put calls to it all through your code. At least then you'll get an idea of where you're crashing.

Also, if you want to print variables out, here's what I usually do.

char message[50];
sprintf(message, "i=%d j=%d", i, j);
PauseMessage(message);

It's quick and dirty, but it usually gets you where you want to go.
 
Last edited by a moderator:
Thank for all the sugestions, i left code for a day and went back to it - eventually tracking down the bug...ironically enough in a call to my own text functions (used for variable character width fonts); not sure why it suddenly started to show, looks like during tidying up all my comments i inadvertantly changed something.

Anyway thanx for the suggestions, nice to know people are trying to help :D

With any luck I'll upload a demo soon
 
Back
Top