Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -138,10 +138,13 @@ rm -fr nds-data mkdir -p nds-data cp testfile.bin testfile.txt testfile.ini serialization.xml nds-data ndstool -c $@ -9 $< -d nds-data rm -fr nds-data + +${PROG_NOINST}.3dsx: ${PROG_NOINST} + 3dsxtool $< $@ CPPFLAGS += -I../src -I../src/exceptions -I../src/runtime -I.. -DSTDOUT LIBS := -L../src -lobjfw ${TESTS_LIBS} ${LIBS} LDFLAGS += ${MAP_LDFLAGS} LD = ${OBJC} Index: tests/TestsAppDelegate.m ================================================================== --- tests/TestsAppDelegate.m +++ tests/TestsAppDelegate.m @@ -48,10 +48,14 @@ # define asm __asm__ # include # undef asm #endif +#ifdef OF_NINTENDO_3DS +# include <3ds.h> +#endif + enum { NO_COLOR, RED, GREEN, YELLOW @@ -127,11 +131,17 @@ #ifdef OF_NINTENDO_DS consoleDemoInit(); #endif -#if defined(OF_WII) || defined(OF_PSP) || defined(OF_NINTENDO_DS) +#ifdef OF_NINTENDO_3DS + gfxInitDefault(); + consoleInit(GFX_TOP, NULL); +#endif + +#if defined(OF_WII) || defined(OF_PSP) || defined(OF_NINTENDO_DS) || \ + defined(OF_NINTENDO_3DS) @try { return of_application_main(&argc, &argv, [TestsAppDelegate class]); } @catch (id e) { TestsAppDelegate *delegate = @@ -165,10 +175,21 @@ 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]; + for (;;) { + hidScanInput(); + + if (hidKeysDown() & KEY_START) + [OFApplication terminateWithStatus: 1]; + + gspWaitForVBlank(); } # else abort(); # endif } @@ -310,10 +331,22 @@ swiWaitForVBlank(); scanKeys(); if (keysDown() & KEY_A) break; } +# endif +# ifdef OF_NINTENDO_3DS + [self outputString: @"Press A to continue!" + inColor: NO_COLOR]; + for (;;) { + hidScanInput(); + + if (hidKeysDown() & KEY_A) + break; + + gspWaitForVBlank(); + } # endif #else [self outputString: @"failed\n" inColor: RED]; #endif @@ -396,11 +429,22 @@ 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]; + for (;;) { + hidScanInput(); + + if (hidKeysDown() & KEY_START) + [OFApplication terminateWithStatus: _fails]; + + gspWaitForVBlank(); } #else [OFApplication terminateWithStatus: _fails]; #endif } @end