making the DS pause for a set amount of time

support for the ARM toolchain
Post Reply
jettehhawk
Posts: 1
Joined: Mon Sep 12, 2011 11:57 am

making the DS pause for a set amount of time

Post by jettehhawk » Mon Sep 12, 2011 12:10 pm

So i'm trying to write a program on the DS (in c++ command line only) and i have come across a bit of a problem. I need the program to stop for a set amount of time so that it is not all processing fast, however I do not want it to stop or make the user have to press a button to continue. See I need to do what the Sleep() function in the windows.h header does but as this does not work for the compiler I need an alternative.
Please help.

WinterMute
Site Admin
Posts: 1862
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: making the DS pause for a set amount of time

Post by WinterMute » Mon Sep 12, 2011 8:42 pm

The easiest way to do this is just call swiWaitForVBlank multiple times, i.e. for a 1 second pause use something like

Code: Select all

int count = 60;
while(count--) swiWaitForVBlank;
for longer/shorter delays then just muliply the number of seconds you want by 60.
Help keep devkitPro toolchains free, Donate today

Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests