From b3c36036b4d84f7950363abf49589cf239a8ecb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ni=C3=B1o=20D=C3=ADaz?= Date: Fri, 2 Aug 2024 21:15:43 +0100 Subject: [PATCH] Fri 2 Aug 21:15:43 BST 2024 --- design/design_guide/index.html | 77 + design/exit_to_loader/index.html | 77 + design/index.html | 77 + dswifi/annotated.html | 2 +- dswifi/classes.html | 2 +- .../dir_317ea3797c15f4a1d9c156bc812661ca.html | 2 +- .../dir_a31f4157c8426a01402443a71f1cf774.html | 2 +- .../dir_d0a04a149c821e4e65be9315f86ccf56.html | 2 +- .../dir_d44c64559bbebec7f509842c48db8b23.html | 2 +- dswifi/dswifi7_8h.html | 2 +- dswifi/dswifi9_8h.html | 2 +- dswifi/files.html | 2 +- dswifi/functions.html | 2 +- dswifi/functions_vars.html | 2 +- dswifi/globals.html | 2 +- dswifi/globals_defs.html | 2 +- dswifi/globals_enum.html | 2 +- dswifi/globals_eval.html | 2 +- dswifi/globals_func.html | 2 +- dswifi/globals_type.html | 2 +- dswifi/index.html | 2 +- dswifi/structWIFI__ACCESSPOINT.html | 2 +- index.html | 77 + index.xml | 7 + introduction/changelog/index.html | 77 + introduction/credits/index.html | 77 + introduction/index.html | 77 + introduction/introduction/index.html | 77 + introduction/licenses/index.html | 77 + introduction/support/index.html | 77 + libnds/annotated.html | 2 +- libnds/arm7_2input_8h.html | 2 +- libnds/arm7_2touch_8h.html | 2 +- libnds/arm9_2card_8h.html | 2 +- libnds/arm9_2input_8h.html | 2 +- libnds/arm9_2sdmmc_8h.html | 2 +- libnds/audio_8h.html | 2 +- libnds/background_8h.html | 2 +- libnds/bios_8h.html | 2 +- libnds/boxtest_8h.html | 2 +- libnds/cache_8h.html | 2 +- libnds/card_8h.html | 2 +- libnds/classes.html | 2 +- libnds/clock_8h.html | 2 +- libnds/codec_8h.html | 2 +- libnds/console_8h.html | 2 +- libnds/cothread_8h.html | 2 +- libnds/debug_8h.html | 2 +- libnds/decompress_8h.html | 2 +- libnds/deprecated.html | 2 +- .../dir_2d2937ff9358bd81f182d4109e99a43c.html | 2 +- .../dir_317ea3797c15f4a1d9c156bc812661ca.html | 2 +- .../dir_43a26886bf57aaa5db5cc4b694360a23.html | 2 +- .../dir_83878ba4c67659cc0852c83e2f61ba2e.html | 2 +- .../dir_b53522c5cee68335ba389010340aafeb.html | 2 +- .../dir_c25c118f76a81c77ceea021073727baa.html | 2 +- .../dir_d44c64559bbebec7f509842c48db8b23.html | 2 +- .../dir_eef24e62abe235ff08d6c310d2f6b3f3.html | 2 +- .../dir_f75569adbbf338cab061740510d0951b.html | 2 +- libnds/dma_8h.html | 2 +- libnds/dsp_8h.html | 2 +- libnds/dynamicArray_8h.html | 2 +- libnds/exceptions_8h.html | 2 +- libnds/fat_8h.html | 2 +- libnds/fifo_8h.html | 2 +- libnds/fifocommon_8h.html | 2 +- libnds/files.html | 2 +- libnds/filesystem_8h.html | 2 +- libnds/firmware_8h.html | 2 +- libnds/functions.html | 2 +- libnds/functions_b.html | 2 +- libnds/functions_c.html | 2 +- libnds/functions_d.html | 2 +- libnds/functions_e.html | 2 +- libnds/functions_f.html | 2 +- libnds/functions_g.html | 2 +- libnds/functions_h.html | 2 +- libnds/functions_i.html | 2 +- libnds/functions_j.html | 2 +- libnds/functions_k.html | 2 +- libnds/functions_l.html | 2 +- libnds/functions_m.html | 2 +- libnds/functions_n.html | 2 +- libnds/functions_o.html | 2 +- libnds/functions_p.html | 2 +- libnds/functions_r.html | 2 +- libnds/functions_s.html | 2 +- libnds/functions_t.html | 2 +- libnds/functions_u.html | 2 +- libnds/functions_v.html | 2 +- libnds/functions_vars.html | 2 +- libnds/functions_vars_b.html | 2 +- libnds/functions_vars_c.html | 2 +- libnds/functions_vars_d.html | 2 +- libnds/functions_vars_e.html | 2 +- libnds/functions_vars_f.html | 2 +- libnds/functions_vars_g.html | 2 +- libnds/functions_vars_h.html | 2 +- libnds/functions_vars_i.html | 2 +- libnds/functions_vars_j.html | 2 +- libnds/functions_vars_k.html | 2 +- libnds/functions_vars_l.html | 2 +- libnds/functions_vars_m.html | 2 +- libnds/functions_vars_n.html | 2 +- libnds/functions_vars_o.html | 2 +- libnds/functions_vars_p.html | 2 +- libnds/functions_vars_r.html | 2 +- libnds/functions_vars_s.html | 2 +- libnds/functions_vars_t.html | 2 +- libnds/functions_vars_u.html | 2 +- libnds/functions_vars_v.html | 2 +- libnds/functions_vars_w.html | 2 +- libnds/functions_vars_x.html | 2 +- libnds/functions_vars_y.html | 2 +- libnds/functions_vars_z.html | 2 +- libnds/functions_w.html | 2 +- libnds/functions_x.html | 2 +- libnds/functions_y.html | 2 +- libnds/functions_z.html | 2 +- libnds/gl2d_8h.html | 2 +- libnds/globals.html | 2 +- libnds/globals_a.html | 2 +- libnds/globals_b.html | 2 +- libnds/globals_c.html | 2 +- libnds/globals_d.html | 2 +- libnds/globals_defs.html | 2 +- libnds/globals_defs_b.html | 2 +- libnds/globals_defs_c.html | 2 +- libnds/globals_defs_d.html | 2 +- libnds/globals_defs_e.html | 2 +- libnds/globals_defs_f.html | 2 +- libnds/globals_defs_g.html | 2 +- libnds/globals_defs_i.html | 2 +- libnds/globals_defs_k.html | 2 +- libnds/globals_defs_m.html | 2 +- libnds/globals_defs_n.html | 2 +- libnds/globals_defs_o.html | 2 +- libnds/globals_defs_p.html | 2 +- libnds/globals_defs_r.html | 2 +- libnds/globals_defs_s.html | 2 +- libnds/globals_defs_t.html | 2 +- libnds/globals_defs_v.html | 2 +- libnds/globals_e.html | 2 +- libnds/globals_enum.html | 2 +- libnds/globals_eval.html | 2 +- libnds/globals_eval_c.html | 2 +- libnds/globals_eval_d.html | 2 +- libnds/globals_eval_f.html | 2 +- libnds/globals_eval_g.html | 2 +- libnds/globals_eval_h.html | 2 +- libnds/globals_eval_i.html | 2 +- libnds/globals_eval_k.html | 2 +- libnds/globals_eval_l.html | 2 +- libnds/globals_eval_m.html | 2 +- libnds/globals_eval_n.html | 2 +- libnds/globals_eval_o.html | 2 +- libnds/globals_eval_p.html | 2 +- libnds/globals_eval_r.html | 2 +- libnds/globals_eval_s.html | 2 +- libnds/globals_eval_t.html | 2 +- libnds/globals_eval_u.html | 2 +- libnds/globals_eval_v.html | 2 +- libnds/globals_eval_w.html | 2 +- libnds/globals_f.html | 2 +- libnds/globals_func.html | 2 +- libnds/globals_func_b.html | 2 +- libnds/globals_func_c.html | 2 +- libnds/globals_func_d.html | 2 +- libnds/globals_func_e.html | 2 +- libnds/globals_func_f.html | 2 +- libnds/globals_func_g.html | 2 +- libnds/globals_func_h.html | 2 +- libnds/globals_func_i.html | 2 +- libnds/globals_func_k.html | 2 +- libnds/globals_func_l.html | 2 +- libnds/globals_func_m.html | 2 +- libnds/globals_func_n.html | 2 +- libnds/globals_func_o.html | 2 +- libnds/globals_func_p.html | 2 +- libnds/globals_func_r.html | 2 +- libnds/globals_func_s.html | 2 +- libnds/globals_func_t.html | 2 +- libnds/globals_func_v.html | 2 +- libnds/globals_func_w.html | 2 +- libnds/globals_g.html | 2 +- libnds/globals_h.html | 2 +- libnds/globals_i.html | 2 +- libnds/globals_k.html | 2 +- libnds/globals_l.html | 2 +- libnds/globals_m.html | 2 +- libnds/globals_n.html | 2 +- libnds/globals_o.html | 2 +- libnds/globals_p.html | 2 +- libnds/globals_r.html | 2 +- libnds/globals_s.html | 2 +- libnds/globals_t.html | 2 +- libnds/globals_type.html | 2 +- libnds/globals_u.html | 2 +- libnds/globals_v.html | 2 +- libnds/globals_vars.html | 2 +- libnds/globals_w.html | 2 +- libnds/gpio_8h.html | 2 +- libnds/grf_8h.html | 2 +- libnds/group__background__api__group.html | 2 +- .../group__background__register__group.html | 2 +- libnds/group__main__display__registers.html | 2 +- libnds/group__sub__display__registers.html | 2 +- libnds/guitarGrip_8h.html | 2 +- libnds/image_8h.html | 2 +- libnds/index.html | 2 +- libnds/input_8h.html | 2 +- libnds/interrupts_8h.html | 2 +- libnds/keyboard_8h.html | 2 +- libnds/linkedlist_8h.html | 2 +- libnds/math_8h.html | 2 +- libnds/memory_8h.html | 2 +- libnds/ndma_8h.html | 2 +- libnds/nds_8h.html | 2 +- libnds/ndsmotion_8h.html | 2 +- libnds/ndstypes_8h.html | 2 +- libnds/nwram_8h.html | 2 +- libnds/paddle_8h.html | 2 +- libnds/pages.html | 2 +- libnds/pcx_8h.html | 2 +- libnds/piano_8h.html | 2 +- libnds/postest_8h.html | 2 +- libnds/rsa_8h.html | 2 +- libnds/rumble_8h.html | 2 +- libnds/sassert_8h.html | 2 +- libnds/serial_8h.html | 2 +- libnds/sha1_8h.html | 2 +- libnds/slot2_8h.html | 2 +- libnds/slot2gyro_8h.html | 2 +- libnds/slot2solar_8h.html | 2 +- libnds/slot2tilt_8h.html | 2 +- libnds/sound_8h.html | 2 +- libnds/sprite_8h.html | 2 +- libnds/structBgState.html | 2 +- libnds/structConsoleFont.html | 2 +- libnds/structDLDI__INTERFACE.html | 2 +- libnds/structDecompressionStream.html | 2 +- libnds/structDynamicArray.html | 2 +- libnds/structGLvector.html | 2 +- libnds/structGRFHeader.html | 2 +- libnds/structKeyMap.html | 2 +- libnds/structKeyboard.html | 2 +- libnds/structLinkedList.html | 2 +- libnds/structOamState.html | 2 +- libnds/structPrintConsole.html | 2 +- libnds/structRGB__24.html | 2 +- libnds/structRTCtime.html | 2 +- libnds/structSpriteRotation.html | 2 +- libnds/structTileMapEntry16.html | 2 +- libnds/structTileMapEntry8.html | 2 +- libnds/structUnpackStruct.html | 2 +- libnds/struct____ndsabi__coro__t.html | 2 +- libnds/structbg__attribute.html | 2 +- libnds/structbg__scroll.html | 2 +- libnds/structbg__transform.html | 2 +- libnds/structglImage.html | 2 +- libnds/structm3x3.html | 2 +- libnds/structm4x3.html | 2 +- libnds/structm4x4.html | 2 +- libnds/structrtcTime.html | 2 +- libnds/structrtcTimeAndDate.html | 2 +- libnds/structsGBAHeader.html | 2 +- libnds/structsImage.html | 2 +- libnds/structsNDSBanner.html | 2 +- libnds/structsNDSHeader.html | 2 +- libnds/structswiRSAHeapContext.html | 2 +- libnds/structswiRSAbuffers.html | 2 +- libnds/structswiSHA1context.html | 2 +- libnds/structsysVectors.html | 2 +- libnds/structtPERSONAL__DATA.html | 2 +- libnds/structtlf__header.html | 2 +- libnds/structtlf__section__header.html | 2 +- libnds/structtouchPosition.html | 2 +- libnds/system_8h.html | 2 +- libnds/timers_8h.html | 2 +- libnds/tlf_8h.html | 2 +- libnds/tmio_8h.html | 2 +- libnds/topics.html | 2 +- libnds/touch_8h.html | 2 +- libnds/trig__lut_8h.html | 2 +- libnds/tsc_8h.html | 2 +- libnds/unionOAMTable.html | 2 +- libnds/unionSpriteEntry.html | 2 +- libnds/videoGL_8h.html | 2 +- libnds/video_8h.html | 2 +- libnds/window_8h.html | 2 +- libteak/ahbm_8h.html | 2 +- libteak/apbp_8h.html | 2 +- libteak/btdmp_8h.html | 2 +- .../dir_5030c3ca5838c7123811aad4ea6c6594.html | 2 +- .../dir_d44c64559bbebec7f509842c48db8b23.html | 2 +- libteak/dma_8h.html | 2 +- libteak/files.html | 2 +- libteak/global_8h.html | 2 +- libteak/globals.html | 2 +- libteak/globals_defs.html | 2 +- libteak/globals_func.html | 2 +- libteak/icu_8h.html | 2 +- libteak/index.html | 2 +- libteak/teak_8h.html | 2 +- libteak/timer_8h.html | 2 +- .../dir_138aff360eb965c43b94267b8d1ce09e.html | 2 +- .../dir_d44c64559bbebec7f509842c48db8b23.html | 2 +- libxm7/files.html | 2 +- libxm7/globals.html | 2 +- libxm7/globals_enum.html | 2 +- libxm7/globals_eval.html | 2 +- libxm7/globals_func.html | 2 +- libxm7/group__libxm7__arm7.html | 2 +- libxm7/group__libxm7__arm9.html | 2 +- libxm7/group__libxm7__types.html | 2 +- libxm7/index.html | 2 +- libxm7/libxm7_8h.html | 2 +- libxm7/topics.html | 2 +- maxmod/annotated.html | 2 +- maxmod/classes.html | 2 +- .../dir_138aff360eb965c43b94267b8d1ce09e.html | 2 +- .../dir_d44c64559bbebec7f509842c48db8b23.html | 2 +- maxmod/files.html | 2 +- maxmod/functions.html | 2 +- maxmod/functions_vars.html | 2 +- maxmod/globals.html | 2 +- maxmod/globals_defs.html | 2 +- maxmod/globals_enum.html | 2 +- maxmod/globals_eval.html | 2 +- maxmod/globals_func.html | 2 +- maxmod/globals_type.html | 2 +- maxmod/group__gba__init.html | 2 +- maxmod/group__gba__misc.html | 2 +- maxmod/group__gba__module__playback.html | 2 +- maxmod/group__gba__playback__events.html | 2 +- maxmod/group__gba__sound__effects.html | 2 +- maxmod/group__maxmod__types.html | 2 +- maxmod/group__nds__arm7__init.html | 2 +- maxmod/group__nds__arm7__misc.html | 2 +- .../group__nds__arm7__module__playback.html | 2 +- .../group__nds__arm7__playback__events.html | 2 +- maxmod/group__nds__arm7__reverb.html | 2 +- maxmod/group__nds__arm7__sound__effects.html | 2 +- maxmod/group__nds__arm7__streaming.html | 2 +- maxmod/group__nds__arm9__init.html | 2 +- .../group__nds__arm9__module__playback.html | 2 +- .../group__nds__arm9__playback__events.html | 2 +- maxmod/group__nds__arm9__reverb.html | 2 +- maxmod/group__nds__arm9__sound__effects.html | 2 +- maxmod/group__nds__arm9__streaming.html | 2 +- maxmod/index.html | 2 +- maxmod/maxmod7_8h.html | 2 +- maxmod/maxmod9_8h.html | 2 +- maxmod/maxmod_8h.html | 2 +- .../md_documentation_2audio__streaming.html | 2 +- .../md_documentation_2conversion__guide.html | 2 +- maxmod/md_documentation_2cpu__usage.html | 2 +- ...documentation_2ds__programming__guide.html | 2 +- ...ocumentation_2gba__programming__guide.html | 2 +- maxmod/md_documentation_2hardware__usage.html | 2 +- maxmod/md_documentation_2memory__usage.html | 2 +- maxmod/md_documentation_2using__reverb.html | 2 +- ...md_documentation_2using__song__events.html | 2 +- maxmod/mm__types_8h.html | 2 +- maxmod/pages.html | 2 +- maxmod/structmmreverbcfg.html | 2 +- maxmod/structt__mmdssample.html | 2 +- maxmod/structt__mmdssystem.html | 2 +- maxmod/structt__mmgbasystem.html | 2 +- maxmod/structt__mmsoundeffect.html | 2 +- maxmod/structt__mmstream.html | 2 +- maxmod/topics.html | 2 +- search/en.data.min.json | 2 +- setup/additional_libs/index.html | 83 +- setup/extra_steps/index.html | 77 + setup/index.html | 77 + setup/options/docker/index.html | 77 + setup/options/from_source/index.html | 77 + setup/options/index.html | 77 + setup/options/linux/index.html | 77 + setup/options/windows/index.html | 77 + sitemap.xml | 2 + tags/index.html | 77 + technical/devkitarm_porting_guide/index.html | 77 + technical/dldi_arm7/index.html | 77 + technical/filesystem/index.html | 77 + technical/index.html | 77 + technical/libc/index.html | 77 + technical/memory_map/index.html | 77 + technical/optimization_guide/index.html | 77 + technical/updating_guide/index.html | 77 + technical/usage_notes/index.html | 77 + usage/debugging/index.html | 2929 +++++++++++++++++ usage/exception_handler.png | Bin 0 -> 10385 bytes usage/index.html | 83 +- usage/index.xml | 7 + usage/legacy_support/index.html | 83 +- 397 files changed, 5626 insertions(+), 371 deletions(-) create mode 100644 usage/debugging/index.html create mode 100644 usage/exception_handler.png diff --git a/design/design_guide/index.html b/design/design_guide/index.html index ecfa0aeda..6f21431d3 100644 --- a/design/design_guide/index.html +++ b/design/design_guide/index.html @@ -971,6 +971,50 @@

Navigation

+
  • + + + + +
  • + + + + + + + + + + + + + + + + + + +
  • Design choices + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/design/exit_to_loader/index.html b/design/exit_to_loader/index.html index 2bc5c3cdf..215371ea8 100644 --- a/design/exit_to_loader/index.html +++ b/design/exit_to_loader/index.html @@ -965,6 +965,50 @@

    Navigation

    +
  • + + + + +
  • + + + + + + + + + + + + + + + + + + +
  • Exit to loader protocol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/design/index.html b/design/index.html index 127b05732..6d185a5f4 100644 --- a/design/index.html +++ b/design/index.html @@ -961,6 +961,50 @@

    Navigation

    +
  • + + + + +
  • + + + + + + + + + + + + + + + + + + +
  • Additional information + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dswifi/annotated.html b/dswifi/annotated.html index d8cbb525d..e008c17be 100644 --- a/dswifi/annotated.html +++ b/dswifi/annotated.html @@ -91,7 +91,7 @@ diff --git a/dswifi/classes.html b/dswifi/classes.html index 605b14c50..62c76d43b 100644 --- a/dswifi/classes.html +++ b/dswifi/classes.html @@ -92,7 +92,7 @@ diff --git a/dswifi/dir_317ea3797c15f4a1d9c156bc812661ca.html b/dswifi/dir_317ea3797c15f4a1d9c156bc812661ca.html index 52f2eafbf..ad8d6041e 100644 --- a/dswifi/dir_317ea3797c15f4a1d9c156bc812661ca.html +++ b/dswifi/dir_317ea3797c15f4a1d9c156bc812661ca.html @@ -90,7 +90,7 @@ diff --git a/dswifi/dir_a31f4157c8426a01402443a71f1cf774.html b/dswifi/dir_a31f4157c8426a01402443a71f1cf774.html index 74c6a86c9..e3cd80348 100644 --- a/dswifi/dir_a31f4157c8426a01402443a71f1cf774.html +++ b/dswifi/dir_a31f4157c8426a01402443a71f1cf774.html @@ -90,7 +90,7 @@ diff --git a/dswifi/dir_d0a04a149c821e4e65be9315f86ccf56.html b/dswifi/dir_d0a04a149c821e4e65be9315f86ccf56.html index 3985d4983..387ef494e 100644 --- a/dswifi/dir_d0a04a149c821e4e65be9315f86ccf56.html +++ b/dswifi/dir_d0a04a149c821e4e65be9315f86ccf56.html @@ -90,7 +90,7 @@ diff --git a/dswifi/dir_d44c64559bbebec7f509842c48db8b23.html b/dswifi/dir_d44c64559bbebec7f509842c48db8b23.html index 9af60954c..b727c257d 100644 --- a/dswifi/dir_d44c64559bbebec7f509842c48db8b23.html +++ b/dswifi/dir_d44c64559bbebec7f509842c48db8b23.html @@ -109,7 +109,7 @@ diff --git a/dswifi/dswifi7_8h.html b/dswifi/dswifi7_8h.html index 08b1f917b..94104fce1 100644 --- a/dswifi/dswifi7_8h.html +++ b/dswifi/dswifi7_8h.html @@ -356,7 +356,7 @@

    diff --git a/dswifi/dswifi9_8h.html b/dswifi/dswifi9_8h.html index 0db9e4656..513733548 100644 --- a/dswifi/dswifi9_8h.html +++ b/dswifi/dswifi9_8h.html @@ -1278,7 +1278,7 @@

    diff --git a/dswifi/files.html b/dswifi/files.html index d06ced1fe..c2101bc88 100644 --- a/dswifi/files.html +++ b/dswifi/files.html @@ -93,7 +93,7 @@ diff --git a/dswifi/functions.html b/dswifi/functions.html index 32eb3b48f..6be0f2d88 100644 --- a/dswifi/functions.html +++ b/dswifi/functions.html @@ -95,7 +95,7 @@ diff --git a/dswifi/functions_vars.html b/dswifi/functions_vars.html index 1106ed424..d32104dd5 100644 --- a/dswifi/functions_vars.html +++ b/dswifi/functions_vars.html @@ -95,7 +95,7 @@ diff --git a/dswifi/globals.html b/dswifi/globals.html index 76a1ee93c..509bf924f 100644 --- a/dswifi/globals.html +++ b/dswifi/globals.html @@ -167,7 +167,7 @@

    - w -

      diff --git a/dswifi/globals_defs.html b/dswifi/globals_defs.html index bc4776880..7ca83c95e 100644 --- a/dswifi/globals_defs.html +++ b/dswifi/globals_defs.html @@ -87,7 +87,7 @@ diff --git a/dswifi/globals_enum.html b/dswifi/globals_enum.html index 9ebb94ee4..340511db9 100644 --- a/dswifi/globals_enum.html +++ b/dswifi/globals_enum.html @@ -90,7 +90,7 @@ diff --git a/dswifi/globals_eval.html b/dswifi/globals_eval.html index 530c1841c..9370d48fb 100644 --- a/dswifi/globals_eval.html +++ b/dswifi/globals_eval.html @@ -107,7 +107,7 @@ diff --git a/dswifi/globals_func.html b/dswifi/globals_func.html index a5c1b31fc..fdc99bcba 100644 --- a/dswifi/globals_func.html +++ b/dswifi/globals_func.html @@ -131,7 +131,7 @@

      - w -

        diff --git a/dswifi/globals_type.html b/dswifi/globals_type.html index 368b58014..0b7f7ac03 100644 --- a/dswifi/globals_type.html +++ b/dswifi/globals_type.html @@ -88,7 +88,7 @@ diff --git a/dswifi/index.html b/dswifi/index.html index 110e9d6f9..d667b0f4c 100644 --- a/dswifi/index.html +++ b/dswifi/index.html @@ -96,7 +96,7 @@

        diff --git a/dswifi/structWIFI__ACCESSPOINT.html b/dswifi/structWIFI__ACCESSPOINT.html index 1d4ab414c..bf8df22bb 100644 --- a/dswifi/structWIFI__ACCESSPOINT.html +++ b/dswifi/structWIFI__ACCESSPOINT.html @@ -143,7 +143,7 @@ diff --git a/index.html b/index.html index 8d1f2867a..c4d51c109 100644 --- a/index.html +++ b/index.html @@ -933,6 +933,50 @@

        Navigation

        +
      • + + + + +
      • + + + + + + + + + + + + + + + + + + +
      • BlocksDS Documentation

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/index.xml b/index.xml index 4619e4c24..261a0e02f 100644 --- a/index.xml +++ b/index.xml @@ -49,6 +49,13 @@ https://blocksds.github.io/docs/technical/filesystem/ 1. Introduction BlocksDS supports using standard C functions to access the filesystem. It is possible to use them to access both the SD cards of flashcarts, and the internal SD slot of the DSi. This code is integrated in libnds, so you don’t need to do anything special to use it. Add the following to your project: #include <fat.h> int main(int argc, char *argv[]) { bool init_ok = fatInitDefault(); if (! + + How to debug programs + https://blocksds.github.io/docs/usage/debugging/ + Mon, 01 Jan 0001 00:00:00 +0000 + https://blocksds.github.io/docs/usage/debugging/ + While developing applications with BlocksDS you will reach situations where you need to debug your code. There are different ways to do this with BlocksDS, and they are described below. 1. printf debugging This is a classic way to debug messages, but it’s still worth mentioning it. It’s very easy to setup libnds so that the output of printf() is sent to a text console on the screen. All you have to do is: + Memory map https://blocksds.github.io/docs/technical/memory_map/ diff --git a/introduction/changelog/index.html b/introduction/changelog/index.html index 22e895bce..09d1c7df4 100644 --- a/introduction/changelog/index.html +++ b/introduction/changelog/index.html @@ -968,6 +968,50 @@

    Navigation

    +
  • + + + + +
  • + + + + + + + + + + + + + + + + + + +
  • Changelog
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/introduction/credits/index.html b/introduction/credits/index.html index 4e518d525..9ef0db4aa 100644 --- a/introduction/credits/index.html +++ b/introduction/credits/index.html @@ -968,6 +968,50 @@

    Navigation

    +
  • + + + + +
  • + + + + + + + + + + + + + + + + + + +
  • Credits + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/introduction/index.html b/introduction/index.html index 3326807ad..68d424028 100644 --- a/introduction/index.html +++ b/introduction/index.html @@ -961,6 +961,50 @@

    Navigation

    +
  • + + + + +
  • + + + + + + + + + + + + + + + + + + +
  • Introduction + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/introduction/introduction/index.html b/introduction/introduction/index.html index 5c1ac0849..2326afdfa 100644 --- a/introduction/introduction/index.html +++ b/introduction/introduction/index.html @@ -971,6 +971,50 @@

    Navigation

    +
  • + + + + +
  • + + + + + + + + + + + + + + + + + + +
  • Introduction + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/introduction/licenses/index.html b/introduction/licenses/index.html index c73fa6f13..275f1f19e 100644 --- a/introduction/licenses/index.html +++ b/introduction/licenses/index.html @@ -974,6 +974,50 @@

    Navigation

    +
  • + + + + +
  • + + + + + + + + + + + + + + + + + + +
  • Licenses + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/introduction/support/index.html b/introduction/support/index.html index d763e71f7..e01a4e3b1 100644 --- a/introduction/support/index.html +++ b/introduction/support/index.html @@ -968,6 +968,50 @@

    Navigation

    +
  • + + + + +
  • + + + + + + + + + + + + + + + + + + +
  • Getting support + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libnds/annotated.html b/libnds/annotated.html index 5186a4515..ffad1ec06 100644 --- a/libnds/annotated.html +++ b/libnds/annotated.html @@ -132,7 +132,7 @@ diff --git a/libnds/arm7_2input_8h.html b/libnds/arm7_2input_8h.html index fa45ffc63..6dd7b8476 100644 --- a/libnds/arm7_2input_8h.html +++ b/libnds/arm7_2input_8h.html @@ -157,7 +157,7 @@

    diff --git a/libnds/arm7_2touch_8h.html b/libnds/arm7_2touch_8h.html index 9eb1f3854..de9c754f0 100644 --- a/libnds/arm7_2touch_8h.html +++ b/libnds/arm7_2touch_8h.html @@ -194,7 +194,7 @@

    diff --git a/libnds/arm9_2card_8h.html b/libnds/arm9_2card_8h.html index db9a06fed..9dbb76530 100644 --- a/libnds/arm9_2card_8h.html +++ b/libnds/arm9_2card_8h.html @@ -159,7 +159,7 @@

    diff --git a/libnds/arm9_2input_8h.html b/libnds/arm9_2input_8h.html index 1ac9b090c..df36b616f 100644 --- a/libnds/arm9_2input_8h.html +++ b/libnds/arm9_2input_8h.html @@ -322,7 +322,7 @@

    diff --git a/libnds/arm9_2sdmmc_8h.html b/libnds/arm9_2sdmmc_8h.html index 79b3da031..36f9db260 100644 --- a/libnds/arm9_2sdmmc_8h.html +++ b/libnds/arm9_2sdmmc_8h.html @@ -319,7 +319,7 @@

    diff --git a/libnds/audio_8h.html b/libnds/audio_8h.html index 06843e248..04b624f5b 100644 --- a/libnds/audio_8h.html +++ b/libnds/audio_8h.html @@ -364,7 +364,7 @@

    diff --git a/libnds/background_8h.html b/libnds/background_8h.html index 8e6489208..0c30e72c8 100644 --- a/libnds/background_8h.html +++ b/libnds/background_8h.html @@ -722,7 +722,7 @@ diff --git a/libnds/bios_8h.html b/libnds/bios_8h.html index a2dc7f030..9870765cc 100644 --- a/libnds/bios_8h.html +++ b/libnds/bios_8h.html @@ -1533,7 +1533,7 @@

    diff --git a/libnds/boxtest_8h.html b/libnds/boxtest_8h.html index 126f955c8..097c5f1b2 100644 --- a/libnds/boxtest_8h.html +++ b/libnds/boxtest_8h.html @@ -429,7 +429,7 @@

    diff --git a/libnds/cache_8h.html b/libnds/cache_8h.html index 7e7d53de2..8f87d28ef 100644 --- a/libnds/cache_8h.html +++ b/libnds/cache_8h.html @@ -261,7 +261,7 @@

    diff --git a/libnds/card_8h.html b/libnds/card_8h.html index 4d48902f2..6298b7565 100644 --- a/libnds/card_8h.html +++ b/libnds/card_8h.html @@ -754,7 +754,7 @@

    diff --git a/libnds/classes.html b/libnds/classes.html index 84eea29fc..2ab8b183c 100644 --- a/libnds/classes.html +++ b/libnds/classes.html @@ -131,7 +131,7 @@ diff --git a/libnds/clock_8h.html b/libnds/clock_8h.html index c9d185dfc..172fbb346 100644 --- a/libnds/clock_8h.html +++ b/libnds/clock_8h.html @@ -283,7 +283,7 @@

    diff --git a/libnds/codec_8h.html b/libnds/codec_8h.html index 31689bf44..7dd52167e 100644 --- a/libnds/codec_8h.html +++ b/libnds/codec_8h.html @@ -154,7 +154,7 @@

    diff --git a/libnds/console_8h.html b/libnds/console_8h.html index 8fca1975f..5df1c8aef 100644 --- a/libnds/console_8h.html +++ b/libnds/console_8h.html @@ -640,7 +640,7 @@

    diff --git a/libnds/cothread_8h.html b/libnds/cothread_8h.html index 89a2d9002..c300dd81c 100644 --- a/libnds/cothread_8h.html +++ b/libnds/cothread_8h.html @@ -648,7 +648,7 @@

    diff --git a/libnds/debug_8h.html b/libnds/debug_8h.html index 0335e3a6c..53614a816 100644 --- a/libnds/debug_8h.html +++ b/libnds/debug_8h.html @@ -186,7 +186,7 @@

    diff --git a/libnds/decompress_8h.html b/libnds/decompress_8h.html index e79608b41..780ec2ca7 100644 --- a/libnds/decompress_8h.html +++ b/libnds/decompress_8h.html @@ -324,7 +324,7 @@

    diff --git a/libnds/deprecated.html b/libnds/deprecated.html index 356e889fc..dfb826753 100644 --- a/libnds/deprecated.html +++ b/libnds/deprecated.html @@ -93,7 +93,7 @@ diff --git a/libnds/dir_2d2937ff9358bd81f182d4109e99a43c.html b/libnds/dir_2d2937ff9358bd81f182d4109e99a43c.html index d8536e81b..71ca26bbc 100644 --- a/libnds/dir_2d2937ff9358bd81f182d4109e99a43c.html +++ b/libnds/dir_2d2937ff9358bd81f182d4109e99a43c.html @@ -185,7 +185,7 @@ diff --git a/libnds/dir_317ea3797c15f4a1d9c156bc812661ca.html b/libnds/dir_317ea3797c15f4a1d9c156bc812661ca.html index 55f4d6b12..cdada6921 100644 --- a/libnds/dir_317ea3797c15f4a1d9c156bc812661ca.html +++ b/libnds/dir_317ea3797c15f4a1d9c156bc812661ca.html @@ -90,7 +90,7 @@ diff --git a/libnds/dir_43a26886bf57aaa5db5cc4b694360a23.html b/libnds/dir_43a26886bf57aaa5db5cc4b694360a23.html index 79762a1cc..9e4dc589f 100644 --- a/libnds/dir_43a26886bf57aaa5db5cc4b694360a23.html +++ b/libnds/dir_43a26886bf57aaa5db5cc4b694360a23.html @@ -90,7 +90,7 @@ diff --git a/libnds/dir_83878ba4c67659cc0852c83e2f61ba2e.html b/libnds/dir_83878ba4c67659cc0852c83e2f61ba2e.html index cf51341aa..0c9dde7dd 100644 --- a/libnds/dir_83878ba4c67659cc0852c83e2f61ba2e.html +++ b/libnds/dir_83878ba4c67659cc0852c83e2f61ba2e.html @@ -103,7 +103,7 @@ diff --git a/libnds/dir_b53522c5cee68335ba389010340aafeb.html b/libnds/dir_b53522c5cee68335ba389010340aafeb.html index e42110039..e7fa7d487 100644 --- a/libnds/dir_b53522c5cee68335ba389010340aafeb.html +++ b/libnds/dir_b53522c5cee68335ba389010340aafeb.html @@ -106,7 +106,7 @@ diff --git a/libnds/dir_c25c118f76a81c77ceea021073727baa.html b/libnds/dir_c25c118f76a81c77ceea021073727baa.html index c9e97a77d..254f7fedc 100644 --- a/libnds/dir_c25c118f76a81c77ceea021073727baa.html +++ b/libnds/dir_c25c118f76a81c77ceea021073727baa.html @@ -90,7 +90,7 @@ diff --git a/libnds/dir_d44c64559bbebec7f509842c48db8b23.html b/libnds/dir_d44c64559bbebec7f509842c48db8b23.html index a7f516541..2a3bc455e 100644 --- a/libnds/dir_d44c64559bbebec7f509842c48db8b23.html +++ b/libnds/dir_d44c64559bbebec7f509842c48db8b23.html @@ -115,7 +115,7 @@ diff --git a/libnds/dir_eef24e62abe235ff08d6c310d2f6b3f3.html b/libnds/dir_eef24e62abe235ff08d6c310d2f6b3f3.html index 3a5743438..09a5f5b6c 100644 --- a/libnds/dir_eef24e62abe235ff08d6c310d2f6b3f3.html +++ b/libnds/dir_eef24e62abe235ff08d6c310d2f6b3f3.html @@ -157,7 +157,7 @@ diff --git a/libnds/dir_f75569adbbf338cab061740510d0951b.html b/libnds/dir_f75569adbbf338cab061740510d0951b.html index 1d77f1e4a..8c6e8eeeb 100644 --- a/libnds/dir_f75569adbbf338cab061740510d0951b.html +++ b/libnds/dir_f75569adbbf338cab061740510d0951b.html @@ -124,7 +124,7 @@ diff --git a/libnds/dma_8h.html b/libnds/dma_8h.html index 79273144b..bd550364c 100644 --- a/libnds/dma_8h.html +++ b/libnds/dma_8h.html @@ -827,7 +827,7 @@

    diff --git a/libnds/dsp_8h.html b/libnds/dsp_8h.html index 7e03469bf..18633c1b9 100644 --- a/libnds/dsp_8h.html +++ b/libnds/dsp_8h.html @@ -585,7 +585,7 @@

    diff --git a/libnds/dynamicArray_8h.html b/libnds/dynamicArray_8h.html index c2cfc408f..20cc47bcb 100644 --- a/libnds/dynamicArray_8h.html +++ b/libnds/dynamicArray_8h.html @@ -279,7 +279,7 @@

    diff --git a/libnds/exceptions_8h.html b/libnds/exceptions_8h.html index 2d15a1316..a72ca660a 100644 --- a/libnds/exceptions_8h.html +++ b/libnds/exceptions_8h.html @@ -170,7 +170,7 @@

    diff --git a/libnds/fat_8h.html b/libnds/fat_8h.html index f24209add..5ac42eb81 100644 --- a/libnds/fat_8h.html +++ b/libnds/fat_8h.html @@ -378,7 +378,7 @@

    diff --git a/libnds/fifo_8h.html b/libnds/fifo_8h.html index 75527fd46..0e865830b 100644 --- a/libnds/fifo_8h.html +++ b/libnds/fifo_8h.html @@ -360,7 +360,7 @@

    diff --git a/libnds/fifocommon_8h.html b/libnds/fifocommon_8h.html index 02a691bba..c4eecf534 100644 --- a/libnds/fifocommon_8h.html +++ b/libnds/fifocommon_8h.html @@ -1190,7 +1190,7 @@

    diff --git a/libnds/files.html b/libnds/files.html index 6a10b8b73..4f4af11a1 100644 --- a/libnds/files.html +++ b/libnds/files.html @@ -163,7 +163,7 @@ diff --git a/libnds/filesystem_8h.html b/libnds/filesystem_8h.html index ed36ae86c..215f05d32 100644 --- a/libnds/filesystem_8h.html +++ b/libnds/filesystem_8h.html @@ -255,7 +255,7 @@

    diff --git a/libnds/firmware_8h.html b/libnds/firmware_8h.html index 6a5612807..e04e654ee 100644 --- a/libnds/firmware_8h.html +++ b/libnds/firmware_8h.html @@ -159,7 +159,7 @@ diff --git a/libnds/functions.html b/libnds/functions.html index 8f7f8f7f4..c8573703a 100644 --- a/libnds/functions.html +++ b/libnds/functions.html @@ -110,7 +110,7 @@

    - a -

      diff --git a/libnds/functions_b.html b/libnds/functions_b.html index d92206e66..a761bb164 100644 --- a/libnds/functions_b.html +++ b/libnds/functions_b.html @@ -103,7 +103,7 @@

      - b -

        diff --git a/libnds/functions_c.html b/libnds/functions_c.html index ea23774cc..0232915c8 100644 --- a/libnds/functions_c.html +++ b/libnds/functions_c.html @@ -108,7 +108,7 @@

        - c -

          diff --git a/libnds/functions_d.html b/libnds/functions_d.html index cb47feb13..9a53bb9e8 100644 --- a/libnds/functions_d.html +++ b/libnds/functions_d.html @@ -106,7 +106,7 @@

          - d -

            diff --git a/libnds/functions_e.html b/libnds/functions_e.html index ae9c81a28..3f9e6e77a 100644 --- a/libnds/functions_e.html +++ b/libnds/functions_e.html @@ -88,7 +88,7 @@

            - e -

              diff --git a/libnds/functions_f.html b/libnds/functions_f.html index b322e6725..313712256 100644 --- a/libnds/functions_f.html +++ b/libnds/functions_f.html @@ -102,7 +102,7 @@

              - f -

                diff --git a/libnds/functions_g.html b/libnds/functions_g.html index 595e490a3..52a0d97c6 100644 --- a/libnds/functions_g.html +++ b/libnds/functions_g.html @@ -105,7 +105,7 @@

                - g -

                  diff --git a/libnds/functions_h.html b/libnds/functions_h.html index 3dd114b4f..36c911a21 100644 --- a/libnds/functions_h.html +++ b/libnds/functions_h.html @@ -97,7 +97,7 @@

                  - h -

                    diff --git a/libnds/functions_i.html b/libnds/functions_i.html index ec42dd991..aa467999e 100644 --- a/libnds/functions_i.html +++ b/libnds/functions_i.html @@ -98,7 +98,7 @@

                    - i -

                      diff --git a/libnds/functions_j.html b/libnds/functions_j.html index 61c3cb85c..ef735674a 100644 --- a/libnds/functions_j.html +++ b/libnds/functions_j.html @@ -88,7 +88,7 @@

                      - j -

                        diff --git a/libnds/functions_k.html b/libnds/functions_k.html index 9912c0bd4..7863e5ec5 100644 --- a/libnds/functions_k.html +++ b/libnds/functions_k.html @@ -90,7 +90,7 @@

                        - k -

                          diff --git a/libnds/functions_l.html b/libnds/functions_l.html index 5b9ebc2a8..25a2440e9 100644 --- a/libnds/functions_l.html +++ b/libnds/functions_l.html @@ -91,7 +91,7 @@

                          - l -

                            diff --git a/libnds/functions_m.html b/libnds/functions_m.html index 93578cfee..213273f7a 100644 --- a/libnds/functions_m.html +++ b/libnds/functions_m.html @@ -103,7 +103,7 @@

                            - m -

                              diff --git a/libnds/functions_n.html b/libnds/functions_n.html index 10fdaed94..2cbd9b632 100644 --- a/libnds/functions_n.html +++ b/libnds/functions_n.html @@ -93,7 +93,7 @@

                              - n -

                                diff --git a/libnds/functions_o.html b/libnds/functions_o.html index 198a38d15..1589c6d2c 100644 --- a/libnds/functions_o.html +++ b/libnds/functions_o.html @@ -93,7 +93,7 @@

                                - o -

                                  diff --git a/libnds/functions_p.html b/libnds/functions_p.html index f39178d75..d0248e3d4 100644 --- a/libnds/functions_p.html +++ b/libnds/functions_p.html @@ -100,7 +100,7 @@

                                  - p -

                                    diff --git a/libnds/functions_r.html b/libnds/functions_r.html index 23976e0f6..31ca4c616 100644 --- a/libnds/functions_r.html +++ b/libnds/functions_r.html @@ -100,7 +100,7 @@

                                    - r -

                                      diff --git a/libnds/functions_s.html b/libnds/functions_s.html index 21e71ee64..06d7514ef 100644 --- a/libnds/functions_s.html +++ b/libnds/functions_s.html @@ -103,7 +103,7 @@

                                      - s -

                                        diff --git a/libnds/functions_t.html b/libnds/functions_t.html index db2ad96b1..797b62af7 100644 --- a/libnds/functions_t.html +++ b/libnds/functions_t.html @@ -99,7 +99,7 @@

                                        - t -

                                          diff --git a/libnds/functions_u.html b/libnds/functions_u.html index 5e63bf633..2e5a01eff 100644 --- a/libnds/functions_u.html +++ b/libnds/functions_u.html @@ -93,7 +93,7 @@

                                          - u -

                                            diff --git a/libnds/functions_v.html b/libnds/functions_v.html index 358304ad6..22ba8c936 100644 --- a/libnds/functions_v.html +++ b/libnds/functions_v.html @@ -94,7 +94,7 @@

                                            - v -

                                              diff --git a/libnds/functions_vars.html b/libnds/functions_vars.html index 9b1ca6c20..220fa94ea 100644 --- a/libnds/functions_vars.html +++ b/libnds/functions_vars.html @@ -110,7 +110,7 @@

                                              - a -

                                                diff --git a/libnds/functions_vars_b.html b/libnds/functions_vars_b.html index ffd1690a5..463bf2ea2 100644 --- a/libnds/functions_vars_b.html +++ b/libnds/functions_vars_b.html @@ -103,7 +103,7 @@

                                                - b -

                                                  diff --git a/libnds/functions_vars_c.html b/libnds/functions_vars_c.html index 99f0d0a4a..f8a88d045 100644 --- a/libnds/functions_vars_c.html +++ b/libnds/functions_vars_c.html @@ -108,7 +108,7 @@

                                                  - c -

                                                    diff --git a/libnds/functions_vars_d.html b/libnds/functions_vars_d.html index 44383a435..9e31a6cc4 100644 --- a/libnds/functions_vars_d.html +++ b/libnds/functions_vars_d.html @@ -106,7 +106,7 @@

                                                    - d -

                                                      diff --git a/libnds/functions_vars_e.html b/libnds/functions_vars_e.html index 0476e74ce..6d72987d7 100644 --- a/libnds/functions_vars_e.html +++ b/libnds/functions_vars_e.html @@ -88,7 +88,7 @@

                                                      - e -

                                                        diff --git a/libnds/functions_vars_f.html b/libnds/functions_vars_f.html index 423275081..4e0fac17c 100644 --- a/libnds/functions_vars_f.html +++ b/libnds/functions_vars_f.html @@ -102,7 +102,7 @@

                                                        - f -

                                                          diff --git a/libnds/functions_vars_g.html b/libnds/functions_vars_g.html index f76a11022..f58017298 100644 --- a/libnds/functions_vars_g.html +++ b/libnds/functions_vars_g.html @@ -105,7 +105,7 @@

                                                          - g -

                                                            diff --git a/libnds/functions_vars_h.html b/libnds/functions_vars_h.html index 2c32bf2e4..8d0368cdc 100644 --- a/libnds/functions_vars_h.html +++ b/libnds/functions_vars_h.html @@ -97,7 +97,7 @@

                                                            - h -

                                                              diff --git a/libnds/functions_vars_i.html b/libnds/functions_vars_i.html index 69e268b23..1c0656cb6 100644 --- a/libnds/functions_vars_i.html +++ b/libnds/functions_vars_i.html @@ -98,7 +98,7 @@

                                                              - i -

                                                                diff --git a/libnds/functions_vars_j.html b/libnds/functions_vars_j.html index 36a4250ea..af2a8e23d 100644 --- a/libnds/functions_vars_j.html +++ b/libnds/functions_vars_j.html @@ -88,7 +88,7 @@

                                                                - j -

                                                                  diff --git a/libnds/functions_vars_k.html b/libnds/functions_vars_k.html index 5359d70b0..ab96b86a3 100644 --- a/libnds/functions_vars_k.html +++ b/libnds/functions_vars_k.html @@ -90,7 +90,7 @@

                                                                  - k -

                                                                    diff --git a/libnds/functions_vars_l.html b/libnds/functions_vars_l.html index 8cf9e52cc..fe4747353 100644 --- a/libnds/functions_vars_l.html +++ b/libnds/functions_vars_l.html @@ -91,7 +91,7 @@

                                                                    - l -

                                                                      diff --git a/libnds/functions_vars_m.html b/libnds/functions_vars_m.html index 7526ca718..601df4cb8 100644 --- a/libnds/functions_vars_m.html +++ b/libnds/functions_vars_m.html @@ -103,7 +103,7 @@

                                                                      - m -

                                                                        diff --git a/libnds/functions_vars_n.html b/libnds/functions_vars_n.html index 982d98c1e..d7f49066a 100644 --- a/libnds/functions_vars_n.html +++ b/libnds/functions_vars_n.html @@ -93,7 +93,7 @@

                                                                        - n -

                                                                          diff --git a/libnds/functions_vars_o.html b/libnds/functions_vars_o.html index 41cbe0865..5e25cfbe0 100644 --- a/libnds/functions_vars_o.html +++ b/libnds/functions_vars_o.html @@ -93,7 +93,7 @@

                                                                          - o -

                                                                            diff --git a/libnds/functions_vars_p.html b/libnds/functions_vars_p.html index f73c81cad..8ca25ae7a 100644 --- a/libnds/functions_vars_p.html +++ b/libnds/functions_vars_p.html @@ -100,7 +100,7 @@

                                                                            - p -

                                                                              diff --git a/libnds/functions_vars_r.html b/libnds/functions_vars_r.html index 1ee382f32..b095af3df 100644 --- a/libnds/functions_vars_r.html +++ b/libnds/functions_vars_r.html @@ -100,7 +100,7 @@

                                                                              - r -

                                                                                diff --git a/libnds/functions_vars_s.html b/libnds/functions_vars_s.html index f64887cd3..a051142d1 100644 --- a/libnds/functions_vars_s.html +++ b/libnds/functions_vars_s.html @@ -103,7 +103,7 @@

                                                                                - s -

                                                                                  diff --git a/libnds/functions_vars_t.html b/libnds/functions_vars_t.html index 862c01d11..5ade5e4d2 100644 --- a/libnds/functions_vars_t.html +++ b/libnds/functions_vars_t.html @@ -99,7 +99,7 @@

                                                                                  - t -

                                                                                    diff --git a/libnds/functions_vars_u.html b/libnds/functions_vars_u.html index 7388b3760..39e139a00 100644 --- a/libnds/functions_vars_u.html +++ b/libnds/functions_vars_u.html @@ -93,7 +93,7 @@

                                                                                    - u -

                                                                                      diff --git a/libnds/functions_vars_v.html b/libnds/functions_vars_v.html index 3b92044df..c57fd8531 100644 --- a/libnds/functions_vars_v.html +++ b/libnds/functions_vars_v.html @@ -94,7 +94,7 @@

                                                                                      - v -

                                                                                        diff --git a/libnds/functions_vars_w.html b/libnds/functions_vars_w.html index 749044f01..296790059 100644 --- a/libnds/functions_vars_w.html +++ b/libnds/functions_vars_w.html @@ -93,7 +93,7 @@

                                                                                        - w -

                                                                                          diff --git a/libnds/functions_vars_x.html b/libnds/functions_vars_x.html index 7807aa11f..f7bf83479 100644 --- a/libnds/functions_vars_x.html +++ b/libnds/functions_vars_x.html @@ -88,7 +88,7 @@

                                                                                          - x -

                                                                                            diff --git a/libnds/functions_vars_y.html b/libnds/functions_vars_y.html index ebf12c516..22a07def7 100644 --- a/libnds/functions_vars_y.html +++ b/libnds/functions_vars_y.html @@ -89,7 +89,7 @@

                                                                                            - y -

                                                                                              diff --git a/libnds/functions_vars_z.html b/libnds/functions_vars_z.html index aea3b9205..d6dc6cb82 100644 --- a/libnds/functions_vars_z.html +++ b/libnds/functions_vars_z.html @@ -89,7 +89,7 @@

                                                                                              - z -

                                                                                                diff --git a/libnds/functions_w.html b/libnds/functions_w.html index 566c25f5b..07f10aae3 100644 --- a/libnds/functions_w.html +++ b/libnds/functions_w.html @@ -93,7 +93,7 @@

                                                                                                - w -

                                                                                                  diff --git a/libnds/functions_x.html b/libnds/functions_x.html index 6ab99bee5..3d7671e65 100644 --- a/libnds/functions_x.html +++ b/libnds/functions_x.html @@ -88,7 +88,7 @@

                                                                                                  - x -

                                                                                                    diff --git a/libnds/functions_y.html b/libnds/functions_y.html index 8b874a236..15afc1af2 100644 --- a/libnds/functions_y.html +++ b/libnds/functions_y.html @@ -89,7 +89,7 @@

                                                                                                    - y -

                                                                                                      diff --git a/libnds/functions_z.html b/libnds/functions_z.html index 864d97997..50fc650eb 100644 --- a/libnds/functions_z.html +++ b/libnds/functions_z.html @@ -89,7 +89,7 @@

                                                                                                      - z -

                                                                                                        diff --git a/libnds/gl2d_8h.html b/libnds/gl2d_8h.html index a0369d78c..37d28ae79 100644 --- a/libnds/gl2d_8h.html +++ b/libnds/gl2d_8h.html @@ -1611,7 +1611,7 @@

                                                                                                        diff --git a/libnds/globals.html b/libnds/globals.html index 82b4c7297..910c1fedd 100644 --- a/libnds/globals.html +++ b/libnds/globals.html @@ -89,7 +89,7 @@

                                                                                                        - _ -

                                                                                                          diff --git a/libnds/globals_a.html b/libnds/globals_a.html index b34fc9154..74f1a88a0 100644 --- a/libnds/globals_a.html +++ b/libnds/globals_a.html @@ -102,7 +102,7 @@

                                                                                                          - a -

                                                                                                            diff --git a/libnds/globals_b.html b/libnds/globals_b.html index 0d2a55811..ec6d85674 100644 --- a/libnds/globals_b.html +++ b/libnds/globals_b.html @@ -225,7 +225,7 @@

                                                                                                            - b -

                                                                                                              diff --git a/libnds/globals_c.html b/libnds/globals_c.html index 79e8f3278..4ed5298cc 100644 --- a/libnds/globals_c.html +++ b/libnds/globals_c.html @@ -161,7 +161,7 @@

                                                                                                              - c -

                                                                                                                diff --git a/libnds/globals_d.html b/libnds/globals_d.html index d2ba7eced..8e61bde19 100644 --- a/libnds/globals_d.html +++ b/libnds/globals_d.html @@ -194,7 +194,7 @@

                                                                                                                - d -

                                                                                                                  diff --git a/libnds/globals_defs.html b/libnds/globals_defs.html index ac61644fe..203a018e6 100644 --- a/libnds/globals_defs.html +++ b/libnds/globals_defs.html @@ -98,7 +98,7 @@

                                                                                                                  - a -

                                                                                                                    diff --git a/libnds/globals_defs_b.html b/libnds/globals_defs_b.html index 100045956..cbc31b420 100644 --- a/libnds/globals_defs_b.html +++ b/libnds/globals_defs_b.html @@ -109,7 +109,7 @@

                                                                                                                    - b -

                                                                                                                      diff --git a/libnds/globals_defs_c.html b/libnds/globals_defs_c.html index 0cec7260e..876686180 100644 --- a/libnds/globals_defs_c.html +++ b/libnds/globals_defs_c.html @@ -95,7 +95,7 @@

                                                                                                                      - c -

                                                                                                                        diff --git a/libnds/globals_defs_d.html b/libnds/globals_defs_d.html index e16bc78a1..b4a9918fb 100644 --- a/libnds/globals_defs_d.html +++ b/libnds/globals_defs_d.html @@ -101,7 +101,7 @@

                                                                                                                        - d -

                                                                                                                          diff --git a/libnds/globals_defs_e.html b/libnds/globals_defs_e.html index 3cf1692a9..f2ed1315e 100644 --- a/libnds/globals_defs_e.html +++ b/libnds/globals_defs_e.html @@ -89,7 +89,7 @@

                                                                                                                          - e -

                                                                                                                            diff --git a/libnds/globals_defs_f.html b/libnds/globals_defs_f.html index a460d05a2..3a2f41762 100644 --- a/libnds/globals_defs_f.html +++ b/libnds/globals_defs_f.html @@ -138,7 +138,7 @@

                                                                                                                            - f -

                                                                                                                              diff --git a/libnds/globals_defs_g.html b/libnds/globals_defs_g.html index 2977f6982..a638c0ecf 100644 --- a/libnds/globals_defs_g.html +++ b/libnds/globals_defs_g.html @@ -92,7 +92,7 @@

                                                                                                                              - g -

                                                                                                                                diff --git a/libnds/globals_defs_i.html b/libnds/globals_defs_i.html index e79d250d3..eae02e662 100644 --- a/libnds/globals_defs_i.html +++ b/libnds/globals_defs_i.html @@ -134,7 +134,7 @@

                                                                                                                                - i -

                                                                                                                                  diff --git a/libnds/globals_defs_k.html b/libnds/globals_defs_k.html index 8929fe8eb..e32bfb832 100644 --- a/libnds/globals_defs_k.html +++ b/libnds/globals_defs_k.html @@ -92,7 +92,7 @@

                                                                                                                                  - k -

                                                                                                                                    diff --git a/libnds/globals_defs_m.html b/libnds/globals_defs_m.html index 17a2bd7b4..0203ee188 100644 --- a/libnds/globals_defs_m.html +++ b/libnds/globals_defs_m.html @@ -93,7 +93,7 @@

                                                                                                                                    - m -

                                                                                                                                      diff --git a/libnds/globals_defs_n.html b/libnds/globals_defs_n.html index ed4c30048..c4ca6ed3c 100644 --- a/libnds/globals_defs_n.html +++ b/libnds/globals_defs_n.html @@ -89,7 +89,7 @@

                                                                                                                                      - n -

                                                                                                                                        diff --git a/libnds/globals_defs_o.html b/libnds/globals_defs_o.html index e4c254ef9..d96d72cfb 100644 --- a/libnds/globals_defs_o.html +++ b/libnds/globals_defs_o.html @@ -89,7 +89,7 @@

                                                                                                                                        - o -

                                                                                                                                          diff --git a/libnds/globals_defs_p.html b/libnds/globals_defs_p.html index 6ca2b8896..e23920d7c 100644 --- a/libnds/globals_defs_p.html +++ b/libnds/globals_defs_p.html @@ -90,7 +90,7 @@

                                                                                                                                          - p -

                                                                                                                                            diff --git a/libnds/globals_defs_r.html b/libnds/globals_defs_r.html index ffbc2a99d..4249afef6 100644 --- a/libnds/globals_defs_r.html +++ b/libnds/globals_defs_r.html @@ -160,7 +160,7 @@

                                                                                                                                            - r -

                                                                                                                                              diff --git a/libnds/globals_defs_s.html b/libnds/globals_defs_s.html index c6f8d5d21..cf534bfed 100644 --- a/libnds/globals_defs_s.html +++ b/libnds/globals_defs_s.html @@ -111,7 +111,7 @@

                                                                                                                                              - s -

                                                                                                                                                diff --git a/libnds/globals_defs_t.html b/libnds/globals_defs_t.html index 2a8bc7c32..0453a3d21 100644 --- a/libnds/globals_defs_t.html +++ b/libnds/globals_defs_t.html @@ -128,7 +128,7 @@

                                                                                                                                                - t -

                                                                                                                                                  diff --git a/libnds/globals_defs_v.html b/libnds/globals_defs_v.html index 2658b88d8..7e737f6a3 100644 --- a/libnds/globals_defs_v.html +++ b/libnds/globals_defs_v.html @@ -106,7 +106,7 @@

                                                                                                                                                  - v -

                                                                                                                                                    diff --git a/libnds/globals_e.html b/libnds/globals_e.html index 567556753..36e8165be 100644 --- a/libnds/globals_e.html +++ b/libnds/globals_e.html @@ -97,7 +97,7 @@

                                                                                                                                                    - e -

                                                                                                                                                      diff --git a/libnds/globals_enum.html b/libnds/globals_enum.html index 1e152f4f7..238ecceb8 100644 --- a/libnds/globals_enum.html +++ b/libnds/globals_enum.html @@ -207,7 +207,7 @@

                                                                                                                                                      - w -

                                                                                                                                                        diff --git a/libnds/globals_eval.html b/libnds/globals_eval.html index 5112c9521..7c6ab5445 100644 --- a/libnds/globals_eval.html +++ b/libnds/globals_eval.html @@ -151,7 +151,7 @@

                                                                                                                                                        - b -

                                                                                                                                                          diff --git a/libnds/globals_eval_c.html b/libnds/globals_eval_c.html index ed8f08737..42220c14f 100644 --- a/libnds/globals_eval_c.html +++ b/libnds/globals_eval_c.html @@ -95,7 +95,7 @@

                                                                                                                                                          - c -

                                                                                                                                                            diff --git a/libnds/globals_eval_d.html b/libnds/globals_eval_d.html index 637eea8b3..0cd90fd82 100644 --- a/libnds/globals_eval_d.html +++ b/libnds/globals_eval_d.html @@ -122,7 +122,7 @@

                                                                                                                                                            - d -

                                                                                                                                                              diff --git a/libnds/globals_eval_f.html b/libnds/globals_eval_f.html index 617b8d7fa..458af1aa1 100644 --- a/libnds/globals_eval_f.html +++ b/libnds/globals_eval_f.html @@ -104,7 +104,7 @@

                                                                                                                                                              - f -

                                                                                                                                                                diff --git a/libnds/globals_eval_g.html b/libnds/globals_eval_g.html index c3d255401..e034a6c8a 100644 --- a/libnds/globals_eval_g.html +++ b/libnds/globals_eval_g.html @@ -152,7 +152,7 @@

                                                                                                                                                                - g -

                                                                                                                                                                  diff --git a/libnds/globals_eval_h.html b/libnds/globals_eval_h.html index 66208c22f..7fa49f02c 100644 --- a/libnds/globals_eval_h.html +++ b/libnds/globals_eval_h.html @@ -88,7 +88,7 @@

                                                                                                                                                                  - h -

                                                                                                                                                                    diff --git a/libnds/globals_eval_i.html b/libnds/globals_eval_i.html index b935ad40e..eb10a717d 100644 --- a/libnds/globals_eval_i.html +++ b/libnds/globals_eval_i.html @@ -89,7 +89,7 @@

                                                                                                                                                                    - i -

                                                                                                                                                                      diff --git a/libnds/globals_eval_k.html b/libnds/globals_eval_k.html index 104d371b8..26fdefe56 100644 --- a/libnds/globals_eval_k.html +++ b/libnds/globals_eval_k.html @@ -102,7 +102,7 @@

                                                                                                                                                                      - k -

                                                                                                                                                                        diff --git a/libnds/globals_eval_l.html b/libnds/globals_eval_l.html index 94db4110f..8eac97fcf 100644 --- a/libnds/globals_eval_l.html +++ b/libnds/globals_eval_l.html @@ -90,7 +90,7 @@

                                                                                                                                                                        - l -

                                                                                                                                                                          diff --git a/libnds/globals_eval_m.html b/libnds/globals_eval_m.html index d9cf772bf..0d756c88c 100644 --- a/libnds/globals_eval_m.html +++ b/libnds/globals_eval_m.html @@ -108,7 +108,7 @@

                                                                                                                                                                          - m -

                                                                                                                                                                            diff --git a/libnds/globals_eval_n.html b/libnds/globals_eval_n.html index 4a866dac3..e5cb5e74b 100644 --- a/libnds/globals_eval_n.html +++ b/libnds/globals_eval_n.html @@ -104,7 +104,7 @@

                                                                                                                                                                            - n -

                                                                                                                                                                              diff --git a/libnds/globals_eval_o.html b/libnds/globals_eval_o.html index a7ee2b6f8..112b7ac80 100644 --- a/libnds/globals_eval_o.html +++ b/libnds/globals_eval_o.html @@ -105,7 +105,7 @@

                                                                                                                                                                              - o -

                                                                                                                                                                                diff --git a/libnds/globals_eval_p.html b/libnds/globals_eval_p.html index 4849a3eec..f3a5e048a 100644 --- a/libnds/globals_eval_p.html +++ b/libnds/globals_eval_p.html @@ -138,7 +138,7 @@

                                                                                                                                                                                - p -

                                                                                                                                                                                  diff --git a/libnds/globals_eval_r.html b/libnds/globals_eval_r.html index 1292c0842..12fac9786 100644 --- a/libnds/globals_eval_r.html +++ b/libnds/globals_eval_r.html @@ -90,7 +90,7 @@

                                                                                                                                                                                  - r -

                                                                                                                                                                                    diff --git a/libnds/globals_eval_s.html b/libnds/globals_eval_s.html index 2d3f67522..0d982f40d 100644 --- a/libnds/globals_eval_s.html +++ b/libnds/globals_eval_s.html @@ -120,7 +120,7 @@

                                                                                                                                                                                    - s -

                                                                                                                                                                                      diff --git a/libnds/globals_eval_t.html b/libnds/globals_eval_t.html index 9de4785ac..12785284b 100644 --- a/libnds/globals_eval_t.html +++ b/libnds/globals_eval_t.html @@ -100,7 +100,7 @@

                                                                                                                                                                                      - t -

                                                                                                                                                                                        diff --git a/libnds/globals_eval_u.html b/libnds/globals_eval_u.html index f1cc3300e..6396b678b 100644 --- a/libnds/globals_eval_u.html +++ b/libnds/globals_eval_u.html @@ -88,7 +88,7 @@

                                                                                                                                                                                        - u -

                                                                                                                                                                                          diff --git a/libnds/globals_eval_v.html b/libnds/globals_eval_v.html index 1298cc323..ece887bf5 100644 --- a/libnds/globals_eval_v.html +++ b/libnds/globals_eval_v.html @@ -203,7 +203,7 @@

                                                                                                                                                                                          - v -

                                                                                                                                                                                            diff --git a/libnds/globals_eval_w.html b/libnds/globals_eval_w.html index da5c3fe1b..c0d05bfb6 100644 --- a/libnds/globals_eval_w.html +++ b/libnds/globals_eval_w.html @@ -91,7 +91,7 @@

                                                                                                                                                                                            - w -

                                                                                                                                                                                              diff --git a/libnds/globals_f.html b/libnds/globals_f.html index d4c6f6048..4d7105502 100644 --- a/libnds/globals_f.html +++ b/libnds/globals_f.html @@ -195,7 +195,7 @@

                                                                                                                                                                                              - f -

                                                                                                                                                                                                diff --git a/libnds/globals_func.html b/libnds/globals_func.html index 9d0440d5f..76910ce29 100644 --- a/libnds/globals_func.html +++ b/libnds/globals_func.html @@ -90,7 +90,7 @@

                                                                                                                                                                                                - a -

                                                                                                                                                                                                  diff --git a/libnds/globals_func_b.html b/libnds/globals_func_b.html index 5d036aea0..7bddf46c6 100644 --- a/libnds/globals_func_b.html +++ b/libnds/globals_func_b.html @@ -131,7 +131,7 @@

                                                                                                                                                                                                  - b -

                                                                                                                                                                                                    diff --git a/libnds/globals_func_c.html b/libnds/globals_func_c.html index d48f76e8e..e120402b8 100644 --- a/libnds/globals_func_c.html +++ b/libnds/globals_func_c.html @@ -137,7 +137,7 @@

                                                                                                                                                                                                    - c -

                                                                                                                                                                                                      diff --git a/libnds/globals_func_d.html b/libnds/globals_func_d.html index 970d5c8a3..f6a0c5bbc 100644 --- a/libnds/globals_func_d.html +++ b/libnds/globals_func_d.html @@ -138,7 +138,7 @@

                                                                                                                                                                                                      - d -

                                                                                                                                                                                                        diff --git a/libnds/globals_func_e.html b/libnds/globals_func_e.html index 0478adeb5..f33edc9b3 100644 --- a/libnds/globals_func_e.html +++ b/libnds/globals_func_e.html @@ -92,7 +92,7 @@

                                                                                                                                                                                                        - e -

                                                                                                                                                                                                          diff --git a/libnds/globals_func_f.html b/libnds/globals_func_f.html index 4cad0fc8f..8541393a7 100644 --- a/libnds/globals_func_f.html +++ b/libnds/globals_func_f.html @@ -118,7 +118,7 @@

                                                                                                                                                                                                          - f -

                                                                                                                                                                                                            diff --git a/libnds/globals_func_g.html b/libnds/globals_func_g.html index 476052c3b..41e9e2f4d 100644 --- a/libnds/globals_func_g.html +++ b/libnds/globals_func_g.html @@ -219,7 +219,7 @@

                                                                                                                                                                                                            - g -

                                                                                                                                                                                                              diff --git a/libnds/globals_func_h.html b/libnds/globals_func_h.html index deafd17c1..67fdf0652 100644 --- a/libnds/globals_func_h.html +++ b/libnds/globals_func_h.html @@ -88,7 +88,7 @@

                                                                                                                                                                                                              - h -

                                                                                                                                                                                                                diff --git a/libnds/globals_func_i.html b/libnds/globals_func_i.html index 362e9f872..54c78cdfc 100644 --- a/libnds/globals_func_i.html +++ b/libnds/globals_func_i.html @@ -109,7 +109,7 @@

                                                                                                                                                                                                                - i -

                                                                                                                                                                                                                  diff --git a/libnds/globals_func_k.html b/libnds/globals_func_k.html index b6041609a..c8da754d4 100644 --- a/libnds/globals_func_k.html +++ b/libnds/globals_func_k.html @@ -103,7 +103,7 @@

                                                                                                                                                                                                                  - k -

                                                                                                                                                                                                                    diff --git a/libnds/globals_func_l.html b/libnds/globals_func_l.html index faa883cc0..4a29edae6 100644 --- a/libnds/globals_func_l.html +++ b/libnds/globals_func_l.html @@ -94,7 +94,7 @@

                                                                                                                                                                                                                    - l -

                                                                                                                                                                                                                      diff --git a/libnds/globals_func_m.html b/libnds/globals_func_m.html index 17f5ad8b0..40bb31a28 100644 --- a/libnds/globals_func_m.html +++ b/libnds/globals_func_m.html @@ -129,7 +129,7 @@

                                                                                                                                                                                                                      - m -

                                                                                                                                                                                                                        diff --git a/libnds/globals_func_n.html b/libnds/globals_func_n.html index 5c50894e6..5934b4e0f 100644 --- a/libnds/globals_func_n.html +++ b/libnds/globals_func_n.html @@ -107,7 +107,7 @@

                                                                                                                                                                                                                        - n -

                                                                                                                                                                                                                          diff --git a/libnds/globals_func_o.html b/libnds/globals_func_o.html index 526de0786..283c23d75 100644 --- a/libnds/globals_func_o.html +++ b/libnds/globals_func_o.html @@ -116,7 +116,7 @@

                                                                                                                                                                                                                          - o -

                                                                                                                                                                                                                            diff --git a/libnds/globals_func_p.html b/libnds/globals_func_p.html index 9c032ce9d..23160e55f 100644 --- a/libnds/globals_func_p.html +++ b/libnds/globals_func_p.html @@ -124,7 +124,7 @@

                                                                                                                                                                                                                            - p -

                                                                                                                                                                                                                              diff --git a/libnds/globals_func_r.html b/libnds/globals_func_r.html index 7f84e71a9..799741322 100644 --- a/libnds/globals_func_r.html +++ b/libnds/globals_func_r.html @@ -100,7 +100,7 @@

                                                                                                                                                                                                                              - r -

                                                                                                                                                                                                                                diff --git a/libnds/globals_func_s.html b/libnds/globals_func_s.html index 704bdb9e9..d135c1abc 100644 --- a/libnds/globals_func_s.html +++ b/libnds/globals_func_s.html @@ -172,7 +172,7 @@

                                                                                                                                                                                                                                - s -

                                                                                                                                                                                                                                  diff --git a/libnds/globals_func_t.html b/libnds/globals_func_t.html index 3b5dcb256..5c66bc5e4 100644 --- a/libnds/globals_func_t.html +++ b/libnds/globals_func_t.html @@ -116,7 +116,7 @@

                                                                                                                                                                                                                                  - t -

                                                                                                                                                                                                                                    diff --git a/libnds/globals_func_v.html b/libnds/globals_func_v.html index 379769550..2ca187978 100644 --- a/libnds/globals_func_v.html +++ b/libnds/globals_func_v.html @@ -110,7 +110,7 @@

                                                                                                                                                                                                                                    - v -

                                                                                                                                                                                                                                      diff --git a/libnds/globals_func_w.html b/libnds/globals_func_w.html index 6565df592..b5267ad56 100644 --- a/libnds/globals_func_w.html +++ b/libnds/globals_func_w.html @@ -95,7 +95,7 @@

                                                                                                                                                                                                                                      - w -

                                                                                                                                                                                                                                        diff --git a/libnds/globals_g.html b/libnds/globals_g.html index 5d2515123..c9926e0de 100644 --- a/libnds/globals_g.html +++ b/libnds/globals_g.html @@ -308,7 +308,7 @@

                                                                                                                                                                                                                                        - g -

                                                                                                                                                                                                                                          diff --git a/libnds/globals_h.html b/libnds/globals_h.html index e64a6b830..2110c5285 100644 --- a/libnds/globals_h.html +++ b/libnds/globals_h.html @@ -89,7 +89,7 @@

                                                                                                                                                                                                                                          - h -

                                                                                                                                                                                                                                            diff --git a/libnds/globals_i.html b/libnds/globals_i.html index 2cc3ba4d5..53632eb72 100644 --- a/libnds/globals_i.html +++ b/libnds/globals_i.html @@ -159,7 +159,7 @@

                                                                                                                                                                                                                                            - i -

                                                                                                                                                                                                                                              diff --git a/libnds/globals_k.html b/libnds/globals_k.html index 86144c3f7..209364a82 100644 --- a/libnds/globals_k.html +++ b/libnds/globals_k.html @@ -129,7 +129,7 @@

                                                                                                                                                                                                                                              - k -

                                                                                                                                                                                                                                                diff --git a/libnds/globals_l.html b/libnds/globals_l.html index 859c94661..0575a36db 100644 --- a/libnds/globals_l.html +++ b/libnds/globals_l.html @@ -98,7 +98,7 @@

                                                                                                                                                                                                                                                - l -

                                                                                                                                                                                                                                                  diff --git a/libnds/globals_m.html b/libnds/globals_m.html index db6cc2f0d..ce7b8fd86 100644 --- a/libnds/globals_m.html +++ b/libnds/globals_m.html @@ -160,7 +160,7 @@

                                                                                                                                                                                                                                                  - m -

                                                                                                                                                                                                                                                    diff --git a/libnds/globals_n.html b/libnds/globals_n.html index 7642de8aa..26657d18f 100644 --- a/libnds/globals_n.html +++ b/libnds/globals_n.html @@ -131,7 +131,7 @@

                                                                                                                                                                                                                                                    - n -

                                                                                                                                                                                                                                                      diff --git a/libnds/globals_o.html b/libnds/globals_o.html index 6b601b206..eac5af4e9 100644 --- a/libnds/globals_o.html +++ b/libnds/globals_o.html @@ -145,7 +145,7 @@

                                                                                                                                                                                                                                                      - o -

                                                                                                                                                                                                                                                        diff --git a/libnds/globals_p.html b/libnds/globals_p.html index f86c5da56..720d00d41 100644 --- a/libnds/globals_p.html +++ b/libnds/globals_p.html @@ -182,7 +182,7 @@

                                                                                                                                                                                                                                                        - p -

                                                                                                                                                                                                                                                          diff --git a/libnds/globals_r.html b/libnds/globals_r.html index 80f9ca5d9..5ed6f4f0a 100644 --- a/libnds/globals_r.html +++ b/libnds/globals_r.html @@ -178,7 +178,7 @@

                                                                                                                                                                                                                                                          - r -

                                                                                                                                                                                                                                                            diff --git a/libnds/globals_s.html b/libnds/globals_s.html index 350c09f81..56951baff 100644 --- a/libnds/globals_s.html +++ b/libnds/globals_s.html @@ -245,7 +245,7 @@

                                                                                                                                                                                                                                                            - s -

                                                                                                                                                                                                                                                              diff --git a/libnds/globals_t.html b/libnds/globals_t.html index c2c6893fb..253188955 100644 --- a/libnds/globals_t.html +++ b/libnds/globals_t.html @@ -179,7 +179,7 @@

                                                                                                                                                                                                                                                              - t -

                                                                                                                                                                                                                                                                diff --git a/libnds/globals_type.html b/libnds/globals_type.html index b48c552a5..8a7c45211 100644 --- a/libnds/globals_type.html +++ b/libnds/globals_type.html @@ -227,7 +227,7 @@

                                                                                                                                                                                                                                                                - v -

                                                                                                                                                                                                                                                                  diff --git a/libnds/globals_u.html b/libnds/globals_u.html index 0a4f019d9..352b8522d 100644 --- a/libnds/globals_u.html +++ b/libnds/globals_u.html @@ -92,7 +92,7 @@

                                                                                                                                                                                                                                                                  - u -

                                                                                                                                                                                                                                                                    diff --git a/libnds/globals_v.html b/libnds/globals_v.html index a9f4df876..840304f57 100644 --- a/libnds/globals_v.html +++ b/libnds/globals_v.html @@ -274,7 +274,7 @@

                                                                                                                                                                                                                                                                    - v -

                                                                                                                                                                                                                                                                      diff --git a/libnds/globals_vars.html b/libnds/globals_vars.html index 44cc88fd4..2f99fea2c 100644 --- a/libnds/globals_vars.html +++ b/libnds/globals_vars.html @@ -90,7 +90,7 @@ diff --git a/libnds/globals_w.html b/libnds/globals_w.html index dcba65ef3..573d0e083 100644 --- a/libnds/globals_w.html +++ b/libnds/globals_w.html @@ -100,7 +100,7 @@

                                                                                                                                                                                                                                                                      - w -

                                                                                                                                                                                                                                                                        diff --git a/libnds/gpio_8h.html b/libnds/gpio_8h.html index 1db51a2f9..f2951dcea 100644 --- a/libnds/gpio_8h.html +++ b/libnds/gpio_8h.html @@ -149,7 +149,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/grf_8h.html b/libnds/grf_8h.html index c1f75c9df..9da2e5b7c 100644 --- a/libnds/grf_8h.html +++ b/libnds/grf_8h.html @@ -797,7 +797,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/group__background__api__group.html b/libnds/group__background__api__group.html index a65801375..94d0cf266 100644 --- a/libnds/group__background__api__group.html +++ b/libnds/group__background__api__group.html @@ -1913,7 +1913,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/group__background__register__group.html b/libnds/group__background__register__group.html index 4b1b9982e..9ee2bc13c 100644 --- a/libnds/group__background__register__group.html +++ b/libnds/group__background__register__group.html @@ -341,7 +341,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/group__main__display__registers.html b/libnds/group__main__display__registers.html index 388b0e8cc..f507ee30f 100644 --- a/libnds/group__main__display__registers.html +++ b/libnds/group__main__display__registers.html @@ -378,7 +378,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/group__sub__display__registers.html b/libnds/group__sub__display__registers.html index 0d201e718..469fbaba6 100644 --- a/libnds/group__sub__display__registers.html +++ b/libnds/group__sub__display__registers.html @@ -378,7 +378,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/guitarGrip_8h.html b/libnds/guitarGrip_8h.html index 95052bb3f..48e3c6cab 100644 --- a/libnds/guitarGrip_8h.html +++ b/libnds/guitarGrip_8h.html @@ -224,7 +224,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/image_8h.html b/libnds/image_8h.html index 5df8a6f78..de45cbc74 100644 --- a/libnds/image_8h.html +++ b/libnds/image_8h.html @@ -288,7 +288,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/index.html b/libnds/index.html index da0d2ddbb..28b49a418 100644 --- a/libnds/index.html +++ b/libnds/index.html @@ -213,7 +213,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/input_8h.html b/libnds/input_8h.html index a66680094..444da3f62 100644 --- a/libnds/input_8h.html +++ b/libnds/input_8h.html @@ -243,7 +243,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/interrupts_8h.html b/libnds/interrupts_8h.html index db13dc553..6a5ddfb89 100644 --- a/libnds/interrupts_8h.html +++ b/libnds/interrupts_8h.html @@ -674,7 +674,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/keyboard_8h.html b/libnds/keyboard_8h.html index 62c12a02f..bd3e97abb 100644 --- a/libnds/keyboard_8h.html +++ b/libnds/keyboard_8h.html @@ -588,7 +588,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/linkedlist_8h.html b/libnds/linkedlist_8h.html index ae177e20e..0de43a620 100644 --- a/libnds/linkedlist_8h.html +++ b/libnds/linkedlist_8h.html @@ -189,7 +189,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/math_8h.html b/libnds/math_8h.html index 59c4174eb..cfc7787fb 100644 --- a/libnds/math_8h.html +++ b/libnds/math_8h.html @@ -1318,7 +1318,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/memory_8h.html b/libnds/memory_8h.html index 862e167df..e4dbb134c 100644 --- a/libnds/memory_8h.html +++ b/libnds/memory_8h.html @@ -339,7 +339,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/ndma_8h.html b/libnds/ndma_8h.html index ac1fb088f..9cbc0ee60 100644 --- a/libnds/ndma_8h.html +++ b/libnds/ndma_8h.html @@ -141,7 +141,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/nds_8h.html b/libnds/nds_8h.html index 77106fb7d..80afa6b8c 100644 --- a/libnds/nds_8h.html +++ b/libnds/nds_8h.html @@ -164,7 +164,7 @@ diff --git a/libnds/ndsmotion_8h.html b/libnds/ndsmotion_8h.html index 07ab117c8..770e49c2b 100644 --- a/libnds/ndsmotion_8h.html +++ b/libnds/ndsmotion_8h.html @@ -692,7 +692,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/ndstypes_8h.html b/libnds/ndstypes_8h.html index 34e7c7b86..779919380 100644 --- a/libnds/ndstypes_8h.html +++ b/libnds/ndstypes_8h.html @@ -277,7 +277,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/nwram_8h.html b/libnds/nwram_8h.html index a3639c0d5..008307a00 100644 --- a/libnds/nwram_8h.html +++ b/libnds/nwram_8h.html @@ -570,7 +570,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/paddle_8h.html b/libnds/paddle_8h.html index 76f5e67a4..048130b25 100644 --- a/libnds/paddle_8h.html +++ b/libnds/paddle_8h.html @@ -177,7 +177,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/pages.html b/libnds/pages.html index a89eb2e9d..a5c34621c 100644 --- a/libnds/pages.html +++ b/libnds/pages.html @@ -91,7 +91,7 @@ diff --git a/libnds/pcx_8h.html b/libnds/pcx_8h.html index 45a3232f4..9226f3dda 100644 --- a/libnds/pcx_8h.html +++ b/libnds/pcx_8h.html @@ -143,7 +143,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/piano_8h.html b/libnds/piano_8h.html index 18301abe2..2d0098c02 100644 --- a/libnds/piano_8h.html +++ b/libnds/piano_8h.html @@ -224,7 +224,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/postest_8h.html b/libnds/postest_8h.html index b34f1c775..ccb13c2f6 100644 --- a/libnds/postest_8h.html +++ b/libnds/postest_8h.html @@ -375,7 +375,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/rsa_8h.html b/libnds/rsa_8h.html index 9cb7b9cb0..d95008399 100644 --- a/libnds/rsa_8h.html +++ b/libnds/rsa_8h.html @@ -332,7 +332,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/rumble_8h.html b/libnds/rumble_8h.html index 0f7efdffe..42c139163 100644 --- a/libnds/rumble_8h.html +++ b/libnds/rumble_8h.html @@ -279,7 +279,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/sassert_8h.html b/libnds/sassert_8h.html index f81412d95..c462a8bf1 100644 --- a/libnds/sassert_8h.html +++ b/libnds/sassert_8h.html @@ -106,7 +106,7 @@ diff --git a/libnds/serial_8h.html b/libnds/serial_8h.html index 61c97822f..553e24db0 100644 --- a/libnds/serial_8h.html +++ b/libnds/serial_8h.html @@ -107,7 +107,7 @@ diff --git a/libnds/sha1_8h.html b/libnds/sha1_8h.html index 20f2f9f8e..c5c4861fc 100644 --- a/libnds/sha1_8h.html +++ b/libnds/sha1_8h.html @@ -323,7 +323,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/slot2_8h.html b/libnds/slot2_8h.html index 3044384df..84c3668d7 100644 --- a/libnds/slot2_8h.html +++ b/libnds/slot2_8h.html @@ -435,7 +435,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/slot2gyro_8h.html b/libnds/slot2gyro_8h.html index 70e756380..bb105951c 100644 --- a/libnds/slot2gyro_8h.html +++ b/libnds/slot2gyro_8h.html @@ -129,7 +129,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/slot2solar_8h.html b/libnds/slot2solar_8h.html index b7df216a2..1598d1e13 100644 --- a/libnds/slot2solar_8h.html +++ b/libnds/slot2solar_8h.html @@ -130,7 +130,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/slot2tilt_8h.html b/libnds/slot2tilt_8h.html index c62404249..85d8a12e4 100644 --- a/libnds/slot2tilt_8h.html +++ b/libnds/slot2tilt_8h.html @@ -159,7 +159,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/sound_8h.html b/libnds/sound_8h.html index 85186af25..10d8730fb 100644 --- a/libnds/sound_8h.html +++ b/libnds/sound_8h.html @@ -846,7 +846,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/sprite_8h.html b/libnds/sprite_8h.html index 304616bf0..9548810bd 100644 --- a/libnds/sprite_8h.html +++ b/libnds/sprite_8h.html @@ -1992,7 +1992,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/structBgState.html b/libnds/structBgState.html index 2a7cb7ef2..6f00821fc 100644 --- a/libnds/structBgState.html +++ b/libnds/structBgState.html @@ -96,7 +96,7 @@ diff --git a/libnds/structConsoleFont.html b/libnds/structConsoleFont.html index 570c422ec..ad9ed9d07 100644 --- a/libnds/structConsoleFont.html +++ b/libnds/structConsoleFont.html @@ -127,7 +127,7 @@ diff --git a/libnds/structDLDI__INTERFACE.html b/libnds/structDLDI__INTERFACE.html index 1a78a08c7..ad78805c1 100644 --- a/libnds/structDLDI__INTERFACE.html +++ b/libnds/structDLDI__INTERFACE.html @@ -221,7 +221,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/structDecompressionStream.html b/libnds/structDecompressionStream.html index f938ead06..f1cd7e44b 100644 --- a/libnds/structDecompressionStream.html +++ b/libnds/structDecompressionStream.html @@ -122,7 +122,7 @@ diff --git a/libnds/structDynamicArray.html b/libnds/structDynamicArray.html index efc9503de..5195c9bf6 100644 --- a/libnds/structDynamicArray.html +++ b/libnds/structDynamicArray.html @@ -110,7 +110,7 @@ diff --git a/libnds/structGLvector.html b/libnds/structGLvector.html index e5e5afd4c..e06cf5e16 100644 --- a/libnds/structGLvector.html +++ b/libnds/structGLvector.html @@ -97,7 +97,7 @@ diff --git a/libnds/structGRFHeader.html b/libnds/structGRFHeader.html index ecac746b4..3a03b716e 100644 --- a/libnds/structGRFHeader.html +++ b/libnds/structGRFHeader.html @@ -130,7 +130,7 @@ diff --git a/libnds/structKeyMap.html b/libnds/structKeyMap.html index b2cef0d61..dfab759d8 100644 --- a/libnds/structKeyMap.html +++ b/libnds/structKeyMap.html @@ -122,7 +122,7 @@ diff --git a/libnds/structKeyboard.html b/libnds/structKeyboard.html index a35448c0c..af4f1290b 100644 --- a/libnds/structKeyboard.html +++ b/libnds/structKeyboard.html @@ -182,7 +182,7 @@ diff --git a/libnds/structLinkedList.html b/libnds/structLinkedList.html index 3cb16c155..bb88265fc 100644 --- a/libnds/structLinkedList.html +++ b/libnds/structLinkedList.html @@ -114,7 +114,7 @@ diff --git a/libnds/structOamState.html b/libnds/structOamState.html index 2d2a65b4b..a39f7cc3e 100644 --- a/libnds/structOamState.html +++ b/libnds/structOamState.html @@ -123,7 +123,7 @@ diff --git a/libnds/structPrintConsole.html b/libnds/structPrintConsole.html index 4c7ee0507..d1902e60d 100644 --- a/libnds/structPrintConsole.html +++ b/libnds/structPrintConsole.html @@ -229,7 +229,7 @@ diff --git a/libnds/structRGB__24.html b/libnds/structRGB__24.html index 63afea069..b61b1dc77 100644 --- a/libnds/structRGB__24.html +++ b/libnds/structRGB__24.html @@ -114,7 +114,7 @@ diff --git a/libnds/structRTCtime.html b/libnds/structRTCtime.html index d8a86c225..46fc62f80 100644 --- a/libnds/structRTCtime.html +++ b/libnds/structRTCtime.html @@ -131,7 +131,7 @@ diff --git a/libnds/structSpriteRotation.html b/libnds/structSpriteRotation.html index 949ab8e68..4e247dcb3 100644 --- a/libnds/structSpriteRotation.html +++ b/libnds/structSpriteRotation.html @@ -118,7 +118,7 @@ diff --git a/libnds/structTileMapEntry16.html b/libnds/structTileMapEntry16.html index 69081f225..e277fec7e 100644 --- a/libnds/structTileMapEntry16.html +++ b/libnds/structTileMapEntry16.html @@ -96,7 +96,7 @@ diff --git a/libnds/structTileMapEntry8.html b/libnds/structTileMapEntry8.html index 77c4ff3ba..84596ecad 100644 --- a/libnds/structTileMapEntry8.html +++ b/libnds/structTileMapEntry8.html @@ -96,7 +96,7 @@ diff --git a/libnds/structUnpackStruct.html b/libnds/structUnpackStruct.html index 8d95e189f..db67247a9 100644 --- a/libnds/structUnpackStruct.html +++ b/libnds/structUnpackStruct.html @@ -118,7 +118,7 @@ diff --git a/libnds/struct____ndsabi__coro__t.html b/libnds/struct____ndsabi__coro__t.html index 766dbc1ad..83640a607 100644 --- a/libnds/struct____ndsabi__coro__t.html +++ b/libnds/struct____ndsabi__coro__t.html @@ -110,7 +110,7 @@ diff --git a/libnds/structbg__attribute.html b/libnds/structbg__attribute.html index 2f6b452df..caaf73901 100644 --- a/libnds/structbg__attribute.html +++ b/libnds/structbg__attribute.html @@ -118,7 +118,7 @@ diff --git a/libnds/structbg__scroll.html b/libnds/structbg__scroll.html index 5a2462143..3af555e1d 100644 --- a/libnds/structbg__scroll.html +++ b/libnds/structbg__scroll.html @@ -110,7 +110,7 @@ diff --git a/libnds/structbg__transform.html b/libnds/structbg__transform.html index daedfaec4..5f9d2888b 100644 --- a/libnds/structbg__transform.html +++ b/libnds/structbg__transform.html @@ -126,7 +126,7 @@ diff --git a/libnds/structglImage.html b/libnds/structglImage.html index 712e78d81..808404cd9 100644 --- a/libnds/structglImage.html +++ b/libnds/structglImage.html @@ -160,7 +160,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/structm3x3.html b/libnds/structm3x3.html index e6ff11695..f6cd5a62a 100644 --- a/libnds/structm3x3.html +++ b/libnds/structm3x3.html @@ -106,7 +106,7 @@ diff --git a/libnds/structm4x3.html b/libnds/structm4x3.html index a340bd13d..0d02deee5 100644 --- a/libnds/structm4x3.html +++ b/libnds/structm4x3.html @@ -106,7 +106,7 @@ diff --git a/libnds/structm4x4.html b/libnds/structm4x4.html index 75bbf7dbc..3a1ca4231 100644 --- a/libnds/structm4x4.html +++ b/libnds/structm4x4.html @@ -106,7 +106,7 @@ diff --git a/libnds/structrtcTime.html b/libnds/structrtcTime.html index 1b7f819de..9b328064f 100644 --- a/libnds/structrtcTime.html +++ b/libnds/structrtcTime.html @@ -114,7 +114,7 @@ diff --git a/libnds/structrtcTimeAndDate.html b/libnds/structrtcTimeAndDate.html index c3a02e4c7..acb39854a 100644 --- a/libnds/structrtcTimeAndDate.html +++ b/libnds/structrtcTimeAndDate.html @@ -130,7 +130,7 @@ diff --git a/libnds/structsGBAHeader.html b/libnds/structsGBAHeader.html index fbc4e3b79..704b35dd9 100644 --- a/libnds/structsGBAHeader.html +++ b/libnds/structsGBAHeader.html @@ -147,7 +147,7 @@ diff --git a/libnds/structsImage.html b/libnds/structsImage.html index 0892d61bc..ac7c34bc4 100644 --- a/libnds/structsImage.html +++ b/libnds/structsImage.html @@ -136,7 +136,7 @@ diff --git a/libnds/structsNDSBanner.html b/libnds/structsNDSBanner.html index 839ce39ae..9508f3923 100644 --- a/libnds/structsNDSBanner.html +++ b/libnds/structsNDSBanner.html @@ -123,7 +123,7 @@ diff --git a/libnds/structsNDSHeader.html b/libnds/structsNDSHeader.html index 155ddfd67..eb597db48 100644 --- a/libnds/structsNDSHeader.html +++ b/libnds/structsNDSHeader.html @@ -255,7 +255,7 @@ diff --git a/libnds/structswiRSAHeapContext.html b/libnds/structswiRSAHeapContext.html index 9d6e6f2ee..69c5e8752 100644 --- a/libnds/structswiRSAHeapContext.html +++ b/libnds/structswiRSAHeapContext.html @@ -114,7 +114,7 @@ diff --git a/libnds/structswiRSAbuffers.html b/libnds/structswiRSAbuffers.html index c5879b677..da64415dd 100644 --- a/libnds/structswiRSAbuffers.html +++ b/libnds/structswiRSAbuffers.html @@ -114,7 +114,7 @@ diff --git a/libnds/structswiSHA1context.html b/libnds/structswiSHA1context.html index 4630bdc29..aa5f886fa 100644 --- a/libnds/structswiSHA1context.html +++ b/libnds/structswiSHA1context.html @@ -122,7 +122,7 @@ diff --git a/libnds/structsysVectors.html b/libnds/structsysVectors.html index a675cba30..2f0b29efc 100644 --- a/libnds/structsysVectors.html +++ b/libnds/structsysVectors.html @@ -136,7 +136,7 @@ diff --git a/libnds/structtPERSONAL__DATA.html b/libnds/structtPERSONAL__DATA.html index 816a7933c..2ec86f08e 100644 --- a/libnds/structtPERSONAL__DATA.html +++ b/libnds/structtPERSONAL__DATA.html @@ -228,7 +228,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/structtlf__header.html b/libnds/structtlf__header.html index 705f711d6..803bbb0f6 100644 --- a/libnds/structtlf__header.html +++ b/libnds/structtlf__header.html @@ -122,7 +122,7 @@ diff --git a/libnds/structtlf__section__header.html b/libnds/structtlf__section__header.html index 0e8f98dc3..8bf3de75c 100644 --- a/libnds/structtlf__section__header.html +++ b/libnds/structtlf__section__header.html @@ -122,7 +122,7 @@ diff --git a/libnds/structtouchPosition.html b/libnds/structtouchPosition.html index 7a249cd35..c836d0ac3 100644 --- a/libnds/structtouchPosition.html +++ b/libnds/structtouchPosition.html @@ -126,7 +126,7 @@ diff --git a/libnds/system_8h.html b/libnds/system_8h.html index d2340e8dd..176f1f3c1 100644 --- a/libnds/system_8h.html +++ b/libnds/system_8h.html @@ -1174,7 +1174,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/timers_8h.html b/libnds/timers_8h.html index c4fd419db..ad5ef9761 100644 --- a/libnds/timers_8h.html +++ b/libnds/timers_8h.html @@ -746,7 +746,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/tlf_8h.html b/libnds/tlf_8h.html index bf5a9cdd4..28890e627 100644 --- a/libnds/tlf_8h.html +++ b/libnds/tlf_8h.html @@ -164,7 +164,7 @@ diff --git a/libnds/tmio_8h.html b/libnds/tmio_8h.html index adf4920bc..9f361e195 100644 --- a/libnds/tmio_8h.html +++ b/libnds/tmio_8h.html @@ -476,7 +476,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/topics.html b/libnds/topics.html index 1d50e1baf..6d413e59b 100644 --- a/libnds/topics.html +++ b/libnds/topics.html @@ -94,7 +94,7 @@ diff --git a/libnds/touch_8h.html b/libnds/touch_8h.html index 2ee8f0122..95b748d7c 100644 --- a/libnds/touch_8h.html +++ b/libnds/touch_8h.html @@ -113,7 +113,7 @@ diff --git a/libnds/trig__lut_8h.html b/libnds/trig__lut_8h.html index 6cba6fb7e..4ef7b411d 100644 --- a/libnds/trig__lut_8h.html +++ b/libnds/trig__lut_8h.html @@ -483,7 +483,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/tsc_8h.html b/libnds/tsc_8h.html index dff899947..7520dc80b 100644 --- a/libnds/tsc_8h.html +++ b/libnds/tsc_8h.html @@ -242,7 +242,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/unionOAMTable.html b/libnds/unionOAMTable.html index ad7ae0fa2..6851aeda8 100644 --- a/libnds/unionOAMTable.html +++ b/libnds/unionOAMTable.html @@ -96,7 +96,7 @@ diff --git a/libnds/unionSpriteEntry.html b/libnds/unionSpriteEntry.html index b97b40c10..d325be1dd 100644 --- a/libnds/unionSpriteEntry.html +++ b/libnds/unionSpriteEntry.html @@ -96,7 +96,7 @@ diff --git a/libnds/videoGL_8h.html b/libnds/videoGL_8h.html index c64c6c032..52464e103 100644 --- a/libnds/videoGL_8h.html +++ b/libnds/videoGL_8h.html @@ -5146,7 +5146,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/video_8h.html b/libnds/video_8h.html index 5ae9b27c9..4f458f58b 100644 --- a/libnds/video_8h.html +++ b/libnds/video_8h.html @@ -2015,7 +2015,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libnds/window_8h.html b/libnds/window_8h.html index c2b896eef..5668e626b 100644 --- a/libnds/window_8h.html +++ b/libnds/window_8h.html @@ -582,7 +582,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libteak/ahbm_8h.html b/libteak/ahbm_8h.html index c8c024c84..60223b142 100644 --- a/libteak/ahbm_8h.html +++ b/libteak/ahbm_8h.html @@ -264,7 +264,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libteak/apbp_8h.html b/libteak/apbp_8h.html index 62bfa7dc5..918be4817 100644 --- a/libteak/apbp_8h.html +++ b/libteak/apbp_8h.html @@ -411,7 +411,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libteak/btdmp_8h.html b/libteak/btdmp_8h.html index 918606590..9eedeac7b 100644 --- a/libteak/btdmp_8h.html +++ b/libteak/btdmp_8h.html @@ -320,7 +320,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libteak/dir_5030c3ca5838c7123811aad4ea6c6594.html b/libteak/dir_5030c3ca5838c7123811aad4ea6c6594.html index a81c38c2f..f8c3bcdce 100644 --- a/libteak/dir_5030c3ca5838c7123811aad4ea6c6594.html +++ b/libteak/dir_5030c3ca5838c7123811aad4ea6c6594.html @@ -118,7 +118,7 @@ diff --git a/libteak/dir_d44c64559bbebec7f509842c48db8b23.html b/libteak/dir_d44c64559bbebec7f509842c48db8b23.html index 094b8e3ec..552079c13 100644 --- a/libteak/dir_d44c64559bbebec7f509842c48db8b23.html +++ b/libteak/dir_d44c64559bbebec7f509842c48db8b23.html @@ -96,7 +96,7 @@ diff --git a/libteak/dma_8h.html b/libteak/dma_8h.html index eb73b12e1..5cee8d376 100644 --- a/libteak/dma_8h.html +++ b/libteak/dma_8h.html @@ -508,7 +508,7 @@

                                                                                                                                                                                                                                                                        diff --git a/libteak/files.html b/libteak/files.html index 1a1d6c6ad..486754198 100644 --- a/libteak/files.html +++ b/libteak/files.html @@ -100,7 +100,7 @@ diff --git a/libteak/global_8h.html b/libteak/global_8h.html index e769adf7a..a1523a001 100644 --- a/libteak/global_8h.html +++ b/libteak/global_8h.html @@ -105,7 +105,7 @@ diff --git a/libteak/globals.html b/libteak/globals.html index f9b9c5726..3a8581963 100644 --- a/libteak/globals.html +++ b/libteak/globals.html @@ -190,7 +190,7 @@

                                                                                                                                                                                                                                                                        - t -

                                                                                                                                                                                                                                                                          diff --git a/libteak/globals_defs.html b/libteak/globals_defs.html index 0068ac28d..486667cce 100644 --- a/libteak/globals_defs.html +++ b/libteak/globals_defs.html @@ -148,7 +148,7 @@

                                                                                                                                                                                                                                                                          - t -

                                                                                                                                                                                                                                                                            diff --git a/libteak/globals_func.html b/libteak/globals_func.html index e3d33e879..a2ab75bd8 100644 --- a/libteak/globals_func.html +++ b/libteak/globals_func.html @@ -115,7 +115,7 @@ diff --git a/libteak/icu_8h.html b/libteak/icu_8h.html index cc9c2ad7b..757dfedd6 100644 --- a/libteak/icu_8h.html +++ b/libteak/icu_8h.html @@ -230,7 +230,7 @@

                                                                                                                                                                                                                                                                            diff --git a/libteak/index.html b/libteak/index.html index 009163266..15e659840 100644 --- a/libteak/index.html +++ b/libteak/index.html @@ -101,7 +101,7 @@

                                                                                                                                                                                                                                                                            diff --git a/libteak/teak_8h.html b/libteak/teak_8h.html index d14daccd1..5e7c030c8 100644 --- a/libteak/teak_8h.html +++ b/libteak/teak_8h.html @@ -104,7 +104,7 @@ diff --git a/libteak/timer_8h.html b/libteak/timer_8h.html index 81b0a89d5..cf1680989 100644 --- a/libteak/timer_8h.html +++ b/libteak/timer_8h.html @@ -225,7 +225,7 @@

                                                                                                                                                                                                                                                                            diff --git a/libxm7/dir_138aff360eb965c43b94267b8d1ce09e.html b/libxm7/dir_138aff360eb965c43b94267b8d1ce09e.html index 2357fbf10..e6a856631 100644 --- a/libxm7/dir_138aff360eb965c43b94267b8d1ce09e.html +++ b/libxm7/dir_138aff360eb965c43b94267b8d1ce09e.html @@ -90,7 +90,7 @@ diff --git a/libxm7/dir_d44c64559bbebec7f509842c48db8b23.html b/libxm7/dir_d44c64559bbebec7f509842c48db8b23.html index 4a769657e..68f3d4cce 100644 --- a/libxm7/dir_d44c64559bbebec7f509842c48db8b23.html +++ b/libxm7/dir_d44c64559bbebec7f509842c48db8b23.html @@ -97,7 +97,7 @@ diff --git a/libxm7/files.html b/libxm7/files.html index 0e2e1d244..adf8bd2d6 100644 --- a/libxm7/files.html +++ b/libxm7/files.html @@ -92,7 +92,7 @@ diff --git a/libxm7/globals.html b/libxm7/globals.html index 7f9e2baf3..46a2f4d26 100644 --- a/libxm7/globals.html +++ b/libxm7/globals.html @@ -114,7 +114,7 @@ diff --git a/libxm7/globals_enum.html b/libxm7/globals_enum.html index 13cb1cbd3..a0833d4bf 100644 --- a/libxm7/globals_enum.html +++ b/libxm7/globals_enum.html @@ -89,7 +89,7 @@ diff --git a/libxm7/globals_eval.html b/libxm7/globals_eval.html index 50ee96e22..02b3cee16 100644 --- a/libxm7/globals_eval.html +++ b/libxm7/globals_eval.html @@ -100,7 +100,7 @@ diff --git a/libxm7/globals_func.html b/libxm7/globals_func.html index 77cc8632b..a79fb3cd0 100644 --- a/libxm7/globals_func.html +++ b/libxm7/globals_func.html @@ -95,7 +95,7 @@ diff --git a/libxm7/group__libxm7__arm7.html b/libxm7/group__libxm7__arm7.html index 5fae989d6..ad957ca75 100644 --- a/libxm7/group__libxm7__arm7.html +++ b/libxm7/group__libxm7__arm7.html @@ -213,7 +213,7 @@

                                                                                                                                                                                                                                                                            diff --git a/libxm7/group__libxm7__arm9.html b/libxm7/group__libxm7__arm9.html index 6332b4a6b..13cad43c4 100644 --- a/libxm7/group__libxm7__arm9.html +++ b/libxm7/group__libxm7__arm9.html @@ -333,7 +333,7 @@

                                                                                                                                                                                                                                                                            diff --git a/libxm7/group__libxm7__types.html b/libxm7/group__libxm7__types.html index 9b4e3845e..f4d9a62de 100644 --- a/libxm7/group__libxm7__types.html +++ b/libxm7/group__libxm7__types.html @@ -239,7 +239,7 @@

                                                                                                                                                                                                                                                                            diff --git a/libxm7/index.html b/libxm7/index.html index 72287559b..ff2c386cb 100644 --- a/libxm7/index.html +++ b/libxm7/index.html @@ -215,7 +215,7 @@

                                                                                                                                                                                                                                                                            diff --git a/libxm7/libxm7_8h.html b/libxm7/libxm7_8h.html index 45f0aa5b2..6d5e5484c 100644 --- a/libxm7/libxm7_8h.html +++ b/libxm7/libxm7_8h.html @@ -178,7 +178,7 @@ diff --git a/libxm7/topics.html b/libxm7/topics.html index 56dee7e5e..33342dfeb 100644 --- a/libxm7/topics.html +++ b/libxm7/topics.html @@ -93,7 +93,7 @@ diff --git a/maxmod/annotated.html b/maxmod/annotated.html index 3d5aa2da8..5e6ecdfad 100644 --- a/maxmod/annotated.html +++ b/maxmod/annotated.html @@ -96,7 +96,7 @@ diff --git a/maxmod/classes.html b/maxmod/classes.html index 6afb83423..673ed6fdc 100644 --- a/maxmod/classes.html +++ b/maxmod/classes.html @@ -95,7 +95,7 @@ diff --git a/maxmod/dir_138aff360eb965c43b94267b8d1ce09e.html b/maxmod/dir_138aff360eb965c43b94267b8d1ce09e.html index 23c5f33fa..8753a42f5 100644 --- a/maxmod/dir_138aff360eb965c43b94267b8d1ce09e.html +++ b/maxmod/dir_138aff360eb965c43b94267b8d1ce09e.html @@ -90,7 +90,7 @@ diff --git a/maxmod/dir_d44c64559bbebec7f509842c48db8b23.html b/maxmod/dir_d44c64559bbebec7f509842c48db8b23.html index 1581b2003..c79016390 100644 --- a/maxmod/dir_d44c64559bbebec7f509842c48db8b23.html +++ b/maxmod/dir_d44c64559bbebec7f509842c48db8b23.html @@ -106,7 +106,7 @@ diff --git a/maxmod/files.html b/maxmod/files.html index 509ab9b44..2fb53157c 100644 --- a/maxmod/files.html +++ b/maxmod/files.html @@ -95,7 +95,7 @@ diff --git a/maxmod/functions.html b/maxmod/functions.html index 9acb85f6d..967b9aa0c 100644 --- a/maxmod/functions.html +++ b/maxmod/functions.html @@ -178,7 +178,7 @@

                                                                                                                                                                                                                                                                            - w -

                                                                                                                                                                                                                                                                              diff --git a/maxmod/functions_vars.html b/maxmod/functions_vars.html index 45819d5aa..62634de29 100644 --- a/maxmod/functions_vars.html +++ b/maxmod/functions_vars.html @@ -178,7 +178,7 @@

                                                                                                                                                                                                                                                                              - w -

                                                                                                                                                                                                                                                                                diff --git a/maxmod/globals.html b/maxmod/globals.html index 053a94e60..32912a08b 100644 --- a/maxmod/globals.html +++ b/maxmod/globals.html @@ -211,7 +211,7 @@

                                                                                                                                                                                                                                                                                - m -

                                                                                                                                                                                                                                                                                  diff --git a/maxmod/globals_defs.html b/maxmod/globals_defs.html index 0fe62cd1d..5d6e67675 100644 --- a/maxmod/globals_defs.html +++ b/maxmod/globals_defs.html @@ -90,7 +90,7 @@ diff --git a/maxmod/globals_enum.html b/maxmod/globals_enum.html index 82f8a9ae4..42301fbc4 100644 --- a/maxmod/globals_enum.html +++ b/maxmod/globals_enum.html @@ -93,7 +93,7 @@ diff --git a/maxmod/globals_eval.html b/maxmod/globals_eval.html index 9c6d3aa5a..e9ebccb57 100644 --- a/maxmod/globals_eval.html +++ b/maxmod/globals_eval.html @@ -125,7 +125,7 @@

                                                                                                                                                                                                                                                                                  - m -

                                                                                                                                                                                                                                                                                    diff --git a/maxmod/globals_func.html b/maxmod/globals_func.html index a3be6cc0d..1ba6604e8 100644 --- a/maxmod/globals_func.html +++ b/maxmod/globals_func.html @@ -145,7 +145,7 @@

                                                                                                                                                                                                                                                                                    - m -

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/globals_type.html b/maxmod/globals_type.html index 48a4aa978..a287ed310 100644 --- a/maxmod/globals_type.html +++ b/maxmod/globals_type.html @@ -100,7 +100,7 @@ diff --git a/maxmod/group__gba__init.html b/maxmod/group__gba__init.html index d51d4f204..4dd6d8f14 100644 --- a/maxmod/group__gba__init.html +++ b/maxmod/group__gba__init.html @@ -393,7 +393,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/group__gba__misc.html b/maxmod/group__gba__misc.html index 72c114d7b..aba1dd579 100644 --- a/maxmod/group__gba__misc.html +++ b/maxmod/group__gba__misc.html @@ -87,7 +87,7 @@ diff --git a/maxmod/group__gba__module__playback.html b/maxmod/group__gba__module__playback.html index 03cd800d6..70b665e51 100644 --- a/maxmod/group__gba__module__playback.html +++ b/maxmod/group__gba__module__playback.html @@ -594,7 +594,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/group__gba__playback__events.html b/maxmod/group__gba__playback__events.html index 95108b44f..edf00ff12 100644 --- a/maxmod/group__gba__playback__events.html +++ b/maxmod/group__gba__playback__events.html @@ -101,7 +101,7 @@ diff --git a/maxmod/group__gba__sound__effects.html b/maxmod/group__gba__sound__effects.html index 027d61adc..bc05a1fe9 100644 --- a/maxmod/group__gba__sound__effects.html +++ b/maxmod/group__gba__sound__effects.html @@ -441,7 +441,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/group__maxmod__types.html b/maxmod/group__maxmod__types.html index d49be29aa..6e1647bf2 100644 --- a/maxmod/group__maxmod__types.html +++ b/maxmod/group__maxmod__types.html @@ -632,7 +632,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/group__nds__arm7__init.html b/maxmod/group__nds__arm7__init.html index 8d917fa91..cb8109680 100644 --- a/maxmod/group__nds__arm7__init.html +++ b/maxmod/group__nds__arm7__init.html @@ -265,7 +265,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/group__nds__arm7__misc.html b/maxmod/group__nds__arm7__misc.html index df898e25c..6a345d3f2 100644 --- a/maxmod/group__nds__arm7__misc.html +++ b/maxmod/group__nds__arm7__misc.html @@ -87,7 +87,7 @@ diff --git a/maxmod/group__nds__arm7__module__playback.html b/maxmod/group__nds__arm7__module__playback.html index 1b5902557..08539e50a 100644 --- a/maxmod/group__nds__arm7__module__playback.html +++ b/maxmod/group__nds__arm7__module__playback.html @@ -423,7 +423,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/group__nds__arm7__playback__events.html b/maxmod/group__nds__arm7__playback__events.html index b6b9688b0..4451e34b9 100644 --- a/maxmod/group__nds__arm7__playback__events.html +++ b/maxmod/group__nds__arm7__playback__events.html @@ -101,7 +101,7 @@ diff --git a/maxmod/group__nds__arm7__reverb.html b/maxmod/group__nds__arm7__reverb.html index e907d96f3..c3dca0327 100644 --- a/maxmod/group__nds__arm7__reverb.html +++ b/maxmod/group__nds__arm7__reverb.html @@ -289,7 +289,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/group__nds__arm7__sound__effects.html b/maxmod/group__nds__arm7__sound__effects.html index c57f9fa2a..6967f404a 100644 --- a/maxmod/group__nds__arm7__sound__effects.html +++ b/maxmod/group__nds__arm7__sound__effects.html @@ -413,7 +413,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/group__nds__arm7__streaming.html b/maxmod/group__nds__arm7__streaming.html index 8f8923c4f..bf67a7bd2 100644 --- a/maxmod/group__nds__arm7__streaming.html +++ b/maxmod/group__nds__arm7__streaming.html @@ -196,7 +196,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/group__nds__arm9__init.html b/maxmod/group__nds__arm9__init.html index 9b17a355c..d702f0957 100644 --- a/maxmod/group__nds__arm9__init.html +++ b/maxmod/group__nds__arm9__init.html @@ -551,7 +551,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/group__nds__arm9__module__playback.html b/maxmod/group__nds__arm9__module__playback.html index 903516214..309922438 100644 --- a/maxmod/group__nds__arm9__module__playback.html +++ b/maxmod/group__nds__arm9__module__playback.html @@ -415,7 +415,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/group__nds__arm9__playback__events.html b/maxmod/group__nds__arm9__playback__events.html index e91b2f3d2..502b52474 100644 --- a/maxmod/group__nds__arm9__playback__events.html +++ b/maxmod/group__nds__arm9__playback__events.html @@ -101,7 +101,7 @@ diff --git a/maxmod/group__nds__arm9__reverb.html b/maxmod/group__nds__arm9__reverb.html index 369d24ba5..a41ef311d 100644 --- a/maxmod/group__nds__arm9__reverb.html +++ b/maxmod/group__nds__arm9__reverb.html @@ -289,7 +289,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/group__nds__arm9__sound__effects.html b/maxmod/group__nds__arm9__sound__effects.html index 29e15ad0f..836924c98 100644 --- a/maxmod/group__nds__arm9__sound__effects.html +++ b/maxmod/group__nds__arm9__sound__effects.html @@ -452,7 +452,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/group__nds__arm9__streaming.html b/maxmod/group__nds__arm9__streaming.html index 36120be6a..786295cfb 100644 --- a/maxmod/group__nds__arm9__streaming.html +++ b/maxmod/group__nds__arm9__streaming.html @@ -178,7 +178,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/index.html b/maxmod/index.html index ae2e35db5..60fa4ea60 100644 --- a/maxmod/index.html +++ b/maxmod/index.html @@ -142,7 +142,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/maxmod7_8h.html b/maxmod/maxmod7_8h.html index b3eebad30..ff2c85f44 100644 --- a/maxmod/maxmod7_8h.html +++ b/maxmod/maxmod7_8h.html @@ -227,7 +227,7 @@ diff --git a/maxmod/maxmod9_8h.html b/maxmod/maxmod9_8h.html index 2bcf992e2..a1e9af01d 100644 --- a/maxmod/maxmod9_8h.html +++ b/maxmod/maxmod9_8h.html @@ -254,7 +254,7 @@ diff --git a/maxmod/maxmod_8h.html b/maxmod/maxmod_8h.html index 3efe6bd7d..c829b576b 100644 --- a/maxmod/maxmod_8h.html +++ b/maxmod/maxmod_8h.html @@ -237,7 +237,7 @@ diff --git a/maxmod/md_documentation_2audio__streaming.html b/maxmod/md_documentation_2audio__streaming.html index dfd54f502..b741e7c25 100644 --- a/maxmod/md_documentation_2audio__streaming.html +++ b/maxmod/md_documentation_2audio__streaming.html @@ -247,7 +247,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/md_documentation_2conversion__guide.html b/maxmod/md_documentation_2conversion__guide.html index 15f19d127..19484a767 100644 --- a/maxmod/md_documentation_2conversion__guide.html +++ b/maxmod/md_documentation_2conversion__guide.html @@ -151,7 +151,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/md_documentation_2cpu__usage.html b/maxmod/md_documentation_2cpu__usage.html index 3c10c59b7..63c9a7594 100644 --- a/maxmod/md_documentation_2cpu__usage.html +++ b/maxmod/md_documentation_2cpu__usage.html @@ -131,7 +131,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/md_documentation_2ds__programming__guide.html b/maxmod/md_documentation_2ds__programming__guide.html index 0717d8865..69c347705 100644 --- a/maxmod/md_documentation_2ds__programming__guide.html +++ b/maxmod/md_documentation_2ds__programming__guide.html @@ -195,7 +195,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/md_documentation_2gba__programming__guide.html b/maxmod/md_documentation_2gba__programming__guide.html index 4a6f335ce..5b2680114 100644 --- a/maxmod/md_documentation_2gba__programming__guide.html +++ b/maxmod/md_documentation_2gba__programming__guide.html @@ -231,7 +231,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/md_documentation_2hardware__usage.html b/maxmod/md_documentation_2hardware__usage.html index 4ba085d19..19444eace 100644 --- a/maxmod/md_documentation_2hardware__usage.html +++ b/maxmod/md_documentation_2hardware__usage.html @@ -113,7 +113,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/md_documentation_2memory__usage.html b/maxmod/md_documentation_2memory__usage.html index 1c3383b69..14779872e 100644 --- a/maxmod/md_documentation_2memory__usage.html +++ b/maxmod/md_documentation_2memory__usage.html @@ -117,7 +117,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/md_documentation_2using__reverb.html b/maxmod/md_documentation_2using__reverb.html index 886e6a39a..433d7086f 100644 --- a/maxmod/md_documentation_2using__reverb.html +++ b/maxmod/md_documentation_2using__reverb.html @@ -273,7 +273,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/md_documentation_2using__song__events.html b/maxmod/md_documentation_2using__song__events.html index e1ce36922..bbd103ad6 100644 --- a/maxmod/md_documentation_2using__song__events.html +++ b/maxmod/md_documentation_2using__song__events.html @@ -122,7 +122,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/mm__types_8h.html b/maxmod/mm__types_8h.html index 1daf445af..a7ff1bd5f 100644 --- a/maxmod/mm__types_8h.html +++ b/maxmod/mm__types_8h.html @@ -279,7 +279,7 @@ diff --git a/maxmod/pages.html b/maxmod/pages.html index 615c33cd3..4e6ec40a4 100644 --- a/maxmod/pages.html +++ b/maxmod/pages.html @@ -99,7 +99,7 @@ diff --git a/maxmod/structmmreverbcfg.html b/maxmod/structmmreverbcfg.html index 4ccc8ec2e..8908543fd 100644 --- a/maxmod/structmmreverbcfg.html +++ b/maxmod/structmmreverbcfg.html @@ -127,7 +127,7 @@ diff --git a/maxmod/structt__mmdssample.html b/maxmod/structt__mmdssample.html index b7a8ef27b..a4454041f 100644 --- a/maxmod/structt__mmdssample.html +++ b/maxmod/structt__mmdssample.html @@ -124,7 +124,7 @@ diff --git a/maxmod/structt__mmdssystem.html b/maxmod/structt__mmdssystem.html index d1b6e997a..61cf8132f 100644 --- a/maxmod/structt__mmdssystem.html +++ b/maxmod/structt__mmdssystem.html @@ -142,7 +142,7 @@

                                                                                                                                                                                                                                                                                      diff --git a/maxmod/structt__mmgbasystem.html b/maxmod/structt__mmgbasystem.html index 797cbf4b3..9a075972a 100644 --- a/maxmod/structt__mmgbasystem.html +++ b/maxmod/structt__mmgbasystem.html @@ -143,7 +143,7 @@ diff --git a/maxmod/structt__mmsoundeffect.html b/maxmod/structt__mmsoundeffect.html index 16c65459c..69d916e9c 100644 --- a/maxmod/structt__mmsoundeffect.html +++ b/maxmod/structt__mmsoundeffect.html @@ -119,7 +119,7 @@ diff --git a/maxmod/structt__mmstream.html b/maxmod/structt__mmstream.html index ce046d7e6..b1ac049f3 100644 --- a/maxmod/structt__mmstream.html +++ b/maxmod/structt__mmstream.html @@ -127,7 +127,7 @@ diff --git a/maxmod/topics.html b/maxmod/topics.html index 3c0c1e2f4..0fa81cdf7 100644 --- a/maxmod/topics.html +++ b/maxmod/topics.html @@ -109,7 +109,7 @@ diff --git a/search/en.data.min.json b/search/en.data.min.json index 3c943f463..ac318767f 100644 --- a/search/en.data.min.json +++ b/search/en.data.min.json @@ -1 +1 @@ -[{"id":0,"href":"/docs/introduction/","title":"Introduction","parent":"BlocksDS Documentation","content":"","description":""},{"id":1,"href":"/docs/introduction/introduction/","title":"Introduction","parent":"Introduction","content":"This is an SDK to develop applications for Nintendo DS in C or C++.\n1. Goals To create an easy-to-use NDS software development kit based on GCC with as few dependencies as possible, and that supports as many features of the DS and DSi as possible.\nTo encourage developers to hack and improve the SDK by letting them have all the source code of the SDK. This also shows how easy it is to build the whole codebase. The exception is the toolchain, which is non-trivial to build. Because of that, Wonderful Toolchains is used instead of asking the users to build it themselves.\nTo try to keep compatibility with pre-existing C projects made by devkitARM. In theory, it should be enough to replace the Makefile of devkitARM by a Makefile of BlocksDS to build any old project, with some few exceptions. Check this guide for more details.\nTo document as much of the SDK as possible. For detailed information about the design of BlocksDS, check this document.\nTo ensure that the licensing status of all the code is correct and that the licenses used are all FOSS. This SDK is made from the work of many others that came before it and who developed FOSS libraries that can be now used by BlocksDS. This SDK must ensure that all the code remains FOSS for other people to use it in the future. For more information about the licenses used by different components, check this.\n2. Features 2.1 Standard libraries Binaries are pretty small and their baseline RAM usage is low thanks to using picolibc instead of the more commonly used newlib.\nA libc with most of the features and functions you would expect in a regular environment like in a PC. For example: printf(), scanf(), fopen(), stat(), opendir(), malloc(), gettimeofday(), time() and exit().\nThere are versions of functions like memcpy(), memset() and memmove() that have been optimized for the CPUs of the DS. This is thanks to using ndsabi, a fork of agbabi by felixjones.\nAlso, argv may be provided by the environment so that programs know where they are running from (the path of the NDS file is provided in argv[0]), and any arguments pased to it if any.\nIt is possible to access the filesystem of DLDI devices (like the SD card of flashcarts), the SD slot of the DSi, and the filesystem embedded in a NDS ROM (NitroFS). Performance (particularly for reads) has been optimized by asie a lot. This is partly thanks to using FatFs, partly due to the DSi SD driver by profi200, and partly due to lots of additional optimizations by asie\nC++ is supported, as well as libstdc++ but it hasn\u0026rsquo;t been tested as extensively as the C standard library.\nThere is basic cooperative multithreading support. libnds has been modified to be thread-safe. Thread-local storage support has also been added. You can define variables that are unique per thread like this:\n__thread int my_variable = 1000; __thread int other_variable; Filesystem reads can be done from the ARM9 and ARM7. You can make the ARM9 ask the ARM7 to load files in one thread. While the ARM7 load files the ARM9 can be doing other things in other threads, so you aren\u0026rsquo;t blocked. This is always done when loading files from the SD card of the DSi, but it can also be done with DLDI devices. Most DLDI drivers can run from the ARM7 even if they haven\u0026rsquo;t been explicitly built with that in mind!\n2.2 Supported DS features All features of the 2D video hardware are supported. There are some APIs to simplify the usage of backgrounds and sprites, as well as a basic text console system based on the 2D background system.\nAll features of the 3D hardware are supported through an API that is similar to the one of OpenGL 1. There is a library to render 2D graphics with the 3D hardware easily, called GL2D.\nThere is a tool to convert graphics to the formats used by the DS: grit. The only format that it doesn\u0026rsquo;t support is the Tex4x4 texture format, but that one is supported by ptexconv.\nThe audio hardware is supported. There are two libraries that can be used to play music: Maxmod and libxm7. libxm7 only supports playing MOD and XM files, and it is required to use libnds to play SFXs through a basic sound API. Maxmod, on the other hand, has its own way to play sound effects and music, and it supports MOD, XM, IT and S3M files.\nIt is possible to record audio using the microphone of the console.\nThere are some helpers to use the division and square root co-processor, the BIOS functions, hardware timers, DMA, interrupt handlers, and the hardware FIFO system for ARM9 \u0026lt;-\u0026gt; ARM7 communications.\nThere are some helpers to setup the MPU and to manipulate the cache of the ARM9 (to clean it or invalidate it).\nThere is an API to access the DS cartridge ROM, as well as EEPROM chips in the cartridges that use it. It is also possible to access the filesystem of SD cards used in flashcarts.\nThere is an API to read the state of the buttons and the touchscreen.\nThere is an API to use Slot-2 peripherals such as RAM expansion cartridges, gyroscopes or tilt sensors.\nThere are some helper functions to decompress some formats supported by the BIOS.\nIt is possible to read and set the date and time of the RTC clock.\nWiFi support isn\u0026rsquo;t complete. It is possible to connect to Access Points with the library DS WiFi, but it doesn\u0026rsquo;t support DS to DS WiFi communications.\nndstool supports creating NDS ROMs and define a ROM icon and banner text (in multiple languages!).\n2.3 Supported DSi features The SD slot of the DSi is supported.\nThe new DMA features, as well as the new WRAM memory banks, are supported.\nndstool supports animated icons from PNG, GIF, even animated GIF files.\nThe DSi camera is supported (thanks, asie!). It\u0026rsquo;s still quite basic, but enough to be able to take photos from the front and back cameras.\nThere is preliminary support for the DSP of the DSi (the toolchain is very buggy, so be very careful when using it, it\u0026rsquo;s probably not ready to be used by most developers!).\nUnfortunately, none of the DSi WiFi features (such as WPA support) are supported by DS WiFi yet.\n","description":"This is an SDK to develop applications for Nintendo DS in C or C++.\n1. Goals To create an easy-to-use NDS software development kit based on GCC with as few dependencies as possible, and that supports as many features of the DS and DSi as possible.\nTo encourage developers to hack and improve the SDK by letting them have all the source code of the SDK. This also shows how easy it is to build the whole codebase."},{"id":2,"href":"/docs/setup/","title":"Setup instructions","parent":"BlocksDS Documentation","content":"","description":""},{"id":3,"href":"/docs/usage/","title":"Usage","parent":"BlocksDS Documentation","content":"","description":""},{"id":4,"href":"/docs/introduction/changelog/","title":"Changelog","parent":"Introduction","content":" Version 1.3.1 (2024-07-26) libnds:\nAdded memory barriers to libnds functions which remap user-accessible memory. consolePrintChar() has been exposed in the public API. Coupled with internal refactors, this allows using the built-in console without pulling in printf/scanf as a dependency. Fixed function parameters and improved parameters for BIOS RSA functions. Fixed potential memory corruption when micStopRecording() was called twice. Fixed regression in new touchscreen driver on CDC (TWL). Improved documentation for the BIOS CRC-16 calculation function. Minor optimizations to videoGL and console code. SDK:\nNew examples:\nAdded a 3D billboard drawing example. Added a 3D spot lights example. Added a 3D two-pass rendering example. Added a BIOS bit unpacking example. Added a BIOS CRC-16 calculation example. Added a BIOS RSA decruption example. Added a microphone recording example. Added a Maxmod audio modes example. Added a Maxmod reverb example. Fixed a regression in the exception handler example. picolibc:\nThe bundled version of picolibc has been updated. Added an implementation of posix_memalign(). Added support for %a and %A formats in scanf(). Fixed freopen() not resetting the unget buffer. Fixed hexadecimal string conversion in strtod(), strtof() and strtold(). Fixed lgammal() corrupting the application-defined signgam value. Fixed potential issue when calling fclose() more than once. Fixed printf() rounding issues for %a and %f formats. General header cleanups have been performed. Other:\nExpanded the touch input test to allow sampling input on initial pen press only, as opposed to every frame while the pen is touching the display. Version 1.3.0 (2024-07-06) libnds:\nNew touchscreen driver:\nThe touchscreen driver has been rewritten from the ground up. A new routine for filtering measurements is now used for both TSC (NTR) and CDC (TWL) touch inputs. This should provide more accurate results, particularly on more worn down displays and screen protectors. More testing is required, however. On TSC (NTR), tscMeasure() now uses the 16-clock-per-conversion method to speed up measurement readouts. The duration of the critical (interrupt-blocking) section of the touch driver has been reduced, and the TSC (NTR) driver has had its performance optimized on top of that compared to 1.2.0 and below. On the ARM7 side, touchApplyCalibration and touchReadData have been added to allow more granular access to the touchscreen driver\u0026rsquo;s logic. As these commands were only intended for TSC (NTR), touchRead and touchReadTemperature were moved to a new header, tsc.h, and renamed to tscRead and tscReadTemperature respectively. Interrupt handling:\nThe interrupt dispatcher has been optimized to use O(1) as opposed to O(n) lookups. This is always faster on ARM9, and faster for more than 2-3 defined IRQ handlers on ARM7, which is the common scenario. Fixed a bug where irqClearAUX() would disable the non-auxillary interrupt of the same bit mask on ARM7. Fixed behaviour in setting and clearing of multiple interrupt handlers at a time (bit masks with more than one bit set). Now, setting multiple bits at once with irqSet() or irqClear() acts the same as setting one bit at a time. Memory usage:\nITCM use has been reduced by about 320-380 bytes, depending on your codebase\u0026rsquo;s use of libnds. DTCM use has been reduced by 192 bytes - the size of the reserved section at the end of memory is now 64 bytes by default and can be controlled with the __dtcm_reserved_size linker symbol. ARM7 IWRAM use has been reduced by 192 bytes - the size of the reserved section at the end of memory is now 64 bytes by default and can be controlled with the __iwram_reserved_size linker symbol. The size of the supervisor and IRQ stack can now be controlled by defining the __svc_stack_size and __irq_stack_size linker symbols. Graphics:\nA new function has been added to set the object mode (regular, bitmap, window, blended): oamSetBlendMode(). A new function has been added to get a SpriteSize entry from the size of a sprite in pixels: oamDimensionsToSize(). Also, SpriteSize_Invalid has been introduced to represent dimensions that aren\u0026rsquo;t valid 2D sprite sizes. New definitions have been added for the bit fields of the BLDALPHA and BLDY registers. The following functions now return error codes: glBindTexture(), glAssignColorTable(), glGetColorTableParameterEXT(), and glTexParameter(), making it easier to handle errors gracefully when using them. There has been a big refactor in videoGL to handle allocation errors gracefully (or at least crash with an assertion if the code can\u0026rsquo;t recover from the error). Code refactoring:\nRTC_CR, RTC_CR8 and HALT_CR have been renamed to REG_RTCCNT, REG_RTCCNT8 and REG_HALTCNT, respectively. GL2D now uses existing videoGL.h helpers instead of reimplementing its own copies. Many fields and functions have been documented, including firmware flash commands, DLDI driver structures. Missing DMA_START constants have been added. The constants used in tscReadTemperature have been documented. SerialWaitBusy has been renamed to spiWaitBusy. oamSetGfx() has been moved away from the header to fix C++ builds. Other:\nARM7 SPI bus helper functions have been added: spiExchange, spiRead and spiWrite. consoleLoadFont() has been cleaned up. Note that the convertSingleColor option has been removed, as 1bpp fonts are now supported. Decompression of Huffman-compressed data has been implemented. To faciliate this, decompressStreamStruct() has been added. Decompression utility functions are now available in both the ARM9 and ARM7 build of libnds. glCallList() and cardStartTransfer() now use the safe helper function dmaSetParams(). wf-fatfs has been updated, bringing minor performance improvements to directory lookups. The magic numbers used to represent MPU memory regions have been replaced by definitions. A missing include has been added to grf.h. SDK:\nNew examples:\nAdded an 8-bit bitmap background loading example. Added an example of combining 3D, 2D sprite, and 2D background display. Added an example of loading sprites of all graphics types from GRF files. Added an example of loading bitmap sprites. Added an example of loading and using affine sprites. Added examples of using regular windows and windows using objects as mask. Added examples of using extended palettes for sprites and backgrounds. Added an example of using a text console in an extended affine background. Added an example of using the mosaic effect in sprites and backgrounds. Added an example of animating 2D sprites by updating frames in real time or by pre-loading all frames to VRAM from the start. Added an example of using 2D alpha blending and fade effects. Added a BIOS decompression example. Added a NitroFS paletted texture loading example. Added a touch input test, and two examples. Added an example of creating graphics effects using the horizontal blanking interrupt. Added a sample minigame based on Space Invaders. Changes to examples:\nOAM memory and textures is now freed in all examples that allocate them. While this isn\u0026rsquo;t needed in examples as short as ours, it\u0026rsquo;s good practice to show developers how to free resources when they aren\u0026rsquo;t needed anymore. The names of the ROMs and the titles and subtitles in the ROM header have been modified to make them consistent across all examples. Background IDs returned by bgInit() are now used instead of hardcoded layer numbers. videoSetMode() is no longer used to enable sprites or to set sprite mapping modes, that should be done by the libnds sprite API. Tilemaps are now explicitly excluded from grit generation in all the grit files that are used to convert sprites. grit:\nFixed reading data from assembly files as input. Fixed uninitialized memory use when loading a picture with an odd width. picolibc:\nThe bundled version of picolibc has been updated. Added an implementation of funopen. Added bounds checking to asctime_r and ctime_r. Added implementations of fgetpos and fsetpos. Added stub implementations for POSIX unlocked file functions. Fixed fgetwc and fputwc not setting the file stream to wide orientation. Fixed regex.h not being usable when compiling C++ code. Other:\nFixed NitroFS generation in the combined ARM7+ARM9 ROM template. The BlocksDS SDK now depends on the wf-nnpack package, which provides standalone, command-line compressors for the decompression methods supported by the console\u0026rsquo;s BIOS. The code style of libteak and DSWiFi has been changed using clang-format to improve readability. The documentation has been updated with additional notes about migrating from older and current versions of devkitARM, covering further potential issues. The Teak LLVM toolchain is no longer mentioned in the Windows setup instructions, as it is not available there. Version 1.2.0 (2024-06-08) libnds:\nvideoGL:\nAdd glGetColorTablePointer() (returns pointer in VRAM to the palette of a texture). Add glGetTextureExtPointer() (returns pointer in VRAM to the additional texture data of GL_COMPRESSED textures). Fix allocation of GL_COMPRESSED textures when VRAM_A is not allocated to the 3D engine. Fix crash in glTexImage2D() with no active texture. Fix error checking in glColorTableEXT() and glTexImage2D(). General code cleanup and improvements. Minor optimization to loading GL_RGB textures using glTexImage2D(). Note that using this format is not recommended; see documentation for additional details. TEXTURE_SIZE_INVALID has been added to GL_TEXTURE_SIZE_ENUM. glTexImage2D() now fails correctly when invalid sizes are used. Some minor comment improvements. GL2D:\nImprove error checking when loading textures. Modify sprite sets to use uint16_t arrays for texture coordinates. Other:\nAdd hw_sqrtf() - a hardware-accelerated alternative to sqrtf(). Small optimizations to functions that use the hardware accelerators of division and square root. Add support for detecting stack smash canaries. As a result, the debug versions of libnds are now built with the stack protector enabled. Add support for printing standard output to the debug console if the on-display console is not initialized. Change SOUND_FREQ (ARM7) and TIMER_FREQ to always return the correct frequency value, rounded to the nearest achievable one. This has been found in user research to be the most intuitive default; if you\u0026rsquo;d like alternate options, please let us know. Fix swiSwitchToGBAMode(). Improve documentation of RTC structs. SDK:\nAdd error code checks to 3D engine examples. Add GL2D spriteset and tileset examples. Add new tool: squeezer (by @huxingyi), used for generating packed textures for GL2D sprite sets. It has been forked to easily export formats used by GL2D instead of generic formats. Add tests for hw_sqrtf(). Avoid using GL_RGB and TEXTURE_SIZE_n defines in 3D engine examples. Fix VRAM bank setup in \u0026ldquo;text over 3D\u0026rdquo; example. Improve timer example. Add a test for the videoGL functions that allocate textures and palettes. Version 1.1.0 (2024-05-08) libnds:\nAdd keyboardExit() function to deinitialize keyboard structures. Add realpath() implementation. Adjust keyboardInit() to only link the default keyboard if no custom keyboard is being used. Fix getcwd() result when called in the root NitroFS directory. Fix Slot-1 card reads not being aligned to 512 bytes. Minor allocation/string handling bugfixes. Fix some memory allocation issues found by GCC 14. SDK:\nAdd examples (paletted textures, rotation backgrounds, 16-bit backgrounds, sprites in sub screen, FAT file attributes, GL2D usage). Add tests for realpath(). Fix warnings found by GCC 14 in examples. Version 1.0.0 (2024-03-30) libnds:\nFix C++ builds (there was a missing cast from enum to int, and the Makefile was using the wrong program to link binaries). Optimize some videoGL functions (compile them as ARM instead of Thumb to take advantage of the faster multiplication instructions). Fix bug in readdir(). Implement __retarget_lock_*() family of functions to allow libc functions to work in a multithreaded environment. Make glCallList() take a void pointer instead of u32. Add checks to NWRAM functions to see if MBK1-MBK5 are writable. Don\u0026rsquo;t remap NWRAM-A when starting the DSP (only B and C are needed). Fix swiUnpackBits(). Fix some casts to respect \u0026ldquo;const\u0026rdquo;. Fix some warnings. Improve some documentation comments. Deprecate typedef fp (the name is too short!) and PUnpackStruct. Add missing files to the Doxygen documentation. SDK:\nAdd examples (3D object picking, 3D toon shading, building 3D display lists, 3D volumetric shadows, compressed textures, orthogonal projections, using console windows with the default console API). Improve C++ test to prevent regressions like during the last few versions. Document memory map of the DS. Add note about the Makefiles of BlocksDS not supporting paths outside of the root folder of the project (thanks, @lifehackerhansol). Fix linking C++ projects in default makefiles. Maxmod:\nFix return type of mmEffectCancel() in ARM9 code. Version 0.14.0 (2024-03-02) libnds:\nThe GRF loading functions have been modified to be actually useful. In some cases it wasn\u0026rsquo;t possible to infer the size of some data chunks of the file (it was impossible to calculate the size of a tileset, for example). The new functions break compatibility with the old ones, but this change was required. Added glTexSizeToEnum() to convert sizes in pixels to GL_TEX_SIZE_ENUM values. Also, the funciton glTexImage2D() now accepts sizes in pixels as well as GL_TEX_SIZE_ENUM values. Added a function to return the default drive (sd: in the case of DSi, fat: in the case of a DS). FatFs has been moved to an external repository (wf-fatfs) which is included in libnds as a submodule. The documentation of FatFs has been removed from this repository. Added some missing 3D polygon attribute definitions. Fixed the return type of swiSHA1Verify(). The fatfs.h header has been removed, it is redundant. SDK:\nRefactor documentation.\nIt now uses Hugo, and it is available as a static website. Some old sections have been updated. The documentation of all libraries has been integrated with the documentation of BlocksDS so that everything is linked. Document how to use Slot-2 flashcarts with BlocksDS applications. Reword devkitARM porting guide. A doxygen theme has been applied to the documentation of all the libraries used by BlocksDS. Add lots of examples:\n3D and 2D graphics. DSWifi. How to use multiple DSP binaries in the same application General NitroFS usage in an application (such as loading music for LibXM7 or graphics to be used as 2D backgrounds or sprites). DSi SHA1 functions. Hardware timers. Video capture (render to texture, dual screen 3D, save screenshot as PNG). More text console examples. Small change to makefiles that modifies the destination folder of build artifacts.\nLibXM7:\nIt now uses timer 0 instead of timer 1, so that Maxmod and LibXM7 use the same timer and it\u0026rsquo;s easier to switch libraries. The documentation has been improved. DSWifi:\nWEP modes have been documented. The prototypes of some functions have been cleaned up. The documentation has been improved. Maxmod:\nThe return type of mmEffectCancel() has been fixed. Some definitions have been turned into enums. inline functions in headers have been turned into static inline. Version 0.13.0 (2024-02-01) libnds:\nBreaking change: Refactor input handling in the ARM9. In order to fix a race condition where the touch screen state could be updated between calls to scanKeys() and touchRead() it has become mandatory to call scanKeys() before touchRead(), keyboardGetChar(), keyboardUpdate() and the deprecated touchReadXY(). Most programs are already doing this, but this may break a small number of programs that don\u0026rsquo;t do it. Implemented isHwDebugger(), which returns 1 if the console running the code is a hardware debugger, regardless of the DS model and CPU state. This is meant to replace swiIsDebugger(), which only works if the cache is disabled, and only in DS models (not DSi). The documentation of swiIsDebugger() has been updated to mention its limitations. Fix Slot-2 tilt API introduced in version 0.11.0, which hadn\u0026rsquo;t been tested on hardware. The old peripheralSlot2TiltUpdate() has been replaced by peripheralSlot2TiltStart() and peripheralSlot2TiltRead(). Implemented utime() and utimes() for changing file modification dates. Implemented scandir(), alphasort() and versionsort(), Fixed statvfs() and fstatvfs() on NitroFS paths and files. Added stubs for getwd() and get_current_dir_name(). Added stubs for getuid(), getgid(), etc. Add helpers to load GRF files generated by grit. Reintroduce logic to read Slot-1 cartridges with card commands from the ARM7 to save CPU cycles on the ARM9. The value of the RAM size field in REG_SCFG_EXT in the ARM9 is now set to 16 MB or 32 MB instead of being fixed to 32 MB even in retail DSi units. Some CP15 defines have been fixed. Simplify logic in ARM7 input handler. Generate default font from a PNG at build time instead of doing it from a preconverted BIN file to make it easier to replace it in the future. grit:\nAdded the -D argument, specifying the destination folder for non-shared data as a counterpart to -O. Fixed a situation in which the first color in an image\u0026rsquo;s palette would be used as transparent if the user-provided color (with -gT) was not present in the image. Breaking change: Fixed GRF file output to properly follow the RIFF chunk format. It will also export new information in the file header, like using special magic values to specify the formats A3I5, A5I3 and TEX4x4, and specifying the number of colors contained in the palette (for 16-bit textures it\u0026rsquo;s 0). In order for the new information to fit in the header, some fields have been increased in size. Fixed palette size calculation for DS textures. Improvements to error messages. LibXM7:\nMake types XM7_XMModuleHeader_Type and XM7_MODModuleHeader_Type private. Developers consider their MOD/XM files as a typeless blob of data, they shouldn\u0026rsquo;t need to cast it to anything, the library should do it itself. The structs that define the MOD and XM formats have been made private, as well as some definitions internal to the player. Some defines have been turned into enums, which will help developers and IDEs identify what to use in which functions. The documentation has been updated. Tests:\nAdd test to read DSi SCFG registers to see which DSi features are available with the loader that has been used to launch the application. Add test to display all configured MPU regions. Version 0.12.0 (2023-12-26) libnds:\nDot and dot-dot entries are now properly emitted in readdir(). In line with common software expectations, they mirror standard FAT filesystem behaviour, that is are present for all subdirectories. For NitroFS, these entries are emulated accordingly. The d_ino field in readdir() output is now correctly populated, to match stat() and fstat(). Added nitroFSOpenById() and nitroFSFopenById() functions, allowing opening files directly without paying the cost of a directory lookup. Accordingly, NitroFS file systems which contain a FAT table but no FNT table can now be opened. Optimized glMaterialShinyness(). SDK:\nThe default Makefiles have been simplified and now use compiler-provided .specs files. In turn, a few additional features have been added: Support for picolibc\u0026rsquo;s compiler define-based selection of the printf and scanf implementations. The __BLOCKSDS__ define, which can be used to detect a BlocksDS environment during building. Fixed camera initialization with the default ARM7 binary. grit:\nAdded the -ftB argument, which outputs files with .img, .map, .meta, .pal extensions, as opposed to .img.bin, .map.bin, .meta.bin and .pal.bin. Version 0.11.3 (2023-12-04) libnds:\nAdded helpers to control microphone power independently from recording. This can be used for scenarios in which the DSP is tasked from recording microphone input. Added helpers and definitions for the DSi GPIO registers. Added function to detect availability of NWRAM. Fixed atexit() handlers not being called during a normal main() return. Fixed TSC configuration for enabling 47 kHz input/output in DSi mode. Improved error handling in Teak DSP code execution helpers. The Teak DSP is now powered off before loading a DSP binary. DSWiFi:\nReduced memory usage, especially while Wi-Fi is not initialized. ndstool:\nBreaking: Instead of providing alternate-language banner text using -bt5 \u0026quot;Text\u0026quot;, the form -bt 5 \u0026quot;Text\u0026quot; is now required. Added support for providing mutliple root directories for building NitroFS images. All specified root directories are combined to create the root of the file system. Fixed -w treating other options as file masks. Improved argument handling. SDK:\nUpdated compiler flags: The superfluous -mtune=arm7tdmi has been removed from ARM7 Makefiles. -march=armv5te -mtune=arm946e-s has been replaced with -mcpu=arm946e-s+nofp in ARM9 Makefiles. -Wl,--use-blx has been added to ARM9 linker flags. This allows the use of the BLX opcode for linking ARM/Thumb code in place of trampolines, slightly improving final executable size and performance. Version 0.11.2 (2023-11-27) libnds:\nFixed a bug introduced in version 0.11.1 that didn\u0026rsquo;t initialize audio hardware correctly in DSi mode. Some superfluous audio helpers added in version 0.11.1 have been removed. Move libteak to its own repository so that it can be reused by other toolchains. Modify functions to load DSP binaries to return int instead of bool for more flexibility. DSP:\nMove crt0 and linkerscript to libteak repository. Preprocess all assembly files, not just the crt0. Version 0.11.1 (2023-11-25) libnds:\nFixed an edge case which could read to invalid small reads/writes to DSi/ARM7-controlled removable storage. Added helpers to control REG_SNDEXTCNT from the ARM9 (to enable DSP audio output to the speakers, for example). Some DSP functions have been moved to twl sections to save memory when the game runs in a regular DS. Wrapped camera functions to prevent crashes when used in NDS mode. Change license of DLDI-related files to Zlib with permission from the authors. Fix Doxygen documentation of peripherals. DSP:\nAdded BTDMP helpers to stream audio from the DSP to the speakers. Added an example to show how to generate audio from the ARM7 and the DSP at the same time. Added an example of how to use DMA to transfer data from the DSP memory to the ARM9 memory. Version 0.11.0 (2023-11-19) libc:\nFixed an important regression in memcpy() and memset() implementations. Improved file I/O performance:\nAdded support for batch reads and writes of contiguous clusters, improving SD card performance for very large sequential reads/writes. Added fatInitLookupCacheFile(). This allows opting a file into having a special in-memory cache which significantly speeds up file seek operations. Provisionally automatically enabled the in-memory cache for NitroFS files. If you\u0026rsquo;re experiencing slowdowns, make sure to defragment your SD card - this requirement will be loosened in future releases (but it\u0026rsquo;s still a good idea). Integrated profi200\u0026rsquo;s dsi_sdmmc driver, improving reliability and performance for reading from and writing to the DSi\u0026rsquo;s SD card. Optimized unaligned buffer I/O performance for the DSi\u0026rsquo;s SD card. Only cluster table/directory-related reads will now be cached by the built-in sector cache. This allows better use of this sector cache; one can use setvbuf() to enable a larger cache for file I/O. Other minor optimizations have been made throughout the code. Added a new Slot-2 API (arm9/peripherals/slot2.h).\nAdded support for detecting external RAM cartridges (SuperCard, M3, G6, DS Memory Expansion Pak, EZ-Flash variants, EverDrive). Added support for enabling and disabling the data cache on the Slot-2 memory area. Combined with suitable bus speed detection for these cartridges, this allows efficient usage of such an external RAM area. Added support for detecting and using the Gyro, Solar and Tilt sensors available on various GBA game cartridges. Fixed detection of GBA cartridge rumble (WarioWare, Drill Dozer). Modify rumble example to show how to use the new API. DLDI:\nMoved the built-in sector cache into unused memory occupied by the reserved DLDI driver area. This effectly saves ~20KB of heap RAM for most homebrew. The DLDI driver area size can now be changed by defining the __dldi_size symbol to a value away from the default of 16384, such as 8192 (if your application is highly RAM-constrained - this may break support with some cartridges, however) or 32768 (restores compatibility with MoonShell versions at the cost of an additional 16KB of RAM). The DLDI driver area is now guaranteed to be close to the beginning of the .nds file, which may slightly improve load times. DSP:\nAdd BTDMP and ICU helpers. Refactor crt0.s. Add examples of handling interrupts, including timer interrupts. libnds:\nRename some cache helpers for consistency. Fixed a file handle leak that could occur if nitroFSInit() was pointed to an .nds file which does not contain a NitroFS file system. Fixed a rare case in which nitroFSInit() could try reading from the GBA slot on the DSi, causing an exception. Added readFirmwareJEDEC() function to read the ID of the DS firmware flash chip. (lifehackerhansol) Minor optimizations have been done to readUserSettings(). Fixed the NDMA_DST_FIX macro definition. Version 0.10.2 (2023-11-11) NitroFS: Fix file traversal not working without running a chdir() first. Version 0.10.1 (2023-11-11) Fix NitroFS directory reads occasionally failing on non-DLDI environments. Version 0.10.0 (2023-11-11) Build system:\nThe default makefiles no longer rely on the toolchain being in the current PATH. Now, the default Makefiles have the default path to Wonderful Toolchain, which can be overriden by the user if desired. The makefiles used by the tests and examples have been moved to a system location so that they are more easily reused. dldipatch has replaced dlditool as the default to apply DLDI patches, due to bugs in dlditool\u0026rsquo;s patch application process: https://problemkaputt.de/gbatek-ds-cart-dldi-driver-guessed-address-adjustments.htm Update your makefiles to take advantage of the updates. Filesystem improvements:\nReplaced NitroFAT by a new Zlib-licensed implementation of the NitroFS filesystem by @asiekierka. This fixes the performance drawbacks of NitroFAT. In stat() and fstat(), the fields st_dev and st_ino are now properly populated. Fixed stat() not acknowledging / as a directory. Remove NitroFAT support from ndstool. The example makefiles have been modified to stop using mkfatimg. DSP:\nInitial experimental, incomplete support for the Teak DSP of the DSi. This isn\u0026rsquo;t ready to be used, it\u0026rsquo;s still under development and it\u0026rsquo;s going through a lot of changes. Most of the code is derived from @Gericom\u0026rsquo;s prototype code. Support for building DSP binaries won\u0026rsquo;t be present on Windows until it\u0026rsquo;s more stable. However, if you already have pre-built DSP binaries, it\u0026rsquo;s possible to use them on Windows. Introduced teaktool, which converts ELF files into TLF (Teak Loadable Format) files that can be loaded by libnds. Added ARM9 functions to libnds to handle the DSP, load TLF files and communicate with programs running on the DSP. Introduce libteak, a library with helpers to use the AHBM, DMA, APBP, ICU and timer peripherals. It has been documented and added to the Doxygen pages of libnds. Added a few examples of how to use the currently supported DSP features. Update user instructions and Dockerfile to use and mention the LLVM Teak toolchain. Add NWRAM defintions and helpers. DLDI improvements:\nThe DLDI template now automatically calculates the \u0026ldquo;size\u0026rdquo; and \u0026ldquo;fix flags\u0026rdquo; fields of the header. The binary R4 DLDI driver, used for DeSmuMe compatibility, has been replaced by a Zlib-licensed impementation built from source. libnds:\nMicrophone samples can now be captured using full 16-bit precision on DSi. Cleaned up and added some missing MMIO/bitfield defines throughout libnds. Implemented inlined BIOS calls based on gba-hpp. This should make code using BIOS calls slightly smaller and faster. Small reorganization of syscalls code. Slightly optimized coroutine threading code. Added documentation about ARM7 audio helpers. Submodules:\nBefore this version, repositories owned by third parties were added as submodules to the SDK repository. This can be a problem if the owner isn\u0026rsquo;t responsive, changes name, deletes the repository\u0026hellip; In order to avoid issues, forks have been created under the BlocksDS organization. It is expected to contribute to the original repositories and update the fork to stay in sync. Contributing to the forks is a last resort option. Tests:\nAdded a new test for SWI functions. Version 0.9.1 (2023-10-19) Revert changes in Maxmod that duplicated some symbols. Version 0.9.0 (2023-10-18) SDK:\nNative windows support added. Wonderful toolchains now distribute native Windows binaries, and the only required change in BlocksDS was to change a library used by Grit. Thank you, Generic and asie! The stdio implementation of picolibc provided by Wonderful Toolchains has been patched by asie and this has substantially improved direct SD card read and write speeds. The RTC interrupt is no longer used in any test, example or template. Users are now expected to timer interrupt instead because the RTC interrupt isn\u0026rsquo;t supported on 3DS in DS/DSi mode or most emulators. Check the new code to see how to adapt old code. The RTC interrupt functions will still be supported to preserve compatibility with old projects that aren\u0026rsquo;t updated. Document the ARM9 \u0026lt;-\u0026gt; ARM7 boot synchronization routine. In the dockerfile, set a locale to be able to pass UTF-8 characters to ndstool to appear in the title of the NDS ROM. Add a test to ensure that the libnds modules that use the ARM9 \u0026lt;-\u0026gt; ARM7 transfer memory region don\u0026rsquo;t break. New examples: Getting key input state. Using NitroFAT, DLDI and DSi SD in the same program. Send a buffer in main RAM to the ARM7 from the ARM9. Read battery status. Set the real time clock of the NDS. libnds:\nRTC: Add new helpers to get and set the date. They use typedefs to move values between functions instead of byte arrays. The old helpers that use byte arrays have been deprecated. Using the RTC interrupt as a way to update the time every second has been deprecated. Documentation: Document values returned by the battery read function. Document RTC helpers. Add some ARM7 modules to the front page of the Doxygen documentation. Memory: Disable data cache and instruction fetch access to DTCM. Rumble detection functions won\u0026rsquo;t try to detect anything on DSi. Change location of transfer region area on DSi so that it\u0026rsquo;s uncached. Import safe DMA helpers written by Gericom and use them from all DMA helpers. Video: Make glGetInt() wait for the GPU to be idle when getting the polygon and vertices count. It is common for developers to forget to wait. Cleanup some helpers and add some missing VRAM definitions. Document hardware bug of the DMA in GFX FIFO mode. Other: FatFs updated to R0.15p3. Support the debug button (only available in emulators and debug consoles). Switch to using ARM unified syntax (UAL). Grit:\nSwitch from libfreeimage to libplum. This allows us to build Grit on Windows easier. Version 0.8.1 (2023-08-01) libnds:\nFixed NitroFAT in emulators. It only worked when DLDI was initialized correctly, which isn\u0026rsquo;t the case in emulators like no$gba. Set the right CPU as owner of the Slot-1 bus in NitroFAT handling functions. SDK:\nUpdated build systems to generate Maxmod soundbanks in the NitroFAT filesystem if the filesystem is used. This isn\u0026rsquo;t supported by ARM9 + ARM7 makefiles for now, only by ARM9 makefiles. Fixed segmentation fault in mkfatimg when not enough arguments are provided. Stop relying on make -j in Makefiles. It is passed by make to any sub-make, so it isn\u0026rsquo;t required. Added basic Maxmod and Maxmod + NitroFAT examples. Version 0.8 (2023-07-16) libnds:\nFilesystem: fatInit() now correctly sets the current working directory. NitroFAT now changes directory to nitro:/ on initialization. Fixed code that selects the default filesystem (DSi SD or DLDI). Added asynchronous math functions to suplement the synchronous functions. Added support for redirecting stdout and stderr to user functions. Added support for more rumble packs. Improved support for DSi regions in guruMeditationDump(). Documented MPU setup code properly. Cleaned up exception handling code. Added missing DLDI_SIZE_2KB define. Fixed leaking file handlers in truncate(). Fixed memory leaks and handling in image and pcx modules. ndstool:\nFixed warnings. Removed non-homebrew-related functionality. SDK:\nAutomatically link with libc and libstdc++ rather than forcing users to do it explicitly. Support *.arm.c and *.arm.cpp filenames for compatibility with devkitARM-utilizing projects. Fixed TLS initialization on the ARM7. Improved bin2c. Updated libc documentation. Improved and cleanup some examples. Version 0.7 (2023-04-19) libnds:\nKeyboard: Fixed initialization glitch where it could blink for a frame. Fixed backspace handling. Added support for non-blocking keyboard capture when using cothreads. cothread: Fixed stack alignment. Fixed the stack size of the scheduler thread. Fixed no$gba debug messages on the ARM9. Added support of no$gba debug messages to the ARM7. Implemented fatInit(). Improved sassert() so that it can exit to the loader instead of locking the application. Unified all coding and documentation style of the codebase. Changed license of GL2D to Zlib (with the author\u0026rsquo;s permission). Reduced the size of OamState structures. mmutil:\nFixed segfault with samples with implied zero loop. SDK:\nImproved some old examples. Fix memory leaks in all examples that used getcwd(). Fixed ARM9 linkerscript to place ITCM sections in ITCM correctly. Added new examples: Exception handling, assertions, no$gba debug console. Prevent mkfatimg from generating FAT images that are so small that FatFs can\u0026rsquo;t mount them. Improved installation instructions. Version 0.6 (2023-04-11) SDK:\nAdded a DLDI driver template. Refactored install targets of the SDK components. Now, all components can be installed on their own, and they copy the licenses of the components to the installation directory. Tweak bin2c behaviour to more closely match devkitPro\u0026rsquo;s bin2s. Use SPDX license identifiers in all libraries and components that end up in the NDS application binary. Some cleanup of code formatting. libnds:\nFIFO subsystem: The FIFO subsystem has been cleaned up and documented. Some bugs in the FIFO subsystem have been fixed (the stress test still fails, though). Prevent using cothread_yield() in the ARM7. Alignment of thread local storage sections has been fixed. Added support for calling stat() on the root directory of a filesystem. Added support for statvfs() and fstatvfs(). Avoid pulling in the default keyboard data when stdin-requesting code is used. This saves over 10 KB of data in any situation where the default keyboard is not used (no keyboard or non-default keyboard alike). Allow setting the duration of the lid sleep check, and to disable it completely. Build release versions of the library as well as debug. Document MPU setup steps and CP15 registers. Enable more warnings in the Makefile and fix them. ndstool:\nSupport multiple languages in the banner. Support more file formats for icons (GIF, PNG). Support animated icons (from GIF files). Version 0.5 (2023-03-31) SDK:\nDefined a default location for BlocksDS: /opt/blocksds/ LibXM7 has been integrated as a core library. Use mkfatimg (distributed with FatFs) instead of imgbuild.sh to reduce the number of dependencies. Fixed mmutil target in Makefiles in parallel builds. libnds:\nPeripherals: Improved rumble peripheral handling (including detection of the DS Rumble Pak). Cleaned up REG_EXMEMCNT initialization for the Guitar Grip and Paddle peripheral drivers. Improved error recovery in glInit(). This allows recovering the geometry engine from certain situations where a program exited in the middle of 3D engine processing. Improved error recovery in getcwd(). Fixed and simplified exit to loader code on the ARM7 side. Improved documentation of exit to loader logic and BoxTest(). Version 0.4 (2023-03-26) SDK:\nUse the Wonderful Toolchain to get full C++ standard library support. As a result, BlocksDS now targets a specific version of binutils, gcc and picolibc. Removed picolibc and avr-libstdcpp as submodules (all previous history has been condensed to one commit). Simplified the build system of tests and examples. libnds:\nMultithreading: Added cooperative multithreading scheduler. Enabled scheduler in the ARM9 by default. Added examples of having multiple threads, mutexes, and asynchronous file loading. Added support for thread-local storage. Added mutexes to FIFO handling and removable storage accesses. Added initial support and example of DSi camera (thanks, asie!). Added support for malloc() on the ARM7. Implemented stubs for fchmod(), fchmodat(), fchown(), fchownat(). readlink(), symlink(), getentropy(). Updated FatFS to R0.15p2. Fixed glTexImage2D() not flushing textures before copying them with DMA. Version 0.3.1 (2023-03-20) libnds:\nRestored support of gettimeofday() on the ARM7. Version 0.3 (2023-03-20) SDK:\nAdded some tests. Build system improvements (support two-line app titles, remove old makefiles). libsysnds has been integrated in libnds. libnds:\nImplemented a disk cache to improve FatFs performance. Added support for handling DLDI in the ARM7, as opposed to only the ARM9. This is currently controlled either using an additional, previously unused bit in the DLDI specification, or explicitly requested by the homebrew program. Added function for the ARM9 to request the ARM7 to read the cartridge. Added some missing definitions of DSi registers (SCFG/NDMA). Improved TWL/DSi interrupt support. Improved data cache handling for removable storage read/writes. Fixed detecting certain types of 128 KB cart EEPROMs. Fixed incorrect size detection for certain cases of cart EEPROM data. Tweaked default keyboard texture to make the keycap legends opaque. General cleanup of libnds code (like replacing magic numbers by defines). Fixed consoleDemoInit() to restore display brightness when initializing. Version 0.2 (2023-03-15) SDK:\nImproved C++ support (now the C++ standard library it is actually usable). Improved C library support. Fixed install target. libnds:\nIntegrated agbabi renamed as ndsabi. This provides fast implementations of memcpy(), memmove(), memset(), helper functions for facilitating coroutines, etc. Implemented support for 1BPP fonts in consoleLoadFont() and replaced default_font.bin with a derivative of Unscii, limited to ASCII characters 32-127. In total, this saves ~7.25 KB of code size for any program using the built-in console. Reduced the size of data structures controlling the built-in keyboard. Implemented missing bounds checks in keyboardGetKey(). Version 0.1 (2023-03-14) First beta release of BlocksDS. Features:\nSDK:\nSupports libnds, Maxmod, DSWiFi. Supports a lot of the standard C library. Very early support of the standard C++ library. Supports DLDI, DSi SD slot and NitroFAT (open source alternative of NitroFS) using Elm\u0026rsquo;s FatFs. Documentation on how to migrate projects to BlocksDS. Docker image provided. libnds:\nAdded new CP15 control helpers for the ARM9. Added Z1/Z2 read support for the TWL/DSi touch screen controller. This allows measuring an approximation of pressure, similar to NTR/NDS mode. ","description":"Version 1.3.1 (2024-07-26) libnds:\nAdded memory barriers to libnds functions which remap user-accessible memory. consolePrintChar() has been exposed in the public API. Coupled with internal refactors, this allows using the built-in console without pulling in printf/scanf as a dependency. Fixed function parameters and improved parameters for BIOS RSA functions. Fixed potential memory corruption when micStopRecording() was called twice. Fixed regression in new touchscreen driver on CDC (TWL). Improved documentation for the BIOS CRC-16 calculation function."},{"id":5,"href":"/docs/setup/options/windows/","title":"Windows","parent":"Options","content":"The following instructions describe how to install BlocksDS on Windows natively. If you want to use it in WSL, follow the instructions for Linux instead.\nYou will need to install the ARM toolchain of Wonderful Toolchains. Follow the instructions in this link: https://wonderful.asie.pl/docs/getting-started/#windows-via-msys2\nInstall the ARM toolchain of Wonderful Toolchain:\nwf-pacman -Syu wf-pacman -S toolchain-gcc-arm-none-eabi Now, install BlocksDS itself. For the latest stable version of BlocksDS, run:\nwf-pacman -S thirdparty-blocksds-toolchain To install the documentation and examples you can install:\nwf-pacman -S thirdparty-blocksds-docs For the latest unstable version, install the following packages instead of the previous ones:\nwf-pacman -S thirdparty-blocksds-git-toolchain \\ thirdparty-blocksds-git-docs (Optional step) You can also install some third party libraries like NightFox’s Lib and Nitro Engine using wf-pacman:\nwf-pacman -S thirdparty-blocksds-nflib \\ thirdparty-blocksds-nitroengine Whenever you need to update the SDK, run:\nwf-pacman -Syu Run Wonderful Toolchain Shell from the Start menu. This shell has predefined environment variables to ensure that BLOCKSDS projects can be built. If you don\u0026rsquo;t, BLOCKSDS won\u0026rsquo;t be set to the right path.\n","description":"The following instructions describe how to install BlocksDS on Windows natively. If you want to use it in WSL, follow the instructions for Linux instead.\nYou will need to install the ARM toolchain of Wonderful Toolchains. Follow the instructions in this link: https://wonderful.asie.pl/docs/getting-started/#windows-via-msys2\nInstall the ARM toolchain of Wonderful Toolchain:\nwf-pacman -Syu wf-pacman -S toolchain-gcc-arm-none-eabi Now, install BlocksDS itself. For the latest stable version of BlocksDS, run:\nwf-pacman -S thirdparty-blocksds-toolchain To install the documentation and examples you can install:"},{"id":6,"href":"/docs/setup/options/from_source/","title":"Build from source","parent":"Options","content":"This is the option you should use if you want to help develop BlocksDS, or if you want to always use the cutting edge version of BlocksDS.\nYou need to install a cross compiler to build applications for NDS. You also need to build a few host tools, including a C/C++ compiler.\nIf you\u0026rsquo;re on Ubuntu run the following command:\nsudo apt-get install -y --no-install-recommends build-essential You will also need to install the ARM toolchain of Wonderful Toolchains. Follow the instructions in this link but you skip step 5: https://wonderful.asie.pl/doc/general/getting-started/#linux\nNow, install the ARM toolchain of Wonderful Toolchains:\nexport PATH=/opt/wonderful/bin:$PATH wf-pacman -Syu wf-pacman -S toolchain-gcc-arm-none-eabi You can also install the Teak toolchain if you want to develop binaries for the DSP of the DSi. This isn\u0026rsquo;t available in all platforms (like in Windows).\nwf-pacman -S toolchain-llvm-teak-llvm Now, clone this repository:\ngit clone --recurse-submodules https://github.com/blocksds/sdk.git cd sdk To build the SDK, run this from the root of this repository:\nBLOCKSDS=$PWD make -j`nproc` Now, you have some options. The first one is recommended, the others are for users that may have advanced needs.\nRecommended. Install it in your system. You won\u0026rsquo;t need to set BLOCKSDS or BLOCKSDSEXT manually to use the SDK. Run:\nsudo mkdir /opt/blocksds/ \u0026amp;\u0026amp; sudo chown $USER:$USER /opt/blocksds mkdir /opt/blocksds/external make install This will install the libraries and tools to /opt/blocksds/core. Third party libraries and tools are expected to be installed to /opt/blocksds/external.\nBLOCKDS defaults to /opt/blocksds/core in all Makefiles, and BLOCKDSEXT defaults to /opt/blocksds/external.\nInstall it in your system in a custom path. You will need to set BLOCKSDS or BLOCKSDSEXT manually to use the SDK. Run:\nBLOCKSDS=$PWD make INSTALLDIR=my/path -j`nproc` You can avoid exporting BLOCKSDS every time by adding it to your .bashrc, .zshenv or similar.\nUse the libraries from this path. Make sure that the environment variable BLOCKSDS is always set to the right location when you want to use the SDK. The build system of the templates and examples will use this variable to locate the components of BlocksDS it and use them. Any other external library will need to be managed by you.\nYou can avoid exporting BLOCKSDS every time by adding it to your .bashrc, .zshenv or similar.\n","description":"This is the option you should use if you want to help develop BlocksDS, or if you want to always use the cutting edge version of BlocksDS.\nYou need to install a cross compiler to build applications for NDS. You also need to build a few host tools, including a C/C++ compiler.\nIf you\u0026rsquo;re on Ubuntu run the following command:\nsudo apt-get install -y --no-install-recommends build-essential You will also need to install the ARM toolchain of Wonderful Toolchains."},{"id":7,"href":"/docs/design/exit_to_loader/","title":"Exit to loader protocol","parent":"Additional information","content":" 1. Introduction Normally, the only way to exit a DS application is to switch the console off and turn it on again. It can get annoying to do this if you\u0026rsquo;re, for example, testing many applications. libnds supports a protocol that allows an application loader (such as the menu of a flashcart) to setup an exit routine that allows the application to return to the loader. This is needed because the DS doesn\u0026rsquo;t have an OS, so the protocol is managed manually.\nThere is a bit of information about the protocol in this link. However, this documentation is very lacking. There is also an open source loader that implements this protocol, called NDS Homebrew Menu.\nThis document describes the process that happens when a homebrew application tries to return to the loader.\nBefore starting the application, the loader copies a small binary blob at the end of RAM, in a location that has been predefined by the protocol. Then, the loader starts the application.\n2. The application exits The first step involves the application itself. Both the ARM9 and ARM7 CPUs can call exit(), or to return from the main() function.\nexit() is a standard C library function. In both devkitARM and BlocksDS all it does is to call another function, __libnds_exit().\nIf the main() function returns, the effect is the same, as the crt0 will call __libnds_exit() right after main() returns.\n3. libnds starts the exit to the loader The implementation of __libnds_exit() is in libnds_exit.c.\nThe first thing it does is to look for the protocol structure in RAM.\nThis is the format of the struct that is used by the protocol:\n#define BOOTSIG 0x62757473746F6F62ULL // \u0026#34;bootstub\u0026#34; in ASCII struct __bootstub { u64 bootsig; VoidFn arm9reboot; VoidFn arm7reboot; u32 bootsize; }; The location of this struct is 48 KiB before the end of RAM. Depending on the DS model, the size of the RAM is different, so the location will change as well. In libnds there is a pointer called fake_heap_end that is set up during boot and points to this location.\nModel RAM end bootstub address DS/DS Lite 0x2400000 0x23F4000 DSi 0x3000000 0x2FF4000 __libnds_exit() tries to access the struct at that location. If bootsig matches BOOTSIG, it means that the exit to loader data has been provided and the function can try to start the exit process. If the signature isn\u0026rsquo;t found, it will simply power off the console (which actually causes a reset to the system menu in the DSi).\nIf the reset has been requested from the ARM7, arm7reboot() is called. Similarly, if the ARM9 has requested the reset, arm9reboot() is called. Note that in BlocksDS, arm7reboot() isn\u0026rsquo;t used anymore.\nThe last field of the struct, bootsize, is the size of the loader that arm7reboot() and arm9reboot() eventually boot into. The loader is located right after the arm7reboot() and arm9reboot() functions. It is simply appended to the bootstub code. This will be explained later.\n4. Handshake between ARM7 and ARM9 This part of the process involves the code in bootstub.s.\nThat code is quite hard to read, so this is a disassembled and commented version of that code:\n// SPDX-License-Identifier: GPL-2.0+ // // Copyright (C) 2010 Dave \u0026#34;WinterMute\u0026#34; Murphy // Copyright (C) 2023 Antonio Niño Díaz // This file is a reverse-engineered version of: // // https://github.com/devkitPro/nds-hb-menu/blob/d982d376ad8fc232c9c9b9284e26c28d0fc9d521/bootstub/bootstub.s typedef struct { uint64_t signature; // \u0026#34;bootstub\u0026#34; uintptr_t arm9reboot; uintptr_t arm7reboot; uint32_t loader_size; } bootstub_header_t; // swiSoftReset() jumps to the addresses written in the locations below after // preparing for the reset. #define BIOS_ARM7_BOOTADDR (*(uint32_t *)0x02FFFE34) #define BIOS_ARM9_BOOTADDR (*(uint32_t *)0x02FFFE24) // the FIFO handler will detect this value, sync with the function waitcode(), // below, then call swiSoftReset(). #define LIBNDS_RESET_CODE 0x0C04000C // The ARM7 reset vector sets the reset address of the ARM9 to the reset vector // of the ARM9, then it forces the ARM9 to call swiSoftReset() and jump to that // vector. The ARM9 will then start the actual reset process, including telling // the ARM7 to call swiSoftReset(). void hook9from7(void) // arm7reboot() -\u0026gt; this has to run on the ARM7 { // Tell the ARM9 to run this function after swiSoftReset() BIOS_ARM9_BOOTADDR = hook7from9; // Tell the ARM9 to sync with the ARM7 and call swiSoftReset() REG_IPC_FIFO_TX = LIBNDS_RESET_CODE; // ARM7 bootcode can be loaded here (37F8000h..3807DFFh) uint32_t *ARM7BASE = 0x037F8000; // Copy both the waitcode() and waitsync() code to ARM7BASE memcpy(ARM7BASE, waitcode, sizeof(waitcode) + sizeof(waitsync)); ARM7BASE() // After returning from ARM7BASE(), the ARM7 returns to __libnds_exit() and // gets trapped in an infinite loop. } void waitcode(void) { waitsync(1) REG_IPC_SYNC = 0x100; waitsync(0) REG_IPC_SYNC = 0x0; } void waitsync(uint32_t val) { while ((REG_IPC_SYNC \u0026amp; 0x000F) != val); } // The ARM9 reset vector disables the cache, loads the loader code to VRAM_C, // sets VRAM_C as the boot address of the ARM7 after a reset, and forces the // ARM7 to call swiSoftReset() and jump to that address. The ARM9 will stay in // an infinite loop until the ARM7 gives it a boot address. It\u0026#39;s the // responsibility of the loader to provide this address to the ARM9. void hook7from9(void) // arm9reboot() -\u0026gt; this has to run on the ARM9 { REG_IME = 0; // ldr r1, 0x2078 @ disable TCM and protection unit // mcr p15, 0, r1, c1, c0 // // @ Disable cache // mov r0, #0 // mcr p15, 0, r0, c7, c5, 0 @ Instruction cache // mcr p15, 0, r0, c7, c6, 0 @ Data cache // mcr p15, 0, r0, c3, c0, 0 @ write buffer // // @ Wait for write buffer to empty // mcr p15, 0, r0, c7, c10, 4 REG_VRAMCNT_C = VRAM_ENABLE | VRAM_C_LCD; // This is the loader code provided right after the bootstub code. The size // is specified in the bootstub header. It will run in the ARM7, not the // ARM9. The loader code comes from here: // // https://github.com/devkitPro/nds-bootloader/tree/69cea3c5b7f3278f4b63672d345d0009b7f7d62d // // Its purpose is to reload nds-hb-menu and jump to it memcpy(VRAM_C, _loader, _loader_size) REG_VRAMCNT_C = VRAM_ENABLE | VRAM_C_ARM7_0x06000000; // Mapped to 6000000h REG_EXMEMCNT |= (1 \u0026lt;\u0026lt; 11) | (1 \u0026lt;\u0026lt; 7); // ARM7 owns both Slot-1 and Slot-2 // Tell the ARM7 to run the code in VRAM_C after swiSoftReset() BIOS_ARM7_BOOTADDR = 0x06000000; // Tell the ARM7 to sync with the ARM9 and call swiSoftReset() REG_IPC_FIFO_TX = LIBNDS_RESET_CODE; waitsync(1) REG_IPC_SYNC = 0x100; waitsync(0) REG_IPC_SYNC = 0x0; // Set up and enter passme loop // Basically, we setup the value of 0x02fffe04 to be a branch to the address // stored in 0x02fffe24. Initially, this address is 0x02fffe04, so this is // an infinite loop until something writes to 0x02fffe24 and frees the ARM9. #define ARM9_BRANCH_ADDRESS (uint32_t *)0x02fffe04 #define ARM9_BRANCH_DESTINATION (uint32_t *)0x02fffe24 *ARM9_BRANCH_ADDRESS = 0xE59FF018; // ldr r15, [r15 + 0x20] *ARM9_BRANCH_DESTINATION = ARM9_BRANCH_ADDRESS; ARM9_BRANCH_ADDRESS(); } Exit from ARM7 This process is different in devkitPro and BlocksDS. The version of BlocksDS is slightly simplified compared to devkitPro (it simplifies exit from the ARM7 by reducing it to the case of exit from the ARM9). BlocksDS reserves two different FIFO command IDs, one for each CPU, while devkitPro uses the same command ID for both CPUs.\nBlocksDS:\nThe ARM7 sends command 0x0C04000B using the FIFO registers. It corresponds to the following:\nFIFO_ADDRESSBIT | FIFO_IMMEDIATEBIT | FIFO_ARM7_REQUESTS_ARM9_RESET The ARM7 enters an infinite loop with interrupts enabled.\nThe ARM9 receives the message, which causes an interrupt.\nThe ARM9 FIFO interrupt handler sees this special message (FIFO_ADDRESSBIT and FIFO_IMMEDIATEBIT are never used together in normal messages) and it calls exit(), which eventually calls arm9reboot(). This means that, at this point, the process is the same as when the reset has been started from the ARM9.\ndevkitPro:\nThe ARM7 calls arm7reboot().\narm7reboot() writes the address of arm9reboot() to address BIOS_ARM9_BOOTADDR (0x02FFFE24). This is a special location known by the BIOS, used later.\narm7reboot() sends command 0x0C04000C to the ARM9.\nThe ARM7 enters a sync routine that uses register REG_IPC_SYNC to synchronize both CPUs.\nThe ARM9 FIFO interrupt handler sees this special message and it enters a similar sync procedure.\nWhen the sync procedure is over, the ARM7 enters an infinite loop, and the ARM9 calls swiSoftReset().\nswiSoftReset() makes the ARM9 jump to the address in BIOS_ARM9_BOOTADDR. This means that, at this point, the process is the same as when the reset has been started from the ARM9.\nExit from ARM9 arm9reboot() is called by the ARM9.\nIt disables interrupts, the cache, TCM and the protection unit, and cleans the cache.\nIt copies to VRAM_C the loader appended right after the bootstub code. It copies bootsize bytes in total. Then, it sets up VRAM_C as ARM7 RAM mapped to address 0x06000000. It\u0026rsquo;s important to notice that the loader boot code is ARM7 code, this will be explained later.\nIt switches the ownership of Slot-1 and Slot-2 to the ARM7.\nIt sets the ARM7 start address (specified in BIOS_ARM7_BOOTADDR, address 0x02FFFE34) as the start of VRAM_C (mapped to 0x06000000).\nIt sends command 0x0C04000C to the ARM7.\nFIFO_ADDRESSBIT | FIFO_IMMEDIATEBIT | FIFO_ARM9_REQUESTS_ARM7_RESET The ARM9 and the ARM7 synchronize using REG_IPC_SYNC.\nThe ARM9 setups a boot loop that jumps forever to the address stored in 0x02FFFE24.\nThe ARM7 calls swiSoftReset(), which makes it jump to the start of the loader in VRAM_C.\nSome loader code runs in the ARM7 (read the next section).\nEventually, the loader code will write an address to 0x02FFFE24 so that the ARM9 can end the boot loop and jump to the ARM9 code that will continue the process.\n5. Loader of bootloader This code runs from VRAM_C, and initially it runs on the ARM7 only. The ARM7 must copy the ARM9 code somewhere outside of VRAM_C (it has been mapped to the ARM7 so it is hidden from the ARM9). When the code of the ARM9 has been loaded to its final destination, the ARM7 tells the ARM9 to jump there.\nThis loader is a small application that can use DLDI or the DSi SD driver to load an application from the SD card, and then it boots that application.\nIn the case of the NDS Homebrew Menu, this loader loads the NDS ROM of the NDS Homebrew Menu. This way, from the point of view of the user, the application returns to the loader. In reality, the application hasn\u0026rsquo;t returned to the loader, it has just loaded the loader again!\n","description":"1. Introduction Normally, the only way to exit a DS application is to switch the console off and turn it on again. It can get annoying to do this if you\u0026rsquo;re, for example, testing many applications. libnds supports a protocol that allows an application loader (such as the menu of a flashcart) to setup an exit routine that allows the application to return to the loader. This is needed because the DS doesn\u0026rsquo;t have an OS, so the protocol is managed manually."},{"id":8,"href":"/docs/technical/filesystem/","title":"Filesystem support","parent":"Technical information","content":" 1. Introduction BlocksDS supports using standard C functions to access the filesystem. It is possible to use them to access both the SD cards of flashcarts, and the internal SD slot of the DSi. This code is integrated in libnds, so you don\u0026rsquo;t need to do anything special to use it.\nAdd the following to your project:\n#include \u0026lt;fat.h\u0026gt; int main(int argc, char *argv[]) { bool init_ok = fatInitDefault(); if (!init_ok) { // Handle error } // Rest of the code } This function whether it\u0026rsquo;s running on a regular DS or a DSi.\nDS: It will try to use DLDI to initialize access to the SD card of the flashcart. If it isn\u0026rsquo;t possible it returns false. If it succeedes, it returns true.\nDSi: It will try to initialize access to the internal SD slot, and the SD of the flashcart. It will only return false if the internal slot of the DSi can\u0026rsquo;t be accessed, and it will return true if it can.\nThe initial working directory is \u0026ldquo;fat:/\u0026rdquo; on the DS (DLDI), and \u0026ldquo;sd:/\u0026rdquo; on DSi. On the DSi it is possible to switch between both filesystems with chdir().\nIt is also possible to embed a filesystem in the NDS ROM with NitroFS. This is a good way to keep all the assets and code of your game as one single file. You can access files in this filesystem by using the drive name nitro:/ in any path provided to the C library functions.\n#include \u0026lt;filesystem.h\u0026gt; int main(int argc, char *argv[]) { // Call fatInitDefault() here if you want. bool init_ok = nitroFSInit(NULL); if (!init_ok) { // Handle error. You probably want to hang here if NitroFS can´t be // read, because all of your assets will be unavailable. Another // option is to return from main() or call exit() to return to the // loader. } // Rest of the code } Check this example to see how to use NitroFS.\n2. Supported functions You may use functions such as fopen, fread, fwrite, fseek, fclose, stat, rename, truncate, mkdir, unlink, access, chdir, getcwd. fstat works, but a limitation: it doesn\u0026rsquo;t have access to the modification date of the file, while stat does.\nYou can also use open, read, write, lseek and close, but this isn\u0026rsquo;t as common.\nThe dirent.h functions to read the contents of directories are available: opendir, closedir, readdir, rewinddir, seekdir, telldir.\nIt\u0026rsquo;s easy to find information online about how to use all of them. If any specific function isn\u0026rsquo;t supported, raise an issue to request it.\n3. Running on hardware If your flashcart doesn\u0026rsquo;t do it automatically, patch your ROM with the DLDI patcher. Most flashcarts do this automatically.\n4. Running on emulators Filesystem access works in several emulators. The following ones have been tested:\nmelonDS: The ROM runs in DS/DSi mode. no$gba: The ROM runs in DSi mode. A FAT image needs to be used. DeSmuMe: The ROM needs to be DLDI patched, it only runs in DS mode. melonDS melonDS supports both DLDI in DS/DSi modes, and the internal SD in DSi mode.\nIt supports using a folder as a base for the SD of the DSi, or for a DLDI device for DS.\nOpen \u0026ldquo;Emu settings\u0026rdquo;. The \u0026ldquo;DSi mode\u0026rdquo; and \u0026ldquo;DLDI\u0026rdquo; tabs let you select the folders to use as root of the filesystems (or the filesystem images to be used, if you prefer that).\nno$gba no$gba supports DSi mode. You must generate a FAT filesystem image with tools/imgbuild. The sample Makefile of the provided templates have a target that lets you do this automatically. Open the Makefile and set the variables SDROOT and SDIMAGE. To build the image, run:\nmake sdimage no$gba requires that the image is called DSi-1.sd and is located in the same directory as no$gba. Set SDIMAGE to \u0026lt;path-to-folder\u0026gt;/DSi-1.sd to avoid renaming the file all the time.\nThen, open no$gba as normal.\nDeSmuMe It supports DS mode only. Run the following command when building the ROM:\nmake dldipatch This will patch the ROM with the DLDI driver of the R4, which is required for the emulator to access the filesystem.\nYou will need to set the \u0026ldquo;Slot 1\u0026rdquo; configuration to \u0026ldquo;R4\u0026rdquo;, and set the directory to the folder that will act as root of your filesystem. If using DeSmuMe with a graphical interface, the settings can be found in \u0026ldquo;Config \u0026gt; Slot 1\u0026rdquo;. If using it through the command line, run it like this:\ndesmume --slot1=R4 --slot1-fat-dir=\u0026lt;path-to-folder\u0026gt; \u0026lt;path-to-rom\u0026gt;.nds ","description":"1. Introduction BlocksDS supports using standard C functions to access the filesystem. It is possible to use them to access both the SD cards of flashcarts, and the internal SD slot of the DSi. This code is integrated in libnds, so you don\u0026rsquo;t need to do anything special to use it.\nAdd the following to your project:\n#include \u0026lt;fat.h\u0026gt; int main(int argc, char *argv[]) { bool init_ok = fatInitDefault(); if (!"},{"id":9,"href":"/docs/design/","title":"Additional information","parent":"BlocksDS Documentation","content":"","description":""},{"id":10,"href":"/docs/technical/memory_map/","title":"Memory map","parent":"Technical information","content":" 1. Introduction The DS has several RAM regions that are distributed across its address space. In most cases you don\u0026rsquo;t need to worry about the details, as libnds is set up in a way that covers most use-cases. All you normally need to worry about is how to allocate VRAM to be used by the 2D and 3D engines. However, in some cases it may be needed to understand how everything works.\n2. Memory map 2.1 ARM9 Memory Map Address Size Description 0x0000000 32 KB Instruction TCM (ITCM) (mirror-able to 1000000h) 0xxxxx000 16 KB Data TCM (DTCM) (moveable) 0x2000000 4 MB Main RAM (8 MB in debugger consoles) 0x3000000 0/16/32 KB Shared WRAM 0x4000000 - I/O registers 0x5000000 2 KB Standard palette RAM (for 2D BGs and sprites) 0x6000000 - VRAM 0x7000000 2 KB OAM (for 2D sprites) 0x8000000 32 MB GBA slot ROM/RAM 0xA000000 64 KB GBA slot SRAM 0xFFFF0000 32 KB ARM9 BIOS 2.2 ARM7 Memory Map Address Size Description 0x0000000 16 KB ARM7 BIOS 0x2000000 4 MB Main RAM (8 MB in debugger consoles) 0x3000000 0/16/32 KB Shared WRAM 0x3800000 64 KB ARM7 WRAM (64KB) 0x4000000 - I/O registers 0x6000000 - VRAM allocated as Work RAM to the ARM7 0x8000000 32 MB GBA slot ROM/RAM 0xA000000 64 KB GBA slot SRAM 2.3 DSi changes ARM7 BIOS is 64 KB instead of 16 KB. ARM9 BIOS is 64 KB instead of 32 KB. Main RAM is quadrupled to 16 MB (32 MB in debugger consoles). An additional 768 KB of WRAM is provided, referred to as NWRAM. The GBA slot ROM and RAM areas are filled with 0xFF. At 0xC000000 there is a mirror of main RAM. 3. Memory Protection Unit (MPU) The ARM9 has a MPU, as well as data and instruction caches. The MPU lets you:\nDefine which parts of the address space can be read/written. If you try to read or write an address that you\u0026rsquo;re not allowed to, you will cause a data abort exception. Decide which parts of the address space can be executed as code. Decide which parts of the address space are cached. The MPU doesn\u0026rsquo;t let you remap any memory block. However, most memory regions are mirrored. For example, on a regular DS, main RAM starts at 0x2000000, and the next memory can be found at address 0x3000000. In total, this is 16 MB. However, main RAM is only 4 MB in size. Mirroring means that the 4 MB are repeated a total of 4 times until address 0x3000000.\nMirrors allow us to do clever things with the MPU:\nITCM is mapped at address 0x0000000, but it is repeated until 0x2000000. Using it at address 0x0000000 is problematic because NULL would become a valid address, and normally we want it to be invalid, so that reads/writes to a NULL pointer cause exceptions. With the MPU we can block accesses to the first mirror of ITCM, and we can only let programs access it at address 0x1000000. Normally we want main RAM to be cached. However, it can be very useful to access it without cache in some cases. We can use the MPU to enable accesses to one of the mirrors as cached memory, and to a different mirror as uncached memory. Even without an MPU, mirrors can be useful:\nThe BIOS exception vector address as well as the pointer to the top of exception stack is stored at the end of main RAM. We could calculate the right address of the end of the RAM for all DS models, but it\u0026rsquo;s easier to access it at the last mirror of main RAM right before 0x3000000, so that it\u0026rsquo;s the same address in all models. Shared WRAM is found at 0x3000000, but it is mirrored up to 0x3800000, where ARM7 WRAM starts. This means that it is possible to use the last mirror of shared WRAM and the first mirror of ARM7 WRAM as one contiguous memory block. The regions of the address space that are cached in libnds are the ARM9 BIOS, and main RAM. ITCM and DTCM aren\u0026rsquo;t supposed to be cached.\nIf you want to know all the details of the MPU setup, you can check the code in libnds, which is fairly well documented.\nNote that slot 2 memory is normally uncached, but libnds provides helpers to use RAM slot 2 cartridges, and it allows the developer to enable cache for them if desired.\n4. Main RAM 4.1. Configuration The size and location of main RAM changes depending on the console model. All of them have main RAM starting at address 0x2000000, this table shows the differences:\nModel Size Mirrors Retail DS 4 MB 0x2400000, 0x2800000, 0x2C00000 Debugger DS 8 MB 0x2800000 Retail DSi 16 MB 0xC000000 Debugger DSi 16+16 MB 0xC000000 All mirrors are uncached in libnds.\nOn the DSi, the register SCFG_EXT allows the developer to set the limit of main RAM. It allows you to map 4, 16 or 32 MB of RAM to the adddress space:\n4 MB: Used as DS compatibility mode, the other 12 MB will be mirrors of the first 4 MB instead of more RAM. 16 MB: Normal setting. 32 MB: On a DSi debugger, it will expose the additional 16 MB of RAM. On a retail DSi, the additional 16 MB will be a mirror of the first 16 MB. You may have realized that the debugger DSi model doesn\u0026rsquo;t have enough space at 0x2000000-0x3000000 for the full 32 MB of RAM, only for 16 MB. Unfortunately, the additional 16 MB can only be accessed at 0xD000000. This means that, according to the setup of libnds, this area is uncached.\nDebugger DSi consoles are very unusual, so they aren\u0026rsquo;t a real concern. However, 3DS consoles in DSi mode can access the full 32 MB that would correspond to a DSi debugger unit. Because of this, it is interesting to support the full 32 MB of RAM.\n4.2. Reserved areas The last 48 KB of main RAM is reserved by libnds and/or contains data provided by the .nds loader:\nAddress Description 0x2FF0000 libnds shadows this area with DTCM, making it inaccessible through this address. 0x2FF4000 devkitARM bootstub structure. Used for implementing the exit to loader protocol. 0x2FFE000 DSi only: .nds header - 0x1000 bytes. 0x2FFF000 libnds ARM9/ARM7 internal IPC region. (Mostly) deprecated. 0x2FFFC80 DS/DSi: user settings loaded from flash memory. 0x2FFFD9C DS/DSi: ARM9 exception vector, as well as top of stack. 0x2FFFE00 DS/DSi: .nds header - 0x160 bytes on DSi, 0x170 bytes on NDS. 0x2FFFE70 devkitARM argv structure. Used for implementing argument passing. 4.3. Caveats Note that, if both CPUs are accessing main RAM at the same time, there will be penalties that will delay accesses. Ideally, ARM9 and ARM7 should use different memory regions so that this doesn\u0026rsquo;t happen. That\u0026rsquo;s why the ARM7 normally only uses ARM7 WRAM and Shared WRAM (which is always mapped to the ARM7 by libnds). This way the ARM7 has access to 96 KB of WRAM, which isn\u0026rsquo;t much, but it\u0026rsquo;s normally enough.\n5. ITCM and DTCM Because of how fast it is, DTCM is used for the stack of the ARM9. DTCM can be mapped anywhere, and libnds maps the 16 KB of DTCM at 0x2FF0000-0x2FF4000. Developers may use DTCM for their own variables, but that will reduce the amount of stack available, so be careful when doing that.\nYou may notice that this overlaps with 16 KB of main RAM in DSi consoles. Yes, the main RAM that is hidden by DTCM can only be accessed through the uncached main RAM mirror in this case.\nITCM is similarly fast, and it is used by libnds for time-sensitive code like exception handlers. Developers may use the remaining space for anything they like.\nSomething very important to consider is that only the ARM9 sees ITCM and DTCM. The ARM7 can\u0026rsquo;t see them, so you can\u0026rsquo;t use them to share data between CPUs. Also, the DMA doesn\u0026rsquo;t see ITCM or DTCM, so you can\u0026rsquo;t use it to copy data when the source or destination is in ITCM or DTCM, you will have to use a regular CPU copy.\nITCM can\u0026rsquo;t be remapped, but the 32 KB of ITCM are mirrored from 0x0000000 to 0x2000000. It is important to allow the CPU to access the first few KB of ITCM at address 0x0000000 because that\u0026rsquo;s where the CPU expects the exception vectors, but address 0x0000000 is very inconvenient from the point of view of development. Normally, NULL doesn\u0026rsquo;t point to valid memory. It would be better to not use any pointer that is too close to NULL. That\u0026rsquo;s why libnds sets up the MPU so that ITCM is accessed at address 0x1000000.\n6. ARM7 WRAM and Shared WRAM This WRAM is available for the ARM7 only. It\u0026rsquo;s fairly small, only 64 KB. However, this is the main RAM that the ARM7 should use, as it will leave main RAM to be freely accessed without any penalty by the ARM9.\nShared WRAM can be mapped to the ARM9 or ARM7 as two blocks of 16 KB. However, because the ARM7 WRAM is so small, libnds allocates all of it to the ARM7 in a way that the 32 KB of shared WRAM go right before the 64 KB of ARM7 WRAM, for a total of 96 KB of WRAM.\n6.1. Reserved areas The last 64 bytes of ARM7 WRAM is reserved for the NDS BIOS:\nAddress Description 0x380FFC0 BIOS auxillary (DSi-specific) IRQ acknowledgement 0x380FFDC ARM7 exception vector, as well as top of stack. 0x380FFF8 BIOS IRQ acknowledgement 0x380FFFC BIOS IRQ handler access 6.2. DSi Shared WRAM (NWRAM) The DSi introduces 3 new banks of WRAM (libnds calls it NWRAM). Each one of the banks (A, B and C) are 256 KB in size. Each bank is divided in 32 KB slots that can be assigned to ARM7 or ARM9. In the case of NWRAM-B and C, they can also be assigned as memory to the DSP.\nThis WRAM is a bit problematic.\nFirst, there is SCFG_EXT. This register can disable access to the SCFG and MBK registers (bit 31). If the loader of the NDS ROM doesn\u0026rsquo;t have enough privileges and it loads the NDS ROM with this bit set to 0, the ROM won\u0026rsquo;t be able to reconfigure the SCFG or MBK registers.\nThen, there are registers called MBK1 up to MBK9, which are used to configure NWRAM. MBK9 can disable access to registers MBK1 to MBK5, the same registers that enable or disable the new WRAM banks.\nNintendo seems to use the convention that WRAM-A is always mapped to the ARM7, and it\u0026rsquo;s mapped to address 0x3000000. This is reliable enough that libnds uses the same convention and always allocates WRAM-A to the ARM7 at the same address.\nHowever, WRAM-B and C don\u0026rsquo;t seem to have any specific convention (and they need to be allocated to the DSP if the DSP is used) so there isn\u0026rsquo;t any specific default in libnds for them.\nThe functions that map WRAM-A/B/C in libnds always check the MBK9 register to ensure that it is possible to modify the settings before trying to do it.\nFinal note: The DSi ROM header has some fields that are used as default values for all MBK registers. However, it doesn\u0026rsquo;t look like all homebrew loaders use them, so we can\u0026rsquo;t rely on them.\n7. GBA slot In DS consoles it is possible to access the GBA slot starting at address 0x8000000. While it is possible to use this to read the ROM of GBA cartridges, the main situation where this memory region is useful is when there is a RAM expansion pack or some sensor or input device connected to the GBA slot.\nNormally this memory region is uncached because libnds can\u0026rsquo;t make any assumption of what the GBA slot will contain, but developers can reconfigure this region as cached (which could be useful if a RAM expansion pack is detected).\nAlso, note that RAM in this memory region can\u0026rsquo;t be written in 8-bit units, only in 16 or 32-bit units.\n8. VRAM VRAM mappings aren\u0026rsquo;t very intuitive. Let\u0026rsquo;s explain this with an example.\nThe developer configures background 2 of the main screen as a 256x256 16-bit bitmap, using map base 0. The 2D graphics engine will try to render it by reading from addresses 0x06000000 to 0x06020000. The developer must ensure that there is memory mapped to that memory range. For that, the developer must setup one of the VRAM banks (A to I) as main engine background VRAM.\nFor example, the developer can map VRAM A as main engine background RAM:\nvramSetBankA(VRAM_A_MAIN_BG_0x06000000); This will map all of the 128 KB of VRAM A starting at address 0x6000000. It is possible to use other VRAM banks for the same purpose. Any of the following 3 lines would have the same effect:\nvramSetBankB(VRAM_B_MAIN_BG_0x06000000); vramSetBankC(VRAM_C_MAIN_BG_0x06000000); vramSetBankD(VRAM_D_MAIN_BG_0x06000000); (VRAM banks E, F and G can also be used as main engine background VRAM, but they aren\u0026rsquo;t big enough to hold a 256x256 16-bit bitmap!)\nIf you want to allocate all VRAM A to D banks for main screen backgrounds, you could do something like this:\nvramSetBankA(VRAM_A_MAIN_BG_0x06000000); vramSetBankB(VRAM_B_MAIN_BG_0x06020000); vramSetBankC(VRAM_C_MAIN_BG_0x06040000); vramSetBankD(VRAM_D_MAIN_BG_0x06060000); You can write from the CPU to the addresses that you have just mapped if you want to modify the data in VRAM.\nThis is the end of the explanation for backgrounds. For sprites, the explanation is the same.\nHowever, 3D texture data, texture palette, and extended sprite/background palettes are different. It isn\u0026rsquo;t possible for the CPU and the graphics engines to access them at the same time. For that reason, it is needed to copy data to them while they are in LCDC mode. This mode maps VRAM to the CPU, but the graphics engines can\u0026rsquo;t access VRAM.\nFor example, to load texture data and texture palettes, map the banks as LCDC:\nvramSetBankA(VRAM_A_LCD); vramSetBankB(VRAM_B_LCD); vramSetBankE(VRAM_E_LCD); This will make VRAM A and B available starting at address 0x6800000, and VRAM E available starting at address 0x6880000. After the data has been copied to VRAM you can set them up as texture data and texture palette RAM:\nvramSetBankA(VRAM_A_TEXTURE_SLOT0); vramSetBankB(VRAM_B_TEXTURE_SLOT1); vramSetBankE(VRAM_E_TEX_PALETTE); The addresses where VRAM can be mapped are:\nBase address Which engine Usage 0x6000000 Main engine BG VRAM (max 512KB) 0x6200000 Sub engine BG VRAM (max 128KB) 0x6400000 Main engine Sprite VRAM (max 256KB) 0x6600000 Sub engine Sprite VRAM (max 128KB) 0x6800000 LCDC LCDC-allocated (max 656KB) LCDC mode is also special in another way. The main graphics engine can capture its output and save it to one of the main VRAM banks (A to D). For that to work, the bank needs to be setup as LCDC.\nIt is also possible to setup one of the main VRAM banks as LCDC and ask the main graphics engine to render its contents directly to the screen. This is equivalent to using that VRAM bank as a framebuffer.\nIf you want to configure VRAM in a visual way, you should use mtheall\u0026rsquo;s NDS Homebrew VRAM Banks Selector and NDS Homebrew VRAM BG Allocation Conflict Viewer.\n","description":"1. Introduction The DS has several RAM regions that are distributed across its address space. In most cases you don\u0026rsquo;t need to worry about the details, as libnds is set up in a way that covers most use-cases. All you normally need to worry about is how to allocate VRAM to be used by the 2D and 3D engines. However, in some cases it may be needed to understand how everything works."},{"id":11,"href":"/docs/technical/dldi_arm7/","title":"DLDI in ARM7","parent":"Technical information","content":" 1. Introduction DLDI (Dynamically Linked Disc Interface) is an interface designed for homebrew projects to be able to access the memory of flashcarts (usually micro SD cards) in a standardized way. https://www.chishm.com/DLDI/\nIn short, when you build an application, the DLDI stub is added to your application. Then you and your users have to patch your application with the DLDI driver your flashcarts. Most flashcarts patch homebrew NDS ROMs, so normally you don\u0026rsquo;t need to worry about it, it just works. Some old flashcarts (specially slot-2 flashcarts) don\u0026rsquo;t support this, so you have to patch ROMs yourself. DeSmuME doesn\u0026rsquo;t autopatch ROMS, for example, while melonDS does.\nThis is an archive of DLDI drivers: https://github.com/DS-Homebrew/DLDI\n2. Why is DLDI in ARM7 important? Reading files with DLDI is very slow because reading from SD cards is very slow. It\u0026rsquo;s not limited to DLDI. Regular cartridge read commands (like the ones used by offical games) are also slow. Traditionally this process happens in the ARM9.\nThis means that, if you have a game that has a 3D open world, and you want to move around the world while loading and unloading models and textures from the filesystem you can\u0026rsquo;t do it in the same CPU. The ARM9 is too busy with the game logic, it can\u0026rsquo;t just stop until it has finished reading a file.\nThe fix is to use the ARM7 to do the reads while the ARM9 is doing other things. Note that, at the time of writing this document, while DLDI in ARM7 is supported, there is no way to do asynchronous reads yet. For this, a cooperative multithreading scheduler is needed. This has a high priority in the to-do list of this SDK.\n3. Supported flashcarts The main drawback of this approach is that not all flashcarts support this. Some DLDI drivers have been built for the ARM9 and will crash in the ARM7, for example. This is why DLDI in ARM7 isn\u0026rsquo;t enforced. The current code supports using DLDI from both ARM9 and ARM7 without rebuilding the application.\n4. Adding support to a DLDI driver All you need to do is to make sure that your code is built for the ARM7 instead of the ARM9. Use -mcpu=arm7tdmi instead of -mcpu=arm946e-s+nofp.\nThen add the following flag to the features entry of your DLDI header:\n#define FEATURE_ARM7_CAPABLE 0x00000100 BlocksDS\u0026rsquo;s fork of libnds will detect this flag and switch to using DLDI from the ARM7.\n5. Using DLDI with BlocksDS If your application doesn\u0026rsquo;t care about which CPU uses DLDI, you don\u0026rsquo;t have to do anything. Any driver marked with FEATURE_ARM7_CAPABLE will run from the ARM7, and any driver without the mark will run from the ARM9. If you want to force a certain CPU to do it, you can do it this way:\n#include \u0026lt;nds/arm9/dldi.h\u0026gt; // Set the DLDI mode dldiSetMode(DLDI_MODE_ARM9); // or DLDI_MODE_AUTODETECT or DLDI_MODE_ARM7 // Get the current mode. This is set to DLDI_MODE_ARM9 or DLDI_MODE_ARM7 // after initializing the FAT system. DLDI_MODE dldi_mode = dldiGetMode(void); 6. Supported flashcarts This is a list of flashcarts that have been reported to work. Please, test your flashcart using this test and report your findings.\nflashcart ARM9 ARM7 Notes Acekard 2i Yes Yes SuperCard DSTWO Yes Yes Original R4 Yes Yes ","description":"1. Introduction DLDI (Dynamically Linked Disc Interface) is an interface designed for homebrew projects to be able to access the memory of flashcarts (usually micro SD cards) in a standardized way. https://www.chishm.com/DLDI/\nIn short, when you build an application, the DLDI stub is added to your application. Then you and your users have to patch your application with the DLDI driver your flashcarts. Most flashcarts patch homebrew NDS ROMs, so normally you don\u0026rsquo;t need to worry about it, it just works."},{"id":12,"href":"/docs/introduction/support/","title":"Getting support","parent":"Introduction","content":"If you want to report any bugs or suggest new features and make sure they aren\u0026rsquo;t forgotten, use the GitHub issue tracker of BlocksDS.\nIf you prefer to chat with other developers in real time, the best way is to join the gbadev Discord server, where we hang out. This is a community of GBA game developers, and it has a small section for NDS developent. The NDS is in many ways an upgraded GBA, so most of the discussions about the GBA are still useful.\nNote that there aren\u0026rsquo;t any Discord invitations here because they sometimes change. You can find the invitation in this link.\n","description":"If you want to report any bugs or suggest new features and make sure they aren\u0026rsquo;t forgotten, use the GitHub issue tracker of BlocksDS.\nIf you prefer to chat with other developers in real time, the best way is to join the gbadev Discord server, where we hang out. This is a community of GBA game developers, and it has a small section for NDS developent. The NDS is in many ways an upgraded GBA, so most of the discussions about the GBA are still useful."},{"id":13,"href":"/docs/setup/extra_steps/","title":"Extra steps","parent":"Setup instructions","content":" 1. Test To test that everything is working, you can try building one of the examples or project templates included in BlocksDS.\nThere is a template that lets the programmer write the code for both CPUs of the NDS (rom_combined) and a template that uses the default ARM7 core that comes with Blocks DS and lets the programmer focus on the ARM9 core (rom_arm9). There are also two templates to create static libraries.\nFor example, go to the combined template folder and build it:\ncd templates/rom_combined make This should have generated a NDS ROM that you can run on any emulator or flashcart.\nTo do a verbose build, run make like this (this also works for the Makefile of the SDK):\nVERBOSE=1 make NOTE: The paths in the Makefile that refer to source code, includes, graphics, data, etc, must be inside the folder of the project. That means you can\u0026rsquo;t use .. in a path to go one level up from the Makefile. If you really need to use folders outside of the folder of the project, create a symlink to the destination, or build the other code as a static library and link it with the project.\n2. Additional libraries and tools This document has a list of tools and libraries that support BlocksDS and can be installed in /opt/blocksds/external.\n3. Keeping multiple versions of BlocksDS You may keep multiple versions of this SDK in your PC. The location of the active SDK is stored in the environment variables BLOCKSDS and BLOCKSDSEXT, so all you need to do is to change their values and point to the version of the SDK you want to use.\nBy default, the paths are assumed to be /opt/blocksds/core/ and /opt/blocksds/external/. The first one is used for core BlocksDS libraries and tools, and it is managed by BlocksDS. The second one is left for users to freely install third party libraries and tools.\n","description":"1. Test To test that everything is working, you can try building one of the examples or project templates included in BlocksDS.\nThere is a template that lets the programmer write the code for both CPUs of the NDS (rom_combined) and a template that uses the default ARM7 core that comes with Blocks DS and lets the programmer focus on the ARM9 core (rom_arm9). There are also two templates to create static libraries."},{"id":14,"href":"/docs/technical/optimization_guide/","title":"Optimization guide","parent":"Technical information","content":"This guide covers some techniques one can use to optimize DS/DSi homebrew with BlocksDS.\nOptimizing CPU usage Measure CPU performance on hardware only! As of writing (May 2024), the most popular emulators are not sufficiently cycle-accurate to provide accurate profiling results; this might lead, at worst, to mistaken optimizations. Avoid using floating point values (float, double). As the DS does not include any hardware for accelerating floating point math, operations on them have to be emulated in software, which is quite costly. On the ARM9, place \u0026ldquo;hot\u0026rdquo; (often used) code and data in ITCM and DTCM, respectively. More information is available below. ITCM and DTCM ITCM stands for Instruction Tightly Coupled Memory, and on the DS refers to 32 kilobytes of fast memory connected directly to the ARM9 CPU to be used for instruction code. Analogously, DTCM refers to 16 kilobytes of Data Tightly Coupled Memory.\nTo place a function in ITCM or DTCM, you can use one of two approaches:\nRename the .c or .cpp file containing it to use the .itcm.c, .itcm.cpp, .dtcm.c or .dtcm.cpp suffix instead - to move the file\u0026rsquo;s entire contents, Annotate the specific function with one of the following macros: ITCM_CODE - for code, DTCM_DATA - for data pre-initialized with values, DTCM_BSS - for data which is not pre-initialized or is filled with zeros. Note that neither ITCM nor DTCM are accessible to hardware external to the ARM9 main CPU, such as the ARM7 or the DMA hardware.\nMore details, as well as information on how to use ITCM/DTCM in assembly code, is available in the usage notes.\nReducing memory usage By default, the versions of printf() and scanf() linked by the toolchain contain code to handle float and double values. The required conversion code costs a few kilobytes of memory. Instead, integer versions can be utilized, as documented below. Integer versions of stdio.h functions By default, the build of picolibc of BlocksDS makes printf(), sscanf() and similar functions support float and double conversions. This is done to maintain compatibility with existing code (and the C standard), but it increases the size of the final binaries. It is possible to switch to integer-only versions of the functions by adding the following line to the DEFINES of your Makefile:\nDEFINES := [all other options go here] \\ -DPICOLIBC_LONG_LONG_PRINTF_SCANF There are additional variants available, depending on the codebase\u0026rsquo;s specific requirements:\n-DPICOLIBC_DOUBLE_PRINTF_SCANF: the default; supports float and double values. -DPICOLIBC_FLOAT_PRINTF_SCANF: supports float values, but not doubles. -DPICOLIBC_LONG_LONG_PRINTF_SCANF: supports all integer types, but not float types. -DPICOLIBC_INTEGER_PRINTF_SCANF: supports 32-bit integer types, but not 64-bit integer types such as long long or float types. -DPICOLIBC_MINIMAL_PRINTF_SCANF: the smallest version; supports only 32-bit integer types and omits support for many non-basic printf/scanf features. Full compatibility with libnds is not guaranteed at this level, and it should be used with caution. For more information, please read the relevant picolibc documentation.\nOptimizing filesystem usage If you\u0026rsquo;ve programmed for ROM-based platforms before, like the GBA, you might be used to accessing in-ROM assets or filesystems instantly. That is not the case on BlocksDS; only data loaded to memory is fast to access, while filesystem reads including NitroFS are comparatively slow. Note that the speed also differs depending on hardware. Emulators and the DSi SD card are faster than commonly available flashcarts. Some SD cards are also slower than others. In addition, fragmented FAT filesystems can be slower to read than defragmented ones. As such, one should not rely on filesystem accesses being of a particular minimum speed.\nThere are things which can be done to make the most out of filesystem I/O:\nRead larger chunks of data at a time. As starting an SD card read has latency of its own, processing more than one sector in one read call is much faster than doing so across multiple read calls. An optimal value is the size of one cluster (typically between 4 and 32 KB), though BlocksDS can also sometimes optimize reads larger than that. If your data format is based around small sequential reads, you may benefit from enabling the C standard library\u0026rsquo;s buffering mechanism using the setvbuf function. Note that this slows down random reads, as a buffered random read will require re-filling the whole buffer. For example, to allocate a 4 KB buffer for a file, one can use: setvbuf(file, NULL, _IOFBF, 4 * 1024); If your data format is based around random reads, you may benefit from enabling a lookup cache. This reduces the amount of SD card reads required for finding the location of the specific chunk of data in the filesystem. The lookup cache has to be of a certain maximum size, but on defragmented devices will typically not exceed a few hundred bytes. Note that the lookup cache is automatically enabled for NitroFS accesses. For example, to try and enable the lookup cache on a file: fatInitLookupCacheFile(file, 2 * 1024); /* 2 KB maximum lookup cache */ OpenGL-like API usage Texture formats The GL_RGB texture format isn\u0026rsquo;t actually supported by the hardware. When a texture is loaded with glTexImage2D() with format GL_RGB, it is actually converted to GL_RGBA internally by setting the alpha bit of all pixels to 1. This is pretty slow, and it isn\u0026rsquo;t normally needed because any graphics conversion tool (such as grit) can set the alpha bit to 1 when the image is converted. None of the 3D examples of BlocksDS use GL_RGB. The ones that use GL_RGBA also show how to convert images the right way.\nAlso, consider using other texture formats. GL_RGBA isn\u0026rsquo;t a very efficient way to store textures. All other formats (the ones that use palettes) use a lot less memory. In many cases GL_COMPRESSED is the best format you can use (but converting images to this format is only currently supported by ptexconv).\nBlocksDS has examples of how to use all texture formats (except for GL_RGB, which works the same way as GL_RGBA, and is never used in order to not encourage new users to use it). Take a look at the examples for more details.\nFinal note: The video capture circuit of the NDS sets the alpha bit to 1, so it isn\u0026rsquo;t needed even if you want to use the saved image as a texture, or as a 16-bit bitmap background. There is an example of how to render to a texture too.\n","description":"This guide covers some techniques one can use to optimize DS/DSi homebrew with BlocksDS.\nOptimizing CPU usage Measure CPU performance on hardware only! As of writing (May 2024), the most popular emulators are not sufficiently cycle-accurate to provide accurate profiling results; this might lead, at worst, to mistaken optimizations. Avoid using floating point values (float, double). As the DS does not include any hardware for accelerating floating point math, operations on them have to be emulated in software, which is quite costly."},{"id":15,"href":"/docs/setup/additional_libs/","title":"Additional libraries/tools","parent":"Setup instructions","content":"There are also some libraries and tools that are supported in BlocksDS, but not fully integrated with it. They are listed below.\nLibraries:\nNightFox’s Lib: Library designed to make development of 2D games easy, with support for sprites, backgrounds (even \u0026ldquo;infinite\u0026rdquo; maps), and it also has limited 2D graphics support using the 3D engine.\nNitro Engine: Library to create 3D applications. It supports dual screen 3D, static and animated models, supports all texture types, and has basic 2D support using the 3D hardware. It\u0026rsquo;s compatible with NightFox\u0026rsquo;s Lib.\ngbajpeg: Library designed to load JPEG files on GBA with very low resource usage, which also makes it a good library for NDS.\nLibDSF: Library to render text using the 3D hardware of the NDS.\nTools:\nptexconv: Tool to convert images to files in the format of the NDS. This tool is one of the few available tools that can output files in the very efficient tex4x4 format used by the GPU of the NDS.\nArchitectDS: BlocksDS comes with sample Makefiles to build projects. They don\u0026rsquo;t support many common use-cases, like converting graphics and storing them in the filesystem. They don\u0026rsquo;t support things like having multiple DSP binaries either. You can check ArchitectDS if you need a more flexible build system.\n","description":"There are also some libraries and tools that are supported in BlocksDS, but not fully integrated with it. They are listed below.\nLibraries:\nNightFox’s Lib: Library designed to make development of 2D games easy, with support for sprites, backgrounds (even \u0026ldquo;infinite\u0026rdquo; maps), and it also has limited 2D graphics support using the 3D engine.\nNitro Engine: Library to create 3D applications. It supports dual screen 3D, static and animated models, supports all texture types, and has basic 2D support using the 3D hardware."},{"id":16,"href":"/docs/introduction/credits/","title":"Credits","parent":"Introduction","content":"This project wouldn\u0026rsquo;t have been possible without:\nMany thanks to asie for his help and advice, and for Wonderful Toolchain devkitPro picolibc libnds DSWiFi Maxmod (and mmutil) grit GCC make And many others! ","description":"This project wouldn\u0026rsquo;t have been possible without:\nMany thanks to asie for his help and advice, and for Wonderful Toolchain devkitPro picolibc libnds DSWiFi Maxmod (and mmutil) grit GCC make And many others! "},{"id":17,"href":"/docs/usage/legacy_support/","title":"Legacy device/launcher support","parent":"Usage","content":"ROMs built with BlocksDS are designed first and foremost to support modern execution environments and maximize the amount of free memory available to the application. Unfortunately, some changes end up breaking compatibility with legacy homebrew execution methods.\nKnown loaders which cause issues include:\nthe PassMe/WifiMe methods, the MoonShell launcher, the Unlaunch launcher, many legacy cartridge devices. Workarounds exist to run affected homebrew software on these platforms, both from the user and developer\u0026rsquo;s perspective. A detailed explanation of the specific technical issues is also provided further below.\nUser workarounds This section is intended for users who would like to run modern homebrew on affected legacy devices and execution methods.\nnds-hb-menu The recommended way to launch a BlocksDS ROM on legacy devices is to use the nds-hb-menu launcher, which is lightweight and appropriately respects all modern homebrew standards.\nExample: Slot-1 devices Download nds-hb-menu here. The file that is required for this is BOOT.NDS. Other files in the hbmenu directory provide support for replacing some devices\u0026rsquo; launchers with nds-hb-menu directly.\nOn some devices, you may need to perform a DLDI patch, otherwise the filesystem won\u0026rsquo;t be detected. For this, you can use the dldipatch tool bundled with BlocksDS:\n/opt/blocksds/core/tools/dldipatch/dldipatch patch BOOT.NDS device_driver.dldi Example: Slot-2 devices Some Slot-2 devices require additional work for proper support.\nDownload nds-hb-menu here. The file that is required for this is BOOT.NDS.\nDownload ndsmall.bin from DarkFader\u0026rsquo;s website. A copy is also provided here.\nDownload the DLDI driver. For example, the SuperCard SD should use scsd_moon.dldi from this DLDI archive.\nConcatenate ndsmall.bin and BOOT.NDS:\ncat ndsmall.bin BOOT.NDS \u0026gt; hbmenu.sc.nds Patch this ROM with the DLDI driver:\n/opt/blocksds/core/tools/dldipatch/dldipatch patch hbmenu.sc.nds scsd_moon.dldi Copy hbmenu.sc.nds to your SD card. Any NDS homebrew ROM loaded with this loader should work.\nDeveloper workarounds This section is intended for developers who would like to understand why modern homebrew does not run on affected legacy devices and execution methods. Workarounds are provided where available, but their use is discouraged and should be limited to appropriate, specialized use cases.\nMissing argv support The argv structure was added to libnds in mid-2007; this means that any launcher written before that date, as well as many launchers written after that date (including ones as recent as Unlaunch), do not support passing command-line arguments. Most notably, this impacts the NitroFS filesystem, which - outside of Slot-2 cartridges - relies on reading argv[0] to find the .nds file it was launched from.\nAs this is a missing feature rather than a bug, there is no workaround available.\nReduced DLDI driver reserved space ROM files built from 2017 onwards only reserve 16 kilobytes, as opposed to 32 kilobytes, for the DLDI driver used to communicate with the launch device\u0026rsquo;s filesystem. This frees RAM to be used by the homebrew program. Unfortunately, some legacy launchers - most notably MoonShell - incorrectly perform the DLDI patching process when encountering such .nds files. This affects any homebrew program which links in filesystem access code (be it FAT or NitroFS), even if the code is not used at runtime.\nThere is a workaround available to emit .nds files with the larger reserved DLDI space; one has to create an assembly file (for example, dldi_size_32k.s) in the source directory with the following contents:\n.global __dldi_size .equ __dldi_size, 32768 NDS/DSi hybrid ROMs ROM files built from 2017 onwards are designed to simultaneously be both valid NDS and DSi-format ROMs. However, this fully breaks some forms of executing ROMs:\nPassMe, WifiMe and Slot-2 flashcarts launch ROMs by jumping to the beginning of the file, normally containing the game title. On older homebrew ROMs, however, a branch instruction to a small built-in .nds loader is placed there. MoonShell, in particular, also relies on said built-in .nds loader to run homebrew applications. By adding -h 0x200 to the ndstool command line arguments, an NDS-only ROM can be generated, which will work on the above environments. However, such ROMs will not work at all on DSi/3DS consoles in DSi mode, so its use is heavily discouraged.\n","description":"ROMs built with BlocksDS are designed first and foremost to support modern execution environments and maximize the amount of free memory available to the application. Unfortunately, some changes end up breaking compatibility with legacy homebrew execution methods.\nKnown loaders which cause issues include:\nthe PassMe/WifiMe methods, the MoonShell launcher, the Unlaunch launcher, many legacy cartridge devices. Workarounds exist to run affected homebrew software on these platforms, both from the user and developer\u0026rsquo;s perspective."},{"id":18,"href":"/docs/technical/updating_guide/","title":"Upgrade guide","parent":"Technical information","content":"Newer BlocksDS versions occasionally introduce breaking changes which require developer action, as well as non-breaking changes which developers are encouraged to implement. These are documented here.\nPlease refer to the changelog for a full list of changes, including additions and enhancements to the SDK which are not listed here.\nUpgrading to BlocksDS 1.3.0 General changes:\nThe ConsoleFont struct no longer takes a convertSingleColor argument. For 4bpp uses, it is recommended to instead provide 1bpp font tile data, which will be automatically unpacked to use color indices 0 and 15. Another option is to manually ensure that the tile uses color indices 0 and 15 (or 0 and 255 for 8bpp graphics). ARM7-specific changes:\nAs these commands were only intended for TSC (NTR), touchRead and touchReadTemperature were moved to a new header, tsc.h, and renamed to tscRead and tscReadTemperature respectively. In a similar fashion, cdcTouchRead is no longer available - it has been replaced by cdcTouchReadData which exposes all samples read; however, it is recommended to use touchReadData which supports both TSC (NTR) and CDC (TWL). Some macro and function names have been changed: RTC_CR, RTC_CR8 and HALT_CR have been renamed to REG_RTCCNT, REG_RTCCNT8 and REG_HALTCNT, respectively. SerialWaitBusy has been renamed to spiWaitBusy. Upgrading to BlocksDS 1.2.0 The SOUND_FREQ (ARM7) and TIMER_FREQ macros have been reworked to provide the nearest frequency to the one requested by the user, rounded. This changes their returned values in some cases; you may want to validate your uses of these macros. In gl2d.h, glLoadSpriteSet now expects an array of uint16_t integers for texture coordinates, rather than 32-bit unsigned ints. This has been done to reduce memory waste, as the coordinates always fit in a 16-bit integer. Upgrading to BlocksDS 1.0.0 In nds/bios.h, the PUnpackStruct alias for TUnpackStruct* has been deprecated. In nds/ndstypes.h, the fp function pointer type has been deprecated. Upgrading to BlocksDS 0.14.0 The nds/arm9/grf.h GRF file loading functions introduced in BlocksDS 0.13.0 have been replaced. The libxm7 library now uses timer 0, matching maxmod. Upgrading to BlocksDS 0.13.0 Users are encouraged to use the new function isHwDebugger() over swiIsDebugger() to more accurately detect debug units. The GRF format used by Grit has been adjusted to properly follow the RIFF standard. As such, if your project relies on pre-generated GRF files, they may need to be regenerated. The Slot-2 tilt API introduced in BlocksDS 0.11.0 has been replaced. libnds touch screen and keyboard handling scanKeys() updates the internal state of the key handling code. This is then used by keysHeld() and keysDown().\nHowever, BlocksDS also requires the user to call scanKeys() before any of the following functions: touchRead(), keyboardGetChar(), keyboardUpdate() and the deprecated touchReadXY().\nThis is unlikely to be a problem in most projects, as the normal thing to do is to both scan the keys and read the touchscreen status, not just read the touchscreen.\nThe reason is that the functions scanKeys() and touchRead() aren\u0026rsquo;t synchronized in any way, which creates a race condition. Consider this code:\nwhile (1) { scanKeys(); if (keysHeld() \u0026amp; KEY_TOUCH) { touchPosition touchPos; touchRead(\u0026amp;touchPos); printf(\u0026#34;%d, %d\\n\u0026#34;, touchPos.px, touchPos.py); } swiWaitForVBlank(); } The state of the X and Y buttons, as well as the state of the touch screen, is passed from the ARM7 with a FIFO message. This message can technically happen in between scanKeys() and touchRead(), which means that it\u0026rsquo;s possible that keysHeld() \u0026amp; KEY_TOUCH is true, but the coordinates read by touchRead() are (0, 0) because the user has stopped pressing the screen right at that point, and scanKeys() read the outdated values while touchRead() read the updated values.\nIn BlocksDS, scanKeys() is used to latch the current state of the keys and the touch screen. This forces the developer to call scanKeys(), but it also ensures that there are no race conditions, as scanKeys() will read all the state atomically.\nUpgrading to BlocksDS 0.12.0 In readdir(), . and .. filesystem entries are now returned, both on FAT and NitroFS filesystems. Upgrading to BlocksDS 0.11.3 If you were using the ndstool feature of adding alternate language banner text (added in BlocksDS 0.6), the argument syntax has changed from -bt5 \u0026quot;Text\u0026quot; to -bt 5 \u0026quot;Text\u0026quot;. ","description":"Newer BlocksDS versions occasionally introduce breaking changes which require developer action, as well as non-breaking changes which developers are encouraged to implement. These are documented here.\nPlease refer to the changelog for a full list of changes, including additions and enhancements to the SDK which are not listed here.\nUpgrading to BlocksDS 1.3.0 General changes:\nThe ConsoleFont struct no longer takes a convertSingleColor argument. For 4bpp uses, it is recommended to instead provide 1bpp font tile data, which will be automatically unpacked to use color indices 0 and 15."},{"id":19,"href":"/docs/technical/devkitarm_porting_guide/","title":"Migrating from devkitARM","parent":"Technical information","content":" 1. Introduction In most cases, porting devkitARM projects to BlocksDS should be relatively easy. BlocksDS includes most of the NDS functionality provided by devkitARM. For simple projects, only minor changes should be required.\n2. New build system This is the biggest difference between devkitARM and BlocksDS. Makefiles provided by devkitARM are more complicated: they call themselves recursively from the build directory. They also hide a lot of compilation rules from the user, as they are provided by sub-makefiles in the devkitARM system directory.\nThe Makefiles of BlocksDS include all available rules so that its behaviour is easier to understand and customize. This allows for example creating a new build system based on them, tailored to your project (for example, with CMake or Meson). They also do not rely on self-recursion.\nAs a BlocksDS user, you need to edit a few paths and variables, same as with devkitARM. Open the Makefile of your devkitARM project and check this part (some variables may be missing if you\u0026rsquo;re not using them):\nTARGET := $(notdir $(CURDIR)) # Name of the resulting NDS file SOURCES := source source/common # Directories with files to compile INCLUDES := include # Directories with files to #include GRAPHICS := graphics # Folder with images and .grit files MUSIC := audio # Folder with audio files for maxmod DATA := data # Folder with .bin files NITRODATA := nitrofs # Root of your NitroFS filesystem Copy the Makefiles from the rom_arm9_only or rom_combined to your project, and open it. You have to copy the values to the following part, and leave them empty if you aren\u0026rsquo;t using them:\nSOURCEDIRS := source INCLUDEDIRS := include GFXDIRS := graphics BINDIRS := data AUDIODIRS := audio NITROFSDIR := nitrofs Important notes:\nSOURCEDIRS searches all directories recursively. If you don\u0026rsquo;t like this behaviour, go to the SOURCES_S, SOURCES_C and SOURCES_CPP lines and add -maxdepth 1 to the find command. Paths to directories that are outside of the root of the project is not supported. Note that TARGET is not part of this group. The top of the Makefile has this other group of variables that you can also set to your own values:\nNAME := template_arm9 # Name of the resulting NDS file # Banner and icon information GAME_TITLE := Combined ARM7+ARM9 template GAME_SUBTITLE := Built with BlocksDS GAME_AUTHOR := github.com/blocksds/sdk GAME_ICON := icon.bmp Once this has been adapted to your desired values, you will need to link with the libraries used by your program.\nThis is how it looks like in a devkitARM project:\nLIBS := -ldswifi9 -lmm9 -lnds9 -lfat -lfilesystem LIBDIRS := $(LIBNDS) This would be the equivalent in a BlocksDS project:\nLIBS := -ldswifi9 -lmm9 -lnds9 LIBDIRS := $(BLOCKSDS)/libs/dswifi \\ $(BLOCKSDS)/libs/maxmod \\ $(BLOCKSDS)/libs/libnds You can remove the DSWiFi or Maxmod libraries if you aren\u0026rsquo;t using them.\nThe reason for this additional complexity with LIBS and LIBDIRS is to allow the user as much flexibility as possible when mixing and matching libraries.\n3. Filesystem libraries devkitARM and BlocksDS also heavily differ with regards to the structure of their filesystem access libraries. For most users, this should not lead to major code chagnes.\ndevkitARM uses libfat and libfilesystem, connected to a modified version of its C library newlib through the devoptab interface. These are devkitPro\u0026rsquo;s additions, and are not replicated in BlocksDS.\nInstead, BlocksDS uses the picolibc C library\u0026rsquo;s \u0026ldquo;tiny\u0026rdquo; stdio implementation. It also uses a modified version of Elm\u0026rsquo;s FatFS library in place of libfat, as well as a custom implementation of NitroFS.\nTo adapt, you have to remove -lfat and -lfilesystem from LIBS in your Makefile. As all filesystem support is included in libnds, no additional libraries are required.\nFrom the point of view of the source code, you can use the same includes as when using libfat and libfilesystem:\n#include \u0026lt;fat.h\u0026gt; #include \u0026lt;filesystem.h\u0026gt; Beyond the limitations listed below, filesystem support should work identically. Please report any behaviour that isn\u0026rsquo;t the same. If any other functionality your homebrew program requires is missing, please report that as well.\n3a. NitroFS compatibility Some minor implementation differences exist between libfilesystem and BlocksDS\u0026rsquo;s implementation:\nIn BlocksDS, NitroFS files can only be opened for reading. This means that, for example, fopen(\u0026quot;nitro:/file.dat\u0026quot;, \u0026quot;rb+\u0026quot;); will always fail, as the rb+ mode allows writing. While the behaviour of nitroFSInit(NULL); is identical, for non-NULL arguments, the provided value is now treated as an input path to the .nds file, as opposed to an output base path. To retrieve the base path, it is required to use the fatGetDefaultCwd() function instead. 3b. readdir() compatibility readdir() returns a struct dirent pointer with the field d_type. This field can be used to determine if an entry is a directory or a file. I\u0026rsquo;ve seen that some programs use it like this:\nstruct dirent *cur = readdir(dirp); if (cur-\u0026gt;d_type \u0026amp; DT_DIR) printf(\u0026#34;This is a directory\\n\u0026#34;); else if (cur-\u0026gt;d_type \u0026amp; DT_REG) printf(\u0026#34;This is a file\\n\u0026#34;); However, this is incorrect. The right way to compare it is by checking if the value is equal:\nstruct dirent *cur = readdir(dirp); if (cur-\u0026gt;d_type == DT_DIR) printf(\u0026#34;This is a directory\\n\u0026#34;); else if (cur-\u0026gt;d_type == DT_REG) printf(\u0026#34;This is a file\\n\u0026#34;); 3c. Other differences To cut down on RAM, code size and complexity, BlocksDS omits the devoptab interface. As homebrew does not generally need to modify the device list, this should not affect them. 4. Integer versions of stdio.h functions The newlib C library provides faster and smaller integer versions of stdio.h functions, such as iprintf() or siscanf(). These are not provided by picolibc. Replace any calls to them by the standard names of the functions: printf(), sscanf(), etc.\nIn newlib, including both iprintf() and printf() in the same codebase led to including both versions of the relevant stdio.h functions, unnecessarily increasing code size. picolibc opts for a different approach - it allows you to decide, project-wide, if you want to use integer-only or float-compatible versions of the printf() and scanf() functions. Note that by default, for compatibility reasons, the float-compatible versions are provided.\npicolibc\u0026rsquo;s printf/scanf replacement functionality is documented further in the optimization guide.\n5. libnds touch screen and keyboard handling scanKeys() updates the internal state of the key handling code. This is then used by keysHeld() and keysDown().\nHowever, BlocksDS also requires the user to call scanKeys() before any of the following functions: touchRead(), keyboardGetChar(), keyboardUpdate() and the deprecated touchReadXY().\nThis is unlikely to be a problem in most projects, as the normal thing to do is to both scan the keys and read the touchscreen status, not just read the touchscreen.\nThe reason is that the functions scanKeys() and touchRead() aren\u0026rsquo;t synchronized in any way, which creates a race condition. Consider this code:\nwhile (1) { scanKeys(); if (keysHeld() \u0026amp; KEY_TOUCH) { touchPosition touchPos; touchRead(\u0026amp;touchPos); printf(\u0026#34;%d, %d\\n\u0026#34;, touchPos.px, touchPos.py); } swiWaitForVBlank(); } The state of the X and Y buttons, as well as the state of the touch screen, is passed from the ARM7 with a FIFO message. This message can technically happen in between scanKeys() and touchRead(), which means that it\u0026rsquo;s possible that keysHeld() \u0026amp; KEY_TOUCH is true, but the coordinates read by touchRead() are (0, 0) because the user has stopped pressing the screen right at that point, and scanKeys() read the outdated values while touchRead() read the updated values.\nIn BlocksDS, scanKeys() is used to latch the current state of the keys and the touch screen. This forces the developer to call scanKeys(), but it also ensures that there are no race conditions, as scanKeys() will read all the state atomically.\n6. Updating legacy devkitARM homebrew Occasionally, various components of the devkitARM toolchain introduced breaking changes of their own, which lead to the unfortunate situation of homebrew being stuck on legacy, buggier and less reliable versions of toolchains. These issues also need to be resolved before updating to BlocksDS. Some known issues and their remedies are documented here; note that this list is not exhaustive.\nARM7 changes In libnds, while the ARM9 initializes console hardware in a separate function called before main(), the ARM7 does so as part of its code. Over time, these initializations have been modified. Not adhering to them can cause issues - for example, a missing touchInit(); can lead to the touch screen not functioning as expected.\nWhen updating old homebrew with custom ARM7 binaries, it is recommended to study the latest version of the default ARM7 binary to apply any necessary changes.\nReplacing IPC with FIFO Many old libnds-based homebrew extend the TransferRegion memory area to facilitate communication between the ARM9 and ARM7 CPUs. With the introducion of the FIFO message queue system, this approach is discouraged for message/command passing. For sharing buffers, one can use the FIFO system to send pointers to main RAM.\nLegacy register names Old versions of libnds used alternate name defines for the DS console\u0026rsquo;s memory mapped registers. They are primarily distinguished by not having the REG_ prefix; for example, SUB_BLEND_CR has been replaced by REG_BLDCNT_SUB in newer versions.\nA translation table is provided in #include \u0026lt;nds/registers_alt.h\u0026gt;; this can be used as a stopgap to compile the project and update all uses of legacy register names.\nNew assembly function definition syntax For ARM/Thumb interwork (calling ARM functions from Thumb and vice versa) to work correctly in more recent versions of the GNU toolchain, functions must be appropriately marked in the generated object file. While they are annotated automatically for code generated by GCC, it has to be done manually for assembly code. For example, a snippet of assembly as follows:\n.global myFunction myFunction: // code should be updated to read as follows:\n.global myFunction .type myFunction, %function myFunction: // code The important part is the addition of the .type annotation. Alternatively, the BEGIN_ASM_FUNC macro may be used:\n#include \u0026lt;nds/asminc.h\u0026gt; BEGIN_ASM_FUNC myFunction // code Memory layout changes Hardcoding areas at the end of RAM at 0x27FFFFF is not compatible with the DSi, as it has more than 8 MB of RAM. Using 0x2FFFFFF works on both DS and DSi consoles. Likewise, operations like using | 0x400000 or | 0x800000 to mark uncached variants of cached addresses should be replaced with the memUncached() helper or by using cached pointers alongside cache flushing/invalidation functions to ensure the ARM7 can see the changes; these transformations are different in DS and DSi modes.\nNote that, as all accesses omit the ARM9 cache on the ARM7 CPU, it is recommended to send pointers to it which have not been processed by memUncached().\nOther changes irqInit() is now called on the ARM9 CPU before main(). As the FIFO system registers its own IRQ handlers, and irqInit() clears them, extraneous calls to it should be removed. DIR_ITER*, diropen, dirnext and dirclose are non-standard libfat extensions; they should be replaced by DIR*, opendir, readdir and closedir, respectively. GCC 10 and above default to -fno-common, which can cause issues if multiple global variables with the same name are defined in the same project without using extern. More information is available here. GCC 14 and above consider as errors some situations which were previously treated as warnings, such as implicit function definitions. More information is available here. ","description":"1. Introduction In most cases, porting devkitARM projects to BlocksDS should be relatively easy. BlocksDS includes most of the NDS functionality provided by devkitARM. For simple projects, only minor changes should be required.\n2. New build system This is the biggest difference between devkitARM and BlocksDS. Makefiles provided by devkitARM are more complicated: they call themselves recursively from the build directory. They also hide a lot of compilation rules from the user, as they are provided by sub-makefiles in the devkitARM system directory."},{"id":20,"href":"/docs/","title":"BlocksDS Documentation","parent":"","content":"Welcome to the documentation of BlocksDS, an SDK for the Nintendo DS.\nThis is an introduction to the SDK.\nIf you\u0026rsquo;re looking for information on how to install BlocksDS, check the instructions.\nIf you\u0026rsquo;re looking for support, check this page.\nIf you\u0026rsquo;re looking for documentation about specific libraries of BlocksDS, check the following links:\nlibnds: General-purpose library to use the hardware of the NDS.\nLibrary documentation Examples Maxmod: Music player that can play MOD, S3M, XM, IT and WAV files. It can use hardware or software mixing, and it runs on the ARM7.\nLibrary documentation Examples LibXM7: Hardware-accelerated player of XM and MOD music files that runs on the ARM7.\nLibrary documentation Examples DSWiFi: Library to use the WiFi hardware of the NDS. It has no support for the WiFi improvements of the DSi.\nLibrary documentation Examples libteak: Library to use the Teak DSP included in the DSi and 3DS consoles.\nLibrary documentation Examples There are also some libraries and tools that are supported by BlocksDS, but not fully integrated with it. They include libraries to easily handle 2D and 3D graphics, additional converters for graphics and build systems. Take a look at the documentation for more information.\n","description":"Welcome to the documentation of BlocksDS, an SDK for the Nintendo DS.\nThis is an introduction to the SDK.\nIf you\u0026rsquo;re looking for information on how to install BlocksDS, check the instructions.\nIf you\u0026rsquo;re looking for support, check this page.\nIf you\u0026rsquo;re looking for documentation about specific libraries of BlocksDS, check the following links:\nlibnds: General-purpose library to use the hardware of the NDS.\nLibrary documentation Examples Maxmod: Music player that can play MOD, S3M, XM, IT and WAV files."},{"id":21,"href":"/docs/technical/libc/","title":"C/C++ support","parent":"Technical information","content":" 1. Introduction BlocksDS supports modern C/C++ standard libraries by providing the following libraries:\npicolibc, an embedded-centric fork of the Newlib C library; libstdc++, the GNU C++ library. However, this support includes some platform-specific caveats.\n2. POSIX I/O BlocksDS provides POSIX standard I/O using the tinystdio library, which is part of picolibc. It supports most of the functionality mandated by the C standard, as well as some extensions.\nFile I/O (fopen, opendir, etc.) is supported. Storage on cartridges and the DSi internal SD card can be accessed. A bundled read-only filesystem called NitroFS is also supported. For more information, check the filesystem documentation.\nConsole I/O (stdin, stdout) is supported; however, by default, no input or output is initialized:\nstdout can be redirected to the built-in libnds console by initializing the console. This can be done using the consoleInit() or consoleDemoInit() functions. stderr can be redirected to the built-in libnds console or a no$gba-compatible emulator debug output by using consoleDebugInit(). Standard output is unbuffered. When text is sent to them (by using printf() or fprintf(stderr, ...) it\u0026rsquo;s always sent to the console. The exceptions are ANSI escape sequences, which are buffered until the end of the sequence is received, and then sent to the console low level functions.\nRemember that you can use fflush(stdout) or fflush(stderr) if buffering becomes an issue.\nFor more information about ANSI escape sequences, check this link.\nstdin is tied to the keyboard of libnds. When sscanf(stdin, ...) is called, for example, the keyboard of libnds is used as input device. For more information, see the relevant examples bundled with BlocksDS. 3. argc and argv To provide correct argv information, the loader needs to support argv structure passing. This is not supported by certain legacy loaders; for more information, see our page on legacy support.\nUnder compatible loading environment, argv[0] will hold the path of the .nds file. Other argv entries may be set as well, but this isn\u0026rsquo;t a common occurrence.\nFor cartridges, the drive name used is fat: - for example, fat:/homebrew/program.nds. For DSi consoles loading .nds files from the internal SD card, the drive name used is sd: - for example, sd:/homebrew/program.nds. 4. Dynamic heap allocation Functions like malloc, calloc, memalign and free are supported. They always return space from the main RAM region.\n5. Time gettimeofday and time are supported. Timezones are not handled in any particular manner, however.\n6. Exit If the NDS ROM loader supports it, exit can be used to return to the loader. You can also return from main() to get the same effect.\nFor more information, check this document.\nIn addition, atexit is supported for dynamically registering program exit handlers.\n7. Multithreading Functions like fopen() or malloc() need to be thread-safe, and picolibc uses locks to ensure that they are thread-safe. The implementation of the locking funtrions is platform-specific, and libnds has its implementation in this file.\nIn general, you don\u0026rsquo;t need to worry about them. However, if there is an unexpected crash because of running the undefined instruction 0xEBAD, it may mean that the locking functions have found a logic error.\nPrinting an error message is very expensive: it is required to include a text font as well as console handling functions. The locking functions simply have a function with an opcode that is defined to always be an undefined instruction in Thumb mode by the ARM Architecture Reference Manual.\n","description":"1. Introduction BlocksDS supports modern C/C++ standard libraries by providing the following libraries:\npicolibc, an embedded-centric fork of the Newlib C library; libstdc++, the GNU C++ library. However, this support includes some platform-specific caveats.\n2. POSIX I/O BlocksDS provides POSIX standard I/O using the tinystdio library, which is part of picolibc. It supports most of the functionality mandated by the C standard, as well as some extensions.\nFile I/O (fopen, opendir, etc."},{"id":22,"href":"/docs/design/design_guide/","title":"Design choices","parent":"Additional information","content":"This guide serves as a loose explanation of some design choices made during the development of BlocksDS.\nA supplementary good source for understanding its design choices is the BlocksDS issue tracker, where many were and continue to be openly discussed.\n1. Standardized binary build of the GCC compiler Existing builds of GCC used for embedded development come with various, often not fully matching C/C++ standard libraries. The compatibility issues and added support headache make relying on user-provided GCC a non-viable option.\nConversely, requiring the user to build GCC is a long and not-too-easy process that doesn\u0026rsquo;t give big advantages over providing binary builds. It would make setting up the SDK a more fragile and time-consuming process.\nLLVM/Clang has also been evaluated, but as of writing it (LLVM 18) appears to generate worse-performing machine code on NDS than GCC (13). This has not been extensively tested, however.\nTherefore, in order to take advantage of per-CPU optimizations and to have a robust toolchain, it has been decided to standardize on a custom binary build of GCC. For this purpose, BlocksDS relies on a courtesy build provided by the Wonderful toolchain\u0026rsquo;s infrastructure.\n2. Easy toolchain modification and rebuilds Often, SDKs come with pre-built libraries - users only need to build them manually if they want to modify them. It is the more convenient route for most, and the Wonderful toolchain\u0026rsquo;s infrastructure currently provides it for BlocksDS users.\nHowever, part of the reason for creating this SDK was to show users how easy it actually is to modify any part of the code in your program. As such, one can easily build (make) and use (export BLOCKSDS) a custom variant of the BlocksDS SDK. This is a quick process (under a minute on most modern machines for a full rebuild) which allows hands-on tinkering with it.\nThe exceptions are picolibc (standard C library) and libstdc++ (standard C++ library), which are fairly difficult to build reliably. They are, as such, provided by the toolchain.\n3. Using picolibc over newlib The C library picolibc is used in BlocksDS instead of newlib. The reasons are:\nClearer licensing: The maintainer of picolibc has ensured that all of the code in the library has consistent BSD-style licensing. Even though non-BSD code was not linked in a typical embedded build, it provides additional peace of mind.\nStandard thread-local storage: newlib utilizes a custom re-entrancy structure for those C library functions which have thread-dependent state. Conversely, picolibc uses standard thread-local storage mechanisms provided by the compiler.\nAdditional optimizations: picolibc modifies many aspects of newlib which help reduce code size and thus memory usage. In particular, tinystdio is a much leaner implementation of POSIX-compatible standard I/O which omits features not typically necessary in an embedded environment.\nCompatibility: picolibc is a fork of newlib, and so is largely compatible with it at the user application level.\nThe main disadvantage I\u0026rsquo;ve seen is that the documentation of picolibc about porting it to a new system is worse than the one of newlib.\nOther C library alternatives with more convenient licensing have been evaluated, such as PDCLib, but as of writing (May 2024) have been deemed insufficiently complete for production use in the context of BlocksDS.\n4. Standard C library port picolibc only provides the generic functionality of the standard C library. For example, it provides versions of memset() or strlen() that are functional. However, it can\u0026rsquo;t access any OS services, so functions like malloc() or fopen() don\u0026rsquo;t work right away. It is needed to port them to the platform.\nlibnds is the library that has the drivers to access the SD card, that provides argc and argv to main(), and that knows where to locate the heap memory used by malloc().\nFor example, for malloc() to work, picolibc expects the port to provide a function called sbrk(). This function needs to get information from libnds to work. The glue code between picolibc and libnds is in libnds, in source/arm9/libc.\nThe extent of this support is documented in this document.\nThe reason to keep this as a separate library, instead of adding it to picolibc as a target, is to make updating picolibc mostly independent from refactors in libnds.\n5. Filesystem support This section will describe how the filesystem support has been implemented in libnds. Check this document if you\u0026rsquo;re interested in the C standard functions that are supported.\nFilesystem support requires 3 things:\nSomething that provides POSIX file I/O functions, like fopen(). This is done by picolibc.\nSomething that reads and writes raw bytes from the SD card. This is done by libnds.\nSomething that understands the raw bytes read from the SD card and interprets it as a FAT filesystem. This is done by a modified version of Elm\u0026rsquo;s FatFs library, which is included in libnds as a submodule.\nAlso, it is needed to provide glue code between the 3 components. For example:\npicolibc provides fopen(), and expects the user to implement open(), which should work like the Linux system call open. open() must have code that calls functions in FatFs to do the right thing. In this case, open() translates its arguments to arguments that f_open() from FatFs can understand.\nInternally, f_open() requires a function called disk_read(), which calls libnds functions to read raw bytes from the SD card. Reading raw bytes is complicated. If you\u0026rsquo;re running the code on a DSi, and you want to read from the internal SD card, you need one specific driver. If you are running the code from a DS slot 1 flashcart, for example, the instructions of how to read from the SD card are provided as a DLDI driver. f_open() must determine the location of the file (based on the filesystem prefix, fat: or sd:) and use DLDI driver functions or DSi SD driver functions accordingly.\n6. NitroFS implementation When creating a game, it is needed to add a lot of assets such as graphics and music. Initially, most people just include them in their ARM9 binary, but this is a bad idea. ARM7 and ARM9 binaries are loaded into RAM. There are only 4 MiB of available memory (actually, a bit less than that, some RAM is used for things like a hook to exit to the loader). The ARM9 is loaded in full to RAM. On top of that, you also need RAM for your program to work. This means that, in most cases, you\u0026rsquo;re limited to 1 or 2 MiB binaries. This isn\u0026rsquo;t enough for larger projects. There is the option to provide a folder with all your assets and tell your users to copy it to their SD card, but this is messy.\nThe solution is to append a filesystem to the .nds file. On the DS platform, a filesystem format called NitroROM is traditionally used. There is a library that can be used to access this filesystem, called libfilesystem (formerly known as Nitrofs). The problem is that this library\u0026rsquo;s licensing status in unclear. As such, instead of using this library, BlocksDS has a compatible reimplementation of NitroFS.\nAccessing the filesystem itself is tricky.\nCommercial games access their own data by issuing card read commands. These only work on emulators and official cartridges. Flashcarts typically rely on patching specific instruction sequences, which is not viable for homebrew projects. The solution, instead, is argv.\nWhen it is initialized, NitroFS checks if argv[0] has been provided and if it can be opened. argv[0] is a path to the executable .nds file being run. For example, it may look like fat:/games/my-game.nds.\nFirst, NitroFS will try to open the file using FatFs. If it can be opened, whenever fopen() is called with a path that starts with nitro:/, FatFs will read blocks from the file in argv[0] with fseek() and fread(). This route is typically used on cartridges and to read from SD cards.\nIf this fails, the Slot-2 cartridge memory area is checked. This is provided solely for compatibility with very legacy execution methods.\nIf this fails, Slot-1 card read commands will be attempted. This approach is provided for compatibility with emulators which do not emulate a full FAT storage device and the DLDI protocol required for homebrew filesystem access.\nThis system makes it possible to use the bundled filesystem to read assets in a transparent manner. The developer doesn\u0026rsquo;t need to worry about the method of execution used for their homebrew; on the vast majority of platforms, it will be handled transparently.\n7. Multithreading The original libnds did not support any kind of multithreading. This made it impossible to fully utilize the CPUs of the NDS during blocking operations. For example, it wasn\u0026rsquo;t possible to offload file operations to the ARM7 while the ARM9 continued to execute code; the ARM9 had to be stalled until the operation was complete.\nBlocksDS supports cooperative multithreading in the form of cothreads. By integrating it with libnds, it is possible for functions like fopen or fread to switch to a different thread while they are waiting for the SD card to finish reading a block.\nDLDI on the ARM7 While accessing the internal SD card on the DSi is performed on the ARM7, DLDI drivers used by cartridges are traditionally executed on the ARM9. However, as they are executed synchronously, this stalls the CPU whenever a file operation is performed, prohibiting the use of multithreading.\nAs a workaround, BlocksDS supports moving DLDI execution to the ARM7 sub CPU; this should be compatible with many, but not all cartridges. Feel free to read this document for more information.\n","description":"This guide serves as a loose explanation of some design choices made during the development of BlocksDS.\nA supplementary good source for understanding its design choices is the BlocksDS issue tracker, where many were and continue to be openly discussed.\n1. Standardized binary build of the GCC compiler Existing builds of GCC used for embedded development come with various, often not fully matching C/C++ standard libraries. The compatibility issues and added support headache make relying on user-provided GCC a non-viable option."},{"id":23,"href":"/docs/setup/options/docker/","title":"Docker","parent":"Options","content":" 1. Introduction If you\u0026rsquo;re not familiar with Docker, in short, it lets you create containers with predefined images. Containers are something similar to a virtual machine. An image is just the contents of the hard drive of that virtual machine.\nIt is very easy to share folders between the docker container and the host. That way you can share your code with the container, build your code from the container, and see the results in the host (so that you can test the result on an emulator or copy it to a flashcart!).\nThe images are available here: https://hub.docker.com/r/skylyrac/blocksds\n2. Setup First, install Docker: https://docs.docker.com/get-docker/ You may need to reboot after the installation.\nThen, pick your image:\nblocksds-dev: For developers that want to improve BlocksDS. blocksds-slim: For developers that just want to focus on NDS development. blocksds-slim is smaller, so it is the recommended image.\nBoth images have all the pre-built SDK, and you don\u0026rsquo;t need to setup any environment variable or anything.\nSlim image Run the following command to get the image:\ndocker image pull skylyrac/blocksds:slim-latest First, clone this repository to get the templates:\ngit clone https://github.com/blocksds/sdk Write down the path to the templates. Open a shell inside the container and share the folder with the templates:\ndocker run --rm -v /path/to/your/code:/work -it --entrypoint bash \\ skylyrac/blocksds:slim-latest The part of the command that shares a folder is -v /path/to/your/code:/work. This example will share the path /path/to/your/code from the host and show it in /work inside the container.\nTo update the image, simply run the previous docker image pull command again.\nDevelopment image Run the following command to get the image:\ndocker image pull skylyrac/blocksds:dev-latest To open a shell inside it, run:\ndocker run --rm -v /path/to/your/code:/work -it --entrypoint bash \\ skylyrac/blocksds:dev-latest The full git repository of BlocksDS is in /opt/blocksds/sdk/.\n3. Uninstall the images If you have installed Docker just for this, you can run the following command to remove all docker images available in your PC:\ndocker system prune -a 4. Build images locally From the docker folder of this repository run one of the two following commands, depending on the image you want to build:\nDevelopment image:\ndocker build --target blocksds-dev --tag blocksds:dev . Slim image:\ndocker build --target blocksds-slim --tag blocksds:dev . ","description":"1. Introduction If you\u0026rsquo;re not familiar with Docker, in short, it lets you create containers with predefined images. Containers are something similar to a virtual machine. An image is just the contents of the hard drive of that virtual machine.\nIt is very easy to share folders between the docker container and the host. That way you can share your code with the container, build your code from the container, and see the results in the host (so that you can test the result on an emulator or copy it to a flashcart!"},{"id":24,"href":"/docs/introduction/licenses/","title":"Licenses","parent":"Introduction","content":"This document enumerates the components provided by BlocksDS and their licenses. This is useful if you want to release a binary built with BlocksDS and you aren\u0026rsquo;t sure about what copyright notices you need to add.\nDSWiFi This is used in the default ARM7 binary.\nMIT license. Copyright notice required:\nCopyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org libnds This is used in all programs that use the default crts, ARM7 binary, etc.\nZlib license. No copyright notice required in binary distributions.\nFatFs uses a custom BSD/MIT/ISC-like license that doesn\u0026rsquo;t require attribution in binary files either.\nSome files (picolib) module are licensed under the BSD-3-Clause. Copyright notice required:\nCopyright © 2019-2022 Keith Packard LibXM7 This is only used if the user explicitly links it.\nMIT license. Copyright notice required:\nCopyright (C) 2018 sverx Maxmod This is used in the default ARM7 binary.\nISC license. Copyright notice required:\nCopyright (c) 2008, Mukunda Johnson (mukunda@maxmod.org) picolibc This is always used unless you tell the compiler to not link libc at all.\nTake a look at COPYING.picolibc in the picolibc folder.\nlibstdc++ This is used in any C++ program or program that is linked with a C++ library.\nIt uses license GPL 3.0 with an exception for any program compiled with GCC. That means that, as long as you use GCC as your compiler, you can license your compiled application under any license you want, or make it closed source. If you use any other compiler, you need to license your application under the GPL 3.0.\nhttps://www.gnu.org/licenses/gcc-exception-3.1.en.html\ncrts This is always used unless the user selects different ones.\nMozilla Public License v2.0. No copyright notice required.\ndefault_arm7 This is used in any project that doesn\u0026rsquo;t include source code for an ARM7 binary.\nZlib license. No copyright notice required in binary distributions.\n","description":"This document enumerates the components provided by BlocksDS and their licenses. This is useful if you want to release a binary built with BlocksDS and you aren\u0026rsquo;t sure about what copyright notices you need to add.\nDSWiFi This is used in the default ARM7 binary.\nMIT license. Copyright notice required:\nCopyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org libnds This is used in all programs that use the default crts, ARM7 binary, etc."},{"id":25,"href":"/docs/setup/options/linux/","title":"Linux","parent":"Options","content":"This is the easiest option, but you may not get the latest version of the SDK right away.\nYou will also need to install the ARM toolchain of Wonderful Toolchains. Follow the instructions in this link: https://wonderful.asie.pl/docs/getting-started/#linux\nNow, install the ARM toolchain of Wonderful Toolchains, as well as the BlocksDS packages.\nexport PATH=/opt/wonderful/bin:$PATH wf-pacman -Syu wf-pacman -S toolchain-gcc-arm-none-eabi Install the following if you plan to develop binaries for the DSP of the DSi:\nwf-pacman -S toolchain-llvm-teak-llvm For the latest stable version of BlocksDS, run:\nwf-pacman -S thirdparty-blocksds-toolchain To install the documentation and examples you can install:\nwf-pacman -S thirdparty-blocksds-docs For the latest unstable version, install the following packages instead:\nwf-pacman -S thirdparty-blocksds-git-toolchain \\ thirdparty-blocksds-git-docs (Optional step) You can also install some third party libraries like NightFox’s Lib and Nitro Engine using wf-pacman:\nwf-pacman -S thirdparty-blocksds-nflib \\ thirdparty-blocksds-nitroengine wf-pacman installs BlocksDS in /opt/wonderful/thirdparty/blocksds/. This isn\u0026rsquo;t the standard location (wf-pacman can only write files to /opt/wonderful/) so you need to do one of the two following options:\nCreate a symlink:\nln -s /opt/wonderful/thirdparty/blocksds /opt/blocksds Set your environment variables correctly:\nexport BLOCKSDS=/opt/wonderful/thirdparty/blocksds/core export BLOCKSDSEXT=/opt/wonderful/thirdparty/blocksds/external Whenever you need to update the SDK, run:\nwf-pacman -Syu ","description":"This is the easiest option, but you may not get the latest version of the SDK right away.\nYou will also need to install the ARM toolchain of Wonderful Toolchains. Follow the instructions in this link: https://wonderful.asie.pl/docs/getting-started/#linux\nNow, install the ARM toolchain of Wonderful Toolchains, as well as the BlocksDS packages.\nexport PATH=/opt/wonderful/bin:$PATH wf-pacman -Syu wf-pacman -S toolchain-gcc-arm-none-eabi Install the following if you plan to develop binaries for the DSP of the DSi:"},{"id":26,"href":"/docs/setup/options/","title":"Options","parent":"Setup instructions","content":" Windows If you are using MinGW, WSL, or any similar environment, you can follow the Linux instructions, which give you more flexibility.\nIf you want to install BlocksDS natively, check the instructions here.\nLinux If you are using Linux, MinGW, WSL, or any similar environment, follow the instructions here.\nDocker The Docker images of BlocksDS can be used in any OS. They require more disk space than the native installation, but they may be needed if a native installation isn\u0026rsquo;t possible.\nFollow the instructions here.\nBuild from source This is the option you should use if you want to help develop BlocksDS, or if you want to always use the cutting edge version of BlocksDS. This is only available in Linux-like environment.\nFollow the instructions here.\n","description":"Windows If you are using MinGW, WSL, or any similar environment, you can follow the Linux instructions, which give you more flexibility.\nIf you want to install BlocksDS natively, check the instructions here.\nLinux If you are using Linux, MinGW, WSL, or any similar environment, follow the instructions here.\nDocker The Docker images of BlocksDS can be used in any OS. They require more disk space than the native installation, but they may be needed if a native installation isn\u0026rsquo;t possible."},{"id":27,"href":"/docs/tags/","title":"Tags","parent":"BlocksDS Documentation","content":"","description":""},{"id":28,"href":"/docs/technical/","title":"Technical information","parent":"BlocksDS Documentation","content":"","description":""},{"id":29,"href":"/docs/technical/usage_notes/","title":"Usage notes","parent":"Technical information","content":" 1. Introduction This is just a list of tips and notes about how to use BlocksDS.\n2. Section annotations in filenames Some projects require specific functions or variables to be placed in specific memory regions. Some functions may also need to be compiled as ARM instead of Thumb, which is the default.\nIt is possible to rename your C and C++ source files to affect the whole file. For example, a file named engine.arm.c will be built as ARM code, and a file called interrupts.itcm.c will be placed in the ITCM memory section.\nYou can also use the annotations in \u0026lt;nds/ndstypes.h\u0026gt;:\n*.dtcm.*: DTCM_DATA, DTCM_BSS *.itcm.*: ITCM_CODE *.twl.*: TWL_CODE, TWL_DATA, TWL_BSS *.arm.c, .arm.cpp: ARM_CODE For assembly source files, you can use the BEGIN_ASM_FUNC macro and specify the section in the second parameter:\n#include \u0026lt;nds/asminc.h\u0026gt; BEGIN_ASM_FUNC my_function itcm mov r0, #0 bx lr 3. Using alternative memory layouts ARM7 options There are three different layouts provided by BlocksDS that applications can use for their ARM7 code. They can be selected by changing the .specs file in the ARM7 makefile:\nDefault: ds_arm7.specs. It expects all code to be in main RAM, and relocates it to IWRAM during boot.\nIWRAM: ds_arm7_iwram.specs. It expects all code to be in IWRAM from the start.\nVRAM: ds_arm7_vram.specs. This option places all sections in VRAM (which needs to be configured as ARM7 memory by the ARM9) and expects the code to be in VRAM from the start.\nNote that the IWRAM and VRAM options aren\u0026rsquo;t supported for DSi applications.\nARM9 options They can be selected by changing the .specs file used in the Makefile:\nDS layout: ds_arm9.specs\nDSi layout: dsi_arm9.specs\n","description":"1. Introduction This is just a list of tips and notes about how to use BlocksDS.\n2. Section annotations in filenames Some projects require specific functions or variables to be placed in specific memory regions. Some functions may also need to be compiled as ARM instead of Thumb, which is the default.\nIt is possible to rename your C and C++ source files to affect the whole file. For example, a file named engine."}] \ No newline at end of file +[{"id":0,"href":"/docs/introduction/","title":"Introduction","parent":"BlocksDS Documentation","content":"","description":""},{"id":1,"href":"/docs/introduction/introduction/","title":"Introduction","parent":"Introduction","content":"This is an SDK to develop applications for Nintendo DS in C or C++.\n1. Goals To create an easy-to-use NDS software development kit based on GCC with as few dependencies as possible, and that supports as many features of the DS and DSi as possible.\nTo encourage developers to hack and improve the SDK by letting them have all the source code of the SDK. This also shows how easy it is to build the whole codebase. The exception is the toolchain, which is non-trivial to build. Because of that, Wonderful Toolchains is used instead of asking the users to build it themselves.\nTo try to keep compatibility with pre-existing C projects made by devkitARM. In theory, it should be enough to replace the Makefile of devkitARM by a Makefile of BlocksDS to build any old project, with some few exceptions. Check this guide for more details.\nTo document as much of the SDK as possible. For detailed information about the design of BlocksDS, check this document.\nTo ensure that the licensing status of all the code is correct and that the licenses used are all FOSS. This SDK is made from the work of many others that came before it and who developed FOSS libraries that can be now used by BlocksDS. This SDK must ensure that all the code remains FOSS for other people to use it in the future. For more information about the licenses used by different components, check this.\n2. Features 2.1 Standard libraries Binaries are pretty small and their baseline RAM usage is low thanks to using picolibc instead of the more commonly used newlib.\nA libc with most of the features and functions you would expect in a regular environment like in a PC. For example: printf(), scanf(), fopen(), stat(), opendir(), malloc(), gettimeofday(), time() and exit().\nThere are versions of functions like memcpy(), memset() and memmove() that have been optimized for the CPUs of the DS. This is thanks to using ndsabi, a fork of agbabi by felixjones.\nAlso, argv may be provided by the environment so that programs know where they are running from (the path of the NDS file is provided in argv[0]), and any arguments pased to it if any.\nIt is possible to access the filesystem of DLDI devices (like the SD card of flashcarts), the SD slot of the DSi, and the filesystem embedded in a NDS ROM (NitroFS). Performance (particularly for reads) has been optimized by asie a lot. This is partly thanks to using FatFs, partly due to the DSi SD driver by profi200, and partly due to lots of additional optimizations by asie\nC++ is supported, as well as libstdc++ but it hasn\u0026rsquo;t been tested as extensively as the C standard library.\nThere is basic cooperative multithreading support. libnds has been modified to be thread-safe. Thread-local storage support has also been added. You can define variables that are unique per thread like this:\n__thread int my_variable = 1000; __thread int other_variable; Filesystem reads can be done from the ARM9 and ARM7. You can make the ARM9 ask the ARM7 to load files in one thread. While the ARM7 load files the ARM9 can be doing other things in other threads, so you aren\u0026rsquo;t blocked. This is always done when loading files from the SD card of the DSi, but it can also be done with DLDI devices. Most DLDI drivers can run from the ARM7 even if they haven\u0026rsquo;t been explicitly built with that in mind!\n2.2 Supported DS features All features of the 2D video hardware are supported. There are some APIs to simplify the usage of backgrounds and sprites, as well as a basic text console system based on the 2D background system.\nAll features of the 3D hardware are supported through an API that is similar to the one of OpenGL 1. There is a library to render 2D graphics with the 3D hardware easily, called GL2D.\nThere is a tool to convert graphics to the formats used by the DS: grit. The only format that it doesn\u0026rsquo;t support is the Tex4x4 texture format, but that one is supported by ptexconv.\nThe audio hardware is supported. There are two libraries that can be used to play music: Maxmod and libxm7. libxm7 only supports playing MOD and XM files, and it is required to use libnds to play SFXs through a basic sound API. Maxmod, on the other hand, has its own way to play sound effects and music, and it supports MOD, XM, IT and S3M files.\nIt is possible to record audio using the microphone of the console.\nThere are some helpers to use the division and square root co-processor, the BIOS functions, hardware timers, DMA, interrupt handlers, and the hardware FIFO system for ARM9 \u0026lt;-\u0026gt; ARM7 communications.\nThere are some helpers to setup the MPU and to manipulate the cache of the ARM9 (to clean it or invalidate it).\nThere is an API to access the DS cartridge ROM, as well as EEPROM chips in the cartridges that use it. It is also possible to access the filesystem of SD cards used in flashcarts.\nThere is an API to read the state of the buttons and the touchscreen.\nThere is an API to use Slot-2 peripherals such as RAM expansion cartridges, gyroscopes or tilt sensors.\nThere are some helper functions to decompress some formats supported by the BIOS.\nIt is possible to read and set the date and time of the RTC clock.\nWiFi support isn\u0026rsquo;t complete. It is possible to connect to Access Points with the library DS WiFi, but it doesn\u0026rsquo;t support DS to DS WiFi communications.\nndstool supports creating NDS ROMs and define a ROM icon and banner text (in multiple languages!).\n2.3 Supported DSi features The SD slot of the DSi is supported.\nThe new DMA features, as well as the new WRAM memory banks, are supported.\nndstool supports animated icons from PNG, GIF, even animated GIF files.\nThe DSi camera is supported (thanks, asie!). It\u0026rsquo;s still quite basic, but enough to be able to take photos from the front and back cameras.\nThere is preliminary support for the DSP of the DSi (the toolchain is very buggy, so be very careful when using it, it\u0026rsquo;s probably not ready to be used by most developers!).\nUnfortunately, none of the DSi WiFi features (such as WPA support) are supported by DS WiFi yet.\n","description":"This is an SDK to develop applications for Nintendo DS in C or C++.\n1. Goals To create an easy-to-use NDS software development kit based on GCC with as few dependencies as possible, and that supports as many features of the DS and DSi as possible.\nTo encourage developers to hack and improve the SDK by letting them have all the source code of the SDK. This also shows how easy it is to build the whole codebase."},{"id":2,"href":"/docs/setup/","title":"Setup instructions","parent":"BlocksDS Documentation","content":"","description":""},{"id":3,"href":"/docs/usage/","title":"Usage","parent":"BlocksDS Documentation","content":"","description":""},{"id":4,"href":"/docs/introduction/changelog/","title":"Changelog","parent":"Introduction","content":" Version 1.3.1 (2024-07-26) libnds:\nAdded memory barriers to libnds functions which remap user-accessible memory. consolePrintChar() has been exposed in the public API. Coupled with internal refactors, this allows using the built-in console without pulling in printf/scanf as a dependency. Fixed function parameters and improved parameters for BIOS RSA functions. Fixed potential memory corruption when micStopRecording() was called twice. Fixed regression in new touchscreen driver on CDC (TWL). Improved documentation for the BIOS CRC-16 calculation function. Minor optimizations to videoGL and console code. SDK:\nNew examples:\nAdded a 3D billboard drawing example. Added a 3D spot lights example. Added a 3D two-pass rendering example. Added a BIOS bit unpacking example. Added a BIOS CRC-16 calculation example. Added a BIOS RSA decruption example. Added a microphone recording example. Added a Maxmod audio modes example. Added a Maxmod reverb example. Fixed a regression in the exception handler example. picolibc:\nThe bundled version of picolibc has been updated. Added an implementation of posix_memalign(). Added support for %a and %A formats in scanf(). Fixed freopen() not resetting the unget buffer. Fixed hexadecimal string conversion in strtod(), strtof() and strtold(). Fixed lgammal() corrupting the application-defined signgam value. Fixed potential issue when calling fclose() more than once. Fixed printf() rounding issues for %a and %f formats. General header cleanups have been performed. Other:\nExpanded the touch input test to allow sampling input on initial pen press only, as opposed to every frame while the pen is touching the display. Version 1.3.0 (2024-07-06) libnds:\nNew touchscreen driver:\nThe touchscreen driver has been rewritten from the ground up. A new routine for filtering measurements is now used for both TSC (NTR) and CDC (TWL) touch inputs. This should provide more accurate results, particularly on more worn down displays and screen protectors. More testing is required, however. On TSC (NTR), tscMeasure() now uses the 16-clock-per-conversion method to speed up measurement readouts. The duration of the critical (interrupt-blocking) section of the touch driver has been reduced, and the TSC (NTR) driver has had its performance optimized on top of that compared to 1.2.0 and below. On the ARM7 side, touchApplyCalibration and touchReadData have been added to allow more granular access to the touchscreen driver\u0026rsquo;s logic. As these commands were only intended for TSC (NTR), touchRead and touchReadTemperature were moved to a new header, tsc.h, and renamed to tscRead and tscReadTemperature respectively. Interrupt handling:\nThe interrupt dispatcher has been optimized to use O(1) as opposed to O(n) lookups. This is always faster on ARM9, and faster for more than 2-3 defined IRQ handlers on ARM7, which is the common scenario. Fixed a bug where irqClearAUX() would disable the non-auxillary interrupt of the same bit mask on ARM7. Fixed behaviour in setting and clearing of multiple interrupt handlers at a time (bit masks with more than one bit set). Now, setting multiple bits at once with irqSet() or irqClear() acts the same as setting one bit at a time. Memory usage:\nITCM use has been reduced by about 320-380 bytes, depending on your codebase\u0026rsquo;s use of libnds. DTCM use has been reduced by 192 bytes - the size of the reserved section at the end of memory is now 64 bytes by default and can be controlled with the __dtcm_reserved_size linker symbol. ARM7 IWRAM use has been reduced by 192 bytes - the size of the reserved section at the end of memory is now 64 bytes by default and can be controlled with the __iwram_reserved_size linker symbol. The size of the supervisor and IRQ stack can now be controlled by defining the __svc_stack_size and __irq_stack_size linker symbols. Graphics:\nA new function has been added to set the object mode (regular, bitmap, window, blended): oamSetBlendMode(). A new function has been added to get a SpriteSize entry from the size of a sprite in pixels: oamDimensionsToSize(). Also, SpriteSize_Invalid has been introduced to represent dimensions that aren\u0026rsquo;t valid 2D sprite sizes. New definitions have been added for the bit fields of the BLDALPHA and BLDY registers. The following functions now return error codes: glBindTexture(), glAssignColorTable(), glGetColorTableParameterEXT(), and glTexParameter(), making it easier to handle errors gracefully when using them. There has been a big refactor in videoGL to handle allocation errors gracefully (or at least crash with an assertion if the code can\u0026rsquo;t recover from the error). Code refactoring:\nRTC_CR, RTC_CR8 and HALT_CR have been renamed to REG_RTCCNT, REG_RTCCNT8 and REG_HALTCNT, respectively. GL2D now uses existing videoGL.h helpers instead of reimplementing its own copies. Many fields and functions have been documented, including firmware flash commands, DLDI driver structures. Missing DMA_START constants have been added. The constants used in tscReadTemperature have been documented. SerialWaitBusy has been renamed to spiWaitBusy. oamSetGfx() has been moved away from the header to fix C++ builds. Other:\nARM7 SPI bus helper functions have been added: spiExchange, spiRead and spiWrite. consoleLoadFont() has been cleaned up. Note that the convertSingleColor option has been removed, as 1bpp fonts are now supported. Decompression of Huffman-compressed data has been implemented. To faciliate this, decompressStreamStruct() has been added. Decompression utility functions are now available in both the ARM9 and ARM7 build of libnds. glCallList() and cardStartTransfer() now use the safe helper function dmaSetParams(). wf-fatfs has been updated, bringing minor performance improvements to directory lookups. The magic numbers used to represent MPU memory regions have been replaced by definitions. A missing include has been added to grf.h. SDK:\nNew examples:\nAdded an 8-bit bitmap background loading example. Added an example of combining 3D, 2D sprite, and 2D background display. Added an example of loading sprites of all graphics types from GRF files. Added an example of loading bitmap sprites. Added an example of loading and using affine sprites. Added examples of using regular windows and windows using objects as mask. Added examples of using extended palettes for sprites and backgrounds. Added an example of using a text console in an extended affine background. Added an example of using the mosaic effect in sprites and backgrounds. Added an example of animating 2D sprites by updating frames in real time or by pre-loading all frames to VRAM from the start. Added an example of using 2D alpha blending and fade effects. Added a BIOS decompression example. Added a NitroFS paletted texture loading example. Added a touch input test, and two examples. Added an example of creating graphics effects using the horizontal blanking interrupt. Added a sample minigame based on Space Invaders. Changes to examples:\nOAM memory and textures is now freed in all examples that allocate them. While this isn\u0026rsquo;t needed in examples as short as ours, it\u0026rsquo;s good practice to show developers how to free resources when they aren\u0026rsquo;t needed anymore. The names of the ROMs and the titles and subtitles in the ROM header have been modified to make them consistent across all examples. Background IDs returned by bgInit() are now used instead of hardcoded layer numbers. videoSetMode() is no longer used to enable sprites or to set sprite mapping modes, that should be done by the libnds sprite API. Tilemaps are now explicitly excluded from grit generation in all the grit files that are used to convert sprites. grit:\nFixed reading data from assembly files as input. Fixed uninitialized memory use when loading a picture with an odd width. picolibc:\nThe bundled version of picolibc has been updated. Added an implementation of funopen. Added bounds checking to asctime_r and ctime_r. Added implementations of fgetpos and fsetpos. Added stub implementations for POSIX unlocked file functions. Fixed fgetwc and fputwc not setting the file stream to wide orientation. Fixed regex.h not being usable when compiling C++ code. Other:\nFixed NitroFS generation in the combined ARM7+ARM9 ROM template. The BlocksDS SDK now depends on the wf-nnpack package, which provides standalone, command-line compressors for the decompression methods supported by the console\u0026rsquo;s BIOS. The code style of libteak and DSWiFi has been changed using clang-format to improve readability. The documentation has been updated with additional notes about migrating from older and current versions of devkitARM, covering further potential issues. The Teak LLVM toolchain is no longer mentioned in the Windows setup instructions, as it is not available there. Version 1.2.0 (2024-06-08) libnds:\nvideoGL:\nAdd glGetColorTablePointer() (returns pointer in VRAM to the palette of a texture). Add glGetTextureExtPointer() (returns pointer in VRAM to the additional texture data of GL_COMPRESSED textures). Fix allocation of GL_COMPRESSED textures when VRAM_A is not allocated to the 3D engine. Fix crash in glTexImage2D() with no active texture. Fix error checking in glColorTableEXT() and glTexImage2D(). General code cleanup and improvements. Minor optimization to loading GL_RGB textures using glTexImage2D(). Note that using this format is not recommended; see documentation for additional details. TEXTURE_SIZE_INVALID has been added to GL_TEXTURE_SIZE_ENUM. glTexImage2D() now fails correctly when invalid sizes are used. Some minor comment improvements. GL2D:\nImprove error checking when loading textures. Modify sprite sets to use uint16_t arrays for texture coordinates. Other:\nAdd hw_sqrtf() - a hardware-accelerated alternative to sqrtf(). Small optimizations to functions that use the hardware accelerators of division and square root. Add support for detecting stack smash canaries. As a result, the debug versions of libnds are now built with the stack protector enabled. Add support for printing standard output to the debug console if the on-display console is not initialized. Change SOUND_FREQ (ARM7) and TIMER_FREQ to always return the correct frequency value, rounded to the nearest achievable one. This has been found in user research to be the most intuitive default; if you\u0026rsquo;d like alternate options, please let us know. Fix swiSwitchToGBAMode(). Improve documentation of RTC structs. SDK:\nAdd error code checks to 3D engine examples. Add GL2D spriteset and tileset examples. Add new tool: squeezer (by @huxingyi), used for generating packed textures for GL2D sprite sets. It has been forked to easily export formats used by GL2D instead of generic formats. Add tests for hw_sqrtf(). Avoid using GL_RGB and TEXTURE_SIZE_n defines in 3D engine examples. Fix VRAM bank setup in \u0026ldquo;text over 3D\u0026rdquo; example. Improve timer example. Add a test for the videoGL functions that allocate textures and palettes. Version 1.1.0 (2024-05-08) libnds:\nAdd keyboardExit() function to deinitialize keyboard structures. Add realpath() implementation. Adjust keyboardInit() to only link the default keyboard if no custom keyboard is being used. Fix getcwd() result when called in the root NitroFS directory. Fix Slot-1 card reads not being aligned to 512 bytes. Minor allocation/string handling bugfixes. Fix some memory allocation issues found by GCC 14. SDK:\nAdd examples (paletted textures, rotation backgrounds, 16-bit backgrounds, sprites in sub screen, FAT file attributes, GL2D usage). Add tests for realpath(). Fix warnings found by GCC 14 in examples. Version 1.0.0 (2024-03-30) libnds:\nFix C++ builds (there was a missing cast from enum to int, and the Makefile was using the wrong program to link binaries). Optimize some videoGL functions (compile them as ARM instead of Thumb to take advantage of the faster multiplication instructions). Fix bug in readdir(). Implement __retarget_lock_*() family of functions to allow libc functions to work in a multithreaded environment. Make glCallList() take a void pointer instead of u32. Add checks to NWRAM functions to see if MBK1-MBK5 are writable. Don\u0026rsquo;t remap NWRAM-A when starting the DSP (only B and C are needed). Fix swiUnpackBits(). Fix some casts to respect \u0026ldquo;const\u0026rdquo;. Fix some warnings. Improve some documentation comments. Deprecate typedef fp (the name is too short!) and PUnpackStruct. Add missing files to the Doxygen documentation. SDK:\nAdd examples (3D object picking, 3D toon shading, building 3D display lists, 3D volumetric shadows, compressed textures, orthogonal projections, using console windows with the default console API). Improve C++ test to prevent regressions like during the last few versions. Document memory map of the DS. Add note about the Makefiles of BlocksDS not supporting paths outside of the root folder of the project (thanks, @lifehackerhansol). Fix linking C++ projects in default makefiles. Maxmod:\nFix return type of mmEffectCancel() in ARM9 code. Version 0.14.0 (2024-03-02) libnds:\nThe GRF loading functions have been modified to be actually useful. In some cases it wasn\u0026rsquo;t possible to infer the size of some data chunks of the file (it was impossible to calculate the size of a tileset, for example). The new functions break compatibility with the old ones, but this change was required. Added glTexSizeToEnum() to convert sizes in pixels to GL_TEX_SIZE_ENUM values. Also, the funciton glTexImage2D() now accepts sizes in pixels as well as GL_TEX_SIZE_ENUM values. Added a function to return the default drive (sd: in the case of DSi, fat: in the case of a DS). FatFs has been moved to an external repository (wf-fatfs) which is included in libnds as a submodule. The documentation of FatFs has been removed from this repository. Added some missing 3D polygon attribute definitions. Fixed the return type of swiSHA1Verify(). The fatfs.h header has been removed, it is redundant. SDK:\nRefactor documentation.\nIt now uses Hugo, and it is available as a static website. Some old sections have been updated. The documentation of all libraries has been integrated with the documentation of BlocksDS so that everything is linked. Document how to use Slot-2 flashcarts with BlocksDS applications. Reword devkitARM porting guide. A doxygen theme has been applied to the documentation of all the libraries used by BlocksDS. Add lots of examples:\n3D and 2D graphics. DSWifi. How to use multiple DSP binaries in the same application General NitroFS usage in an application (such as loading music for LibXM7 or graphics to be used as 2D backgrounds or sprites). DSi SHA1 functions. Hardware timers. Video capture (render to texture, dual screen 3D, save screenshot as PNG). More text console examples. Small change to makefiles that modifies the destination folder of build artifacts.\nLibXM7:\nIt now uses timer 0 instead of timer 1, so that Maxmod and LibXM7 use the same timer and it\u0026rsquo;s easier to switch libraries. The documentation has been improved. DSWifi:\nWEP modes have been documented. The prototypes of some functions have been cleaned up. The documentation has been improved. Maxmod:\nThe return type of mmEffectCancel() has been fixed. Some definitions have been turned into enums. inline functions in headers have been turned into static inline. Version 0.13.0 (2024-02-01) libnds:\nBreaking change: Refactor input handling in the ARM9. In order to fix a race condition where the touch screen state could be updated between calls to scanKeys() and touchRead() it has become mandatory to call scanKeys() before touchRead(), keyboardGetChar(), keyboardUpdate() and the deprecated touchReadXY(). Most programs are already doing this, but this may break a small number of programs that don\u0026rsquo;t do it. Implemented isHwDebugger(), which returns 1 if the console running the code is a hardware debugger, regardless of the DS model and CPU state. This is meant to replace swiIsDebugger(), which only works if the cache is disabled, and only in DS models (not DSi). The documentation of swiIsDebugger() has been updated to mention its limitations. Fix Slot-2 tilt API introduced in version 0.11.0, which hadn\u0026rsquo;t been tested on hardware. The old peripheralSlot2TiltUpdate() has been replaced by peripheralSlot2TiltStart() and peripheralSlot2TiltRead(). Implemented utime() and utimes() for changing file modification dates. Implemented scandir(), alphasort() and versionsort(), Fixed statvfs() and fstatvfs() on NitroFS paths and files. Added stubs for getwd() and get_current_dir_name(). Added stubs for getuid(), getgid(), etc. Add helpers to load GRF files generated by grit. Reintroduce logic to read Slot-1 cartridges with card commands from the ARM7 to save CPU cycles on the ARM9. The value of the RAM size field in REG_SCFG_EXT in the ARM9 is now set to 16 MB or 32 MB instead of being fixed to 32 MB even in retail DSi units. Some CP15 defines have been fixed. Simplify logic in ARM7 input handler. Generate default font from a PNG at build time instead of doing it from a preconverted BIN file to make it easier to replace it in the future. grit:\nAdded the -D argument, specifying the destination folder for non-shared data as a counterpart to -O. Fixed a situation in which the first color in an image\u0026rsquo;s palette would be used as transparent if the user-provided color (with -gT) was not present in the image. Breaking change: Fixed GRF file output to properly follow the RIFF chunk format. It will also export new information in the file header, like using special magic values to specify the formats A3I5, A5I3 and TEX4x4, and specifying the number of colors contained in the palette (for 16-bit textures it\u0026rsquo;s 0). In order for the new information to fit in the header, some fields have been increased in size. Fixed palette size calculation for DS textures. Improvements to error messages. LibXM7:\nMake types XM7_XMModuleHeader_Type and XM7_MODModuleHeader_Type private. Developers consider their MOD/XM files as a typeless blob of data, they shouldn\u0026rsquo;t need to cast it to anything, the library should do it itself. The structs that define the MOD and XM formats have been made private, as well as some definitions internal to the player. Some defines have been turned into enums, which will help developers and IDEs identify what to use in which functions. The documentation has been updated. Tests:\nAdd test to read DSi SCFG registers to see which DSi features are available with the loader that has been used to launch the application. Add test to display all configured MPU regions. Version 0.12.0 (2023-12-26) libnds:\nDot and dot-dot entries are now properly emitted in readdir(). In line with common software expectations, they mirror standard FAT filesystem behaviour, that is are present for all subdirectories. For NitroFS, these entries are emulated accordingly. The d_ino field in readdir() output is now correctly populated, to match stat() and fstat(). Added nitroFSOpenById() and nitroFSFopenById() functions, allowing opening files directly without paying the cost of a directory lookup. Accordingly, NitroFS file systems which contain a FAT table but no FNT table can now be opened. Optimized glMaterialShinyness(). SDK:\nThe default Makefiles have been simplified and now use compiler-provided .specs files. In turn, a few additional features have been added: Support for picolibc\u0026rsquo;s compiler define-based selection of the printf and scanf implementations. The __BLOCKSDS__ define, which can be used to detect a BlocksDS environment during building. Fixed camera initialization with the default ARM7 binary. grit:\nAdded the -ftB argument, which outputs files with .img, .map, .meta, .pal extensions, as opposed to .img.bin, .map.bin, .meta.bin and .pal.bin. Version 0.11.3 (2023-12-04) libnds:\nAdded helpers to control microphone power independently from recording. This can be used for scenarios in which the DSP is tasked from recording microphone input. Added helpers and definitions for the DSi GPIO registers. Added function to detect availability of NWRAM. Fixed atexit() handlers not being called during a normal main() return. Fixed TSC configuration for enabling 47 kHz input/output in DSi mode. Improved error handling in Teak DSP code execution helpers. The Teak DSP is now powered off before loading a DSP binary. DSWiFi:\nReduced memory usage, especially while Wi-Fi is not initialized. ndstool:\nBreaking: Instead of providing alternate-language banner text using -bt5 \u0026quot;Text\u0026quot;, the form -bt 5 \u0026quot;Text\u0026quot; is now required. Added support for providing mutliple root directories for building NitroFS images. All specified root directories are combined to create the root of the file system. Fixed -w treating other options as file masks. Improved argument handling. SDK:\nUpdated compiler flags: The superfluous -mtune=arm7tdmi has been removed from ARM7 Makefiles. -march=armv5te -mtune=arm946e-s has been replaced with -mcpu=arm946e-s+nofp in ARM9 Makefiles. -Wl,--use-blx has been added to ARM9 linker flags. This allows the use of the BLX opcode for linking ARM/Thumb code in place of trampolines, slightly improving final executable size and performance. Version 0.11.2 (2023-11-27) libnds:\nFixed a bug introduced in version 0.11.1 that didn\u0026rsquo;t initialize audio hardware correctly in DSi mode. Some superfluous audio helpers added in version 0.11.1 have been removed. Move libteak to its own repository so that it can be reused by other toolchains. Modify functions to load DSP binaries to return int instead of bool for more flexibility. DSP:\nMove crt0 and linkerscript to libteak repository. Preprocess all assembly files, not just the crt0. Version 0.11.1 (2023-11-25) libnds:\nFixed an edge case which could read to invalid small reads/writes to DSi/ARM7-controlled removable storage. Added helpers to control REG_SNDEXTCNT from the ARM9 (to enable DSP audio output to the speakers, for example). Some DSP functions have been moved to twl sections to save memory when the game runs in a regular DS. Wrapped camera functions to prevent crashes when used in NDS mode. Change license of DLDI-related files to Zlib with permission from the authors. Fix Doxygen documentation of peripherals. DSP:\nAdded BTDMP helpers to stream audio from the DSP to the speakers. Added an example to show how to generate audio from the ARM7 and the DSP at the same time. Added an example of how to use DMA to transfer data from the DSP memory to the ARM9 memory. Version 0.11.0 (2023-11-19) libc:\nFixed an important regression in memcpy() and memset() implementations. Improved file I/O performance:\nAdded support for batch reads and writes of contiguous clusters, improving SD card performance for very large sequential reads/writes. Added fatInitLookupCacheFile(). This allows opting a file into having a special in-memory cache which significantly speeds up file seek operations. Provisionally automatically enabled the in-memory cache for NitroFS files. If you\u0026rsquo;re experiencing slowdowns, make sure to defragment your SD card - this requirement will be loosened in future releases (but it\u0026rsquo;s still a good idea). Integrated profi200\u0026rsquo;s dsi_sdmmc driver, improving reliability and performance for reading from and writing to the DSi\u0026rsquo;s SD card. Optimized unaligned buffer I/O performance for the DSi\u0026rsquo;s SD card. Only cluster table/directory-related reads will now be cached by the built-in sector cache. This allows better use of this sector cache; one can use setvbuf() to enable a larger cache for file I/O. Other minor optimizations have been made throughout the code. Added a new Slot-2 API (arm9/peripherals/slot2.h).\nAdded support for detecting external RAM cartridges (SuperCard, M3, G6, DS Memory Expansion Pak, EZ-Flash variants, EverDrive). Added support for enabling and disabling the data cache on the Slot-2 memory area. Combined with suitable bus speed detection for these cartridges, this allows efficient usage of such an external RAM area. Added support for detecting and using the Gyro, Solar and Tilt sensors available on various GBA game cartridges. Fixed detection of GBA cartridge rumble (WarioWare, Drill Dozer). Modify rumble example to show how to use the new API. DLDI:\nMoved the built-in sector cache into unused memory occupied by the reserved DLDI driver area. This effectly saves ~20KB of heap RAM for most homebrew. The DLDI driver area size can now be changed by defining the __dldi_size symbol to a value away from the default of 16384, such as 8192 (if your application is highly RAM-constrained - this may break support with some cartridges, however) or 32768 (restores compatibility with MoonShell versions at the cost of an additional 16KB of RAM). The DLDI driver area is now guaranteed to be close to the beginning of the .nds file, which may slightly improve load times. DSP:\nAdd BTDMP and ICU helpers. Refactor crt0.s. Add examples of handling interrupts, including timer interrupts. libnds:\nRename some cache helpers for consistency. Fixed a file handle leak that could occur if nitroFSInit() was pointed to an .nds file which does not contain a NitroFS file system. Fixed a rare case in which nitroFSInit() could try reading from the GBA slot on the DSi, causing an exception. Added readFirmwareJEDEC() function to read the ID of the DS firmware flash chip. (lifehackerhansol) Minor optimizations have been done to readUserSettings(). Fixed the NDMA_DST_FIX macro definition. Version 0.10.2 (2023-11-11) NitroFS: Fix file traversal not working without running a chdir() first. Version 0.10.1 (2023-11-11) Fix NitroFS directory reads occasionally failing on non-DLDI environments. Version 0.10.0 (2023-11-11) Build system:\nThe default makefiles no longer rely on the toolchain being in the current PATH. Now, the default Makefiles have the default path to Wonderful Toolchain, which can be overriden by the user if desired. The makefiles used by the tests and examples have been moved to a system location so that they are more easily reused. dldipatch has replaced dlditool as the default to apply DLDI patches, due to bugs in dlditool\u0026rsquo;s patch application process: https://problemkaputt.de/gbatek-ds-cart-dldi-driver-guessed-address-adjustments.htm Update your makefiles to take advantage of the updates. Filesystem improvements:\nReplaced NitroFAT by a new Zlib-licensed implementation of the NitroFS filesystem by @asiekierka. This fixes the performance drawbacks of NitroFAT. In stat() and fstat(), the fields st_dev and st_ino are now properly populated. Fixed stat() not acknowledging / as a directory. Remove NitroFAT support from ndstool. The example makefiles have been modified to stop using mkfatimg. DSP:\nInitial experimental, incomplete support for the Teak DSP of the DSi. This isn\u0026rsquo;t ready to be used, it\u0026rsquo;s still under development and it\u0026rsquo;s going through a lot of changes. Most of the code is derived from @Gericom\u0026rsquo;s prototype code. Support for building DSP binaries won\u0026rsquo;t be present on Windows until it\u0026rsquo;s more stable. However, if you already have pre-built DSP binaries, it\u0026rsquo;s possible to use them on Windows. Introduced teaktool, which converts ELF files into TLF (Teak Loadable Format) files that can be loaded by libnds. Added ARM9 functions to libnds to handle the DSP, load TLF files and communicate with programs running on the DSP. Introduce libteak, a library with helpers to use the AHBM, DMA, APBP, ICU and timer peripherals. It has been documented and added to the Doxygen pages of libnds. Added a few examples of how to use the currently supported DSP features. Update user instructions and Dockerfile to use and mention the LLVM Teak toolchain. Add NWRAM defintions and helpers. DLDI improvements:\nThe DLDI template now automatically calculates the \u0026ldquo;size\u0026rdquo; and \u0026ldquo;fix flags\u0026rdquo; fields of the header. The binary R4 DLDI driver, used for DeSmuMe compatibility, has been replaced by a Zlib-licensed impementation built from source. libnds:\nMicrophone samples can now be captured using full 16-bit precision on DSi. Cleaned up and added some missing MMIO/bitfield defines throughout libnds. Implemented inlined BIOS calls based on gba-hpp. This should make code using BIOS calls slightly smaller and faster. Small reorganization of syscalls code. Slightly optimized coroutine threading code. Added documentation about ARM7 audio helpers. Submodules:\nBefore this version, repositories owned by third parties were added as submodules to the SDK repository. This can be a problem if the owner isn\u0026rsquo;t responsive, changes name, deletes the repository\u0026hellip; In order to avoid issues, forks have been created under the BlocksDS organization. It is expected to contribute to the original repositories and update the fork to stay in sync. Contributing to the forks is a last resort option. Tests:\nAdded a new test for SWI functions. Version 0.9.1 (2023-10-19) Revert changes in Maxmod that duplicated some symbols. Version 0.9.0 (2023-10-18) SDK:\nNative windows support added. Wonderful toolchains now distribute native Windows binaries, and the only required change in BlocksDS was to change a library used by Grit. Thank you, Generic and asie! The stdio implementation of picolibc provided by Wonderful Toolchains has been patched by asie and this has substantially improved direct SD card read and write speeds. The RTC interrupt is no longer used in any test, example or template. Users are now expected to timer interrupt instead because the RTC interrupt isn\u0026rsquo;t supported on 3DS in DS/DSi mode or most emulators. Check the new code to see how to adapt old code. The RTC interrupt functions will still be supported to preserve compatibility with old projects that aren\u0026rsquo;t updated. Document the ARM9 \u0026lt;-\u0026gt; ARM7 boot synchronization routine. In the dockerfile, set a locale to be able to pass UTF-8 characters to ndstool to appear in the title of the NDS ROM. Add a test to ensure that the libnds modules that use the ARM9 \u0026lt;-\u0026gt; ARM7 transfer memory region don\u0026rsquo;t break. New examples: Getting key input state. Using NitroFAT, DLDI and DSi SD in the same program. Send a buffer in main RAM to the ARM7 from the ARM9. Read battery status. Set the real time clock of the NDS. libnds:\nRTC: Add new helpers to get and set the date. They use typedefs to move values between functions instead of byte arrays. The old helpers that use byte arrays have been deprecated. Using the RTC interrupt as a way to update the time every second has been deprecated. Documentation: Document values returned by the battery read function. Document RTC helpers. Add some ARM7 modules to the front page of the Doxygen documentation. Memory: Disable data cache and instruction fetch access to DTCM. Rumble detection functions won\u0026rsquo;t try to detect anything on DSi. Change location of transfer region area on DSi so that it\u0026rsquo;s uncached. Import safe DMA helpers written by Gericom and use them from all DMA helpers. Video: Make glGetInt() wait for the GPU to be idle when getting the polygon and vertices count. It is common for developers to forget to wait. Cleanup some helpers and add some missing VRAM definitions. Document hardware bug of the DMA in GFX FIFO mode. Other: FatFs updated to R0.15p3. Support the debug button (only available in emulators and debug consoles). Switch to using ARM unified syntax (UAL). Grit:\nSwitch from libfreeimage to libplum. This allows us to build Grit on Windows easier. Version 0.8.1 (2023-08-01) libnds:\nFixed NitroFAT in emulators. It only worked when DLDI was initialized correctly, which isn\u0026rsquo;t the case in emulators like no$gba. Set the right CPU as owner of the Slot-1 bus in NitroFAT handling functions. SDK:\nUpdated build systems to generate Maxmod soundbanks in the NitroFAT filesystem if the filesystem is used. This isn\u0026rsquo;t supported by ARM9 + ARM7 makefiles for now, only by ARM9 makefiles. Fixed segmentation fault in mkfatimg when not enough arguments are provided. Stop relying on make -j in Makefiles. It is passed by make to any sub-make, so it isn\u0026rsquo;t required. Added basic Maxmod and Maxmod + NitroFAT examples. Version 0.8 (2023-07-16) libnds:\nFilesystem: fatInit() now correctly sets the current working directory. NitroFAT now changes directory to nitro:/ on initialization. Fixed code that selects the default filesystem (DSi SD or DLDI). Added asynchronous math functions to suplement the synchronous functions. Added support for redirecting stdout and stderr to user functions. Added support for more rumble packs. Improved support for DSi regions in guruMeditationDump(). Documented MPU setup code properly. Cleaned up exception handling code. Added missing DLDI_SIZE_2KB define. Fixed leaking file handlers in truncate(). Fixed memory leaks and handling in image and pcx modules. ndstool:\nFixed warnings. Removed non-homebrew-related functionality. SDK:\nAutomatically link with libc and libstdc++ rather than forcing users to do it explicitly. Support *.arm.c and *.arm.cpp filenames for compatibility with devkitARM-utilizing projects. Fixed TLS initialization on the ARM7. Improved bin2c. Updated libc documentation. Improved and cleanup some examples. Version 0.7 (2023-04-19) libnds:\nKeyboard: Fixed initialization glitch where it could blink for a frame. Fixed backspace handling. Added support for non-blocking keyboard capture when using cothreads. cothread: Fixed stack alignment. Fixed the stack size of the scheduler thread. Fixed no$gba debug messages on the ARM9. Added support of no$gba debug messages to the ARM7. Implemented fatInit(). Improved sassert() so that it can exit to the loader instead of locking the application. Unified all coding and documentation style of the codebase. Changed license of GL2D to Zlib (with the author\u0026rsquo;s permission). Reduced the size of OamState structures. mmutil:\nFixed segfault with samples with implied zero loop. SDK:\nImproved some old examples. Fix memory leaks in all examples that used getcwd(). Fixed ARM9 linkerscript to place ITCM sections in ITCM correctly. Added new examples: Exception handling, assertions, no$gba debug console. Prevent mkfatimg from generating FAT images that are so small that FatFs can\u0026rsquo;t mount them. Improved installation instructions. Version 0.6 (2023-04-11) SDK:\nAdded a DLDI driver template. Refactored install targets of the SDK components. Now, all components can be installed on their own, and they copy the licenses of the components to the installation directory. Tweak bin2c behaviour to more closely match devkitPro\u0026rsquo;s bin2s. Use SPDX license identifiers in all libraries and components that end up in the NDS application binary. Some cleanup of code formatting. libnds:\nFIFO subsystem: The FIFO subsystem has been cleaned up and documented. Some bugs in the FIFO subsystem have been fixed (the stress test still fails, though). Prevent using cothread_yield() in the ARM7. Alignment of thread local storage sections has been fixed. Added support for calling stat() on the root directory of a filesystem. Added support for statvfs() and fstatvfs(). Avoid pulling in the default keyboard data when stdin-requesting code is used. This saves over 10 KB of data in any situation where the default keyboard is not used (no keyboard or non-default keyboard alike). Allow setting the duration of the lid sleep check, and to disable it completely. Build release versions of the library as well as debug. Document MPU setup steps and CP15 registers. Enable more warnings in the Makefile and fix them. ndstool:\nSupport multiple languages in the banner. Support more file formats for icons (GIF, PNG). Support animated icons (from GIF files). Version 0.5 (2023-03-31) SDK:\nDefined a default location for BlocksDS: /opt/blocksds/ LibXM7 has been integrated as a core library. Use mkfatimg (distributed with FatFs) instead of imgbuild.sh to reduce the number of dependencies. Fixed mmutil target in Makefiles in parallel builds. libnds:\nPeripherals: Improved rumble peripheral handling (including detection of the DS Rumble Pak). Cleaned up REG_EXMEMCNT initialization for the Guitar Grip and Paddle peripheral drivers. Improved error recovery in glInit(). This allows recovering the geometry engine from certain situations where a program exited in the middle of 3D engine processing. Improved error recovery in getcwd(). Fixed and simplified exit to loader code on the ARM7 side. Improved documentation of exit to loader logic and BoxTest(). Version 0.4 (2023-03-26) SDK:\nUse the Wonderful Toolchain to get full C++ standard library support. As a result, BlocksDS now targets a specific version of binutils, gcc and picolibc. Removed picolibc and avr-libstdcpp as submodules (all previous history has been condensed to one commit). Simplified the build system of tests and examples. libnds:\nMultithreading: Added cooperative multithreading scheduler. Enabled scheduler in the ARM9 by default. Added examples of having multiple threads, mutexes, and asynchronous file loading. Added support for thread-local storage. Added mutexes to FIFO handling and removable storage accesses. Added initial support and example of DSi camera (thanks, asie!). Added support for malloc() on the ARM7. Implemented stubs for fchmod(), fchmodat(), fchown(), fchownat(). readlink(), symlink(), getentropy(). Updated FatFS to R0.15p2. Fixed glTexImage2D() not flushing textures before copying them with DMA. Version 0.3.1 (2023-03-20) libnds:\nRestored support of gettimeofday() on the ARM7. Version 0.3 (2023-03-20) SDK:\nAdded some tests. Build system improvements (support two-line app titles, remove old makefiles). libsysnds has been integrated in libnds. libnds:\nImplemented a disk cache to improve FatFs performance. Added support for handling DLDI in the ARM7, as opposed to only the ARM9. This is currently controlled either using an additional, previously unused bit in the DLDI specification, or explicitly requested by the homebrew program. Added function for the ARM9 to request the ARM7 to read the cartridge. Added some missing definitions of DSi registers (SCFG/NDMA). Improved TWL/DSi interrupt support. Improved data cache handling for removable storage read/writes. Fixed detecting certain types of 128 KB cart EEPROMs. Fixed incorrect size detection for certain cases of cart EEPROM data. Tweaked default keyboard texture to make the keycap legends opaque. General cleanup of libnds code (like replacing magic numbers by defines). Fixed consoleDemoInit() to restore display brightness when initializing. Version 0.2 (2023-03-15) SDK:\nImproved C++ support (now the C++ standard library it is actually usable). Improved C library support. Fixed install target. libnds:\nIntegrated agbabi renamed as ndsabi. This provides fast implementations of memcpy(), memmove(), memset(), helper functions for facilitating coroutines, etc. Implemented support for 1BPP fonts in consoleLoadFont() and replaced default_font.bin with a derivative of Unscii, limited to ASCII characters 32-127. In total, this saves ~7.25 KB of code size for any program using the built-in console. Reduced the size of data structures controlling the built-in keyboard. Implemented missing bounds checks in keyboardGetKey(). Version 0.1 (2023-03-14) First beta release of BlocksDS. Features:\nSDK:\nSupports libnds, Maxmod, DSWiFi. Supports a lot of the standard C library. Very early support of the standard C++ library. Supports DLDI, DSi SD slot and NitroFAT (open source alternative of NitroFS) using Elm\u0026rsquo;s FatFs. Documentation on how to migrate projects to BlocksDS. Docker image provided. libnds:\nAdded new CP15 control helpers for the ARM9. Added Z1/Z2 read support for the TWL/DSi touch screen controller. This allows measuring an approximation of pressure, similar to NTR/NDS mode. ","description":"Version 1.3.1 (2024-07-26) libnds:\nAdded memory barriers to libnds functions which remap user-accessible memory. consolePrintChar() has been exposed in the public API. Coupled with internal refactors, this allows using the built-in console without pulling in printf/scanf as a dependency. Fixed function parameters and improved parameters for BIOS RSA functions. Fixed potential memory corruption when micStopRecording() was called twice. Fixed regression in new touchscreen driver on CDC (TWL). Improved documentation for the BIOS CRC-16 calculation function."},{"id":5,"href":"/docs/setup/options/windows/","title":"Windows","parent":"Options","content":"The following instructions describe how to install BlocksDS on Windows natively. If you want to use it in WSL, follow the instructions for Linux instead.\nYou will need to install the ARM toolchain of Wonderful Toolchains. Follow the instructions in this link: https://wonderful.asie.pl/docs/getting-started/#windows-via-msys2\nInstall the ARM toolchain of Wonderful Toolchain:\nwf-pacman -Syu wf-pacman -S toolchain-gcc-arm-none-eabi Now, install BlocksDS itself. For the latest stable version of BlocksDS, run:\nwf-pacman -S thirdparty-blocksds-toolchain To install the documentation and examples you can install:\nwf-pacman -S thirdparty-blocksds-docs For the latest unstable version, install the following packages instead of the previous ones:\nwf-pacman -S thirdparty-blocksds-git-toolchain \\ thirdparty-blocksds-git-docs (Optional step) You can also install some third party libraries like NightFox’s Lib and Nitro Engine using wf-pacman:\nwf-pacman -S thirdparty-blocksds-nflib \\ thirdparty-blocksds-nitroengine Whenever you need to update the SDK, run:\nwf-pacman -Syu Run Wonderful Toolchain Shell from the Start menu. This shell has predefined environment variables to ensure that BLOCKSDS projects can be built. If you don\u0026rsquo;t, BLOCKSDS won\u0026rsquo;t be set to the right path.\n","description":"The following instructions describe how to install BlocksDS on Windows natively. If you want to use it in WSL, follow the instructions for Linux instead.\nYou will need to install the ARM toolchain of Wonderful Toolchains. Follow the instructions in this link: https://wonderful.asie.pl/docs/getting-started/#windows-via-msys2\nInstall the ARM toolchain of Wonderful Toolchain:\nwf-pacman -Syu wf-pacman -S toolchain-gcc-arm-none-eabi Now, install BlocksDS itself. For the latest stable version of BlocksDS, run:\nwf-pacman -S thirdparty-blocksds-toolchain To install the documentation and examples you can install:"},{"id":6,"href":"/docs/setup/options/from_source/","title":"Build from source","parent":"Options","content":"This is the option you should use if you want to help develop BlocksDS, or if you want to always use the cutting edge version of BlocksDS.\nYou need to install a cross compiler to build applications for NDS. You also need to build a few host tools, including a C/C++ compiler.\nIf you\u0026rsquo;re on Ubuntu run the following command:\nsudo apt-get install -y --no-install-recommends build-essential You will also need to install the ARM toolchain of Wonderful Toolchains. Follow the instructions in this link but you skip step 5: https://wonderful.asie.pl/doc/general/getting-started/#linux\nNow, install the ARM toolchain of Wonderful Toolchains:\nexport PATH=/opt/wonderful/bin:$PATH wf-pacman -Syu wf-pacman -S toolchain-gcc-arm-none-eabi You can also install the Teak toolchain if you want to develop binaries for the DSP of the DSi. This isn\u0026rsquo;t available in all platforms (like in Windows).\nwf-pacman -S toolchain-llvm-teak-llvm Now, clone this repository:\ngit clone --recurse-submodules https://github.com/blocksds/sdk.git cd sdk To build the SDK, run this from the root of this repository:\nBLOCKSDS=$PWD make -j`nproc` Now, you have some options. The first one is recommended, the others are for users that may have advanced needs.\nRecommended. Install it in your system. You won\u0026rsquo;t need to set BLOCKSDS or BLOCKSDSEXT manually to use the SDK. Run:\nsudo mkdir /opt/blocksds/ \u0026amp;\u0026amp; sudo chown $USER:$USER /opt/blocksds mkdir /opt/blocksds/external make install This will install the libraries and tools to /opt/blocksds/core. Third party libraries and tools are expected to be installed to /opt/blocksds/external.\nBLOCKDS defaults to /opt/blocksds/core in all Makefiles, and BLOCKDSEXT defaults to /opt/blocksds/external.\nInstall it in your system in a custom path. You will need to set BLOCKSDS or BLOCKSDSEXT manually to use the SDK. Run:\nBLOCKSDS=$PWD make INSTALLDIR=my/path -j`nproc` You can avoid exporting BLOCKSDS every time by adding it to your .bashrc, .zshenv or similar.\nUse the libraries from this path. Make sure that the environment variable BLOCKSDS is always set to the right location when you want to use the SDK. The build system of the templates and examples will use this variable to locate the components of BlocksDS it and use them. Any other external library will need to be managed by you.\nYou can avoid exporting BLOCKSDS every time by adding it to your .bashrc, .zshenv or similar.\n","description":"This is the option you should use if you want to help develop BlocksDS, or if you want to always use the cutting edge version of BlocksDS.\nYou need to install a cross compiler to build applications for NDS. You also need to build a few host tools, including a C/C++ compiler.\nIf you\u0026rsquo;re on Ubuntu run the following command:\nsudo apt-get install -y --no-install-recommends build-essential You will also need to install the ARM toolchain of Wonderful Toolchains."},{"id":7,"href":"/docs/design/exit_to_loader/","title":"Exit to loader protocol","parent":"Additional information","content":" 1. Introduction Normally, the only way to exit a DS application is to switch the console off and turn it on again. It can get annoying to do this if you\u0026rsquo;re, for example, testing many applications. libnds supports a protocol that allows an application loader (such as the menu of a flashcart) to setup an exit routine that allows the application to return to the loader. This is needed because the DS doesn\u0026rsquo;t have an OS, so the protocol is managed manually.\nThere is a bit of information about the protocol in this link. However, this documentation is very lacking. There is also an open source loader that implements this protocol, called NDS Homebrew Menu.\nThis document describes the process that happens when a homebrew application tries to return to the loader.\nBefore starting the application, the loader copies a small binary blob at the end of RAM, in a location that has been predefined by the protocol. Then, the loader starts the application.\n2. The application exits The first step involves the application itself. Both the ARM9 and ARM7 CPUs can call exit(), or to return from the main() function.\nexit() is a standard C library function. In both devkitARM and BlocksDS all it does is to call another function, __libnds_exit().\nIf the main() function returns, the effect is the same, as the crt0 will call __libnds_exit() right after main() returns.\n3. libnds starts the exit to the loader The implementation of __libnds_exit() is in libnds_exit.c.\nThe first thing it does is to look for the protocol structure in RAM.\nThis is the format of the struct that is used by the protocol:\n#define BOOTSIG 0x62757473746F6F62ULL // \u0026#34;bootstub\u0026#34; in ASCII struct __bootstub { u64 bootsig; VoidFn arm9reboot; VoidFn arm7reboot; u32 bootsize; }; The location of this struct is 48 KiB before the end of RAM. Depending on the DS model, the size of the RAM is different, so the location will change as well. In libnds there is a pointer called fake_heap_end that is set up during boot and points to this location.\nModel RAM end bootstub address DS/DS Lite 0x2400000 0x23F4000 DSi 0x3000000 0x2FF4000 __libnds_exit() tries to access the struct at that location. If bootsig matches BOOTSIG, it means that the exit to loader data has been provided and the function can try to start the exit process. If the signature isn\u0026rsquo;t found, it will simply power off the console (which actually causes a reset to the system menu in the DSi).\nIf the reset has been requested from the ARM7, arm7reboot() is called. Similarly, if the ARM9 has requested the reset, arm9reboot() is called. Note that in BlocksDS, arm7reboot() isn\u0026rsquo;t used anymore.\nThe last field of the struct, bootsize, is the size of the loader that arm7reboot() and arm9reboot() eventually boot into. The loader is located right after the arm7reboot() and arm9reboot() functions. It is simply appended to the bootstub code. This will be explained later.\n4. Handshake between ARM7 and ARM9 This part of the process involves the code in bootstub.s.\nThat code is quite hard to read, so this is a disassembled and commented version of that code:\n// SPDX-License-Identifier: GPL-2.0+ // // Copyright (C) 2010 Dave \u0026#34;WinterMute\u0026#34; Murphy // Copyright (C) 2023 Antonio Niño Díaz // This file is a reverse-engineered version of: // // https://github.com/devkitPro/nds-hb-menu/blob/d982d376ad8fc232c9c9b9284e26c28d0fc9d521/bootstub/bootstub.s typedef struct { uint64_t signature; // \u0026#34;bootstub\u0026#34; uintptr_t arm9reboot; uintptr_t arm7reboot; uint32_t loader_size; } bootstub_header_t; // swiSoftReset() jumps to the addresses written in the locations below after // preparing for the reset. #define BIOS_ARM7_BOOTADDR (*(uint32_t *)0x02FFFE34) #define BIOS_ARM9_BOOTADDR (*(uint32_t *)0x02FFFE24) // the FIFO handler will detect this value, sync with the function waitcode(), // below, then call swiSoftReset(). #define LIBNDS_RESET_CODE 0x0C04000C // The ARM7 reset vector sets the reset address of the ARM9 to the reset vector // of the ARM9, then it forces the ARM9 to call swiSoftReset() and jump to that // vector. The ARM9 will then start the actual reset process, including telling // the ARM7 to call swiSoftReset(). void hook9from7(void) // arm7reboot() -\u0026gt; this has to run on the ARM7 { // Tell the ARM9 to run this function after swiSoftReset() BIOS_ARM9_BOOTADDR = hook7from9; // Tell the ARM9 to sync with the ARM7 and call swiSoftReset() REG_IPC_FIFO_TX = LIBNDS_RESET_CODE; // ARM7 bootcode can be loaded here (37F8000h..3807DFFh) uint32_t *ARM7BASE = 0x037F8000; // Copy both the waitcode() and waitsync() code to ARM7BASE memcpy(ARM7BASE, waitcode, sizeof(waitcode) + sizeof(waitsync)); ARM7BASE() // After returning from ARM7BASE(), the ARM7 returns to __libnds_exit() and // gets trapped in an infinite loop. } void waitcode(void) { waitsync(1) REG_IPC_SYNC = 0x100; waitsync(0) REG_IPC_SYNC = 0x0; } void waitsync(uint32_t val) { while ((REG_IPC_SYNC \u0026amp; 0x000F) != val); } // The ARM9 reset vector disables the cache, loads the loader code to VRAM_C, // sets VRAM_C as the boot address of the ARM7 after a reset, and forces the // ARM7 to call swiSoftReset() and jump to that address. The ARM9 will stay in // an infinite loop until the ARM7 gives it a boot address. It\u0026#39;s the // responsibility of the loader to provide this address to the ARM9. void hook7from9(void) // arm9reboot() -\u0026gt; this has to run on the ARM9 { REG_IME = 0; // ldr r1, 0x2078 @ disable TCM and protection unit // mcr p15, 0, r1, c1, c0 // // @ Disable cache // mov r0, #0 // mcr p15, 0, r0, c7, c5, 0 @ Instruction cache // mcr p15, 0, r0, c7, c6, 0 @ Data cache // mcr p15, 0, r0, c3, c0, 0 @ write buffer // // @ Wait for write buffer to empty // mcr p15, 0, r0, c7, c10, 4 REG_VRAMCNT_C = VRAM_ENABLE | VRAM_C_LCD; // This is the loader code provided right after the bootstub code. The size // is specified in the bootstub header. It will run in the ARM7, not the // ARM9. The loader code comes from here: // // https://github.com/devkitPro/nds-bootloader/tree/69cea3c5b7f3278f4b63672d345d0009b7f7d62d // // Its purpose is to reload nds-hb-menu and jump to it memcpy(VRAM_C, _loader, _loader_size) REG_VRAMCNT_C = VRAM_ENABLE | VRAM_C_ARM7_0x06000000; // Mapped to 6000000h REG_EXMEMCNT |= (1 \u0026lt;\u0026lt; 11) | (1 \u0026lt;\u0026lt; 7); // ARM7 owns both Slot-1 and Slot-2 // Tell the ARM7 to run the code in VRAM_C after swiSoftReset() BIOS_ARM7_BOOTADDR = 0x06000000; // Tell the ARM7 to sync with the ARM9 and call swiSoftReset() REG_IPC_FIFO_TX = LIBNDS_RESET_CODE; waitsync(1) REG_IPC_SYNC = 0x100; waitsync(0) REG_IPC_SYNC = 0x0; // Set up and enter passme loop // Basically, we setup the value of 0x02fffe04 to be a branch to the address // stored in 0x02fffe24. Initially, this address is 0x02fffe04, so this is // an infinite loop until something writes to 0x02fffe24 and frees the ARM9. #define ARM9_BRANCH_ADDRESS (uint32_t *)0x02fffe04 #define ARM9_BRANCH_DESTINATION (uint32_t *)0x02fffe24 *ARM9_BRANCH_ADDRESS = 0xE59FF018; // ldr r15, [r15 + 0x20] *ARM9_BRANCH_DESTINATION = ARM9_BRANCH_ADDRESS; ARM9_BRANCH_ADDRESS(); } Exit from ARM7 This process is different in devkitPro and BlocksDS. The version of BlocksDS is slightly simplified compared to devkitPro (it simplifies exit from the ARM7 by reducing it to the case of exit from the ARM9). BlocksDS reserves two different FIFO command IDs, one for each CPU, while devkitPro uses the same command ID for both CPUs.\nBlocksDS:\nThe ARM7 sends command 0x0C04000B using the FIFO registers. It corresponds to the following:\nFIFO_ADDRESSBIT | FIFO_IMMEDIATEBIT | FIFO_ARM7_REQUESTS_ARM9_RESET The ARM7 enters an infinite loop with interrupts enabled.\nThe ARM9 receives the message, which causes an interrupt.\nThe ARM9 FIFO interrupt handler sees this special message (FIFO_ADDRESSBIT and FIFO_IMMEDIATEBIT are never used together in normal messages) and it calls exit(), which eventually calls arm9reboot(). This means that, at this point, the process is the same as when the reset has been started from the ARM9.\ndevkitPro:\nThe ARM7 calls arm7reboot().\narm7reboot() writes the address of arm9reboot() to address BIOS_ARM9_BOOTADDR (0x02FFFE24). This is a special location known by the BIOS, used later.\narm7reboot() sends command 0x0C04000C to the ARM9.\nThe ARM7 enters a sync routine that uses register REG_IPC_SYNC to synchronize both CPUs.\nThe ARM9 FIFO interrupt handler sees this special message and it enters a similar sync procedure.\nWhen the sync procedure is over, the ARM7 enters an infinite loop, and the ARM9 calls swiSoftReset().\nswiSoftReset() makes the ARM9 jump to the address in BIOS_ARM9_BOOTADDR. This means that, at this point, the process is the same as when the reset has been started from the ARM9.\nExit from ARM9 arm9reboot() is called by the ARM9.\nIt disables interrupts, the cache, TCM and the protection unit, and cleans the cache.\nIt copies to VRAM_C the loader appended right after the bootstub code. It copies bootsize bytes in total. Then, it sets up VRAM_C as ARM7 RAM mapped to address 0x06000000. It\u0026rsquo;s important to notice that the loader boot code is ARM7 code, this will be explained later.\nIt switches the ownership of Slot-1 and Slot-2 to the ARM7.\nIt sets the ARM7 start address (specified in BIOS_ARM7_BOOTADDR, address 0x02FFFE34) as the start of VRAM_C (mapped to 0x06000000).\nIt sends command 0x0C04000C to the ARM7.\nFIFO_ADDRESSBIT | FIFO_IMMEDIATEBIT | FIFO_ARM9_REQUESTS_ARM7_RESET The ARM9 and the ARM7 synchronize using REG_IPC_SYNC.\nThe ARM9 setups a boot loop that jumps forever to the address stored in 0x02FFFE24.\nThe ARM7 calls swiSoftReset(), which makes it jump to the start of the loader in VRAM_C.\nSome loader code runs in the ARM7 (read the next section).\nEventually, the loader code will write an address to 0x02FFFE24 so that the ARM9 can end the boot loop and jump to the ARM9 code that will continue the process.\n5. Loader of bootloader This code runs from VRAM_C, and initially it runs on the ARM7 only. The ARM7 must copy the ARM9 code somewhere outside of VRAM_C (it has been mapped to the ARM7 so it is hidden from the ARM9). When the code of the ARM9 has been loaded to its final destination, the ARM7 tells the ARM9 to jump there.\nThis loader is a small application that can use DLDI or the DSi SD driver to load an application from the SD card, and then it boots that application.\nIn the case of the NDS Homebrew Menu, this loader loads the NDS ROM of the NDS Homebrew Menu. This way, from the point of view of the user, the application returns to the loader. In reality, the application hasn\u0026rsquo;t returned to the loader, it has just loaded the loader again!\n","description":"1. Introduction Normally, the only way to exit a DS application is to switch the console off and turn it on again. It can get annoying to do this if you\u0026rsquo;re, for example, testing many applications. libnds supports a protocol that allows an application loader (such as the menu of a flashcart) to setup an exit routine that allows the application to return to the loader. This is needed because the DS doesn\u0026rsquo;t have an OS, so the protocol is managed manually."},{"id":8,"href":"/docs/technical/filesystem/","title":"Filesystem support","parent":"Technical information","content":" 1. Introduction BlocksDS supports using standard C functions to access the filesystem. It is possible to use them to access both the SD cards of flashcarts, and the internal SD slot of the DSi. This code is integrated in libnds, so you don\u0026rsquo;t need to do anything special to use it.\nAdd the following to your project:\n#include \u0026lt;fat.h\u0026gt; int main(int argc, char *argv[]) { bool init_ok = fatInitDefault(); if (!init_ok) { // Handle error } // Rest of the code } This function whether it\u0026rsquo;s running on a regular DS or a DSi.\nDS: It will try to use DLDI to initialize access to the SD card of the flashcart. If it isn\u0026rsquo;t possible it returns false. If it succeedes, it returns true.\nDSi: It will try to initialize access to the internal SD slot, and the SD of the flashcart. It will only return false if the internal slot of the DSi can\u0026rsquo;t be accessed, and it will return true if it can.\nThe initial working directory is \u0026ldquo;fat:/\u0026rdquo; on the DS (DLDI), and \u0026ldquo;sd:/\u0026rdquo; on DSi. On the DSi it is possible to switch between both filesystems with chdir().\nIt is also possible to embed a filesystem in the NDS ROM with NitroFS. This is a good way to keep all the assets and code of your game as one single file. You can access files in this filesystem by using the drive name nitro:/ in any path provided to the C library functions.\n#include \u0026lt;filesystem.h\u0026gt; int main(int argc, char *argv[]) { // Call fatInitDefault() here if you want. bool init_ok = nitroFSInit(NULL); if (!init_ok) { // Handle error. You probably want to hang here if NitroFS can´t be // read, because all of your assets will be unavailable. Another // option is to return from main() or call exit() to return to the // loader. } // Rest of the code } Check this example to see how to use NitroFS.\n2. Supported functions You may use functions such as fopen, fread, fwrite, fseek, fclose, stat, rename, truncate, mkdir, unlink, access, chdir, getcwd. fstat works, but a limitation: it doesn\u0026rsquo;t have access to the modification date of the file, while stat does.\nYou can also use open, read, write, lseek and close, but this isn\u0026rsquo;t as common.\nThe dirent.h functions to read the contents of directories are available: opendir, closedir, readdir, rewinddir, seekdir, telldir.\nIt\u0026rsquo;s easy to find information online about how to use all of them. If any specific function isn\u0026rsquo;t supported, raise an issue to request it.\n3. Running on hardware If your flashcart doesn\u0026rsquo;t do it automatically, patch your ROM with the DLDI patcher. Most flashcarts do this automatically.\n4. Running on emulators Filesystem access works in several emulators. The following ones have been tested:\nmelonDS: The ROM runs in DS/DSi mode. no$gba: The ROM runs in DSi mode. A FAT image needs to be used. DeSmuMe: The ROM needs to be DLDI patched, it only runs in DS mode. melonDS melonDS supports both DLDI in DS/DSi modes, and the internal SD in DSi mode.\nIt supports using a folder as a base for the SD of the DSi, or for a DLDI device for DS.\nOpen \u0026ldquo;Emu settings\u0026rdquo;. The \u0026ldquo;DSi mode\u0026rdquo; and \u0026ldquo;DLDI\u0026rdquo; tabs let you select the folders to use as root of the filesystems (or the filesystem images to be used, if you prefer that).\nno$gba no$gba supports DSi mode. You must generate a FAT filesystem image with tools/imgbuild. The sample Makefile of the provided templates have a target that lets you do this automatically. Open the Makefile and set the variables SDROOT and SDIMAGE. To build the image, run:\nmake sdimage no$gba requires that the image is called DSi-1.sd and is located in the same directory as no$gba. Set SDIMAGE to \u0026lt;path-to-folder\u0026gt;/DSi-1.sd to avoid renaming the file all the time.\nThen, open no$gba as normal.\nDeSmuMe It supports DS mode only. Run the following command when building the ROM:\nmake dldipatch This will patch the ROM with the DLDI driver of the R4, which is required for the emulator to access the filesystem.\nYou will need to set the \u0026ldquo;Slot 1\u0026rdquo; configuration to \u0026ldquo;R4\u0026rdquo;, and set the directory to the folder that will act as root of your filesystem. If using DeSmuMe with a graphical interface, the settings can be found in \u0026ldquo;Config \u0026gt; Slot 1\u0026rdquo;. If using it through the command line, run it like this:\ndesmume --slot1=R4 --slot1-fat-dir=\u0026lt;path-to-folder\u0026gt; \u0026lt;path-to-rom\u0026gt;.nds ","description":"1. Introduction BlocksDS supports using standard C functions to access the filesystem. It is possible to use them to access both the SD cards of flashcarts, and the internal SD slot of the DSi. This code is integrated in libnds, so you don\u0026rsquo;t need to do anything special to use it.\nAdd the following to your project:\n#include \u0026lt;fat.h\u0026gt; int main(int argc, char *argv[]) { bool init_ok = fatInitDefault(); if (!"},{"id":9,"href":"/docs/usage/debugging/","title":"How to debug programs","parent":"Usage","content":"While developing applications with BlocksDS you will reach situations where you need to debug your code. There are different ways to do this with BlocksDS, and they are described below.\n1. printf debugging This is a classic way to debug messages, but it\u0026rsquo;s still worth mentioning it.\nIt\u0026rsquo;s very easy to setup libnds so that the output of printf() is sent to a text console on the screen. All you have to do is:\nconsoleDemoInit(); printf(\u0026#34;This is a debug message: %d\u0026#34;, 123); By default, all text sent to stdout and stderr will be directed to this console after it is initialized.\nCheck this example to see it in action.\nNote that if you initialize the console like this, it will setup the sub screen to only display the text console, which can be very limiting if your application is already using that screen for something else. You can use consoleInit() to initialize the console in a more specialized way. Check the examples to see how to use this function.\nYou can check this example for a more advanced setup that allows you to display text over a 3D scene. You can set it up over other 2D layers as well.\n2. no$gba-style console It\u0026rsquo;s possible to setup libnds so that stderr is redirected to the debug console of no$gba (debugger version) instead of a text console on the screen. This has the advantage of being less invasive for your application, and it will let you copy-paste text in case you want to use that for something. You can see the messages this \u0026ldquo;Window\u0026rdquo; \u0026gt; \u0026ldquo;TTY Debug Messages\u0026rdquo;. You can switch between messages sent by the ARM7 and ARM9 by changing the selected CPU in the debugger with \u0026ldquo;Window\u0026rdquo; \u0026gt; \u0026ldquo;ARM9 (Main CPU)\u0026rdquo; and \u0026ldquo;Window\u0026rdquo; \u0026gt; \u0026ldquo;ARM7 (Sub CPU)\u0026rdquo;.\nmelonDS is also compatible with this protocol. If you launch melonDS from the command line prompt like melonDS your_rom.nds it will print all messages to the text console. You can\u0026rsquo;t switch between CPUs, all messages are printed to the same console (so you will need to add a way to identify the messages in your code if they can happen from both CPUs).\nTo use it, follow the instructions below.\nIn the ARM7 the default behaviour is to send stderr messages to this console, so you don\u0026rsquo;t need to do initialize anything. In the ARM9 you need to enable it by doing this:\n// Redirect stderr to the no$gba debug console. By default both stdout and // stderr are redirected to the libnds console. consoleDebugInit(DebugDevice_NOCASH); After that, you can send messages to the console like this:\nfprintf(stderr, \u0026#34;Debug message!\\n\u0026#34;); Remember to check the example to see how to do it in a real application.\nNote that the string can contain special parameters that will be filled in by the emulator:\nThe ascii string may contain parameters, defined as %param%:\nr0, r1, \u0026hellip; r15: Show register value as a hexadecimal number. sp, lr, pc: Same as r13, r14 and r15. scanline: Current scanline number. frame: Number of frames since boot. totalclks: Number of clocks since boot. lastclks: Number of clocks since the last lastclks or zeroclks. zeroclks: Reset the lastclks counter. From C you can use them like this (note that you need to use %% because % by itself is used to format strings!):\nfprintf(stderr, \u0026#34;Frame: %%frame%%\\n\u0026#34;); More information here.\n3. Exception handler libnds comes with an exception handler that can help you debug some crashes in your program. It appears as a red screen that says \u0026ldquo;Guru Meditation Error!\u0026rdquo; followed by a lot of information:\nYou can enable by calling this function, preferably right at the start of main():\ndefaultExceptionHandler(); The exception handler is used whenever:\nThe CPU tries to execute an undefined instruction.\nThis usually means that the CPU is executing memory that isn\u0026rsquo;t code, which can mean anything from memory corruption to a function pointer that was invalid.\nlibnds sometimes deliberately executes an undefined instruction to crash in a controlled way.\nThe CPU tries to access memory that is protected (data abort).\nThis happens because libnds setups the MPU (Memory Protection Unit) in a way that only lets the CPU access addresses where there is actual memory. The 32-bit address space of the CPUs is too big for all the memory available on the NDS, there are large gaps between different memory regions. Accessing the gaps will cause a data abort. Also, the MPU has been setup to cause data aborts if the program tries to write to read-only memory (like the BIOS).\nNote that on a DSi the GBA slot memory isn\u0026rsquo;t accessible. This may cause programs to crash if they haven\u0026rsquo;t been tested on a DSi before. You can solve this issue by checking isDSiMode() before accessing the GBA slot memory.\nNormally this error means that you have a pointer that doesn\u0026rsquo;t point to valid memory and you have tried to access it.\nCheck this example to see it in action. Note that this will only work in melonDS and on hardware. Other emulators won\u0026rsquo;t emulate it at all.\n3.1 How to use all the information on the screen? The most important thing on the screen are the values of pc and addr at the top of the screen. pc says what\u0026rsquo;s the address where the CPU crashed. You can translate this to an address in your code by running addr2line in your terminal. For example:\n/opt/wonderful/toolchain/gcc-arm-none-eabi/bin/arm-none-eabi-addr2line \\ -e build/debug_exception_handler.elf -a 0x2001252 Another option (that can be more useful!) is to use objdump to generate a text file with the assembly code of your program. The templates and examples have a Makefile target to do this for you. For ARM9-only projects, run:\nmake dump For combined ARM7+ARM9 projects, run:\nmake -f Makefile.arm9 dump make -f Makefile.arm7 dump With this, all you have to do is to open the resulting dump file in a text editor and look for the address on the screen.\nAlso, if you understand assembly language, you can try to use the rest of the information on the screen to try to understand what the code was doing when it crashed.\n4. -lnds9d/-lnds7d sassert() melonDS GDB server NO$GBA debugger ","description":"While developing applications with BlocksDS you will reach situations where you need to debug your code. There are different ways to do this with BlocksDS, and they are described below.\n1. printf debugging This is a classic way to debug messages, but it\u0026rsquo;s still worth mentioning it.\nIt\u0026rsquo;s very easy to setup libnds so that the output of printf() is sent to a text console on the screen. All you have to do is:"},{"id":10,"href":"/docs/design/","title":"Additional information","parent":"BlocksDS Documentation","content":"","description":""},{"id":11,"href":"/docs/technical/memory_map/","title":"Memory map","parent":"Technical information","content":" 1. Introduction The DS has several RAM regions that are distributed across its address space. In most cases you don\u0026rsquo;t need to worry about the details, as libnds is set up in a way that covers most use-cases. All you normally need to worry about is how to allocate VRAM to be used by the 2D and 3D engines. However, in some cases it may be needed to understand how everything works.\n2. Memory map 2.1 ARM9 Memory Map Address Size Description 0x0000000 32 KB Instruction TCM (ITCM) (mirror-able to 1000000h) 0xxxxx000 16 KB Data TCM (DTCM) (moveable) 0x2000000 4 MB Main RAM (8 MB in debugger consoles) 0x3000000 0/16/32 KB Shared WRAM 0x4000000 - I/O registers 0x5000000 2 KB Standard palette RAM (for 2D BGs and sprites) 0x6000000 - VRAM 0x7000000 2 KB OAM (for 2D sprites) 0x8000000 32 MB GBA slot ROM/RAM 0xA000000 64 KB GBA slot SRAM 0xFFFF0000 32 KB ARM9 BIOS 2.2 ARM7 Memory Map Address Size Description 0x0000000 16 KB ARM7 BIOS 0x2000000 4 MB Main RAM (8 MB in debugger consoles) 0x3000000 0/16/32 KB Shared WRAM 0x3800000 64 KB ARM7 WRAM (64KB) 0x4000000 - I/O registers 0x6000000 - VRAM allocated as Work RAM to the ARM7 0x8000000 32 MB GBA slot ROM/RAM 0xA000000 64 KB GBA slot SRAM 2.3 DSi changes ARM7 BIOS is 64 KB instead of 16 KB. ARM9 BIOS is 64 KB instead of 32 KB. Main RAM is quadrupled to 16 MB (32 MB in debugger consoles). An additional 768 KB of WRAM is provided, referred to as NWRAM. The GBA slot ROM and RAM areas are filled with 0xFF. At 0xC000000 there is a mirror of main RAM. 3. Memory Protection Unit (MPU) The ARM9 has a MPU, as well as data and instruction caches. The MPU lets you:\nDefine which parts of the address space can be read/written. If you try to read or write an address that you\u0026rsquo;re not allowed to, you will cause a data abort exception. Decide which parts of the address space can be executed as code. Decide which parts of the address space are cached. The MPU doesn\u0026rsquo;t let you remap any memory block. However, most memory regions are mirrored. For example, on a regular DS, main RAM starts at 0x2000000, and the next memory can be found at address 0x3000000. In total, this is 16 MB. However, main RAM is only 4 MB in size. Mirroring means that the 4 MB are repeated a total of 4 times until address 0x3000000.\nMirrors allow us to do clever things with the MPU:\nITCM is mapped at address 0x0000000, but it is repeated until 0x2000000. Using it at address 0x0000000 is problematic because NULL would become a valid address, and normally we want it to be invalid, so that reads/writes to a NULL pointer cause exceptions. With the MPU we can block accesses to the first mirror of ITCM, and we can only let programs access it at address 0x1000000. Normally we want main RAM to be cached. However, it can be very useful to access it without cache in some cases. We can use the MPU to enable accesses to one of the mirrors as cached memory, and to a different mirror as uncached memory. Even without an MPU, mirrors can be useful:\nThe BIOS exception vector address as well as the pointer to the top of exception stack is stored at the end of main RAM. We could calculate the right address of the end of the RAM for all DS models, but it\u0026rsquo;s easier to access it at the last mirror of main RAM right before 0x3000000, so that it\u0026rsquo;s the same address in all models. Shared WRAM is found at 0x3000000, but it is mirrored up to 0x3800000, where ARM7 WRAM starts. This means that it is possible to use the last mirror of shared WRAM and the first mirror of ARM7 WRAM as one contiguous memory block. The regions of the address space that are cached in libnds are the ARM9 BIOS, and main RAM. ITCM and DTCM aren\u0026rsquo;t supposed to be cached.\nIf you want to know all the details of the MPU setup, you can check the code in libnds, which is fairly well documented.\nNote that slot 2 memory is normally uncached, but libnds provides helpers to use RAM slot 2 cartridges, and it allows the developer to enable cache for them if desired.\n4. Main RAM 4.1. Configuration The size and location of main RAM changes depending on the console model. All of them have main RAM starting at address 0x2000000, this table shows the differences:\nModel Size Mirrors Retail DS 4 MB 0x2400000, 0x2800000, 0x2C00000 Debugger DS 8 MB 0x2800000 Retail DSi 16 MB 0xC000000 Debugger DSi 16+16 MB 0xC000000 All mirrors are uncached in libnds.\nOn the DSi, the register SCFG_EXT allows the developer to set the limit of main RAM. It allows you to map 4, 16 or 32 MB of RAM to the adddress space:\n4 MB: Used as DS compatibility mode, the other 12 MB will be mirrors of the first 4 MB instead of more RAM. 16 MB: Normal setting. 32 MB: On a DSi debugger, it will expose the additional 16 MB of RAM. On a retail DSi, the additional 16 MB will be a mirror of the first 16 MB. You may have realized that the debugger DSi model doesn\u0026rsquo;t have enough space at 0x2000000-0x3000000 for the full 32 MB of RAM, only for 16 MB. Unfortunately, the additional 16 MB can only be accessed at 0xD000000. This means that, according to the setup of libnds, this area is uncached.\nDebugger DSi consoles are very unusual, so they aren\u0026rsquo;t a real concern. However, 3DS consoles in DSi mode can access the full 32 MB that would correspond to a DSi debugger unit. Because of this, it is interesting to support the full 32 MB of RAM.\n4.2. Reserved areas The last 48 KB of main RAM is reserved by libnds and/or contains data provided by the .nds loader:\nAddress Description 0x2FF0000 libnds shadows this area with DTCM, making it inaccessible through this address. 0x2FF4000 devkitARM bootstub structure. Used for implementing the exit to loader protocol. 0x2FFE000 DSi only: .nds header - 0x1000 bytes. 0x2FFF000 libnds ARM9/ARM7 internal IPC region. (Mostly) deprecated. 0x2FFFC80 DS/DSi: user settings loaded from flash memory. 0x2FFFD9C DS/DSi: ARM9 exception vector, as well as top of stack. 0x2FFFE00 DS/DSi: .nds header - 0x160 bytes on DSi, 0x170 bytes on NDS. 0x2FFFE70 devkitARM argv structure. Used for implementing argument passing. 4.3. Caveats Note that, if both CPUs are accessing main RAM at the same time, there will be penalties that will delay accesses. Ideally, ARM9 and ARM7 should use different memory regions so that this doesn\u0026rsquo;t happen. That\u0026rsquo;s why the ARM7 normally only uses ARM7 WRAM and Shared WRAM (which is always mapped to the ARM7 by libnds). This way the ARM7 has access to 96 KB of WRAM, which isn\u0026rsquo;t much, but it\u0026rsquo;s normally enough.\n5. ITCM and DTCM Because of how fast it is, DTCM is used for the stack of the ARM9. DTCM can be mapped anywhere, and libnds maps the 16 KB of DTCM at 0x2FF0000-0x2FF4000. Developers may use DTCM for their own variables, but that will reduce the amount of stack available, so be careful when doing that.\nYou may notice that this overlaps with 16 KB of main RAM in DSi consoles. Yes, the main RAM that is hidden by DTCM can only be accessed through the uncached main RAM mirror in this case.\nITCM is similarly fast, and it is used by libnds for time-sensitive code like exception handlers. Developers may use the remaining space for anything they like.\nSomething very important to consider is that only the ARM9 sees ITCM and DTCM. The ARM7 can\u0026rsquo;t see them, so you can\u0026rsquo;t use them to share data between CPUs. Also, the DMA doesn\u0026rsquo;t see ITCM or DTCM, so you can\u0026rsquo;t use it to copy data when the source or destination is in ITCM or DTCM, you will have to use a regular CPU copy.\nITCM can\u0026rsquo;t be remapped, but the 32 KB of ITCM are mirrored from 0x0000000 to 0x2000000. It is important to allow the CPU to access the first few KB of ITCM at address 0x0000000 because that\u0026rsquo;s where the CPU expects the exception vectors, but address 0x0000000 is very inconvenient from the point of view of development. Normally, NULL doesn\u0026rsquo;t point to valid memory. It would be better to not use any pointer that is too close to NULL. That\u0026rsquo;s why libnds sets up the MPU so that ITCM is accessed at address 0x1000000.\n6. ARM7 WRAM and Shared WRAM This WRAM is available for the ARM7 only. It\u0026rsquo;s fairly small, only 64 KB. However, this is the main RAM that the ARM7 should use, as it will leave main RAM to be freely accessed without any penalty by the ARM9.\nShared WRAM can be mapped to the ARM9 or ARM7 as two blocks of 16 KB. However, because the ARM7 WRAM is so small, libnds allocates all of it to the ARM7 in a way that the 32 KB of shared WRAM go right before the 64 KB of ARM7 WRAM, for a total of 96 KB of WRAM.\n6.1. Reserved areas The last 64 bytes of ARM7 WRAM is reserved for the NDS BIOS:\nAddress Description 0x380FFC0 BIOS auxillary (DSi-specific) IRQ acknowledgement 0x380FFDC ARM7 exception vector, as well as top of stack. 0x380FFF8 BIOS IRQ acknowledgement 0x380FFFC BIOS IRQ handler access 6.2. DSi Shared WRAM (NWRAM) The DSi introduces 3 new banks of WRAM (libnds calls it NWRAM). Each one of the banks (A, B and C) are 256 KB in size. Each bank is divided in 32 KB slots that can be assigned to ARM7 or ARM9. In the case of NWRAM-B and C, they can also be assigned as memory to the DSP.\nThis WRAM is a bit problematic.\nFirst, there is SCFG_EXT. This register can disable access to the SCFG and MBK registers (bit 31). If the loader of the NDS ROM doesn\u0026rsquo;t have enough privileges and it loads the NDS ROM with this bit set to 0, the ROM won\u0026rsquo;t be able to reconfigure the SCFG or MBK registers.\nThen, there are registers called MBK1 up to MBK9, which are used to configure NWRAM. MBK9 can disable access to registers MBK1 to MBK5, the same registers that enable or disable the new WRAM banks.\nNintendo seems to use the convention that WRAM-A is always mapped to the ARM7, and it\u0026rsquo;s mapped to address 0x3000000. This is reliable enough that libnds uses the same convention and always allocates WRAM-A to the ARM7 at the same address.\nHowever, WRAM-B and C don\u0026rsquo;t seem to have any specific convention (and they need to be allocated to the DSP if the DSP is used) so there isn\u0026rsquo;t any specific default in libnds for them.\nThe functions that map WRAM-A/B/C in libnds always check the MBK9 register to ensure that it is possible to modify the settings before trying to do it.\nFinal note: The DSi ROM header has some fields that are used as default values for all MBK registers. However, it doesn\u0026rsquo;t look like all homebrew loaders use them, so we can\u0026rsquo;t rely on them.\n7. GBA slot In DS consoles it is possible to access the GBA slot starting at address 0x8000000. While it is possible to use this to read the ROM of GBA cartridges, the main situation where this memory region is useful is when there is a RAM expansion pack or some sensor or input device connected to the GBA slot.\nNormally this memory region is uncached because libnds can\u0026rsquo;t make any assumption of what the GBA slot will contain, but developers can reconfigure this region as cached (which could be useful if a RAM expansion pack is detected).\nAlso, note that RAM in this memory region can\u0026rsquo;t be written in 8-bit units, only in 16 or 32-bit units.\n8. VRAM VRAM mappings aren\u0026rsquo;t very intuitive. Let\u0026rsquo;s explain this with an example.\nThe developer configures background 2 of the main screen as a 256x256 16-bit bitmap, using map base 0. The 2D graphics engine will try to render it by reading from addresses 0x06000000 to 0x06020000. The developer must ensure that there is memory mapped to that memory range. For that, the developer must setup one of the VRAM banks (A to I) as main engine background VRAM.\nFor example, the developer can map VRAM A as main engine background RAM:\nvramSetBankA(VRAM_A_MAIN_BG_0x06000000); This will map all of the 128 KB of VRAM A starting at address 0x6000000. It is possible to use other VRAM banks for the same purpose. Any of the following 3 lines would have the same effect:\nvramSetBankB(VRAM_B_MAIN_BG_0x06000000); vramSetBankC(VRAM_C_MAIN_BG_0x06000000); vramSetBankD(VRAM_D_MAIN_BG_0x06000000); (VRAM banks E, F and G can also be used as main engine background VRAM, but they aren\u0026rsquo;t big enough to hold a 256x256 16-bit bitmap!)\nIf you want to allocate all VRAM A to D banks for main screen backgrounds, you could do something like this:\nvramSetBankA(VRAM_A_MAIN_BG_0x06000000); vramSetBankB(VRAM_B_MAIN_BG_0x06020000); vramSetBankC(VRAM_C_MAIN_BG_0x06040000); vramSetBankD(VRAM_D_MAIN_BG_0x06060000); You can write from the CPU to the addresses that you have just mapped if you want to modify the data in VRAM.\nThis is the end of the explanation for backgrounds. For sprites, the explanation is the same.\nHowever, 3D texture data, texture palette, and extended sprite/background palettes are different. It isn\u0026rsquo;t possible for the CPU and the graphics engines to access them at the same time. For that reason, it is needed to copy data to them while they are in LCDC mode. This mode maps VRAM to the CPU, but the graphics engines can\u0026rsquo;t access VRAM.\nFor example, to load texture data and texture palettes, map the banks as LCDC:\nvramSetBankA(VRAM_A_LCD); vramSetBankB(VRAM_B_LCD); vramSetBankE(VRAM_E_LCD); This will make VRAM A and B available starting at address 0x6800000, and VRAM E available starting at address 0x6880000. After the data has been copied to VRAM you can set them up as texture data and texture palette RAM:\nvramSetBankA(VRAM_A_TEXTURE_SLOT0); vramSetBankB(VRAM_B_TEXTURE_SLOT1); vramSetBankE(VRAM_E_TEX_PALETTE); The addresses where VRAM can be mapped are:\nBase address Which engine Usage 0x6000000 Main engine BG VRAM (max 512KB) 0x6200000 Sub engine BG VRAM (max 128KB) 0x6400000 Main engine Sprite VRAM (max 256KB) 0x6600000 Sub engine Sprite VRAM (max 128KB) 0x6800000 LCDC LCDC-allocated (max 656KB) LCDC mode is also special in another way. The main graphics engine can capture its output and save it to one of the main VRAM banks (A to D). For that to work, the bank needs to be setup as LCDC.\nIt is also possible to setup one of the main VRAM banks as LCDC and ask the main graphics engine to render its contents directly to the screen. This is equivalent to using that VRAM bank as a framebuffer.\nIf you want to configure VRAM in a visual way, you should use mtheall\u0026rsquo;s NDS Homebrew VRAM Banks Selector and NDS Homebrew VRAM BG Allocation Conflict Viewer.\n","description":"1. Introduction The DS has several RAM regions that are distributed across its address space. In most cases you don\u0026rsquo;t need to worry about the details, as libnds is set up in a way that covers most use-cases. All you normally need to worry about is how to allocate VRAM to be used by the 2D and 3D engines. However, in some cases it may be needed to understand how everything works."},{"id":12,"href":"/docs/technical/dldi_arm7/","title":"DLDI in ARM7","parent":"Technical information","content":" 1. Introduction DLDI (Dynamically Linked Disc Interface) is an interface designed for homebrew projects to be able to access the memory of flashcarts (usually micro SD cards) in a standardized way. https://www.chishm.com/DLDI/\nIn short, when you build an application, the DLDI stub is added to your application. Then you and your users have to patch your application with the DLDI driver your flashcarts. Most flashcarts patch homebrew NDS ROMs, so normally you don\u0026rsquo;t need to worry about it, it just works. Some old flashcarts (specially slot-2 flashcarts) don\u0026rsquo;t support this, so you have to patch ROMs yourself. DeSmuME doesn\u0026rsquo;t autopatch ROMS, for example, while melonDS does.\nThis is an archive of DLDI drivers: https://github.com/DS-Homebrew/DLDI\n2. Why is DLDI in ARM7 important? Reading files with DLDI is very slow because reading from SD cards is very slow. It\u0026rsquo;s not limited to DLDI. Regular cartridge read commands (like the ones used by offical games) are also slow. Traditionally this process happens in the ARM9.\nThis means that, if you have a game that has a 3D open world, and you want to move around the world while loading and unloading models and textures from the filesystem you can\u0026rsquo;t do it in the same CPU. The ARM9 is too busy with the game logic, it can\u0026rsquo;t just stop until it has finished reading a file.\nThe fix is to use the ARM7 to do the reads while the ARM9 is doing other things. Note that, at the time of writing this document, while DLDI in ARM7 is supported, there is no way to do asynchronous reads yet. For this, a cooperative multithreading scheduler is needed. This has a high priority in the to-do list of this SDK.\n3. Supported flashcarts The main drawback of this approach is that not all flashcarts support this. Some DLDI drivers have been built for the ARM9 and will crash in the ARM7, for example. This is why DLDI in ARM7 isn\u0026rsquo;t enforced. The current code supports using DLDI from both ARM9 and ARM7 without rebuilding the application.\n4. Adding support to a DLDI driver All you need to do is to make sure that your code is built for the ARM7 instead of the ARM9. Use -mcpu=arm7tdmi instead of -mcpu=arm946e-s+nofp.\nThen add the following flag to the features entry of your DLDI header:\n#define FEATURE_ARM7_CAPABLE 0x00000100 BlocksDS\u0026rsquo;s fork of libnds will detect this flag and switch to using DLDI from the ARM7.\n5. Using DLDI with BlocksDS If your application doesn\u0026rsquo;t care about which CPU uses DLDI, you don\u0026rsquo;t have to do anything. Any driver marked with FEATURE_ARM7_CAPABLE will run from the ARM7, and any driver without the mark will run from the ARM9. If you want to force a certain CPU to do it, you can do it this way:\n#include \u0026lt;nds/arm9/dldi.h\u0026gt; // Set the DLDI mode dldiSetMode(DLDI_MODE_ARM9); // or DLDI_MODE_AUTODETECT or DLDI_MODE_ARM7 // Get the current mode. This is set to DLDI_MODE_ARM9 or DLDI_MODE_ARM7 // after initializing the FAT system. DLDI_MODE dldi_mode = dldiGetMode(void); 6. Supported flashcarts This is a list of flashcarts that have been reported to work. Please, test your flashcart using this test and report your findings.\nflashcart ARM9 ARM7 Notes Acekard 2i Yes Yes SuperCard DSTWO Yes Yes Original R4 Yes Yes ","description":"1. Introduction DLDI (Dynamically Linked Disc Interface) is an interface designed for homebrew projects to be able to access the memory of flashcarts (usually micro SD cards) in a standardized way. https://www.chishm.com/DLDI/\nIn short, when you build an application, the DLDI stub is added to your application. Then you and your users have to patch your application with the DLDI driver your flashcarts. Most flashcarts patch homebrew NDS ROMs, so normally you don\u0026rsquo;t need to worry about it, it just works."},{"id":13,"href":"/docs/introduction/support/","title":"Getting support","parent":"Introduction","content":"If you want to report any bugs or suggest new features and make sure they aren\u0026rsquo;t forgotten, use the GitHub issue tracker of BlocksDS.\nIf you prefer to chat with other developers in real time, the best way is to join the gbadev Discord server, where we hang out. This is a community of GBA game developers, and it has a small section for NDS developent. The NDS is in many ways an upgraded GBA, so most of the discussions about the GBA are still useful.\nNote that there aren\u0026rsquo;t any Discord invitations here because they sometimes change. You can find the invitation in this link.\n","description":"If you want to report any bugs or suggest new features and make sure they aren\u0026rsquo;t forgotten, use the GitHub issue tracker of BlocksDS.\nIf you prefer to chat with other developers in real time, the best way is to join the gbadev Discord server, where we hang out. This is a community of GBA game developers, and it has a small section for NDS developent. The NDS is in many ways an upgraded GBA, so most of the discussions about the GBA are still useful."},{"id":14,"href":"/docs/setup/extra_steps/","title":"Extra steps","parent":"Setup instructions","content":" 1. Test To test that everything is working, you can try building one of the examples or project templates included in BlocksDS.\nThere is a template that lets the programmer write the code for both CPUs of the NDS (rom_combined) and a template that uses the default ARM7 core that comes with Blocks DS and lets the programmer focus on the ARM9 core (rom_arm9). There are also two templates to create static libraries.\nFor example, go to the combined template folder and build it:\ncd templates/rom_combined make This should have generated a NDS ROM that you can run on any emulator or flashcart.\nTo do a verbose build, run make like this (this also works for the Makefile of the SDK):\nVERBOSE=1 make NOTE: The paths in the Makefile that refer to source code, includes, graphics, data, etc, must be inside the folder of the project. That means you can\u0026rsquo;t use .. in a path to go one level up from the Makefile. If you really need to use folders outside of the folder of the project, create a symlink to the destination, or build the other code as a static library and link it with the project.\n2. Additional libraries and tools This document has a list of tools and libraries that support BlocksDS and can be installed in /opt/blocksds/external.\n3. Keeping multiple versions of BlocksDS You may keep multiple versions of this SDK in your PC. The location of the active SDK is stored in the environment variables BLOCKSDS and BLOCKSDSEXT, so all you need to do is to change their values and point to the version of the SDK you want to use.\nBy default, the paths are assumed to be /opt/blocksds/core/ and /opt/blocksds/external/. The first one is used for core BlocksDS libraries and tools, and it is managed by BlocksDS. The second one is left for users to freely install third party libraries and tools.\n","description":"1. Test To test that everything is working, you can try building one of the examples or project templates included in BlocksDS.\nThere is a template that lets the programmer write the code for both CPUs of the NDS (rom_combined) and a template that uses the default ARM7 core that comes with Blocks DS and lets the programmer focus on the ARM9 core (rom_arm9). There are also two templates to create static libraries."},{"id":15,"href":"/docs/technical/optimization_guide/","title":"Optimization guide","parent":"Technical information","content":"This guide covers some techniques one can use to optimize DS/DSi homebrew with BlocksDS.\nOptimizing CPU usage Measure CPU performance on hardware only! As of writing (May 2024), the most popular emulators are not sufficiently cycle-accurate to provide accurate profiling results; this might lead, at worst, to mistaken optimizations. Avoid using floating point values (float, double). As the DS does not include any hardware for accelerating floating point math, operations on them have to be emulated in software, which is quite costly. On the ARM9, place \u0026ldquo;hot\u0026rdquo; (often used) code and data in ITCM and DTCM, respectively. More information is available below. ITCM and DTCM ITCM stands for Instruction Tightly Coupled Memory, and on the DS refers to 32 kilobytes of fast memory connected directly to the ARM9 CPU to be used for instruction code. Analogously, DTCM refers to 16 kilobytes of Data Tightly Coupled Memory.\nTo place a function in ITCM or DTCM, you can use one of two approaches:\nRename the .c or .cpp file containing it to use the .itcm.c, .itcm.cpp, .dtcm.c or .dtcm.cpp suffix instead - to move the file\u0026rsquo;s entire contents, Annotate the specific function with one of the following macros: ITCM_CODE - for code, DTCM_DATA - for data pre-initialized with values, DTCM_BSS - for data which is not pre-initialized or is filled with zeros. Note that neither ITCM nor DTCM are accessible to hardware external to the ARM9 main CPU, such as the ARM7 or the DMA hardware.\nMore details, as well as information on how to use ITCM/DTCM in assembly code, is available in the usage notes.\nReducing memory usage By default, the versions of printf() and scanf() linked by the toolchain contain code to handle float and double values. The required conversion code costs a few kilobytes of memory. Instead, integer versions can be utilized, as documented below. Integer versions of stdio.h functions By default, the build of picolibc of BlocksDS makes printf(), sscanf() and similar functions support float and double conversions. This is done to maintain compatibility with existing code (and the C standard), but it increases the size of the final binaries. It is possible to switch to integer-only versions of the functions by adding the following line to the DEFINES of your Makefile:\nDEFINES := [all other options go here] \\ -DPICOLIBC_LONG_LONG_PRINTF_SCANF There are additional variants available, depending on the codebase\u0026rsquo;s specific requirements:\n-DPICOLIBC_DOUBLE_PRINTF_SCANF: the default; supports float and double values. -DPICOLIBC_FLOAT_PRINTF_SCANF: supports float values, but not doubles. -DPICOLIBC_LONG_LONG_PRINTF_SCANF: supports all integer types, but not float types. -DPICOLIBC_INTEGER_PRINTF_SCANF: supports 32-bit integer types, but not 64-bit integer types such as long long or float types. -DPICOLIBC_MINIMAL_PRINTF_SCANF: the smallest version; supports only 32-bit integer types and omits support for many non-basic printf/scanf features. Full compatibility with libnds is not guaranteed at this level, and it should be used with caution. For more information, please read the relevant picolibc documentation.\nOptimizing filesystem usage If you\u0026rsquo;ve programmed for ROM-based platforms before, like the GBA, you might be used to accessing in-ROM assets or filesystems instantly. That is not the case on BlocksDS; only data loaded to memory is fast to access, while filesystem reads including NitroFS are comparatively slow. Note that the speed also differs depending on hardware. Emulators and the DSi SD card are faster than commonly available flashcarts. Some SD cards are also slower than others. In addition, fragmented FAT filesystems can be slower to read than defragmented ones. As such, one should not rely on filesystem accesses being of a particular minimum speed.\nThere are things which can be done to make the most out of filesystem I/O:\nRead larger chunks of data at a time. As starting an SD card read has latency of its own, processing more than one sector in one read call is much faster than doing so across multiple read calls. An optimal value is the size of one cluster (typically between 4 and 32 KB), though BlocksDS can also sometimes optimize reads larger than that. If your data format is based around small sequential reads, you may benefit from enabling the C standard library\u0026rsquo;s buffering mechanism using the setvbuf function. Note that this slows down random reads, as a buffered random read will require re-filling the whole buffer. For example, to allocate a 4 KB buffer for a file, one can use: setvbuf(file, NULL, _IOFBF, 4 * 1024); If your data format is based around random reads, you may benefit from enabling a lookup cache. This reduces the amount of SD card reads required for finding the location of the specific chunk of data in the filesystem. The lookup cache has to be of a certain maximum size, but on defragmented devices will typically not exceed a few hundred bytes. Note that the lookup cache is automatically enabled for NitroFS accesses. For example, to try and enable the lookup cache on a file: fatInitLookupCacheFile(file, 2 * 1024); /* 2 KB maximum lookup cache */ OpenGL-like API usage Texture formats The GL_RGB texture format isn\u0026rsquo;t actually supported by the hardware. When a texture is loaded with glTexImage2D() with format GL_RGB, it is actually converted to GL_RGBA internally by setting the alpha bit of all pixels to 1. This is pretty slow, and it isn\u0026rsquo;t normally needed because any graphics conversion tool (such as grit) can set the alpha bit to 1 when the image is converted. None of the 3D examples of BlocksDS use GL_RGB. The ones that use GL_RGBA also show how to convert images the right way.\nAlso, consider using other texture formats. GL_RGBA isn\u0026rsquo;t a very efficient way to store textures. All other formats (the ones that use palettes) use a lot less memory. In many cases GL_COMPRESSED is the best format you can use (but converting images to this format is only currently supported by ptexconv).\nBlocksDS has examples of how to use all texture formats (except for GL_RGB, which works the same way as GL_RGBA, and is never used in order to not encourage new users to use it). Take a look at the examples for more details.\nFinal note: The video capture circuit of the NDS sets the alpha bit to 1, so it isn\u0026rsquo;t needed even if you want to use the saved image as a texture, or as a 16-bit bitmap background. There is an example of how to render to a texture too.\n","description":"This guide covers some techniques one can use to optimize DS/DSi homebrew with BlocksDS.\nOptimizing CPU usage Measure CPU performance on hardware only! As of writing (May 2024), the most popular emulators are not sufficiently cycle-accurate to provide accurate profiling results; this might lead, at worst, to mistaken optimizations. Avoid using floating point values (float, double). As the DS does not include any hardware for accelerating floating point math, operations on them have to be emulated in software, which is quite costly."},{"id":16,"href":"/docs/setup/additional_libs/","title":"Additional libraries/tools","parent":"Setup instructions","content":"There are also some libraries and tools that are supported in BlocksDS, but not fully integrated with it. They are listed below.\nLibraries:\nNightFox’s Lib: Library designed to make development of 2D games easy, with support for sprites, backgrounds (even \u0026ldquo;infinite\u0026rdquo; maps), and it also has limited 2D graphics support using the 3D engine.\nNitro Engine: Library to create 3D applications. It supports dual screen 3D, static and animated models, supports all texture types, and has basic 2D support using the 3D hardware. It\u0026rsquo;s compatible with NightFox\u0026rsquo;s Lib.\ngbajpeg: Library designed to load JPEG files on GBA with very low resource usage, which also makes it a good library for NDS.\nLibDSF: Library to render text using the 3D hardware of the NDS.\nTools:\nptexconv: Tool to convert images to files in the format of the NDS. This tool is one of the few available tools that can output files in the very efficient tex4x4 format used by the GPU of the NDS.\nArchitectDS: BlocksDS comes with sample Makefiles to build projects. They don\u0026rsquo;t support many common use-cases, like converting graphics and storing them in the filesystem. They don\u0026rsquo;t support things like having multiple DSP binaries either. You can check ArchitectDS if you need a more flexible build system.\n","description":"There are also some libraries and tools that are supported in BlocksDS, but not fully integrated with it. They are listed below.\nLibraries:\nNightFox’s Lib: Library designed to make development of 2D games easy, with support for sprites, backgrounds (even \u0026ldquo;infinite\u0026rdquo; maps), and it also has limited 2D graphics support using the 3D engine.\nNitro Engine: Library to create 3D applications. It supports dual screen 3D, static and animated models, supports all texture types, and has basic 2D support using the 3D hardware."},{"id":17,"href":"/docs/introduction/credits/","title":"Credits","parent":"Introduction","content":"This project wouldn\u0026rsquo;t have been possible without:\nMany thanks to asie for his help and advice, and for Wonderful Toolchain devkitPro picolibc libnds DSWiFi Maxmod (and mmutil) grit GCC make And many others! ","description":"This project wouldn\u0026rsquo;t have been possible without:\nMany thanks to asie for his help and advice, and for Wonderful Toolchain devkitPro picolibc libnds DSWiFi Maxmod (and mmutil) grit GCC make And many others! "},{"id":18,"href":"/docs/usage/legacy_support/","title":"Legacy device/launcher support","parent":"Usage","content":"ROMs built with BlocksDS are designed first and foremost to support modern execution environments and maximize the amount of free memory available to the application. Unfortunately, some changes end up breaking compatibility with legacy homebrew execution methods.\nKnown loaders which cause issues include:\nthe PassMe/WifiMe methods, the MoonShell launcher, the Unlaunch launcher, many legacy cartridge devices. Workarounds exist to run affected homebrew software on these platforms, both from the user and developer\u0026rsquo;s perspective. A detailed explanation of the specific technical issues is also provided further below.\nUser workarounds This section is intended for users who would like to run modern homebrew on affected legacy devices and execution methods.\nnds-hb-menu The recommended way to launch a BlocksDS ROM on legacy devices is to use the nds-hb-menu launcher, which is lightweight and appropriately respects all modern homebrew standards.\nExample: Slot-1 devices Download nds-hb-menu here. The file that is required for this is BOOT.NDS. Other files in the hbmenu directory provide support for replacing some devices\u0026rsquo; launchers with nds-hb-menu directly.\nOn some devices, you may need to perform a DLDI patch, otherwise the filesystem won\u0026rsquo;t be detected. For this, you can use the dldipatch tool bundled with BlocksDS:\n/opt/blocksds/core/tools/dldipatch/dldipatch patch BOOT.NDS device_driver.dldi Example: Slot-2 devices Some Slot-2 devices require additional work for proper support.\nDownload nds-hb-menu here. The file that is required for this is BOOT.NDS.\nDownload ndsmall.bin from DarkFader\u0026rsquo;s website. A copy is also provided here.\nDownload the DLDI driver. For example, the SuperCard SD should use scsd_moon.dldi from this DLDI archive.\nConcatenate ndsmall.bin and BOOT.NDS:\ncat ndsmall.bin BOOT.NDS \u0026gt; hbmenu.sc.nds Patch this ROM with the DLDI driver:\n/opt/blocksds/core/tools/dldipatch/dldipatch patch hbmenu.sc.nds scsd_moon.dldi Copy hbmenu.sc.nds to your SD card. Any NDS homebrew ROM loaded with this loader should work.\nDeveloper workarounds This section is intended for developers who would like to understand why modern homebrew does not run on affected legacy devices and execution methods. Workarounds are provided where available, but their use is discouraged and should be limited to appropriate, specialized use cases.\nMissing argv support The argv structure was added to libnds in mid-2007; this means that any launcher written before that date, as well as many launchers written after that date (including ones as recent as Unlaunch), do not support passing command-line arguments. Most notably, this impacts the NitroFS filesystem, which - outside of Slot-2 cartridges - relies on reading argv[0] to find the .nds file it was launched from.\nAs this is a missing feature rather than a bug, there is no workaround available.\nReduced DLDI driver reserved space ROM files built from 2017 onwards only reserve 16 kilobytes, as opposed to 32 kilobytes, for the DLDI driver used to communicate with the launch device\u0026rsquo;s filesystem. This frees RAM to be used by the homebrew program. Unfortunately, some legacy launchers - most notably MoonShell - incorrectly perform the DLDI patching process when encountering such .nds files. This affects any homebrew program which links in filesystem access code (be it FAT or NitroFS), even if the code is not used at runtime.\nThere is a workaround available to emit .nds files with the larger reserved DLDI space; one has to create an assembly file (for example, dldi_size_32k.s) in the source directory with the following contents:\n.global __dldi_size .equ __dldi_size, 32768 NDS/DSi hybrid ROMs ROM files built from 2017 onwards are designed to simultaneously be both valid NDS and DSi-format ROMs. However, this fully breaks some forms of executing ROMs:\nPassMe, WifiMe and Slot-2 flashcarts launch ROMs by jumping to the beginning of the file, normally containing the game title. On older homebrew ROMs, however, a branch instruction to a small built-in .nds loader is placed there. MoonShell, in particular, also relies on said built-in .nds loader to run homebrew applications. By adding -h 0x200 to the ndstool command line arguments, an NDS-only ROM can be generated, which will work on the above environments. However, such ROMs will not work at all on DSi/3DS consoles in DSi mode, so its use is heavily discouraged.\n","description":"ROMs built with BlocksDS are designed first and foremost to support modern execution environments and maximize the amount of free memory available to the application. Unfortunately, some changes end up breaking compatibility with legacy homebrew execution methods.\nKnown loaders which cause issues include:\nthe PassMe/WifiMe methods, the MoonShell launcher, the Unlaunch launcher, many legacy cartridge devices. Workarounds exist to run affected homebrew software on these platforms, both from the user and developer\u0026rsquo;s perspective."},{"id":19,"href":"/docs/technical/updating_guide/","title":"Upgrade guide","parent":"Technical information","content":"Newer BlocksDS versions occasionally introduce breaking changes which require developer action, as well as non-breaking changes which developers are encouraged to implement. These are documented here.\nPlease refer to the changelog for a full list of changes, including additions and enhancements to the SDK which are not listed here.\nUpgrading to BlocksDS 1.3.0 General changes:\nThe ConsoleFont struct no longer takes a convertSingleColor argument. For 4bpp uses, it is recommended to instead provide 1bpp font tile data, which will be automatically unpacked to use color indices 0 and 15. Another option is to manually ensure that the tile uses color indices 0 and 15 (or 0 and 255 for 8bpp graphics). ARM7-specific changes:\nAs these commands were only intended for TSC (NTR), touchRead and touchReadTemperature were moved to a new header, tsc.h, and renamed to tscRead and tscReadTemperature respectively. In a similar fashion, cdcTouchRead is no longer available - it has been replaced by cdcTouchReadData which exposes all samples read; however, it is recommended to use touchReadData which supports both TSC (NTR) and CDC (TWL). Some macro and function names have been changed: RTC_CR, RTC_CR8 and HALT_CR have been renamed to REG_RTCCNT, REG_RTCCNT8 and REG_HALTCNT, respectively. SerialWaitBusy has been renamed to spiWaitBusy. Upgrading to BlocksDS 1.2.0 The SOUND_FREQ (ARM7) and TIMER_FREQ macros have been reworked to provide the nearest frequency to the one requested by the user, rounded. This changes their returned values in some cases; you may want to validate your uses of these macros. In gl2d.h, glLoadSpriteSet now expects an array of uint16_t integers for texture coordinates, rather than 32-bit unsigned ints. This has been done to reduce memory waste, as the coordinates always fit in a 16-bit integer. Upgrading to BlocksDS 1.0.0 In nds/bios.h, the PUnpackStruct alias for TUnpackStruct* has been deprecated. In nds/ndstypes.h, the fp function pointer type has been deprecated. Upgrading to BlocksDS 0.14.0 The nds/arm9/grf.h GRF file loading functions introduced in BlocksDS 0.13.0 have been replaced. The libxm7 library now uses timer 0, matching maxmod. Upgrading to BlocksDS 0.13.0 Users are encouraged to use the new function isHwDebugger() over swiIsDebugger() to more accurately detect debug units. The GRF format used by Grit has been adjusted to properly follow the RIFF standard. As such, if your project relies on pre-generated GRF files, they may need to be regenerated. The Slot-2 tilt API introduced in BlocksDS 0.11.0 has been replaced. libnds touch screen and keyboard handling scanKeys() updates the internal state of the key handling code. This is then used by keysHeld() and keysDown().\nHowever, BlocksDS also requires the user to call scanKeys() before any of the following functions: touchRead(), keyboardGetChar(), keyboardUpdate() and the deprecated touchReadXY().\nThis is unlikely to be a problem in most projects, as the normal thing to do is to both scan the keys and read the touchscreen status, not just read the touchscreen.\nThe reason is that the functions scanKeys() and touchRead() aren\u0026rsquo;t synchronized in any way, which creates a race condition. Consider this code:\nwhile (1) { scanKeys(); if (keysHeld() \u0026amp; KEY_TOUCH) { touchPosition touchPos; touchRead(\u0026amp;touchPos); printf(\u0026#34;%d, %d\\n\u0026#34;, touchPos.px, touchPos.py); } swiWaitForVBlank(); } The state of the X and Y buttons, as well as the state of the touch screen, is passed from the ARM7 with a FIFO message. This message can technically happen in between scanKeys() and touchRead(), which means that it\u0026rsquo;s possible that keysHeld() \u0026amp; KEY_TOUCH is true, but the coordinates read by touchRead() are (0, 0) because the user has stopped pressing the screen right at that point, and scanKeys() read the outdated values while touchRead() read the updated values.\nIn BlocksDS, scanKeys() is used to latch the current state of the keys and the touch screen. This forces the developer to call scanKeys(), but it also ensures that there are no race conditions, as scanKeys() will read all the state atomically.\nUpgrading to BlocksDS 0.12.0 In readdir(), . and .. filesystem entries are now returned, both on FAT and NitroFS filesystems. Upgrading to BlocksDS 0.11.3 If you were using the ndstool feature of adding alternate language banner text (added in BlocksDS 0.6), the argument syntax has changed from -bt5 \u0026quot;Text\u0026quot; to -bt 5 \u0026quot;Text\u0026quot;. ","description":"Newer BlocksDS versions occasionally introduce breaking changes which require developer action, as well as non-breaking changes which developers are encouraged to implement. These are documented here.\nPlease refer to the changelog for a full list of changes, including additions and enhancements to the SDK which are not listed here.\nUpgrading to BlocksDS 1.3.0 General changes:\nThe ConsoleFont struct no longer takes a convertSingleColor argument. For 4bpp uses, it is recommended to instead provide 1bpp font tile data, which will be automatically unpacked to use color indices 0 and 15."},{"id":20,"href":"/docs/technical/devkitarm_porting_guide/","title":"Migrating from devkitARM","parent":"Technical information","content":" 1. Introduction In most cases, porting devkitARM projects to BlocksDS should be relatively easy. BlocksDS includes most of the NDS functionality provided by devkitARM. For simple projects, only minor changes should be required.\n2. New build system This is the biggest difference between devkitARM and BlocksDS. Makefiles provided by devkitARM are more complicated: they call themselves recursively from the build directory. They also hide a lot of compilation rules from the user, as they are provided by sub-makefiles in the devkitARM system directory.\nThe Makefiles of BlocksDS include all available rules so that its behaviour is easier to understand and customize. This allows for example creating a new build system based on them, tailored to your project (for example, with CMake or Meson). They also do not rely on self-recursion.\nAs a BlocksDS user, you need to edit a few paths and variables, same as with devkitARM. Open the Makefile of your devkitARM project and check this part (some variables may be missing if you\u0026rsquo;re not using them):\nTARGET := $(notdir $(CURDIR)) # Name of the resulting NDS file SOURCES := source source/common # Directories with files to compile INCLUDES := include # Directories with files to #include GRAPHICS := graphics # Folder with images and .grit files MUSIC := audio # Folder with audio files for maxmod DATA := data # Folder with .bin files NITRODATA := nitrofs # Root of your NitroFS filesystem Copy the Makefiles from the rom_arm9_only or rom_combined to your project, and open it. You have to copy the values to the following part, and leave them empty if you aren\u0026rsquo;t using them:\nSOURCEDIRS := source INCLUDEDIRS := include GFXDIRS := graphics BINDIRS := data AUDIODIRS := audio NITROFSDIR := nitrofs Important notes:\nSOURCEDIRS searches all directories recursively. If you don\u0026rsquo;t like this behaviour, go to the SOURCES_S, SOURCES_C and SOURCES_CPP lines and add -maxdepth 1 to the find command. Paths to directories that are outside of the root of the project is not supported. Note that TARGET is not part of this group. The top of the Makefile has this other group of variables that you can also set to your own values:\nNAME := template_arm9 # Name of the resulting NDS file # Banner and icon information GAME_TITLE := Combined ARM7+ARM9 template GAME_SUBTITLE := Built with BlocksDS GAME_AUTHOR := github.com/blocksds/sdk GAME_ICON := icon.bmp Once this has been adapted to your desired values, you will need to link with the libraries used by your program.\nThis is how it looks like in a devkitARM project:\nLIBS := -ldswifi9 -lmm9 -lnds9 -lfat -lfilesystem LIBDIRS := $(LIBNDS) This would be the equivalent in a BlocksDS project:\nLIBS := -ldswifi9 -lmm9 -lnds9 LIBDIRS := $(BLOCKSDS)/libs/dswifi \\ $(BLOCKSDS)/libs/maxmod \\ $(BLOCKSDS)/libs/libnds You can remove the DSWiFi or Maxmod libraries if you aren\u0026rsquo;t using them.\nThe reason for this additional complexity with LIBS and LIBDIRS is to allow the user as much flexibility as possible when mixing and matching libraries.\n3. Filesystem libraries devkitARM and BlocksDS also heavily differ with regards to the structure of their filesystem access libraries. For most users, this should not lead to major code chagnes.\ndevkitARM uses libfat and libfilesystem, connected to a modified version of its C library newlib through the devoptab interface. These are devkitPro\u0026rsquo;s additions, and are not replicated in BlocksDS.\nInstead, BlocksDS uses the picolibc C library\u0026rsquo;s \u0026ldquo;tiny\u0026rdquo; stdio implementation. It also uses a modified version of Elm\u0026rsquo;s FatFS library in place of libfat, as well as a custom implementation of NitroFS.\nTo adapt, you have to remove -lfat and -lfilesystem from LIBS in your Makefile. As all filesystem support is included in libnds, no additional libraries are required.\nFrom the point of view of the source code, you can use the same includes as when using libfat and libfilesystem:\n#include \u0026lt;fat.h\u0026gt; #include \u0026lt;filesystem.h\u0026gt; Beyond the limitations listed below, filesystem support should work identically. Please report any behaviour that isn\u0026rsquo;t the same. If any other functionality your homebrew program requires is missing, please report that as well.\n3a. NitroFS compatibility Some minor implementation differences exist between libfilesystem and BlocksDS\u0026rsquo;s implementation:\nIn BlocksDS, NitroFS files can only be opened for reading. This means that, for example, fopen(\u0026quot;nitro:/file.dat\u0026quot;, \u0026quot;rb+\u0026quot;); will always fail, as the rb+ mode allows writing. While the behaviour of nitroFSInit(NULL); is identical, for non-NULL arguments, the provided value is now treated as an input path to the .nds file, as opposed to an output base path. To retrieve the base path, it is required to use the fatGetDefaultCwd() function instead. 3b. readdir() compatibility readdir() returns a struct dirent pointer with the field d_type. This field can be used to determine if an entry is a directory or a file. I\u0026rsquo;ve seen that some programs use it like this:\nstruct dirent *cur = readdir(dirp); if (cur-\u0026gt;d_type \u0026amp; DT_DIR) printf(\u0026#34;This is a directory\\n\u0026#34;); else if (cur-\u0026gt;d_type \u0026amp; DT_REG) printf(\u0026#34;This is a file\\n\u0026#34;); However, this is incorrect. The right way to compare it is by checking if the value is equal:\nstruct dirent *cur = readdir(dirp); if (cur-\u0026gt;d_type == DT_DIR) printf(\u0026#34;This is a directory\\n\u0026#34;); else if (cur-\u0026gt;d_type == DT_REG) printf(\u0026#34;This is a file\\n\u0026#34;); 3c. Other differences To cut down on RAM, code size and complexity, BlocksDS omits the devoptab interface. As homebrew does not generally need to modify the device list, this should not affect them. 4. Integer versions of stdio.h functions The newlib C library provides faster and smaller integer versions of stdio.h functions, such as iprintf() or siscanf(). These are not provided by picolibc. Replace any calls to them by the standard names of the functions: printf(), sscanf(), etc.\nIn newlib, including both iprintf() and printf() in the same codebase led to including both versions of the relevant stdio.h functions, unnecessarily increasing code size. picolibc opts for a different approach - it allows you to decide, project-wide, if you want to use integer-only or float-compatible versions of the printf() and scanf() functions. Note that by default, for compatibility reasons, the float-compatible versions are provided.\npicolibc\u0026rsquo;s printf/scanf replacement functionality is documented further in the optimization guide.\n5. libnds touch screen and keyboard handling scanKeys() updates the internal state of the key handling code. This is then used by keysHeld() and keysDown().\nHowever, BlocksDS also requires the user to call scanKeys() before any of the following functions: touchRead(), keyboardGetChar(), keyboardUpdate() and the deprecated touchReadXY().\nThis is unlikely to be a problem in most projects, as the normal thing to do is to both scan the keys and read the touchscreen status, not just read the touchscreen.\nThe reason is that the functions scanKeys() and touchRead() aren\u0026rsquo;t synchronized in any way, which creates a race condition. Consider this code:\nwhile (1) { scanKeys(); if (keysHeld() \u0026amp; KEY_TOUCH) { touchPosition touchPos; touchRead(\u0026amp;touchPos); printf(\u0026#34;%d, %d\\n\u0026#34;, touchPos.px, touchPos.py); } swiWaitForVBlank(); } The state of the X and Y buttons, as well as the state of the touch screen, is passed from the ARM7 with a FIFO message. This message can technically happen in between scanKeys() and touchRead(), which means that it\u0026rsquo;s possible that keysHeld() \u0026amp; KEY_TOUCH is true, but the coordinates read by touchRead() are (0, 0) because the user has stopped pressing the screen right at that point, and scanKeys() read the outdated values while touchRead() read the updated values.\nIn BlocksDS, scanKeys() is used to latch the current state of the keys and the touch screen. This forces the developer to call scanKeys(), but it also ensures that there are no race conditions, as scanKeys() will read all the state atomically.\n6. Updating legacy devkitARM homebrew Occasionally, various components of the devkitARM toolchain introduced breaking changes of their own, which lead to the unfortunate situation of homebrew being stuck on legacy, buggier and less reliable versions of toolchains. These issues also need to be resolved before updating to BlocksDS. Some known issues and their remedies are documented here; note that this list is not exhaustive.\nARM7 changes In libnds, while the ARM9 initializes console hardware in a separate function called before main(), the ARM7 does so as part of its code. Over time, these initializations have been modified. Not adhering to them can cause issues - for example, a missing touchInit(); can lead to the touch screen not functioning as expected.\nWhen updating old homebrew with custom ARM7 binaries, it is recommended to study the latest version of the default ARM7 binary to apply any necessary changes.\nReplacing IPC with FIFO Many old libnds-based homebrew extend the TransferRegion memory area to facilitate communication between the ARM9 and ARM7 CPUs. With the introducion of the FIFO message queue system, this approach is discouraged for message/command passing. For sharing buffers, one can use the FIFO system to send pointers to main RAM.\nLegacy register names Old versions of libnds used alternate name defines for the DS console\u0026rsquo;s memory mapped registers. They are primarily distinguished by not having the REG_ prefix; for example, SUB_BLEND_CR has been replaced by REG_BLDCNT_SUB in newer versions.\nA translation table is provided in #include \u0026lt;nds/registers_alt.h\u0026gt;; this can be used as a stopgap to compile the project and update all uses of legacy register names.\nNew assembly function definition syntax For ARM/Thumb interwork (calling ARM functions from Thumb and vice versa) to work correctly in more recent versions of the GNU toolchain, functions must be appropriately marked in the generated object file. While they are annotated automatically for code generated by GCC, it has to be done manually for assembly code. For example, a snippet of assembly as follows:\n.global myFunction myFunction: // code should be updated to read as follows:\n.global myFunction .type myFunction, %function myFunction: // code The important part is the addition of the .type annotation. Alternatively, the BEGIN_ASM_FUNC macro may be used:\n#include \u0026lt;nds/asminc.h\u0026gt; BEGIN_ASM_FUNC myFunction // code Memory layout changes Hardcoding areas at the end of RAM at 0x27FFFFF is not compatible with the DSi, as it has more than 8 MB of RAM. Using 0x2FFFFFF works on both DS and DSi consoles. Likewise, operations like using | 0x400000 or | 0x800000 to mark uncached variants of cached addresses should be replaced with the memUncached() helper or by using cached pointers alongside cache flushing/invalidation functions to ensure the ARM7 can see the changes; these transformations are different in DS and DSi modes.\nNote that, as all accesses omit the ARM9 cache on the ARM7 CPU, it is recommended to send pointers to it which have not been processed by memUncached().\nOther changes irqInit() is now called on the ARM9 CPU before main(). As the FIFO system registers its own IRQ handlers, and irqInit() clears them, extraneous calls to it should be removed. DIR_ITER*, diropen, dirnext and dirclose are non-standard libfat extensions; they should be replaced by DIR*, opendir, readdir and closedir, respectively. GCC 10 and above default to -fno-common, which can cause issues if multiple global variables with the same name are defined in the same project without using extern. More information is available here. GCC 14 and above consider as errors some situations which were previously treated as warnings, such as implicit function definitions. More information is available here. ","description":"1. Introduction In most cases, porting devkitARM projects to BlocksDS should be relatively easy. BlocksDS includes most of the NDS functionality provided by devkitARM. For simple projects, only minor changes should be required.\n2. New build system This is the biggest difference between devkitARM and BlocksDS. Makefiles provided by devkitARM are more complicated: they call themselves recursively from the build directory. They also hide a lot of compilation rules from the user, as they are provided by sub-makefiles in the devkitARM system directory."},{"id":21,"href":"/docs/","title":"BlocksDS Documentation","parent":"","content":"Welcome to the documentation of BlocksDS, an SDK for the Nintendo DS.\nThis is an introduction to the SDK.\nIf you\u0026rsquo;re looking for information on how to install BlocksDS, check the instructions.\nIf you\u0026rsquo;re looking for support, check this page.\nIf you\u0026rsquo;re looking for documentation about specific libraries of BlocksDS, check the following links:\nlibnds: General-purpose library to use the hardware of the NDS.\nLibrary documentation Examples Maxmod: Music player that can play MOD, S3M, XM, IT and WAV files. It can use hardware or software mixing, and it runs on the ARM7.\nLibrary documentation Examples LibXM7: Hardware-accelerated player of XM and MOD music files that runs on the ARM7.\nLibrary documentation Examples DSWiFi: Library to use the WiFi hardware of the NDS. It has no support for the WiFi improvements of the DSi.\nLibrary documentation Examples libteak: Library to use the Teak DSP included in the DSi and 3DS consoles.\nLibrary documentation Examples There are also some libraries and tools that are supported by BlocksDS, but not fully integrated with it. They include libraries to easily handle 2D and 3D graphics, additional converters for graphics and build systems. Take a look at the documentation for more information.\n","description":"Welcome to the documentation of BlocksDS, an SDK for the Nintendo DS.\nThis is an introduction to the SDK.\nIf you\u0026rsquo;re looking for information on how to install BlocksDS, check the instructions.\nIf you\u0026rsquo;re looking for support, check this page.\nIf you\u0026rsquo;re looking for documentation about specific libraries of BlocksDS, check the following links:\nlibnds: General-purpose library to use the hardware of the NDS.\nLibrary documentation Examples Maxmod: Music player that can play MOD, S3M, XM, IT and WAV files."},{"id":22,"href":"/docs/technical/libc/","title":"C/C++ support","parent":"Technical information","content":" 1. Introduction BlocksDS supports modern C/C++ standard libraries by providing the following libraries:\npicolibc, an embedded-centric fork of the Newlib C library; libstdc++, the GNU C++ library. However, this support includes some platform-specific caveats.\n2. POSIX I/O BlocksDS provides POSIX standard I/O using the tinystdio library, which is part of picolibc. It supports most of the functionality mandated by the C standard, as well as some extensions.\nFile I/O (fopen, opendir, etc.) is supported. Storage on cartridges and the DSi internal SD card can be accessed. A bundled read-only filesystem called NitroFS is also supported. For more information, check the filesystem documentation.\nConsole I/O (stdin, stdout) is supported; however, by default, no input or output is initialized:\nstdout can be redirected to the built-in libnds console by initializing the console. This can be done using the consoleInit() or consoleDemoInit() functions. stderr can be redirected to the built-in libnds console or a no$gba-compatible emulator debug output by using consoleDebugInit(). Standard output is unbuffered. When text is sent to them (by using printf() or fprintf(stderr, ...) it\u0026rsquo;s always sent to the console. The exceptions are ANSI escape sequences, which are buffered until the end of the sequence is received, and then sent to the console low level functions.\nRemember that you can use fflush(stdout) or fflush(stderr) if buffering becomes an issue.\nFor more information about ANSI escape sequences, check this link.\nstdin is tied to the keyboard of libnds. When sscanf(stdin, ...) is called, for example, the keyboard of libnds is used as input device. For more information, see the relevant examples bundled with BlocksDS. 3. argc and argv To provide correct argv information, the loader needs to support argv structure passing. This is not supported by certain legacy loaders; for more information, see our page on legacy support.\nUnder compatible loading environment, argv[0] will hold the path of the .nds file. Other argv entries may be set as well, but this isn\u0026rsquo;t a common occurrence.\nFor cartridges, the drive name used is fat: - for example, fat:/homebrew/program.nds. For DSi consoles loading .nds files from the internal SD card, the drive name used is sd: - for example, sd:/homebrew/program.nds. 4. Dynamic heap allocation Functions like malloc, calloc, memalign and free are supported. They always return space from the main RAM region.\n5. Time gettimeofday and time are supported. Timezones are not handled in any particular manner, however.\n6. Exit If the NDS ROM loader supports it, exit can be used to return to the loader. You can also return from main() to get the same effect.\nFor more information, check this document.\nIn addition, atexit is supported for dynamically registering program exit handlers.\n7. Multithreading Functions like fopen() or malloc() need to be thread-safe, and picolibc uses locks to ensure that they are thread-safe. The implementation of the locking funtrions is platform-specific, and libnds has its implementation in this file.\nIn general, you don\u0026rsquo;t need to worry about them. However, if there is an unexpected crash because of running the undefined instruction 0xEBAD, it may mean that the locking functions have found a logic error.\nPrinting an error message is very expensive: it is required to include a text font as well as console handling functions. The locking functions simply have a function with an opcode that is defined to always be an undefined instruction in Thumb mode by the ARM Architecture Reference Manual.\n","description":"1. Introduction BlocksDS supports modern C/C++ standard libraries by providing the following libraries:\npicolibc, an embedded-centric fork of the Newlib C library; libstdc++, the GNU C++ library. However, this support includes some platform-specific caveats.\n2. POSIX I/O BlocksDS provides POSIX standard I/O using the tinystdio library, which is part of picolibc. It supports most of the functionality mandated by the C standard, as well as some extensions.\nFile I/O (fopen, opendir, etc."},{"id":23,"href":"/docs/design/design_guide/","title":"Design choices","parent":"Additional information","content":"This guide serves as a loose explanation of some design choices made during the development of BlocksDS.\nA supplementary good source for understanding its design choices is the BlocksDS issue tracker, where many were and continue to be openly discussed.\n1. Standardized binary build of the GCC compiler Existing builds of GCC used for embedded development come with various, often not fully matching C/C++ standard libraries. The compatibility issues and added support headache make relying on user-provided GCC a non-viable option.\nConversely, requiring the user to build GCC is a long and not-too-easy process that doesn\u0026rsquo;t give big advantages over providing binary builds. It would make setting up the SDK a more fragile and time-consuming process.\nLLVM/Clang has also been evaluated, but as of writing it (LLVM 18) appears to generate worse-performing machine code on NDS than GCC (13). This has not been extensively tested, however.\nTherefore, in order to take advantage of per-CPU optimizations and to have a robust toolchain, it has been decided to standardize on a custom binary build of GCC. For this purpose, BlocksDS relies on a courtesy build provided by the Wonderful toolchain\u0026rsquo;s infrastructure.\n2. Easy toolchain modification and rebuilds Often, SDKs come with pre-built libraries - users only need to build them manually if they want to modify them. It is the more convenient route for most, and the Wonderful toolchain\u0026rsquo;s infrastructure currently provides it for BlocksDS users.\nHowever, part of the reason for creating this SDK was to show users how easy it actually is to modify any part of the code in your program. As such, one can easily build (make) and use (export BLOCKSDS) a custom variant of the BlocksDS SDK. This is a quick process (under a minute on most modern machines for a full rebuild) which allows hands-on tinkering with it.\nThe exceptions are picolibc (standard C library) and libstdc++ (standard C++ library), which are fairly difficult to build reliably. They are, as such, provided by the toolchain.\n3. Using picolibc over newlib The C library picolibc is used in BlocksDS instead of newlib. The reasons are:\nClearer licensing: The maintainer of picolibc has ensured that all of the code in the library has consistent BSD-style licensing. Even though non-BSD code was not linked in a typical embedded build, it provides additional peace of mind.\nStandard thread-local storage: newlib utilizes a custom re-entrancy structure for those C library functions which have thread-dependent state. Conversely, picolibc uses standard thread-local storage mechanisms provided by the compiler.\nAdditional optimizations: picolibc modifies many aspects of newlib which help reduce code size and thus memory usage. In particular, tinystdio is a much leaner implementation of POSIX-compatible standard I/O which omits features not typically necessary in an embedded environment.\nCompatibility: picolibc is a fork of newlib, and so is largely compatible with it at the user application level.\nThe main disadvantage I\u0026rsquo;ve seen is that the documentation of picolibc about porting it to a new system is worse than the one of newlib.\nOther C library alternatives with more convenient licensing have been evaluated, such as PDCLib, but as of writing (May 2024) have been deemed insufficiently complete for production use in the context of BlocksDS.\n4. Standard C library port picolibc only provides the generic functionality of the standard C library. For example, it provides versions of memset() or strlen() that are functional. However, it can\u0026rsquo;t access any OS services, so functions like malloc() or fopen() don\u0026rsquo;t work right away. It is needed to port them to the platform.\nlibnds is the library that has the drivers to access the SD card, that provides argc and argv to main(), and that knows where to locate the heap memory used by malloc().\nFor example, for malloc() to work, picolibc expects the port to provide a function called sbrk(). This function needs to get information from libnds to work. The glue code between picolibc and libnds is in libnds, in source/arm9/libc.\nThe extent of this support is documented in this document.\nThe reason to keep this as a separate library, instead of adding it to picolibc as a target, is to make updating picolibc mostly independent from refactors in libnds.\n5. Filesystem support This section will describe how the filesystem support has been implemented in libnds. Check this document if you\u0026rsquo;re interested in the C standard functions that are supported.\nFilesystem support requires 3 things:\nSomething that provides POSIX file I/O functions, like fopen(). This is done by picolibc.\nSomething that reads and writes raw bytes from the SD card. This is done by libnds.\nSomething that understands the raw bytes read from the SD card and interprets it as a FAT filesystem. This is done by a modified version of Elm\u0026rsquo;s FatFs library, which is included in libnds as a submodule.\nAlso, it is needed to provide glue code between the 3 components. For example:\npicolibc provides fopen(), and expects the user to implement open(), which should work like the Linux system call open. open() must have code that calls functions in FatFs to do the right thing. In this case, open() translates its arguments to arguments that f_open() from FatFs can understand.\nInternally, f_open() requires a function called disk_read(), which calls libnds functions to read raw bytes from the SD card. Reading raw bytes is complicated. If you\u0026rsquo;re running the code on a DSi, and you want to read from the internal SD card, you need one specific driver. If you are running the code from a DS slot 1 flashcart, for example, the instructions of how to read from the SD card are provided as a DLDI driver. f_open() must determine the location of the file (based on the filesystem prefix, fat: or sd:) and use DLDI driver functions or DSi SD driver functions accordingly.\n6. NitroFS implementation When creating a game, it is needed to add a lot of assets such as graphics and music. Initially, most people just include them in their ARM9 binary, but this is a bad idea. ARM7 and ARM9 binaries are loaded into RAM. There are only 4 MiB of available memory (actually, a bit less than that, some RAM is used for things like a hook to exit to the loader). The ARM9 is loaded in full to RAM. On top of that, you also need RAM for your program to work. This means that, in most cases, you\u0026rsquo;re limited to 1 or 2 MiB binaries. This isn\u0026rsquo;t enough for larger projects. There is the option to provide a folder with all your assets and tell your users to copy it to their SD card, but this is messy.\nThe solution is to append a filesystem to the .nds file. On the DS platform, a filesystem format called NitroROM is traditionally used. There is a library that can be used to access this filesystem, called libfilesystem (formerly known as Nitrofs). The problem is that this library\u0026rsquo;s licensing status in unclear. As such, instead of using this library, BlocksDS has a compatible reimplementation of NitroFS.\nAccessing the filesystem itself is tricky.\nCommercial games access their own data by issuing card read commands. These only work on emulators and official cartridges. Flashcarts typically rely on patching specific instruction sequences, which is not viable for homebrew projects. The solution, instead, is argv.\nWhen it is initialized, NitroFS checks if argv[0] has been provided and if it can be opened. argv[0] is a path to the executable .nds file being run. For example, it may look like fat:/games/my-game.nds.\nFirst, NitroFS will try to open the file using FatFs. If it can be opened, whenever fopen() is called with a path that starts with nitro:/, FatFs will read blocks from the file in argv[0] with fseek() and fread(). This route is typically used on cartridges and to read from SD cards.\nIf this fails, the Slot-2 cartridge memory area is checked. This is provided solely for compatibility with very legacy execution methods.\nIf this fails, Slot-1 card read commands will be attempted. This approach is provided for compatibility with emulators which do not emulate a full FAT storage device and the DLDI protocol required for homebrew filesystem access.\nThis system makes it possible to use the bundled filesystem to read assets in a transparent manner. The developer doesn\u0026rsquo;t need to worry about the method of execution used for their homebrew; on the vast majority of platforms, it will be handled transparently.\n7. Multithreading The original libnds did not support any kind of multithreading. This made it impossible to fully utilize the CPUs of the NDS during blocking operations. For example, it wasn\u0026rsquo;t possible to offload file operations to the ARM7 while the ARM9 continued to execute code; the ARM9 had to be stalled until the operation was complete.\nBlocksDS supports cooperative multithreading in the form of cothreads. By integrating it with libnds, it is possible for functions like fopen or fread to switch to a different thread while they are waiting for the SD card to finish reading a block.\nDLDI on the ARM7 While accessing the internal SD card on the DSi is performed on the ARM7, DLDI drivers used by cartridges are traditionally executed on the ARM9. However, as they are executed synchronously, this stalls the CPU whenever a file operation is performed, prohibiting the use of multithreading.\nAs a workaround, BlocksDS supports moving DLDI execution to the ARM7 sub CPU; this should be compatible with many, but not all cartridges. Feel free to read this document for more information.\n","description":"This guide serves as a loose explanation of some design choices made during the development of BlocksDS.\nA supplementary good source for understanding its design choices is the BlocksDS issue tracker, where many were and continue to be openly discussed.\n1. Standardized binary build of the GCC compiler Existing builds of GCC used for embedded development come with various, often not fully matching C/C++ standard libraries. The compatibility issues and added support headache make relying on user-provided GCC a non-viable option."},{"id":24,"href":"/docs/setup/options/docker/","title":"Docker","parent":"Options","content":" 1. Introduction If you\u0026rsquo;re not familiar with Docker, in short, it lets you create containers with predefined images. Containers are something similar to a virtual machine. An image is just the contents of the hard drive of that virtual machine.\nIt is very easy to share folders between the docker container and the host. That way you can share your code with the container, build your code from the container, and see the results in the host (so that you can test the result on an emulator or copy it to a flashcart!).\nThe images are available here: https://hub.docker.com/r/skylyrac/blocksds\n2. Setup First, install Docker: https://docs.docker.com/get-docker/ You may need to reboot after the installation.\nThen, pick your image:\nblocksds-dev: For developers that want to improve BlocksDS. blocksds-slim: For developers that just want to focus on NDS development. blocksds-slim is smaller, so it is the recommended image.\nBoth images have all the pre-built SDK, and you don\u0026rsquo;t need to setup any environment variable or anything.\nSlim image Run the following command to get the image:\ndocker image pull skylyrac/blocksds:slim-latest First, clone this repository to get the templates:\ngit clone https://github.com/blocksds/sdk Write down the path to the templates. Open a shell inside the container and share the folder with the templates:\ndocker run --rm -v /path/to/your/code:/work -it --entrypoint bash \\ skylyrac/blocksds:slim-latest The part of the command that shares a folder is -v /path/to/your/code:/work. This example will share the path /path/to/your/code from the host and show it in /work inside the container.\nTo update the image, simply run the previous docker image pull command again.\nDevelopment image Run the following command to get the image:\ndocker image pull skylyrac/blocksds:dev-latest To open a shell inside it, run:\ndocker run --rm -v /path/to/your/code:/work -it --entrypoint bash \\ skylyrac/blocksds:dev-latest The full git repository of BlocksDS is in /opt/blocksds/sdk/.\n3. Uninstall the images If you have installed Docker just for this, you can run the following command to remove all docker images available in your PC:\ndocker system prune -a 4. Build images locally From the docker folder of this repository run one of the two following commands, depending on the image you want to build:\nDevelopment image:\ndocker build --target blocksds-dev --tag blocksds:dev . Slim image:\ndocker build --target blocksds-slim --tag blocksds:dev . ","description":"1. Introduction If you\u0026rsquo;re not familiar with Docker, in short, it lets you create containers with predefined images. Containers are something similar to a virtual machine. An image is just the contents of the hard drive of that virtual machine.\nIt is very easy to share folders between the docker container and the host. That way you can share your code with the container, build your code from the container, and see the results in the host (so that you can test the result on an emulator or copy it to a flashcart!"},{"id":25,"href":"/docs/introduction/licenses/","title":"Licenses","parent":"Introduction","content":"This document enumerates the components provided by BlocksDS and their licenses. This is useful if you want to release a binary built with BlocksDS and you aren\u0026rsquo;t sure about what copyright notices you need to add.\nDSWiFi This is used in the default ARM7 binary.\nMIT license. Copyright notice required:\nCopyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org libnds This is used in all programs that use the default crts, ARM7 binary, etc.\nZlib license. No copyright notice required in binary distributions.\nFatFs uses a custom BSD/MIT/ISC-like license that doesn\u0026rsquo;t require attribution in binary files either.\nSome files (picolib) module are licensed under the BSD-3-Clause. Copyright notice required:\nCopyright © 2019-2022 Keith Packard LibXM7 This is only used if the user explicitly links it.\nMIT license. Copyright notice required:\nCopyright (C) 2018 sverx Maxmod This is used in the default ARM7 binary.\nISC license. Copyright notice required:\nCopyright (c) 2008, Mukunda Johnson (mukunda@maxmod.org) picolibc This is always used unless you tell the compiler to not link libc at all.\nTake a look at COPYING.picolibc in the picolibc folder.\nlibstdc++ This is used in any C++ program or program that is linked with a C++ library.\nIt uses license GPL 3.0 with an exception for any program compiled with GCC. That means that, as long as you use GCC as your compiler, you can license your compiled application under any license you want, or make it closed source. If you use any other compiler, you need to license your application under the GPL 3.0.\nhttps://www.gnu.org/licenses/gcc-exception-3.1.en.html\ncrts This is always used unless the user selects different ones.\nMozilla Public License v2.0. No copyright notice required.\ndefault_arm7 This is used in any project that doesn\u0026rsquo;t include source code for an ARM7 binary.\nZlib license. No copyright notice required in binary distributions.\n","description":"This document enumerates the components provided by BlocksDS and their licenses. This is useful if you want to release a binary built with BlocksDS and you aren\u0026rsquo;t sure about what copyright notices you need to add.\nDSWiFi This is used in the default ARM7 binary.\nMIT license. Copyright notice required:\nCopyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org libnds This is used in all programs that use the default crts, ARM7 binary, etc."},{"id":26,"href":"/docs/setup/options/linux/","title":"Linux","parent":"Options","content":"This is the easiest option, but you may not get the latest version of the SDK right away.\nYou will also need to install the ARM toolchain of Wonderful Toolchains. Follow the instructions in this link: https://wonderful.asie.pl/docs/getting-started/#linux\nNow, install the ARM toolchain of Wonderful Toolchains, as well as the BlocksDS packages.\nexport PATH=/opt/wonderful/bin:$PATH wf-pacman -Syu wf-pacman -S toolchain-gcc-arm-none-eabi Install the following if you plan to develop binaries for the DSP of the DSi:\nwf-pacman -S toolchain-llvm-teak-llvm For the latest stable version of BlocksDS, run:\nwf-pacman -S thirdparty-blocksds-toolchain To install the documentation and examples you can install:\nwf-pacman -S thirdparty-blocksds-docs For the latest unstable version, install the following packages instead:\nwf-pacman -S thirdparty-blocksds-git-toolchain \\ thirdparty-blocksds-git-docs (Optional step) You can also install some third party libraries like NightFox’s Lib and Nitro Engine using wf-pacman:\nwf-pacman -S thirdparty-blocksds-nflib \\ thirdparty-blocksds-nitroengine wf-pacman installs BlocksDS in /opt/wonderful/thirdparty/blocksds/. This isn\u0026rsquo;t the standard location (wf-pacman can only write files to /opt/wonderful/) so you need to do one of the two following options:\nCreate a symlink:\nln -s /opt/wonderful/thirdparty/blocksds /opt/blocksds Set your environment variables correctly:\nexport BLOCKSDS=/opt/wonderful/thirdparty/blocksds/core export BLOCKSDSEXT=/opt/wonderful/thirdparty/blocksds/external Whenever you need to update the SDK, run:\nwf-pacman -Syu ","description":"This is the easiest option, but you may not get the latest version of the SDK right away.\nYou will also need to install the ARM toolchain of Wonderful Toolchains. Follow the instructions in this link: https://wonderful.asie.pl/docs/getting-started/#linux\nNow, install the ARM toolchain of Wonderful Toolchains, as well as the BlocksDS packages.\nexport PATH=/opt/wonderful/bin:$PATH wf-pacman -Syu wf-pacman -S toolchain-gcc-arm-none-eabi Install the following if you plan to develop binaries for the DSP of the DSi:"},{"id":27,"href":"/docs/setup/options/","title":"Options","parent":"Setup instructions","content":" Windows If you are using MinGW, WSL, or any similar environment, you can follow the Linux instructions, which give you more flexibility.\nIf you want to install BlocksDS natively, check the instructions here.\nLinux If you are using Linux, MinGW, WSL, or any similar environment, follow the instructions here.\nDocker The Docker images of BlocksDS can be used in any OS. They require more disk space than the native installation, but they may be needed if a native installation isn\u0026rsquo;t possible.\nFollow the instructions here.\nBuild from source This is the option you should use if you want to help develop BlocksDS, or if you want to always use the cutting edge version of BlocksDS. This is only available in Linux-like environment.\nFollow the instructions here.\n","description":"Windows If you are using MinGW, WSL, or any similar environment, you can follow the Linux instructions, which give you more flexibility.\nIf you want to install BlocksDS natively, check the instructions here.\nLinux If you are using Linux, MinGW, WSL, or any similar environment, follow the instructions here.\nDocker The Docker images of BlocksDS can be used in any OS. They require more disk space than the native installation, but they may be needed if a native installation isn\u0026rsquo;t possible."},{"id":28,"href":"/docs/tags/","title":"Tags","parent":"BlocksDS Documentation","content":"","description":""},{"id":29,"href":"/docs/technical/","title":"Technical information","parent":"BlocksDS Documentation","content":"","description":""},{"id":30,"href":"/docs/technical/usage_notes/","title":"Usage notes","parent":"Technical information","content":" 1. Introduction This is just a list of tips and notes about how to use BlocksDS.\n2. Section annotations in filenames Some projects require specific functions or variables to be placed in specific memory regions. Some functions may also need to be compiled as ARM instead of Thumb, which is the default.\nIt is possible to rename your C and C++ source files to affect the whole file. For example, a file named engine.arm.c will be built as ARM code, and a file called interrupts.itcm.c will be placed in the ITCM memory section.\nYou can also use the annotations in \u0026lt;nds/ndstypes.h\u0026gt;:\n*.dtcm.*: DTCM_DATA, DTCM_BSS *.itcm.*: ITCM_CODE *.twl.*: TWL_CODE, TWL_DATA, TWL_BSS *.arm.c, .arm.cpp: ARM_CODE For assembly source files, you can use the BEGIN_ASM_FUNC macro and specify the section in the second parameter:\n#include \u0026lt;nds/asminc.h\u0026gt; BEGIN_ASM_FUNC my_function itcm mov r0, #0 bx lr 3. Using alternative memory layouts ARM7 options There are three different layouts provided by BlocksDS that applications can use for their ARM7 code. They can be selected by changing the .specs file in the ARM7 makefile:\nDefault: ds_arm7.specs. It expects all code to be in main RAM, and relocates it to IWRAM during boot.\nIWRAM: ds_arm7_iwram.specs. It expects all code to be in IWRAM from the start.\nVRAM: ds_arm7_vram.specs. This option places all sections in VRAM (which needs to be configured as ARM7 memory by the ARM9) and expects the code to be in VRAM from the start.\nNote that the IWRAM and VRAM options aren\u0026rsquo;t supported for DSi applications.\nARM9 options They can be selected by changing the .specs file used in the Makefile:\nDS layout: ds_arm9.specs\nDSi layout: dsi_arm9.specs\n","description":"1. Introduction This is just a list of tips and notes about how to use BlocksDS.\n2. Section annotations in filenames Some projects require specific functions or variables to be placed in specific memory regions. Some functions may also need to be compiled as ARM instead of Thumb, which is the default.\nIt is possible to rename your C and C++ source files to affect the whole file. For example, a file named engine."}] \ No newline at end of file diff --git a/setup/additional_libs/index.html b/setup/additional_libs/index.html index 235766c07..2fb9cfaca 100644 --- a/setup/additional_libs/index.html +++ b/setup/additional_libs/index.html @@ -974,6 +974,50 @@

                                                                                                                                                                                                                                                                                      Navigation

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • + + + + +
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                    • Additional libraries/tools
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2676,10 +2753,10 @@

                                                                                                                                                                                                                                                                                      Additional libraries/tools

                                                                                                                                                                                                                                                                                      - Legacy device/launcher support + How to debug programs gdoc_arrow_right_alt diff --git a/setup/extra_steps/index.html b/setup/extra_steps/index.html index 4e505f950..b6a6cba85 100644 --- a/setup/extra_steps/index.html +++ b/setup/extra_steps/index.html @@ -968,6 +968,50 @@

                                                                                                                                                                                                                                                                                      Navigation

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • + + + + +
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                    • Extra steps
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/setup/index.html b/setup/index.html index 72c525d22..0d57e365d 100644 --- a/setup/index.html +++ b/setup/index.html @@ -961,6 +961,50 @@

                                                                                                                                                                                                                                                                                      Navigation

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • + + + + +
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                    • Setup instructions
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/setup/options/docker/index.html b/setup/options/docker/index.html index ac689cba8..f237427da 100644 --- a/setup/options/docker/index.html +++ b/setup/options/docker/index.html @@ -968,6 +968,50 @@

                                                                                                                                                                                                                                                                                      Navigation

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • + + + + +
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                    • Docker
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/setup/options/from_source/index.html b/setup/options/from_source/index.html index db5c1fed8..caf9c32ab 100644 --- a/setup/options/from_source/index.html +++ b/setup/options/from_source/index.html @@ -974,6 +974,50 @@

                                                                                                                                                                                                                                                                                      Navigation

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • + + + + +
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                    • Build from source
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/setup/options/index.html b/setup/options/index.html index 702376c7a..737857e0b 100644 --- a/setup/options/index.html +++ b/setup/options/index.html @@ -974,6 +974,50 @@

                                                                                                                                                                                                                                                                                      Navigation

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • + + + + +
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                    • Options
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/setup/options/linux/index.html b/setup/options/linux/index.html index e872d19ee..00a5f90f9 100644 --- a/setup/options/linux/index.html +++ b/setup/options/linux/index.html @@ -974,6 +974,50 @@

                                                                                                                                                                                                                                                                                      Navigation

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • + + + + +
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                    • Linux
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/setup/options/windows/index.html b/setup/options/windows/index.html index 37b7e7a90..21196a012 100644 --- a/setup/options/windows/index.html +++ b/setup/options/windows/index.html @@ -977,6 +977,50 @@

                                                                                                                                                                                                                                                                                      Navigation

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • + + + + +
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                    • Windows
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sitemap.xml b/sitemap.xml index 8736076d8..1401164f5 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -19,6 +19,8 @@ https://blocksds.github.io/docs/design/exit_to_loader/ https://blocksds.github.io/docs/technical/filesystem/ + + https://blocksds.github.io/docs/usage/debugging/ https://blocksds.github.io/docs/design/ diff --git a/tags/index.html b/tags/index.html index 0537b323b..ad72b32f0 100644 --- a/tags/index.html +++ b/tags/index.html @@ -927,6 +927,50 @@

                                                                                                                                                                                                                                                                                      Navigation

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • + + + + +
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                    • Navigation
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/technical/devkitarm_porting_guide/index.html b/technical/devkitarm_porting_guide/index.html index 38c47094c..5d0b5f0c7 100644 --- a/technical/devkitarm_porting_guide/index.html +++ b/technical/devkitarm_porting_guide/index.html @@ -968,6 +968,50 @@

                                                                                                                                                                                                                                                                                      Navigation

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • + + + + +
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                    • Migrating from devkitARM
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/technical/dldi_arm7/index.html b/technical/dldi_arm7/index.html index 92418ce25..5f70302ff 100644 --- a/technical/dldi_arm7/index.html +++ b/technical/dldi_arm7/index.html @@ -968,6 +968,50 @@

                                                                                                                                                                                                                                                                                      Navigation

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • + + + + +
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                    • DLDI in ARM7
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/technical/filesystem/index.html b/technical/filesystem/index.html index e25e50b27..c34d3c352 100644 --- a/technical/filesystem/index.html +++ b/technical/filesystem/index.html @@ -971,6 +971,50 @@

                                                                                                                                                                                                                                                                                      Navigation

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • + + + + +
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                    • Filesystem support
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/technical/index.html b/technical/index.html index 4e84ab843..62663b7ae 100644 --- a/technical/index.html +++ b/technical/index.html @@ -961,6 +961,50 @@

                                                                                                                                                                                                                                                                                      Navigation

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • + + + + +
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                    • Technical information
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/technical/libc/index.html b/technical/libc/index.html index 580888277..ba07f8014 100644 --- a/technical/libc/index.html +++ b/technical/libc/index.html @@ -974,6 +974,50 @@

                                                                                                                                                                                                                                                                                      Navigation

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • + + + + +
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                    • C/C++ support
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/technical/memory_map/index.html b/technical/memory_map/index.html index e0fcaf1a4..fb0e7c5ba 100644 --- a/technical/memory_map/index.html +++ b/technical/memory_map/index.html @@ -965,6 +965,50 @@

                                                                                                                                                                                                                                                                                      Navigation

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • + + + + +
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                    • Memory map
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/technical/optimization_guide/index.html b/technical/optimization_guide/index.html index 883c95dc7..099b0f492 100644 --- a/technical/optimization_guide/index.html +++ b/technical/optimization_guide/index.html @@ -968,6 +968,50 @@

                                                                                                                                                                                                                                                                                      Navigation

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • + + + + +
                                                                                                                                                                                                                                                                                    • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                    • Optimization guide

                                                                                                                                                                                                                                                                            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/technical/updating_guide/index.html b/technical/updating_guide/index.html index 510a28115..a7a4f0c79 100644 --- a/technical/updating_guide/index.html +++ b/technical/updating_guide/index.html @@ -974,6 +974,50 @@

                                                                                                                                                                                                                                                                            Navigation

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                          • + + + + +
                                                                                                                                                                                                                                                                          • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                          • Upgrade guide
                                                                                                                                                                                                                                                                          • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/technical/usage_notes/index.html b/technical/usage_notes/index.html index c46fa3bd5..a162b1b2a 100644 --- a/technical/usage_notes/index.html +++ b/technical/usage_notes/index.html @@ -971,6 +971,50 @@

                                                                                                                                                                                                                                                                            Navigation

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                          • + + + + +
                                                                                                                                                                                                                                                                          • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                          • Usage notes
                                                                                                                                                                                                                                                                          • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/usage/debugging/index.html b/usage/debugging/index.html new file mode 100644 index 000000000..31e520290 --- /dev/null +++ b/usage/debugging/index.html @@ -0,0 +1,2929 @@ + + + + + + + + + + + + + How to debug programs | BlocksDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                            + + + +
                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            + + + + +
                                                                                                                                                                                                                                                                            + + + + + + + Toggle Dark/Light/Auto mode + + + + Toggle Dark/Light/Auto mode + + + + Toggle Dark/Light/Auto mode + + + + + + + + Back to homepage + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            + + + +
                                                                                                                                                                                                                                                                            + + + + + +
                                                                                                                                                                                                                                                                            + + + + + + + + + + + +
                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                            + + +
                                                                                                                                                                                                                                                                            + + +
                                                                                                                                                                                                                                                                            + + + +
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            How to debug programs

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            While developing applications with BlocksDS you will reach situations where you +need to debug your code. There are different ways to do this with BlocksDS, and +they are described below.

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            + 1. printf debugging +

                                                                                                                                                                                                                                                                            + + + +
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            This is a classic way to debug messages, but it’s still worth mentioning it.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            It’s very easy to setup libnds so that the output of printf() is sent to a +text console on the screen. All you have to do is:

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            consoleDemoInit();
                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            +printf("This is a debug message: %d", 123);
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            By default, all text sent to stdout and stderr will be directed to this +console after it is initialized.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Check this example +to see it in action.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Note that if you initialize the console like this, it will setup the sub screen +to only display the text console, which can be very limiting if your application +is already using that screen for something else. You can use consoleInit() to +initialize the console in a more specialized way. Check the examples to see how +to use this function.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            You can check this example +for a more advanced setup that allows you to display text over a 3D scene. You +can set it up over other 2D layers as well.

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            + 2. no$gba-style console +

                                                                                                                                                                                                                                                                            + + + +
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            It’s possible to setup libnds so that stderr is redirected to the debug +console of no$gba (debugger version) instead of a text console on the screen. +This has the advantage of being less invasive for your application, and it will +let you copy-paste text in case you want to use that for something. You can see +the messages this “Window” > “TTY Debug Messages”. You can switch between +messages sent by the ARM7 and ARM9 by changing the selected CPU in the debugger +with “Window” > “ARM9 (Main CPU)” and “Window” > “ARM7 (Sub CPU)”.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            melonDS is also compatible with this protocol. If you launch melonDS from the +command line prompt like melonDS your_rom.nds it will print all messages to +the text console. You can’t switch between CPUs, all messages are printed to the +same console (so you will need to add a way to identify the messages in your +code if they can happen from both CPUs).

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            To use it, follow the instructions below.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            In the ARM7 the default behaviour is to send stderr messages to this console, +so you don’t need to do initialize anything. In the ARM9 you need to enable it +by doing this:

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            // Redirect stderr to the no$gba debug console. By default both stdout and
                                                                                                                                                                                                                                                                            +// stderr are redirected to the libnds console.
                                                                                                                                                                                                                                                                            +consoleDebugInit(DebugDevice_NOCASH);
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            After that, you can send messages to the console like this:

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            fprintf(stderr, "Debug message!\n");
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Remember to check the example +to see how to do it in a real application.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Note that the string can contain special parameters that will be filled in by +the emulator:

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            The ascii string may contain parameters, defined as %param%:

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                            • r0, r1, … r15: Show register value as a hexadecimal number.
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • sp, lr, pc: Same as r13, r14 and r15.
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • scanline: Current scanline number.
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • frame: Number of frames since boot.
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • totalclks: Number of clocks since boot.
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • lastclks: Number of clocks since the last lastclks or zeroclks.
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • zeroclks: Reset the lastclks counter.
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            From C you can use them like this (note that you need to use %% because % by +itself is used to format strings!):

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            fprintf(stderr, "Frame: %%frame%%\n");
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            More information here.

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            + 3. Exception handler +

                                                                                                                                                                                                                                                                            + + + +
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            libnds comes with an exception handler that can help you debug some crashes in +your program. It appears as a red screen that says “Guru Meditation Error!” +followed by a lot of information:

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Exception handler

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            You can enable by calling this function, preferably right at the start of +main():

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            defaultExceptionHandler();
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            The exception handler is used whenever:

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                            • +

                                                                                                                                                                                                                                                                              The CPU tries to execute an undefined instruction.

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              This usually means that the CPU is executing memory that isn’t code, which can +mean anything from memory corruption to a function pointer that was invalid.

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              libnds sometimes deliberately executes an undefined instruction to crash in a +controlled way.

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • +

                                                                                                                                                                                                                                                                              The CPU tries to access memory that is protected (data abort).

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              This happens because libnds setups the MPU (Memory Protection Unit) in a way +that only lets the CPU access addresses where there is actual memory. The +32-bit address space of the CPUs is too big for all the memory available on +the NDS, there are large gaps between different memory regions. Accessing +the gaps will cause a data abort. Also, the MPU has been setup to cause data +aborts if the program tries to write to read-only memory (like the BIOS).

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              Note that on a DSi the GBA slot memory isn’t accessible. This may cause +programs to crash if they haven’t been tested on a DSi before. You can solve +this issue by checking isDSiMode() before accessing the GBA slot memory.

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              Normally this error means that you have a pointer that doesn’t point to valid +memory and you have tried to access it.

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Check this example +to see it in action. Note that this will only work in melonDS and on hardware. +Other emulators won’t emulate it at all.

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            + 3.1 How to use all the information on the screen? +

                                                                                                                                                                                                                                                                            + + + +
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            The most important thing on the screen are the values of pc and addr at the +top of the screen. pc says what’s the address where the CPU crashed. You can +translate this to an address in your code by running addr2line in your +terminal. For example:

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            /opt/wonderful/toolchain/gcc-arm-none-eabi/bin/arm-none-eabi-addr2line \
                                                                                                                                                                                                                                                                            +    -e build/debug_exception_handler.elf -a 0x2001252
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Another option (that can be more useful!) is to use objdump to generate a text +file with the assembly code of your program. The templates and examples have a +Makefile target to do this for you. For ARM9-only projects, run:

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            make dump
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            For combined ARM7+ARM9 projects, run:

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            make -f Makefile.arm9 dump
                                                                                                                                                                                                                                                                            +make -f Makefile.arm7 dump
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            With this, all you have to do is to open the resulting dump file in a text +editor and look for the address on the screen.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Also, if you understand assembly language, you can try to use the rest of the +information on the screen to try to understand what the code was doing when it +crashed.

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            + 4. +

                                                                                                                                                                                                                                                                            + + + +
                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            -lnds9d/-lnds7d
                                                                                                                                                                                                                                                                            +sassert()
                                                                                                                                                                                                                                                                            +melonDS GDB server
                                                                                                                                                                                                                                                                            +NO$GBA debugger
                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                            + + + + + + + +
                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            + + + +
                                                                                                                                                                                                                                                                            + + + + + + diff --git a/usage/exception_handler.png b/usage/exception_handler.png new file mode 100644 index 0000000000000000000000000000000000000000..212101692c8db1c53d47ad93b5cc657b947be37c GIT binary patch literal 10385 zcmeHtc~q0v)_&Alt+jevi`D@_tRpf75J(L1RuQp9R0Ko>j3GqEAV~-ilGyrr>wrOv zsGtxlRb&VV2vI_aZ50HBltLH`Ni3)VLWmJEK&Ib$gSPg5cdfg+*6;hTtVMW-efHVI z^X$D(7N_^@_WfwyvUxBV>?6OO+xNj>Gfd!@KKFg_1S?H7f|7=hoRUeB@?1! z;&Ha5v?QD@E;S|^21|XKuqSN6&$jdRf(E0P{pVE=TnnQ&y9TUSv-r#KGLnn^)nzKTV_ykL zElZMDmR{p{#t9K|(rmu-p0xEtmcZtrN3@uH{X9_mkgs?W1GfJHBoRzb;I=ro=YIR_-f=+q<(HV#L!J%Yo>B%;CWSN8B;sh1U^x+&d})l4AfWG4bzO1*wXHRAJ#BZg6K$2Tw1!tAm@X z=Vk{C+}+(F+8yiW<>l-NY;?D%iozmx5RwxxAe}J@7(C7?DG_gZ0RAALAblwJG&s9-;pOo#YCt5H))7Gwp*rCzB7gh_D{1snr2iW z?%4F*^lf~Mg-W)z7E&NE*l8Dtm=s);#ZI7W`W5ylCJ~PV)#D9Z-#(A|4^VJ+J`&}M zad&fo!`(3sZU7Jto-WZ?hp4E{E-q1Cu5Mm%k3VZC5~4{IOfv4Dco0VrD*#VRtZdg? z61Cya(v+h(C<`E94ge(oJ77+49Cm_g##@iKIQ_4fY_SNuQ)Ixp>1UvLfm-PFdog?y zGpOwRAO5__#sA?BK=t37{H6H*9j?E_^_L>>mxTXD*Wcm#OA+`>!hfUd|691`{c)Va zC4wo40uD>-f4xKm2d(#yeCfL#{58X1zM`z}z|{vyJ43;n4;MkdGhlhwJ_8Tuko^38 z<_yi9xoE>?ueC)HFxY1(zwQ6rpZZiGZfo!NEQkFvVVh>2(|$v_@qtg<{&-{dfY;Uc z5jL&0yQ(d&V_J(<0z}hXexg^yy1thKP?2-5`>p>7*_oxb0(<7uKcB|!TzjU@2e%Jt^_wk~1q;2hYLq3gXL zt4~T84C)+IozW^mrTI(}{b3PY!&&;Q?5isEJ$wRRtMldayBioIOD>{CMv+OdjKij3 zLPV|oI0Nj#(wDjr{Aj7GiPP6DLQaU6G6dNj1TBwq&bK;8viYjGyKt#~q-ZLH#^{)O zC9Um2CWd6`J1RTt^24Q8a60UE;|lXwhNQs@Trdbiat>h8y(wJhdt1^5O!^#*wh!=cXabB&5{#+ z%C>eof>R{kjmkmGdqZeT3Y7w7dR4kGeP*@3=}d#jRbyU^uG9QjrYxg8DIT{4(TFm@ zj%V7y4m=7pJ|w2I)f)pMeM39FpK9?1OP8Wywu9dW?Pk;VB(P74y03hOViHsmzAxDM zv2IoDEl%A^GffQEVNx#KvOsv{xUZVb6YA2)p-c z7R(Vi`N!=$m;d(W?d>lEMQi5{Ohd0HU&YXu6U|3f(G1>n>>WGxdRYu8gqMY4i)8J{|UZ>y>BekoAkhVA!O zU+k_lleY9Vjtw94SlysS*1v%EKAve#=+?+~%LNR6+x-j^RlY^e5eN!q^LWGr+7}IE zJxWzwP)k5*y4U4MHTmN46NNO>{!0@Hqk@)|uII#y1`|K0YsNqAV@6t1TiC2|dpWeI ztFQ_6Gy*BoPb|8(mm|IUqTblwq2thGn#$!d{pv=(!oHMM*+PB3Xs^vRvwa? z94A|_0@F%!Nv2+7dT>vIKY1PqP#=ZfC!}bE)S_iCbkZ@#MfFQcS%~RkrP5n7Bwx5a z^hLZzKgG!ucMc{#N+XhH^GBPUEC?;6oU(xQF{B2-=fO!ESkiBEV25-wU`y!lUjEyg zcW#fHHRE}!Cyjcs)Hp?!nea>jeKdfzq(-om+sM-$kSzd7a2BEY41-Qvf_y1JmJ%pY z1m&|}Y4N!+v%jiOV^oOwnT+@{#j@;mP4pMXB3&Xtv__NZOtUDzv$MasGrv=G|MKm= zP^C%w4_1QImqQ6_^hTrvoW2v8)5J>!J0xKn&ADqPqCYMS-Kp6$@-JPP-jqUDZZ5=X zH+Z)?%?74K^;iSJ$GTa#MLdeWulhuXQLut#>@B4tQ^Hsy=5gs&KC5Lgq8?D~_C*!z zh|t|xbB^W+YTNNI+AI1!0^uYzH+N$~h(dk2%C?qLWq*L(MIkn}!e0eBT z(mNPjUsVs=dPsZmMSjryRbio$@IJwq&ZFsyQTQaxH3gS8&P1x#G&X>pq6~A!s(f2t zOZF`z2d6bjyl(BprTJ=UlpU9OpHGZciVj}VMz=ieW?lw~)kYf#)zz^9UvO3`M~ij_ zTr67Q(7NnqS)95^6V@~~3DaEH-8Nj$P7sTw-eHEJs zUEIm=)^;YHxrQoJnjJtLu8eDrP;nl$g5sffrNg#@q&=Ys0*!sL4@%p~HBYL2sST_2 z#5JLfugkQC)wO)D*H2XdW`}DGL_@U{iw@1^t|_fAb|lO3cTIYklqc4T_3Ju8ui6oJ zgSA3G($|AjHUst6?E+O+@ZeS29IG|U123mXEH59ihfh>ia!V?nq-%b@w}hptUk5OK z1ZOC8=Y=WjtIBy5j_N7ySd02u08<>whkagpI&cY@9J zO8P{|^^rJr7E>%y9t&pA2I#4ongN3V`4JSj*MJ+%TLd0hGa*mDj9qeRvUe$?&bza7 z^5x@vEvU*5c1_B3)%+%4tez|DMrdP`Wh-0R3U?%3)*B*d7)uKPVJ#!knT)$PdPb4A z*Y_Q`S=UuJv*cdxZ^ z_F;|FTtI@>rfK|qU3I!U{?%}dag){4jomltbx68i3{(*%LAx7<4H>hm;B&2Oo zHTq{&`1#30GePQ}-5s~rD$0iw*rqG0)wG||#qNz`Ls}aZ^-ec$yZ~YXa=Q6F$Us-1 zs^W7xHVVk%%>lCESNE~M6&vAbY-OENoFTcV>R$yUqqzhoW5RDR+x@<|N3&5_(;g9s z6jgi`+BhcCNYoU2CM8Hp)lcRKkRP{OL*U67CmKpOrmKT}&wQ63RQ_dtf|S5+pu~x@!y#13#AY9*w*a9G@>YI|pnyiXwUN8drgxVc~tJUpX3(pVOn^&02-Ae-$jGJ}cvB|{F z`#<2Q)%pnK{$10K=*S~q=?H~Yi!AT-Z5AjRT;|EKJR6T zwFS%#2cEJPt6 zYe3hn{IS^k$~8+dUXBXVEn}Zv>0TH~o|EU*@VYX@jXH|oEbpbV?7f6qJbPzvx}lJ$ zWan&vs;oHEtjK>hw1W0a-Q!kz?&B4alfA<>dXJU*lKJLK4QRQJ1=kRI&V|Y?lUe#w z^M;WvCn{}dqw5%12AxXlJ)Y#pZPCrRejd=#r&zv1v7mN3WTx)S$zffP>}p7WiQT7u zPI<(jx0h(mA-t1^*&ykOfE3WQH~AVZWTdlY;y1YaRckh-RZFt7rZWEr_;kPl0B@x3 z2{JC3)4x};FPo0@e?6pnzU6XRuVl1AOZuu~$}}Vuc$>tQu6m~h0I;KEccHzrPa8nr z4;2}s9#N00t9W7vduZ`uuAY7ofA61gKpYYYt#aaJ)?_`WR1s{5{RU(l z%z*s->=E9gQ5u5OlRp&L&xxFGdZ>^nyA@KyhfPPNRxG6Vc$(8e5npWX;1ou)IKk*8 zpz^_9;|)B@&T8e|XkHOoP7?@_o!$7^!90R!iZseG@|%Y$PYbLWKc^8WB84}h3_+mj zXWLD?2sdqy<}a+%FG!t03F4IvAzq6gXGmPTE8b3BTE&7_3GegL7tl##8Je*7O5?1a z9Q-l%E((s1 z2&=7SiYOTh>dj!jMDGfhbqjK>_;ux)vcbrp9&XV`h0#-B?l{BhW2CUOH#o+!@d#ya zzLm|yHH%3D<^4-=W6xc;DS57j#SHnGAQbT^=kCdLP0gSyOPf+71_!6Am0x~G%(K*n zud8l~$;AQqkJyv~Hu+`sRFps2xvDiZrD{rZFW`V}kYqv%q|MYTxB_ zt^Nj&{JpR2PJsq{*O9yin8f7&R?p!o(gjqAz-3THRgP*mgh*$w=r-7a#b@eoDSDJuwnXiO&9D3V?PLJ>B*R^{wr7IZM z8m^)u{K+(YiiqRw!${XdJ+}t*+#)%GBPphZ{jocr0Y>EF9k-CLB(v7Y>ibo!#gz3}IBTvC4ntjRZ}# zpNaIh%OYD0F{jL_;X0~^%ZfRUYP?lx5T&Y6#GhQUz+EWI(3Te5Wghy?UplNW_m%$g z8H&)B9_Rxy-PNq4y8awQE~fC~`ok`#ck4?6z(T^B{kKcmx2Ae2XoO}Wzm8VK5ueHD z08ZEr21Kd3_ezz=tGjZT6X6m&s=vCkkMJUIq))$F=2m7-)D#s(;pQwr(#A|F4DlDn6n#R=+HEUDjGA?;3L*q`d4335B za22I74ypPPOu<_lZPtf94Zl1!ksm3KjRs(<&R}>%O%=uEos}-HP@W1%mP}8s$JayA zkV(Uqq~E>uU|6YKTNImjHtXXG#ltz!l)RK-S1R9E(J*TTjbgl&_dJ#~3xY%1z<$|u zuT8s@H_$yIl~Nwbxlbdc(AOpI00)){f03-%6i9U7f*vbgNDNn9k#$kj)~eI()Rxx` zMy-G!c!`pz=VSzTec15p4>beRKE^*UqQlm250!BA-)~Y{i%xY>9!Zz}VbJw>zfcKZ zX&$bsXN&l0OCxUj#Wl&10|67zq3ygqm__I3ya?BSxI>lYe5-{t$ zYTb=Z$^ztWT-uCsFjO7?;^K>-OCCEiqAxiJ-`Hjmn+5Z*jPWh6gPmHD)cmg{x+hPF z-OL`!!*!N}2I!|?xRl#z6J^ummAQOSDWTSOWWQ6GS!red+>J$yW^nnFQ6Jqt%*j_1V z6ZD$>z^+35U`g6_FO;j8KB1J4w?+tI&`B==s2^h zs~{8^0ovdwbaVtqe1WQ>{A@orzX)^$be*{eS$Dp z9aY0?k`7#&Wc(N8yULl>>Lr&sfZs+MB>Qjt#-n|_ILaCHy*3d_oK~EA*L6#C#wzvop*;S+Qm9^vfK8M++)UptO zqqmv1oX%GR3V-?uC}m~D{=F|Bx2byM+yU%EU{SW^Tn;8gFO!gbfyx=LU1>aO7&5WE zO}XF<$!n@uo2Jm^8hu4_B*5R{llQ;~o{L<{_BDUXT2q>UG8N$GB<7l-a`A`3U<{BH z$$Vu8c8e!#%HPxVc~_5l;uVZnbzR?2LBjwb#OIc|1PlP5vG?`py{gB0(+8>YzO3#~ z50DL3#s9_yUK4%9!UdtSL0NyIO|ufc^$TFo`pNavigation

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                          • + + + How to debug programs + + + + + + + +
                                                                                                                                                                                                                                                                          • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                          • Usage
                                                                                                                                                                                                                                                                          • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2593,10 +2670,10 @@

                                                                                                                                                                                                                                                                            Usage

                                                                                                                                                                                                                                                                            - Legacy device/launcher support + How to debug programs gdoc_arrow_right_alt diff --git a/usage/index.xml b/usage/index.xml index 19110de76..bda5e4634 100644 --- a/usage/index.xml +++ b/usage/index.xml @@ -7,6 +7,13 @@ Hugo -- gohugo.io en-us + + How to debug programs + https://blocksds.github.io/docs/usage/debugging/ + Mon, 01 Jan 0001 00:00:00 +0000 + https://blocksds.github.io/docs/usage/debugging/ + While developing applications with BlocksDS you will reach situations where you need to debug your code. There are different ways to do this with BlocksDS, and they are described below. 1. printf debugging This is a classic way to debug messages, but it&rsquo;s still worth mentioning it. It&rsquo;s very easy to setup libnds so that the output of printf() is sent to a text console on the screen. All you have to do is: + Legacy device/launcher support https://blocksds.github.io/docs/usage/legacy_support/ diff --git a/usage/legacy_support/index.html b/usage/legacy_support/index.html index 01ea9cca0..83c11efca 100644 --- a/usage/legacy_support/index.html +++ b/usage/legacy_support/index.html @@ -971,6 +971,50 @@

                                                                                                                                                                                                                                                                            Navigation

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                          • + + + + +
                                                                                                                                                                                                                                                                          • + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                          • Legacy device/launcher support

                                                                                                                                                                                                                                                                        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2798,11 +2875,11 @@

                                                                                                                                                                                                                                                                        Legacy device/launcher support

                                                                                                                                                                                                                                                                        gdoc_arrow_left_alt - Additional libraries/tools + How to debug programs