@@ -426,6 +426,13 @@ const byte const_byte_array[] = "A+Gd\0\0\0";
426426#ifdef DEVKITPRO
427427 #include <wiiuse/wpad.h>
428428#endif
429+ #ifdef NDS
430+ #include <nds/ndstypes.h>
431+ #include <nds/arm9/console.h>
432+ #include <nds/arm9/input.h>
433+ #include <nds/interrupts.h>
434+ #include <fat.h>
435+ #endif
429436
430437#ifndef WOLFSSL_HAVE_ECC_KEY_GET_PRIV
431438 /* FIPS build has replaced ecc.h. */
@@ -2457,6 +2464,13 @@ options: [-s max_relative_stack_bytes] [-m max_relative_heap_memory_bytes]\n\
24572464 VIDEO_WaitVSync();
24582465 if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();
24592466#endif
2467+ #ifdef NDS
2468+ // Init Console output
2469+ consoleDemoInit();
2470+
2471+ // Init the Filesystem
2472+ fatInitDefault();
2473+ #endif
24602474
24612475#ifdef HAVE_WNR
24622476 if ((ret = wc_InitNetRandom(wnrConfigFile, NULL, 5000)) != 0) {
@@ -2502,6 +2516,18 @@ options: [-s max_relative_stack_bytes] [-m max_relative_heap_memory_bytes]\n\
25022516 while (1);
25032517#endif
25042518
2519+ #ifdef NDS
2520+ // in Nintendo DS returning from main shuts down the Device without letting you see the Results.
2521+ printf("args.return_code: %d\n", args.return_code);
2522+ printf("Testing complete. Press Start to exit the Program\n");
2523+ while(1) {
2524+ swiWaitForVBlank();
2525+ scanKeys();
2526+ int keys = keysDown();
2527+ if(keys & KEY_START) break;
2528+ }
2529+ #endif
2530+
25052531#if defined(WOLFSSL_ESPIDF)
25062532 /* ESP_LOGI to print takes up a lot less memory than printf */
25072533 ESP_LOGI(ESPIDF_TAG, "Exiting main with return code: % d\n",
@@ -17955,6 +17981,10 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t memory_test(void)
1795517981#elif defined(_WIN32_WCE)
1795617982 #define CERT_PREFIX "\\windows\\"
1795717983 #define CERT_PATH_SEP "\\"
17984+ #elif defined(NDS)
17985+ #undef CERT_PREFIX
17986+ #define CERT_PREFIX "fat:/_nds/"
17987+ #define CERT_PATH_SEP "/"
1795817988#endif
1795917989
1796017990#ifndef CERT_PREFIX
0 commit comments