@@ -429,6 +429,13 @@ const byte const_byte_array[] = "A+Gd\0\0\0";
429429#ifdef DEVKITPRO
430430 #include <wiiuse/wpad.h>
431431#endif
432+ #ifdef NDS
433+ #include <nds/ndstypes.h>
434+ #include <nds/arm9/console.h>
435+ #include <nds/arm9/input.h>
436+ #include <nds/interrupts.h>
437+ #include <fat.h>
438+ #endif
432439
433440#ifndef WOLFSSL_HAVE_ECC_KEY_GET_PRIV
434441 /* FIPS build has replaced ecc.h. */
@@ -2466,6 +2473,13 @@ options: [-s max_relative_stack_bytes] [-m max_relative_heap_memory_bytes]\n\
24662473 VIDEO_WaitVSync();
24672474 if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();
24682475#endif
2476+ #ifdef NDS
2477+ /* Init Console output */
2478+ consoleDemoInit();
2479+
2480+ /* Init the Filesystem */
2481+ fatInitDefault();
2482+ #endif
24692483
24702484#ifdef HAVE_WNR
24712485 if ((ret = wc_InitNetRandom(wnrConfigFile, NULL, 5000)) != 0) {
@@ -2511,6 +2525,18 @@ options: [-s max_relative_stack_bytes] [-m max_relative_heap_memory_bytes]\n\
25112525 while (1);
25122526#endif
25132527
2528+ #ifdef NDS
2529+ /* in Nintendo DS returning from main shuts down the Device without letting you see the Results. */
2530+ printf("args.return_code: %d\n", args.return_code);
2531+ printf("Testing complete. Press Start to exit the Program\n");
2532+ while(1) {
2533+ swiWaitForVBlank();
2534+ scanKeys();
2535+ int keys = keysDown();
2536+ if(keys & KEY_START) break;
2537+ }
2538+ #endif
2539+
25142540#if defined(WOLFSSL_ESPIDF)
25152541 /* ESP_LOGI to print takes up a lot less memory than printf */
25162542 ESP_LOGI(ESPIDF_TAG, "Exiting main with return code: % d\n",
@@ -18083,6 +18109,10 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t memory_test(void)
1808318109#elif defined(_WIN32_WCE)
1808418110 #define CERT_PREFIX "\\windows\\"
1808518111 #define CERT_PATH_SEP "\\"
18112+ #elif defined(NDS)
18113+ #undef CERT_PREFIX
18114+ #define CERT_PREFIX "fat:/_nds/"
18115+ #define CERT_PATH_SEP "/"
1808618116#endif
1808718117
1808818118#ifndef CERT_PREFIX
0 commit comments