Skip to content

Releases: blocksds/sdk

Version 1.3.1

26 Jul 17:50
Compare
Choose a tag to compare
  • libnds:

    • Added 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:

    • New examples:

      • Added 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:

      • The 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:

      • Expanded 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

06 Jul 11:56
Compare
Choose a tag to compare
  • libnds:

    • New touchscreen driver:

      • The 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'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:

      • The 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:

      • ITCM use has been reduced by about 320-380 bytes, depending on your codebase'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:

      • A 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'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't recover from the error).
    • Code refactoring:

      • RTC_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:

      • ARM7 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:

    • New examples:

      • Added 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:

      • OAM memory and textures is now freed in all examples that allocate them. While this isn't needed in examples as short as ours, it's good practice to show developers how to free resources when they aren'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:

      • Fixed reading data from assembly files as input.
      • Fixed uninitialized memory use when loading a picture with an odd width.
    • picolibc:

      • The 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:

      • Fixed 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'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

08 Jun 12:08
Compare
Choose a tag to compare
  • libnds:

    • videoGL:

      • Add 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:

      • Improve error checking when loading textures.
      • Modify sprite sets to use uint16_t arrays for texture coordinates.
    • Add 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'd like alternate options, please let us know.
    • Fix swiSwitchToGBAMode().

    • Improve documentation of RTC structs.

  • SDK:

    • Add 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 "text over 3D" example.
    • Improve timer example.
    • Add a test for the videoGL functions that allocate textures and palettes.

Version 1.1.0

08 May 17:46
Compare
Choose a tag to compare
  • libnds:

    • Add 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:

    • Add 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

30 Mar 10:59
Compare
Choose a tag to compare
  • libnds:

    • Fix 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't remap NWRAM-A when starting the DSP (only B and C are needed).
    • Fix swiUnpackBits().
    • Fix some casts to respect "const".
    • 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:

    • Add 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:

    • Fix return type of mmEffectCancel() in ARM9 code.

Version 0.14.0

02 Mar 14:25
Compare
Choose a tag to compare
  • libnds:

    • The GRF loading functions have been modified to be actually useful. In some cases it wasn'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:

    • Refactor documentation.

      • It 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 flashcards 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:

      • 3D 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.

  • LibXM7:

    • It now uses timer 0 instead of timer 1, so that Maxmod and LibXM7 use the same timer and it's easier to switch libraries.
    • The documentation has been improved.
  • DSWifi:

    • WEP modes have been documented.
    • The prototypes of some functions have been cleaned up.
    • The documentation has been improved.
  • Maxmod:

    • The 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

01 Feb 17:51
Compare
Choose a tag to compare
  • libnds:

    • Breaking 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'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'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:

    • Added 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'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'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:

    • Make types XM7_XMModuleHeader_Type and XM7_MODModuleHeader_Type private. Developers consider their MOD/XM files as a typeless blob of data, they shouldn'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:

    • Add 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

26 Dec 10:31
Compare
Choose a tag to compare
  • libnds:

    • Dot 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:

    • The default Makefiles have been simplified and now use compiler-provided
      .specs files. In turn, a few additional features have been added:

      • Support for picolibc'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:

    • Added 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

04 Dec 20:27
Compare
Choose a tag to compare
  • libnds:

    • Added 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:

    • Reduced memory usage, especially while Wi-Fi is not initialized.
  • ndstool:

    • Breaking: Instead of providing alternate-language banner text using -bt5 "Text", the form -bt 5 "Text" 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:

    • Updated 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

27 Nov 17:29
Compare
Choose a tag to compare
  • libnds:

    • Fixed a bug introduced in version 0.11.1 that didn'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:

    • Move crt0 and linkerscript to libteak repository.
    • Preprocess all assembly files, not just the crt0.