@@ -47,10 +47,16 @@ #import "OFAutoreleasePool+Private.h" #ifdef _WIN32 # include #endif + +#ifdef OF_NINTENDO_DS +# define asm __asm__ +# include +# undef asm +#endif #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFNotImplementedException.h" #import "OFOutOfRangeException.h" @@ -193,10 +199,19 @@ if (rqtp.tv_sec != floor(timeInterval)) @throw [OFOutOfRangeException exception]; nanosleep(&rqtp, NULL); +#elif defined(OF_NINTENDO_DS) + uint64_t counter; + + if (timeInterval > UINT64_MAX / 60) + @throw [OFOutOfRangeException exception]; + + counter = timeInterval * 60; + while (counter--) + swiWaitForVBlank(); #else if (timeInterval > UINT_MAX) @throw [OFOutOfRangeException exception]; sleep((unsigned int)timeInterval);