Having an error with a GBA program...,
Members - Reputation: 122
Posted 11 June 2002 - 05:38 AM
Posted 11 June 2002 - 12:20 PM
Suggestion #1: Declare the variables.
Suggestion #2: Learn C before trying to use it on GBA.
Suggestion #3: sp is a horrible name for anything except the stack pointer.
That is all.
Members - Reputation: 375
Posted 12 June 2002 - 01:31 AM
Are these global variables for your code? What is on and around the lines causing the errors? It''d be helpful to see some code to help you. Read the FAQ on how to paste in source code correctly with pretty highlighting and everything.
To the AP who replied, not really very helpful comments are they. Suggestions 1 and 3 are apt but suggestion 2 is only counter-productive.
Members - Reputation: 1657
Posted 12 June 2002 - 01:58 AM
Original post by CGalyon
As near as I can tell, the first three "errors" aren''t really causing any problems. And I can''t figure out where the "fatal error" is.
Those 3 unimportant errors are causing the "fatal" error. The "fatal" error is that gcc can''t compile your program because its got undeclared (unknown) variables in it (as specified by your three errors).
Unless it calls it a "warning" all "errors" are bad and must be fixed in order to compile and run the program. All compiler "errors" are problems, they all cause problems that will prevent you from compiling your program.
Members - Reputation: 122
Posted 13 June 2002 - 09:34 AM
Ok, well, the problem has finally been resolved. One of the problems was that I had a header file (gba.h) that included most of the other header files I'd inserted. The gba.h header file had an error in defining the function, but the other file had it correct. So I corrected the gba.h and deleted the others. Anyway, now that works, but I have other errors.
If you'd care to take a stab at them.
Basically, the program compiles, but when run through Mappy (I just happen to use this one as it was recommended), I get garbled junk on the top left of the screen (it reaches the top edge, but not the left edge). It appears that either the header file for the sprite is messed up, or the loop that copies the sprite data to the OAMData is messed up. I'm going to experiment with some of the various pcx2sprite converters out there to see if that's the case. The loop doesn't have any glaring problems just yet, but I'll post it so you can take a look.
OAMData[x_loop+y_loop * 256]=sprite1Data[index];
Thanks for the helpful responses. I am relearning C after about 10 years or so of absence. So yeah, I'm rusty on a lot of things. Any complaints regarding my notation should be directed at the originator of the code who has proven himself more than a competent programmer. For my part, I'm simply utilizing someone's tutorials to help me remember everything.
[edited by - CGalyon on June 13, 2002 4:36:12 PM]