@@ -36,16 +36,10 @@ # include # include # undef asm #endif -#ifdef OF_WII_U -# define BOOL WUT_BOOL -# include -# undef BOOL -#endif - #ifdef OF_NINTENDO_DS # define asm __asm__ # include # undef asm #endif @@ -170,12 +164,13 @@ # ifdef OF_HAVE_FILES [[OFFileManager defaultManager] changeCurrentDirectoryPath: @"romfs:/"]; # endif #endif -#if defined(OF_WII) || defined(OF_PSP) || defined(OF_NINTENDO_DS) || \ - defined(OF_NINTENDO_3DS) || defined(OF_NINTENDO_SWITCH) +#if defined(OF_WII) || defined(OF_WII_U) || defined(OF_PSP) || \ + defined(OF_NINTENDO_DS) || defined(OF_NINTENDO_3DS) || \ + defined(OF_NINTENDO_SWITCH) @try { return OFApplicationMain(&argc, &argv, [[TestsAppDelegate alloc] init]); } @catch (id e) { OFString *string = [OFString stringWithFormat: @@ -232,74 +227,53 @@ abort(); # else abort(); # endif } -#elif defined(OF_WII_U) - @try { - return OFApplicationMain(&argc, &argv, - [[TestsAppDelegate alloc] init]); - } @catch (id e) { - OSReport("\nRuntime error: Unhandled exception:\n%s\n", - [[e description] UTF8String]); - OSReport("\nBacktrace:\n %s\n\n", - [[e backtrace] componentsJoinedByString: @"\n "] - .UTF8String); - abort(); - } #else return OFApplicationMain(&argc, &argv, [[TestsAppDelegate alloc] init]); #endif } @implementation TestsAppDelegate - (void)outputTesting: (OFString *)test inModule: (OFString *)module { -#ifndef OF_WII_U if (OFStdOut.hasTerminal) { [OFStdOut setForegroundColor: [OFColor yellow]]; [OFStdOut writeFormat: @"[%@] %@: testing...", module, test]; } else [OFStdOut writeFormat: @"[%@] %@: ", module, test]; -#else - OSReport("[%s] %s: ", module.UTF8String, test.UTF8String); -#endif #ifdef OF_NINTENDO_SWITCH updateConsole(false); #endif } - (void)outputSuccess: (OFString *)test inModule: (OFString *)module { -#ifndef OF_WII_U if (OFStdOut.hasTerminal) { [OFStdOut setForegroundColor: [OFColor lime]]; [OFStdOut eraseLine]; [OFStdOut writeFormat: @"\r[%@] %@: ok\n", module, test]; } else [OFStdOut writeLine: @"ok"]; -#else - OSReport("ok\n"); -#endif #ifdef OF_NINTENDO_SWITCH updateConsole(false); #endif } - (void)outputFailure: (OFString *)test inModule: (OFString *)module { -#ifndef OF_WII_U if (OFStdOut.hasTerminal) { [OFStdOut setForegroundColor: [OFColor red]]; [OFStdOut eraseLine]; [OFStdOut writeFormat: @"\r[%@] %@: failed\n", module, test]; } else [OFStdOut writeLine: @"failed"]; -# ifdef OF_WII +#ifdef OF_WII [OFStdOut reset]; [OFStdOut writeLine: @"Press A to continue!"]; for (;;) { WPAD_ScanPads(); @@ -307,12 +281,12 @@ if (WPAD_ButtonsDown(0) & WPAD_BUTTON_A) return; VIDEO_WaitVSync(); } -# endif -# ifdef OF_PSP +#endif +#ifdef OF_PSP [OFStdOut reset]; [OFStdOut writeLine: @"Press X to continue!"]; for (;;) { SceCtrlData pad; @@ -324,23 +298,23 @@ if (!(pad.Buttons & PSP_CTRL_CROSS)) return; } } } -# endif -# ifdef OF_NINTENDO_DS +#endif +#ifdef OF_NINTENDO_DS [OFStdOut reset]; [OFStdOut writeString: @"Press A to continue!"]; for (;;) { swiWaitForVBlank(); scanKeys(); if (keysDown() & KEY_A) break; } -# endif -# ifdef OF_NINTENDO_3DS +#endif +#ifdef OF_NINTENDO_3DS [OFStdOut reset]; [OFStdOut writeString: @"Press A to continue!"]; for (;;) { hidScanInput(); @@ -348,12 +322,12 @@ if (hidKeysDown() & KEY_A) break; gspWaitForVBlank(); } -# endif -# ifdef OF_NINTENDO_SWITCH +#endif +#ifdef OF_NINTENDO_SWITCH [OFStdOut reset]; [OFStdOut writeString: @"Press A to continue!"]; while (appletMainLoop()) { PadState pad; @@ -362,20 +336,17 @@ updateConsole(true); if (padGetButtonsDown(&pad) & HidNpadButton_A) break; } -# endif +#endif if (OFStdOut.hasTerminal) { [OFStdOut writeString: @"\r"]; [OFStdOut reset]; [OFStdOut eraseLine]; } -#else - OSReport("failed\n"); -#endif } - (void)applicationDidFinishLaunching { #if defined(OF_IOS) && defined(OF_HAVE_FILES)