gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Where did the VBlank go?

#121621 - Robthar - Tue Mar 13, 2007 3:57 pm

When I tryed code from Chris Doubles Page i got errors because of an undefined Macro. How can I manage to bring a swiWaitForVBlank in my projects?

#121622 - Lick - Tue Mar 13, 2007 4:01 pm

If you don't want to do anything in your vblank, do the following:
Code:
irqInit();
irqSet(IRQ_VBLANK, 0);
irqEnable(IRQ_VBLANK);

...
swiWaitForVBlank();


If you want to do some stuff in your vblank, do the following:
Code:
void onVBlank()
{
//meh meh meh.. code!
}

irqInit();
irqSet(IRQ_VBLANK, onVBlank);
irqEnable(IRQ_VBLANK);

...
swiWaitForVBlank();

_________________
http://licklick.wordpress.com

#121724 - Robthar - Wed Mar 14, 2007 9:48 am

Didn't I have to set a Register to tell the DS I handled the VBLank

#121734 - Lick - Wed Mar 14, 2007 12:18 pm

The irq***() functions will do it for you. Those functions are part of libnds, and together they form a more stable way of handling interrupts.
_________________
http://licklick.wordpress.com

#121748 - Robthar - Wed Mar 14, 2007 2:33 pm

Ok