[cc65] Debugging stack overwrite problem

From: Karri Kaksonen <karri1sipo.fi>
Date: 2012-11-22 21:55:23
I wrote a small pong game for the Lynx using collision detection and 
some new features of the tgi driver.

But then I decided to add scores to the display.

main() {
   signed Score;

   Score++;
   itoa(Score, buffer, 10);
   tgi_outtextxy(10, 10, buffer);

}

If the Score is defined inside the main routine it increments by one, 
gets displayed but is the zeroed before the next round.

If I place it outside the main routine it works ok.

signed Score = 0;

main() {
}

I can also remove my own code and then it works even inside the main 
routine.

Obviously I have some routine that is overwriting the stack. Are there 
any tools to find what it could be?

--
Karri

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Nov 22 21:55:36 2012

This archive was generated by hypermail 2.1.8 : 2012-11-22 21:55:41 CET