[Tuxnes-devel] Uninitialized(??) statics in mapper.c:mmc1()
Brought to you by:
tmmm
From: Jim U. <ji...@3e...> - 2001-03-10 05:08:03
|
In my port to the dreamcast, I had trouble with MMC1 games until I changed static int mmc1reg[4]; static int mmc1shc[4]; in mapper.c's mmc1() to static int mmc1reg[4] = { 0 }; static int mmc1shc[4] = { 0 }; Debugging output confirms these were not originally initialized to zero at the beginning of the program. However, my understanding is that C -guarantees- that static (and global) variables will be initialized to zero, without explicitly doing this. Can anyone explain or venture a guess as to why (compiler, etc.) none of my globals/statics are being initialized? Virtually every problem I've had so far is due to variables not being initialized; this would save me a lot of pain... -- "But if food is so good for you, how come the body keeps trying to get rid of it?" -- breatharian.com ji...@3e... / 0x43340710 / 517B C658 D2CB 260D 3E1F 5ED1 6DB3 FBB9 4334 0710 |