Index: tests/OFDNSResolverTests.m ================================================================== --- tests/OFDNSResolverTests.m +++ tests/OFDNSResolverTests.m @@ -25,10 +25,12 @@ - (void)DNSResolverTests { void *pool = objc_autoreleasePoolPush(); OFDNSResolver *resolver = [OFDNSResolver resolver]; OFMutableString *staticHosts = [OFMutableString string]; + + of_stdout.foregroundColor = [OFColor lime]; for (OFString *host in resolver.staticHosts) { OFString *IPs; if (staticHosts.length > 0) @@ -37,30 +39,37 @@ IPs = [[resolver.staticHosts objectForKey: host] componentsJoinedByString: @", "]; [staticHosts appendFormat: @"%@=(%@)", host, IPs]; } - PRINT(GREEN, @"Static hosts: %@", staticHosts); - - PRINT(GREEN, @"Name servers: %@", - [resolver.nameServers componentsJoinedByString: @", "]); - - PRINT(GREEN, @"Local domain: %@", resolver.localDomain); - - PRINT(GREEN, @"Search domains: %@", - [resolver.searchDomains componentsJoinedByString: @", "]); - - PRINT(GREEN, @"Timeout: %lf", resolver.timeout); - - PRINT(GREEN, @"Max attempts: %u", resolver.maxAttempts); - - PRINT(GREEN, @"Min number of dots in absolute name: %u", - resolver.minNumberOfDotsInAbsoluteName); - - PRINT(GREEN, @"Uses TCP: %u", resolver.usesTCP); - - PRINT(GREEN, @"Config reload interval: %lf", - resolver.configReloadInterval); + [of_stdout writeFormat: @"[OFDNSResolver] Static hosts: %@\n", + staticHosts]; + + [of_stdout writeFormat: @"[OFDNSResolver] Name servers: %@\n", + [resolver.nameServers componentsJoinedByString: @", "]]; + + [of_stdout writeFormat: @"[OFDNSResolver] Local domain: %@\n", + resolver.localDomain]; + + [of_stdout writeFormat: @"[OFDNSResolver] Search domains: %@\n", + [resolver.searchDomains componentsJoinedByString: @", "]]; + + [of_stdout writeFormat: @"[OFDNSResolver] Timeout: %lf\n", + resolver.timeout]; + + [of_stdout writeFormat: @"[OFDNSResolver] Max attempts: %u\n", + resolver.maxAttempts]; + + [of_stdout writeFormat: + @"[OFDNSResolver] Min number of dots in absolute name: %u\n", + resolver.minNumberOfDotsInAbsoluteName]; + + [of_stdout writeFormat: @"[OFDNSResolver] Uses TCP: %u\n", + module, resolver.usesTCP]; + + [of_stdout writeFormat: + @"[OFDNSResolver] Config reload interval: %lf\n", + resolver.configReloadInterval]; objc_autoreleasePoolPop(pool); } @end Index: tests/OFIPXSocketTests.m ================================================================== --- tests/OFIPXSocketTests.m +++ tests/OFIPXSocketTests.m @@ -38,21 +38,20 @@ R(address1 = [sock bindToPort: 0 packetType: 0])) } @catch (OFBindFailedException *e) { switch (e.errNo) { case EAFNOSUPPORT: - [self outputString: @"[OFIPXSocket] " - @"-[bindToPort:packetType:]: " - @"IPX unsupported, skipping tests\n" - inColor: GREEN]; + of_stdout.foregroundColor = [OFColor lime]; + [of_stdout writeLine: + @"[OFIPXSocket] -[bindToPort:packetType:]: " + @"IPX unsupported, skipping tests"]; break; case EADDRNOTAVAIL: - [self outputString: @"[OFIPXSocket] " - @"-[bindToPort:packetType:]: " - @"IPX not configured, skipping " - @"tests\n" - inColor: GREEN]; + of_stdout.foregroundColor = [OFColor lime]; + [of_stdout writeLine: + @"[OFIPXSocket] -[bindToPort:packetType:]: " + @"IPX not configured, skipping tests"]; break; default: @throw e; } Index: tests/OFLocaleTests.m ================================================================== --- tests/OFLocaleTests.m +++ tests/OFLocaleTests.m @@ -17,24 +17,27 @@ #include "config.h" #import "TestsAppDelegate.h" -static OFString *module = @"OFLocale"; - @implementation TestsAppDelegate (OFLocaleTests) - (void)localeTests { void *pool = objc_autoreleasePoolPush(); - PRINT(GREEN, @"Language: %@", [OFLocale language]); - - PRINT(GREEN, @"Territory: %@", [OFLocale territory]); - - PRINT(GREEN, @"Encoding: %@", - of_string_name_of_encoding([OFLocale encoding])); - - PRINT(GREEN, @"Decimal point: %@", [OFLocale decimalPoint]); + of_stdout.foregroundColor = [OFColor lime]; + + [of_stdout writeFormat: @"[OFLocale]: Language: %@\n", + [OFLocale language]]; + + [of_stdout writeFormat: @"[OFLocale]: Territory: %@\n", + [OFLocale territory]]; + + [of_stdout writeFormat: @"[OFLocale]: Encoding: %@\n", + of_string_name_of_encoding([OFLocale encoding])]; + + [of_stdout writeFormat: @"[OFLocale]: Decimal point: %@\n", + [OFLocale decimalPoint]]; objc_autoreleasePoolPop(pool); } @end Index: tests/OFSCTPSocketTests.m ================================================================== --- tests/OFSCTPSocketTests.m +++ tests/OFSCTPSocketTests.m @@ -40,14 +40,14 @@ (port = [server bindToHost: @"127.0.0.1" port: 0])) } @catch (OFBindFailedException *e) { switch (e.errNo) { case EPROTONOSUPPORT: - [self outputString: @"[OFSCTPSocket] " - @"-[bindToHost:port:]: SCTP " - @"unsupported, skipping tests\n" - inColor: GREEN]; + of_stdout.foregroundColor = [OFColor lime]; + [of_stdout writeLine: + @"[OFSCTPSocket] -[bindToHost:port:]: " + @"SCTP unsupported, skipping tests"]; break; default: @throw e; } Index: tests/OFSPXSocketTests.m ================================================================== --- tests/OFSPXSocketTests.m +++ tests/OFSPXSocketTests.m @@ -90,24 +90,26 @@ TEST(@"-[bindToPort:]", R(address1 = [sockServer bindToPort: 0])) } @catch (OFBindFailedException *e) { switch (e.errNo) { case EAFNOSUPPORT: - [self outputString: @"[OFSPXSocket] -[bindToPort:]: " - @"IPX unsupported, skipping tests\n" - inColor: GREEN]; + of_stdout.foregroundColor = [OFColor lime]; + [of_stdout writeLine: + @"[OFSPXSocket] -[bindToPort:]: " + @"IPX unsupported, skipping tests"]; break; case ESOCKTNOSUPPORT: - [self outputString: @"[OFSPXSocket] -[bindToPort:]: " - @"SPX unsupported, skipping tests\n" - inColor: GREEN]; + of_stdout.foregroundColor = [OFColor lime]; + [of_stdout writeLine: + @"[OFSPXSocket] -[bindToPort:]: " + @"SPX unsupported, skipping tests"]; break; case EADDRNOTAVAIL: - [self outputString: @"[OFSPXSocket] -[bindToPort:]: " - @"IPX not configured, skipping " - @"tests\n" - inColor: GREEN]; + of_stdout.foregroundColor = [OFColor lime]; + [of_stdout writeLine: + @"[OFSPXSocket] -[bindToPort:]: " + @"IPX not configured, skipping tests"]; break; default: @throw e; } Index: tests/OFSPXStreamSocketTests.m ================================================================== --- tests/OFSPXStreamSocketTests.m +++ tests/OFSPXStreamSocketTests.m @@ -90,27 +90,26 @@ TEST(@"-[bindToPort:]", R(address1 = [sockServer bindToPort: 0])) } @catch (OFBindFailedException *e) { switch (e.errNo) { case EAFNOSUPPORT: - [self outputString: @"[OFSPXStreamSocket] " - @"-[bindToPort:]: " - @"IPX unsupported, skipping tests\n" - inColor: GREEN]; + of_stdout.foregroundColor = [OFColor lime]; + [of_stdout writeLine: + @"[OFSPXStreamSocket] -[bindToPort:]: " + @"IPX unsupported, skipping tests"]; break; case ESOCKTNOSUPPORT: - [self outputString: @"[OFSPXStreamSocket] " - @"-[bindToPort:]: " - @"SPX unsupported, skipping tests\n" - inColor: GREEN]; + of_stdout.foregroundColor = [OFColor lime]; + [of_stdout writeLine: + @"[OFSPXStreamSocket] -[bindToPort:]: " + @"SPX unsupported, skipping tests"]; break; case EADDRNOTAVAIL: - [self outputString: @"[OFSPXStreamSocket] " - @"-[bindToPort:]: " - @"IPX not configured, skipping " - @"tests\n" - inColor: GREEN]; + of_stdout.foregroundColor = [OFColor lime]; + [of_stdout writeLine: + @"[OFSPXStreamSocket] -[bindToPort:]: " + @"IPX not configured, skipping tests"]; break; default: @throw e; } Index: tests/OFSystemInfoTests.m ================================================================== --- tests/OFSystemInfoTests.m +++ tests/OFSystemInfoTests.m @@ -17,85 +17,104 @@ #include "config.h" #import "TestsAppDelegate.h" -static OFString *module = @"OFSystemInfo"; - @implementation TestsAppDelegate (OFSystemInfoTests) - (void)systemInfoTests { void *pool = objc_autoreleasePoolPush(); #ifdef OF_HAVE_FILES OFString *userConfigPath, *userDataPath; #endif - PRINT(GREEN, @"Page size: %zd", [OFSystemInfo pageSize]); - - PRINT(GREEN, @"Number of CPUs: %zd", [OFSystemInfo numberOfCPUs]); - - PRINT(GREEN, @"ObjFW version: %@", [OFSystemInfo ObjFWVersion]); - - PRINT(GREEN, @"ObjFW version major: %u", - [OFSystemInfo ObjFWVersionMajor]); - - PRINT(GREEN, @"ObjFW version minor: %u", - [OFSystemInfo ObjFWVersionMinor]); - - PRINT(GREEN, @"Operating system name: %@", - [OFSystemInfo operatingSystemName]); - - PRINT(GREEN, @"Operating system version: %@", - [OFSystemInfo operatingSystemVersion]); + of_stdout.foregroundColor = [OFColor lime]; + + [of_stdout writeFormat: @"[OFSystemInfo] Page size: %zd\n", + [OFSystemInfo pageSize]]; + + [of_stdout writeFormat: @"[OFSystemInfo] Number of CPUs: %zd\n", + [OFSystemInfo numberOfCPUs]]; + + [of_stdout writeFormat: @"[OFSystemInfo] ObjFW version: %@\n", + [OFSystemInfo ObjFWVersion]]; + + [of_stdout writeFormat: @"[OFSystemInfo] ObjFW version major: %u\n", + [OFSystemInfo ObjFWVersionMajor]]; + + [of_stdout writeFormat: @"[OFSystemInfo] ObjFW version minor: %u\n", + [OFSystemInfo ObjFWVersionMinor]]; + + [of_stdout writeFormat: @"[OFSystemInfo] Operating system name: %@\n", + [OFSystemInfo operatingSystemName]]; + + [of_stdout writeFormat: + @"[OFSystemInfo] Operating system version: %@\n", + [OFSystemInfo operatingSystemVersion]]; #ifdef OF_HAVE_FILES @try { userConfigPath = [OFSystemInfo userConfigPath]; } @catch (OFNotImplementedException *e) { userConfigPath = @"Not implemented"; } - PRINT(GREEN, @"User config path: %@", userConfigPath); + [of_stdout writeFormat: @"[OFSystemInfo] User config path: %@\n", + userConfigPath]; @try { userDataPath = [OFSystemInfo userDataPath]; } @catch (OFNotImplementedException *e) { userDataPath = @"Not implemented"; } - PRINT(GREEN, @"User data path: %@", userDataPath); + [of_stdout writeFormat: @"[OFSystemInfo] User data path: %@\n", + userDataPath]; #endif - PRINT(GREEN, @"CPU vendor: %@", [OFSystemInfo CPUVendor]); + [of_stdout writeFormat: @"[OFSystemInfo] CPU vendor: %@\n", + [OFSystemInfo CPUVendor]]; - PRINT(GREEN, @"CPU model: %@", [OFSystemInfo CPUModel]); + [of_stdout writeFormat: @"[OFSystemInfo] CPU model: %@\n", + [OFSystemInfo CPUModel]]; #if defined(OF_X86_64) || defined(OF_X86) - PRINT(GREEN, @"Supports MMX: %d", [OFSystemInfo supportsMMX]); - - PRINT(GREEN, @"Supports SSE: %d", [OFSystemInfo supportsSSE]); - - PRINT(GREEN, @"Supports SSE2: %d", [OFSystemInfo supportsSSE2]); - - PRINT(GREEN, @"Supports SSE3: %d", [OFSystemInfo supportsSSE3]); - - PRINT(GREEN, @"Supports SSSE3: %d", [OFSystemInfo supportsSSSE3]); - - PRINT(GREEN, @"Supports SSE4.1: %d", [OFSystemInfo supportsSSE41]); - - PRINT(GREEN, @"Supports SSE4.2: %d", [OFSystemInfo supportsSSE42]); - - PRINT(GREEN, @"Supports AVX: %d", [OFSystemInfo supportsAVX]); - - PRINT(GREEN, @"Supports AVX2: %d", [OFSystemInfo supportsAVX2]); - - PRINT(GREEN, @"Supports AES-NI: %d", [OFSystemInfo supportsAESNI]); - - PRINT(GREEN, @"Supports SHA extensions: %d", - [OFSystemInfo supportsSHAExtensions]); + [of_stdout writeFormat: @"[OFSystemInfo] Supports MMX: %d\n", + [OFSystemInfo supportsMMX]]; + + [of_stdout writeFormat: @"[OFSystemInfo] Supports SSE: %d\n", + [OFSystemInfo supportsSSE]]; + + [of_stdout writeFormat: @"[OFSystemInfo] Supports SSE2: %d\n", + [OFSystemInfo supportsSSE2]]; + + [of_stdout writeFormat: @"[OFSystemInfo] Supports SSE3: %d\n", + [OFSystemInfo supportsSSE3]]; + + [of_stdout writeFormat: @"[OFSystemInfo] Supports SSSE3: %d\n", + [OFSystemInfo supportsSSSE3]]; + + [of_stdout writeFormat: @"[OFSystemInfo] Supports SSE4.1: %d\n", + [OFSystemInfo supportsSSE41]]; + + [of_stdout writeFormat: @"[OFSystemInfo] Supports SSE4.2: %d\n", + [OFSystemInfo supportsSSE42]]; + + [of_stdout writeFormat: @"[OFSystemInfo] Supports AVX: %d\n", + [OFSystemInfo supportsAVX]]; + + [of_stdout writeFormat: @"[OFSystemInfo] Supports AVX2: %d\n", + [OFSystemInfo supportsAVX2]]; + + [of_stdout writeFormat: @"[OFSystemInfo] Supports AES-NI: %d\n", + [OFSystemInfo supportsAESNI]]; + + [of_stdout writeFormat: @"[OFSystemInfo] Supports SHA extensions: %d\n", + [OFSystemInfo supportsSHAExtensions]]; #endif #ifdef OF_POWERPC - PRINT(GREEN, @"Supports AltiVec: %d", [OFSystemInfo supportsAltiVec]); + [of_stdout writeFormat: @"[OFSystemInfo] Supports AltiVec: %d\n", + [OFSystemInfo supportsAltiVec]]; #endif objc_autoreleasePoolPop(pool); } @end Index: tests/TestsAppDelegate.h ================================================================== --- tests/TestsAppDelegate.h +++ tests/TestsAppDelegate.h @@ -52,34 +52,18 @@ inModule: module]; \ _fails++; \ } \ } #define R(...) (__VA_ARGS__, 1) -#define PRINT(color, fmt, ...) \ - { \ - OFString *msg = [OFString stringWithFormat: \ - @"[%@] " fmt @"\n", module, __VA_ARGS__]; \ - [self outputString: msg \ - inColor: color]; \ - } @class OFString; -enum { - NO_COLOR, - RED, - GREEN, - YELLOW -}; - @interface TestsAppDelegate: OFObject { int _fails; } -- (void)outputString: (OFString *)str - inColor: (int)color; - (void)outputTesting: (OFString *)test inModule: (OFString *)module; - (void)outputSuccess: (OFString *)test inModule: (OFString *)module; - (void)outputFailure: (OFString *)test Index: tests/TestsAppDelegate.m ================================================================== --- tests/TestsAppDelegate.m +++ tests/TestsAppDelegate.m @@ -153,17 +153,18 @@ @"\nRuntime error: Unhandled exception:\n%@\n", e]; OFString *backtrace = [OFString stringWithFormat: @"\nBacktrace:\n %@\n\n", [[e backtrace] componentsJoinedByString: @"\n "]]; - [delegate outputString: string - inColor: RED]; - [delegate outputString: backtrace - inColor: RED]; + of_stdout.foregroundColor = [OFColor red]; + [of_stdout writeString: string]; + [of_stdout writeString: backtrace]; + # if defined(OF_WII) - [delegate outputString: @"Press home button to exit!\n" - inColor: NO_COLOR]; + [of_stdout reset]; + [of_stdout writeString: @"Press home button to exit!"]; + for (;;) { WPAD_ScanPads(); if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) [OFApplication terminateWithStatus: 1]; @@ -171,21 +172,23 @@ VIDEO_WaitVSync(); } # elif defined(OF_PSP) sceKernelSleepThreadCB(); # elif defined(OF_NINTENDO_DS) - [delegate outputString: @"Press start button to exit!" - inColor: NO_COLOR]; + [of_stdout reset]; + [of_stdout writeString: @"Press start button to exit!"]; + for (;;) { swiWaitForVBlank(); scanKeys(); if (keysDown() & KEY_START) [OFApplication terminateWithStatus: 1]; } # elif defined(OF_NINTENDO_3DS) - [delegate outputString: @"Press start button to exit!" - inColor: NO_COLOR]; + [of_stdout reset]; + [of_stdout writeString: @"Press start button to exit!"]; + for (;;) { hidScanInput(); if (hidKeysDown() & KEY_START) [OFApplication terminateWithStatus: 1]; @@ -201,110 +204,47 @@ [[TestsAppDelegate alloc] init]); #endif } @implementation TestsAppDelegate -- (void)outputString: (OFString *)str - inColor: (int)color -{ -#if defined(OF_PSP) - char space = ' '; - int y = pspDebugScreenGetY(); - - pspDebugScreenSetXY(0, y); - for (uint8_t i = 0; i < 68; i++) - pspDebugScreenPrintData(&space, 1); - - switch (color) { - case NO_COLOR: - pspDebugScreenSetTextColor(0xFFFFFF); - break; - case RED: - pspDebugScreenSetTextColor(0x0000FF); - break; - case GREEN: - pspDebugScreenSetTextColor(0x00FF00); - break; - case YELLOW: - pspDebugScreenSetTextColor(0x00FFFF); - break; - } - - pspDebugScreenSetXY(0, y); - pspDebugScreenPrintData(str.UTF8String, str.UTF8StringLength); -#elif defined(STDOUT) - switch (color) { - case NO_COLOR: - [of_stdout writeString: @"\r\033[K"]; -# if defined(OF_WII) || defined(OF_NINTENDO_DS) - [of_stdout writeString: @"\033[37m"]; -# endif - break; - case RED: - [of_stdout writeString: @"\r\033[K\033[31;1m"]; - break; - case GREEN: - [of_stdout writeString: @"\r\033[K\033[32;1m"]; - break; - case YELLOW: - [of_stdout writeString: @"\r\033[K\033[33;1m"]; - break; - } - - [of_stdout writeString: str]; - [of_stdout writeString: @"\033[m"]; -#elif defined(STDOUT_SIMPLE) - [of_stdout writeString: str]; -#else -# error No output method! -#endif -} - - (void)outputTesting: (OFString *)test inModule: (OFString *)module { - void *pool = objc_autoreleasePoolPush(); #ifndef STDOUT_SIMPLE - [self outputString: [OFString stringWithFormat: @"[%@] %@: testing...", - module, test] - inColor: YELLOW]; + of_stdout.foregroundColor = [OFColor yellow]; + [of_stdout writeFormat: @"[%@] %@: testing...", module, test]; #else - [self outputString: [OFString stringWithFormat: @"[%@] %@: ", - module, test] - inColor: YELLOW]; + [of_stdout writeFormat: @"[%@] %@: ", module, test]; #endif - objc_autoreleasePoolPop(pool); } - (void)outputSuccess: (OFString *)test inModule: (OFString *)module { #ifndef STDOUT_SIMPLE - void *pool = objc_autoreleasePoolPush(); - [self outputString: [OFString stringWithFormat: @"[%@] %@: ok\n", - module, test] - inColor: GREEN]; - objc_autoreleasePoolPop(pool); + of_stdout.cursorColumn = 0; + of_stdout.foregroundColor = [OFColor lime]; + [of_stdout eraseLine]; + [of_stdout writeFormat: @"[%@] %@: ok\n", module, test]; #else - [self outputString: @"ok\n" - inColor: GREEN]; + [of_stdout writeLine: @"ok"]; #endif } - (void)outputFailure: (OFString *)test inModule: (OFString *)module { #ifndef STDOUT_SIMPLE - void *pool = objc_autoreleasePoolPush(); - [self outputString: [OFString stringWithFormat: @"[%@] %@: failed\n", - module, test] - inColor: RED]; - objc_autoreleasePoolPop(pool); + of_stdout.cursorColumn = 0; + of_stdout.foregroundColor = [OFColor red]; + [of_stdout eraseLine]; + [of_stdout writeFormat: @"[%@] %@: failed\n", module, test]; # ifdef OF_WII - [self outputString: @"Press A to continue!\n" - inColor: NO_COLOR]; + [of_stdout reset]; + [of_stdout writeLine: @"Press A to continue!"]; + for (;;) { WPAD_ScanPads(); if (WPAD_ButtonsDown(0) & WPAD_BUTTON_A) return; @@ -311,12 +251,13 @@ VIDEO_WaitVSync(); } # endif # ifdef OF_PSP - [self outputString: @"Press X to continue!\n" - inColor: NO_COLOR]; + [of_stdout reset]; + [of_stdout writeLine: @"Press X to continue!"]; + for (;;) { SceCtrlData pad; sceCtrlReadBufferPositive(&pad, 1); if (pad.Buttons & PSP_CTRL_CROSS) { @@ -327,34 +268,39 @@ } } } # endif # ifdef OF_NINTENDO_DS - [self outputString: @"Press A to continue!" - inColor: NO_COLOR]; + [of_stdout reset]; + [of_stdout writeString: @"Press A to continue!"]; + for (;;) { swiWaitForVBlank(); scanKeys(); if (keysDown() & KEY_A) break; } # endif # ifdef OF_NINTENDO_3DS - [self outputString: @"Press A to continue!" - inColor: NO_COLOR]; + [of_stdout reset]; + [of_stdout writeString: @"Press A to continue!"]; + for (;;) { hidScanInput(); if (hidKeysDown() & KEY_A) break; gspWaitForVBlank(); } # endif + + of_stdout.cursorColumn = 0; + [of_stdout reset]; + [of_stdout eraseLine]; #else - [self outputString: @"failed\n" - inColor: RED]; + [of_stdout writeLine: @"failed"]; #endif } - (void)applicationDidFinishLaunching { @@ -457,43 +403,42 @@ [self DNSResolverTests]; #endif [self systemInfoTests]; [self localeTests]; + [of_stdout reset]; + #if defined(OF_IOS) - [self outputString: [OFString stringWithFormat: @"%d tests failed!", - _fails] - inColor: NO_COLOR]; + [of_stdout writeFormat: @"%d tests failed!", _fails]; [OFApplication terminateWithStatus: _fails]; #elif defined(OF_WII) - [self outputString: @"Press home button to exit!\n" - inColor: NO_COLOR]; + [of_stdout writeString: @"Press home button to exit!"]; + for (;;) { WPAD_ScanPads(); if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) [OFApplication terminateWithStatus: _fails]; VIDEO_WaitVSync(); } #elif defined(OF_PSP) - [self outputString: [OFString stringWithFormat: @"%d tests failed!", - _fails] - inColor: NO_COLOR]; + [of_stdout writeFormat: @"%d tests failed!", _fails]; + sceKernelSleepThreadCB(); #elif defined(OF_NINTENDO_DS) - [self outputString: @"Press start button to exit!" - inColor: NO_COLOR]; + [of_stdout writeString: @"Press start button to exit!"]; + for (;;) { swiWaitForVBlank(); scanKeys(); if (keysDown() & KEY_START) [OFApplication terminateWithStatus: _fails]; } #elif defined(OF_NINTENDO_3DS) - [self outputString: @"Press start button to exit!" - inColor: NO_COLOR]; + [of_stdout writeString: @"Press start button to exit!"]; + for (;;) { hidScanInput(); if (hidKeysDown() & KEY_START) [OFApplication terminateWithStatus: _fails];