swiWaitForVBlank crashing (solved)
Posted: Thu Mar 25, 2010 8:44 pm
Hello,
I have a homebrew project I have been developing on and off for a few years, and I only recently upgraded to the latest version of libnds. The conversion went smoothly and I continued work using the DeSmuME emulator for testing.
Well, when I finally got around to trying the program out on my actual DS, it started crashing in arbitrary, but reproducible circumstances. I switched emulators to NO$GBA, and it reproduced the same crashes. Needless to say, i am continuing development with NO$GBA.
I was able to track the crashes down to the swiWaitForVBlank() function, with some weird consequences for including some of the old interrupt initialization routines.
If I have this:
int main {
...
irqInit();
irqEnable(IRQ_VBLANK);
...
swiWaitForVBlank();
...
}
then the game does not crash, but the X button does not work. I assume the X button problem is based on the fact that irqInit() is no longer necessary and messes up ARM7 interrupts.
So if I try:
int main {
...
irqEnable(IRQ_VBLANK);
...
swiWaitForVBlank();
...
}
then swiWaitForVBlank() crashes during certain actions.
Trying:
int main {
...
// (none)
...
swiWaitForVBlank();
...
}
crashes in the same way.
For completeness, trying:
int main {
...
irqInit();
...
swiWaitForVBlank();
...
}
results in sprites not being loaded and a general mess.
I realize that you can't help debugging this problem without more code, so I'm not asking for that (unless there is something specific you'd like to see). What I'm hoping for is suggestions on what sort of problem might be causing swiWaitForVBlank() to crash during actions like "attack when facing up" but not during "attack when facing down".
Thanks,
Quazgaa
I have a homebrew project I have been developing on and off for a few years, and I only recently upgraded to the latest version of libnds. The conversion went smoothly and I continued work using the DeSmuME emulator for testing.
Well, when I finally got around to trying the program out on my actual DS, it started crashing in arbitrary, but reproducible circumstances. I switched emulators to NO$GBA, and it reproduced the same crashes. Needless to say, i am continuing development with NO$GBA.
I was able to track the crashes down to the swiWaitForVBlank() function, with some weird consequences for including some of the old interrupt initialization routines.
If I have this:
int main {
...
irqInit();
irqEnable(IRQ_VBLANK);
...
swiWaitForVBlank();
...
}
then the game does not crash, but the X button does not work. I assume the X button problem is based on the fact that irqInit() is no longer necessary and messes up ARM7 interrupts.
So if I try:
int main {
...
irqEnable(IRQ_VBLANK);
...
swiWaitForVBlank();
...
}
then swiWaitForVBlank() crashes during certain actions.
Trying:
int main {
...
// (none)
...
swiWaitForVBlank();
...
}
crashes in the same way.
For completeness, trying:
int main {
...
irqInit();
...
swiWaitForVBlank();
...
}
results in sprites not being loaded and a general mess.
I realize that you can't help debugging this problem without more code, so I'm not asking for that (unless there is something specific you'd like to see). What I'm hoping for is suggestions on what sort of problem might be causing swiWaitForVBlank() to crash during actions like "attack when facing up" but not during "attack when facing down".
Thanks,
Quazgaa