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 > Wait() or Delay()

#93028 - iainprice - Sun Jul 16, 2006 4:36 pm

How can I make my NDS wait for 2 seconds.....

other thatn doing a loop several thousand times.....

#93030 - Mighty Max - Sun Jul 16, 2006 4:49 pm

Create a timer, that IRQs after given time.
Disable all other interrupts
Set the arm-cpu into halt mode via cp15 (see references)

It will continue to work after the IRQ happened.
_________________
GBAMP Multiboot

#93043 - tepples - Sun Jul 16, 2006 6:51 pm

You don't need to use a timer for this. Try something along these lines:
Code:
for(int i = 120; i > 0; --i) vsync();

_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#93048 - iainprice - Sun Jul 16, 2006 7:20 pm

Cheers

#93068 - Mighty Max - Sun Jul 16, 2006 9:21 pm

tepples wrote:
You don't need to use a timer for this. Try something along these lines:
Code:
for(int i = 120; i > 0; --i) vsync();


Bah, why easy if you can do it complicated?
_________________
GBAMP Multiboot