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.

Beginners > Delays on the GBA

#33965 - Ilomoga - Tue Jan 11, 2005 7:22 pm

I want to write a little program, but for that I need some kind of a delay because I want to show a picture for example 10 seconds and than go over to the next one. But how can I use delay?

#33967 - poslundc - Tue Jan 11, 2005 7:31 pm

If your program's main loop is set up to cycle once every VBlank (as it should be), the main loop will cycle approximately every 1/60th of a second.

So if you use a variable to count the number of times your main loop has cycled, you can tell how much time has transpired. 60 cycles = 1 second, and 600 cycles = 10 seconds.

Dan.