Skip to content

Releases: blocksds/sdk

Version 1.16.0

25 Dec 12:20

Choose a tag to compare

  • libnds:

    • glDeinit() has been implemented. This function frees all memory used by videoGL and stops the 3D hardware until glInit() is called again.
    • fsync() has been implemented. fflush() doesn't currently guarantee a flush to the disk, so fsync(fileno(fp)) can be used instead. @asiekierka
    • Function fatGetDefaultDrive() can now return "nand:/" if the application runs from NAND.
    • New definitions have been added for the window registers. The old ones didn't use the same names used by GBATEK.
    • Fix SOUNDXCNT_VOL_DIV_x defines.
    • Add defines GL_TRANS_YSORT and GL_ZBUFFERING for glFlush().
    • Define GL_SPECULAR_USE_TABLE has been added so that it can be added to glMaterial() instead of using magic numbers.
    • glMaterialShinyness() has been deprecated. The name is a typo, and the new name is glMaterialShininess(). The old name will be kept around forever because too many projects use it.
    • Add warning to material GL_SHININESS because it isn't used for anything.
    • Align the Huffman temporary buffer to a word just in case it's needed.
    • Stop expecting a size field in the GRF chunk of GRF files.
    • Support PIDX chunks in GRF files. This is used for Tex4x4 texture format.
  • DSWiFi:

    • Access points with hidden SSID (the name of the network) are now supported in DS mode (not in DSi mode yet). This only works for APs that send probe responses that contain a SSID (some APs don't, and they aren't supported).
  • Maxmod:

    • Fix mode C mixer. Version 1.14.0 did a partial fix, but it didn't update the volume divider bits of the audio channel control register correctly. This bug could be seen in the audio_modes example.
  • grit:

    • Remove size field from GRF chunks in GRF files. This was added by BlocksDS and it makes it harder to be compatible with other GRF files. Removing it doesn't affect anything because the RIFF chunk already has the size.
    • When exporting tiled backgrounds grit didn't check if the size of the tile set was too big. There was a check but it was incorrect. Now, grit will fail if it's trying to export too many tiles for the specified format. For example, affine backgrounds can only have up to 256 tiles. Previously, grit would export a broken tile map silently, which was hard to detect if there were too many similar tiles. If you were taking advantage of this broken check to overflow the tile index into th e tile flip bits of regular maps, use options -mB16:p4i12 -mRtp to achieve the same effect.
  • ndstool:

    • The CRC of the secure area wasn't calculated when generating the header. This is now fixed. @edo9300.
    • Support for GRF files has been removed. It was outdated and it didn't make sense to update it. This format was worse than PNG and BMP for static icons because it needs to be pre-converted by hand. Also, it didn't support animated icons like GIF files.
  • SDK:

    • The first official logo of BlocksDS has been created. Thanks to Megan Gozzard.

    • A new icon has been added to the SDK to be used as default icon for all ROMs. The old icon file is still available for projects that depend on it, but it has been updated to use the new icon. Thanks to @DieGo367.

    • dprintf() and vdprintf() have been added to picolibc.

    • Arguments -std=gnu17 and -std=gnu++17 have been removed from all default and template makefiles. They prevented users from changing this themselves.

    • dldipatch now returns the version string when it runs with argument -V (this change was applied to all other tools in version 1.15.0).

    • Examples:

      • Delete both examples about loading textures in GRF format and create a better example that doesn't hardcode any values (grf_textures_nitrofs).
      • Add example of using windows and DMA to create a circular window.
      • Add example of the material properties of 3D objects. It shows several combinations of properties to understand the effect they have on the resulting color of the polygons.
      • Add example of using the master brightness registers (not the LCD brightness).
      • Add example of drawing a single colored 3D quad.
      • Add example that compares modulation and decal 3D polygon modes.
      • Add example of using fog to fade 3D objects over 2D layers.
      • Add example of 3D antialiasing and edge marking.
      • Fix 3D box test example.
      • Set transparent color explicitly in grit files that convert tiled backgrounds. Index 0 is always transparent, so it's a good idea to tell grit which color to use as transparent so that we don't get surprises later.
      • Simplify background image used in the bg_rotation example. It was using way more tiles than the limit of 256, but it wasn't noticeable because many tiles looked similar.
      • Set backdrop color in some examples to black instead of leaving magenta, which is the transparent color of the background.
      • The graphics of the examples in the video_effects folder have been replaced by prettier images.
      • In 3D examples that draw cubes the old vertex order was incorrect (so culling wasn't working properly). It has been fixed.
      • A new example has been added to show how to draw a 3D cube and what's the effect of changing the culling setting.
      • Use GL helpers for texture coordinates instead of raw register writes.
      • Minor improvements to 3D examples.
      • The graphics files used in some 3D examples have been improved.
      • The example that loads a compressed texture has been simplified so that the concatenation happens at build time rather than at run time.
      • A new example has been added to show the different effects of using texture coordinates outside of bounds (stretch, wrap, wrap and flip).
      • Improve the example of drawing several 3D translucent objects to let the user break it in different ways and see the results.
      • Add an example of how to draw a polygon in which all faces are translucent and visible at the same time.
      • Add an example of how to use the 3D alpha test.
      • Add an example of how to draw a simple pre-converted display list.
      • Add an example of how to apply lighting to a 3D cube drawn manually. The previous examples used pre-converted display lists so the developer couldn't see the glNormal() commands.
      • The images used in some examples that combine 2D and 3D graphics have been improved.
      • In the BIOS decompression example, align the Huffman temporary buffer to a word just in case it's needed. Clear the destination buffer before each decompression to make sure that a decompression that doesn't write anything doesn't pass as a correct decompression. Use VRAM-safe compression for LZSS so that it works with WRAM and VRAM decompression routines.
    • Documentation:

      • The documentation has been completely reorganized. Old links to specific pages won't work.
      • The old Hugo theme has been replaced by one that supports different sections better (SDK documentation vs tutorial, for example).
      • A lot of icons and nicer formatting has been added to all the previous documentation. In particular, the setup instructions have been simplified.
      • The documentation now includes information about all the libraries provided in the BlocksDS and Wonderful Toolchain repositories. They weren't easily discoverable before.
      • Add a new page with documentation about filesystem support.
      • The tutorial has new sections about background and sprite extended palettes.
      • The tutorial has new chapters about 2D effects (blending, mosaic, etc), memory management, and 3D.
      • The tutorial has been merged into the SDK repository to unify the documentation of BlocksDS.
      • The tutorial is now licensed under the license CC BY-NC-SA 4.0.
    • Tests:

      • Make DLDI-on-ARM7 test work in DSi Slot-1 flashcarts.

Version 1.15.7

29 Nov 11:20

Choose a tag to compare

  • libnds:

    • Add a wait loop to systemReboot() to give the power management hardware enough time to do the reboot (before systemShutDown() is called, which is faster to act).
    • Update FatFs to version R0.16p1.
  • DSWiFi:

    • gethostbyname() has been marked as deprecated. This function only returns IPv4 addresses and it's deprecated in the libraries of modern systems. You should use getaddrinfo() instead, which returns IPv4 and IPv6 addresses. That way applications will be future-proof.
    • A new flag called WFLAG_APDATA_CONFIG_IN_WFC has been added to Wifi_AccessPoint.flags to tell the developer that the access point has been configured in the WFC settings.
    • Wifi_ConnectWfcAP() has been implemented. This function allows the user to select one of the APs configured in the WFC settings instead of connecting to the first one that the library finds. Previously you could only use
      Wifi_ConnectSecureAP(), which forces you to provide the password instead of reading the data stored in the WFC settings. Now you can use either function depending on whether you want to use the WFC settings or a different password.
  • Maxmod:

    • mmInitNoSoundbank() has been improved to initialize the pointer to the soundbank to NULL for clarity. This wasn't causing any issue because the number of songs and samples was correctly initialized to 0.
  • SDK:

    • The documentation about using filesystems has been improved a lot.
    • Improve synchronization of ARM9 and ARM7 CPUs before the ARM7 is allowed to enter main(). In very rare cases, if the user modified REG_IPC_SYNC too soon inside main() the ARM9 synchronization code would never see the message from the ARM7 allowing it to continue and it would hang.
    • All DSWiFi examples have been updated to stop using gethostbyname() and to use getaddrinfo() instead. One of the examples has been moved to the tests folder to make sure we can still test gethostbyname() in the future (the plan is to keep it and discourage its use, not to remove it). Now all examples support IPv4 and IPv6 as recommended.
    • The DSWiFi examples have been updated to use Wifi_ConnectWfcAP() in addition to the other functions to connect to access points.

Version 1.15.6

12 Nov 20:39

Choose a tag to compare

  • libnds:

    • Fix pianoIsInserted() always returning false. @exelotl
    • Fix sound playback helpers not starting or stopping sounds when requested.
  • DSWiFi:

    • Fix race condition when writing packets to the IPC RX/TX circular buffers that could cause a crash in the library.
  • SDK:

    • Fix the timer index used for RTC on the ARM7 in the ARM9+ARM7 template.
    • Fix make clean target in the examples that use Mbed TLS or libcurl. It used to cause an error if the libraries weren't present in the system.
    • The documentation about multithreading locks has been updated.

Version 1.15.5

01 Nov 16:09

Choose a tag to compare

  • libnds:

    • Split systemShutDown() to create systemReboot().
    • Clean power management definitions.
    • Un-deprecate glTranslate3f32() because it's used in several projects.
    • Stop writing the NAND CID to arbitrary RAM addresses used by the official SDK but not by BlocksDS. @edo9300
    • Stop writing to REG_VCOUNT during initialization of the ROM. Thanks to @TuxSH for finding the original bug.
    • Add global timer definitions so that other libraries know which timer they can use.
    • Ensure that file descriptors passed to truncate() are valid FAT descriptors.
  • DSWiFi:

    • Drop lwIP packets if there isn't enough RAM to allocate a buffer for them (instead of crashing in an assert()).
    • Add a workaround to prevent IPC buffer overflows.
  • SDK:

    • Use the new libnds timer defines in ARM7 templates and examples, as well as in DSWiFI, Maxmod and LibXM7.
    • Fixed the orientation of normals for planes in the volumetric shadow example. @Mori-TM
    • Improve exit-to-loader test.

Version 1.15.4

19 Oct 12:41

Choose a tag to compare

  • libnds:

    • glTranslate3f32() has been converted from a define to a static inline function. The define could cause issues if someone was creating a C++ wrapper with the same name, for example.
  • DSWiFi:

    • Don't crash on an assert() when sending fragmented lwIP packets.
  • SDK:

    • Support unusual main() prototypes with 3 arguments instead of two. The third argument is set to NULL.

Version 1.15.3

17 Oct 17:24

Choose a tag to compare

  • DSWiFi:

    • IPv6 support has been added. The ASSOCSTATUS_DHCP state now waits for an IPv4 or an IPv6 address to be available (normally IPv4 is available first). Function Wifi_GetIPv6() has been added, which lets the caller check if there is an available IPv6 address for the DS.
    • In DS mode, only send data packets to the ARM9 by default. Previously all management packets were being sent.
    • In DS mode, send multicast packets to lwIP. Previously only packets addressed to the console or to the broadcast address (FF:FF:FF:FF:FF:FF) were sent to lwIP, which prevented DHCPv6 from working, for example.
    • TX packets generated by lwIP and passed to DSWiFi weren't handled correctly if they were in a fragmented pbuf. This has been fixed.
    • Fix implementations of ioctl() and fcntl(), as well as the defines O_RDONLY, O_WRONLY, O_RDWR and O_NONBLOCK.
  • SDK:

    • Added a new package with libcurl named blocksds-libcurl.
    • Added a new example of how to use libcurl with BlocksDS.
    • Improve documentation of exception handler example.
    • Add a bloom example based on the original demo by Bluescrn.
    • Mention the multiple ARM7 cores in the migration guide.
    • Support edge-triggered rumble cartridges in the Slot-2 example.

Version 1.15.2

13 Oct 23:37

Choose a tag to compare

  • libnds:

    • Fix mounting filesystems in SD cards with multiple partitions. @edo9300
  • DSWiFi:

    • A potential buffer overflow has been fixed in the DSi RX/TX queues.
    • The DS RX/TX queues that transfer packets between the ARM9 and ARM7 have been rewritten to behave like in DSi mode. Now packets are written to the circular buffer one after the other, but they are never cut into two parts when the end of the buffer is reached. This guarantees that packets are always stored in one piece, which means that the ARM9 can avoid doing an extra copy to concatenate both parts, making communications faster.
    • In DS mode packets are now read from/written to MAC RAM using DMA for extra speed and simplify the code.
    • Now that packets are always stored in one piece, it isn't needed to use Wifi_RxRawReadPacket() to copy them to a user-allocated buffer. Function Wifi_RxRawReadPacketPointer() has been implemented as an alternative. It returns an uncached pointer to the packet in RAM. Please, check the documentation for advice on how to use them.
    • Improve random number generation. Previously, in DS mode, W_RANDOM was used for WEP seeds, a bad handmade RNG was used for WPA2 handshakes, and rand() was used in Mbed TLS instead of hardware entropy collection. A new system has replaced all of them. It constantly collects randomness from different events and updates a seed that is used to seed a xorshift32 generator. It isn't super secure because there is no real source of randomness on the DS, but it's better than the previous systems.
    • The Wifi_TxHeader and Wifi_RxHeader structs are now private. They are never required by user code, and there is no equivalent in DSi mode, so it's better to hide them.
  • SDK:

    • Fix linker warning about the implementation of __sync_synchronize. Thanks to @asiekierka for the workaround.
    • In a DSWiFi example some missing instructions have been added to the console output.
    • The SSL DSWiFi example has been updated with more test websites.

Version 1.15.1

09 Oct 18:22

Choose a tag to compare

  • DSWiFi:

    • In the ARM7, Mbed TLS has been moved to twl sections. This code is only required to connect to WPA2 networks.
    • Transfer of data between DSWiFi and lwIP in the ARM9 has been fixed. The way pbuf structs were managed was incorrect, and caused frequent assertion panic screens.
    • Some missing defines have been added to public DSWiFI headers.
    • Some settings have been changed in lwIP (for example, to increase the number of available simultaneous sockets).

Version 1.15.0

07 Oct 18:06

Choose a tag to compare

  • libnds:

    • Fix reading console ID with SCFG_ROM registers disabled. @edo9300
    • Ensure crypto has been initialized when a NAND read/write command is received in the ARM7. @edo9300
    • Support using write() to send text to the console with file descriptors STDOUT_FILENO and STDERR_FILENO.
    • Fix potential cache corruption caused by DC_InvalidateRange() in readFirmware(). It has been replaced by DC_FlushRange(), and all calls to DC_InvalidateRange() have been removed. For more details, check Cearn's articles here and here.
    • Add some missing SCFG and NDMA register definitions.
    • Add no$gba debug register definitions (also used in melonDS).
    • Simplify no$gba message print on the ARM9 (melonDS doesn't support the simplified system on the ARM7).
  • DSWiFi:

    • Add new DSi mode driver with support for Open, WEP and WPA2 networks. @shinyquagsire23 is the original author of the driver. It has been extracted from dsiwifi and modified to integrate it with the previous DSWiFi code.
    • This driver can be enabled by passing WIFI_ATTEMPT_DSI_MODE as one of the flags to Wifi_InitDefault(). It's also possible to use WIFI_DS_MODE_ONLY to force DS mode even on DSi consoles (this is the default setting).
    • The new DSi driver doesn't support NiFi mode, it's only available in backwards-compatible DS mode.
    • The library now reads all Access Points configured in the WFC settings of DSi consoles. It uses them even in backwards-compatible DS mode (but it ignores access points that use WPA).
    • Wifi_ConnectAP() has been deprecated, Wifi_ConnectSecureAP() supersedes it. It's more convenient because it takes as input a key and key length instead of a key and hardware definitions. It supports WPA, WEP and open networks.
    • The code on the ARM7 side is now divided into two parts. One of them is for DS mode, which is always loaded. The other one is for the DSi driver, which is only loaded to RAM in DSi mode. Some code can be shared between both modes, but not much.
    • The code has been refactored a lot. The WIFI_MODE, WIFI_AUTHLEVEL and WIFI_CONNECT_STATE state machines are now decoupled and they can't directly change the state of other state machines, making it easier to understand the execution flow.
    • The internal IPC code of the library has been simplified. Several status flags have been removed as they are no longer needed.
    • Wifi_FindMatchingAP() has been simplified. It now only checks the BSSID and SSID of the reference AP we're looking for.
    • Some new fields related to the security of the AP have been added to struct Wifi_AccessPoint. Also, field rssi is now signed instead of unsigned.
    • Mbed TLS 3.4.6 has been added to the repository. This is required by the WPA2 handshake code. The license has been added to the repository, and the SDK documentation has been update to mention the new requirements.
    • Flag WFLAG_APDATA_ADHOC no longer works as ad hoc mode support has been removed (this is different from multiplayer mode, that's still supported). Field macaddr has been removed from struct Wifi_AccessPoint.
    • Unused define WFLAG_APDATA_SHORTPREAMBLE has been removed.
    • The strings of ASSOCSTATUS_STRINGS have been modified to make them useful.
    • The network interface (netif) used by lwIP is now set down when the WiFi connection is lost and set up when the console connects to an access point. This helps lwIP do some things better, like DHCP.
    • Scan mode is now a bit faster in DS mode, the library stays for a shorter period of time in each channel.
    • A few definitions and structs have been added to the public headers, as well as freeaddrinfo() and getaddrinfo().
  • SDK:

    • Improve SDK version string generation. The makefiles of all tools (except for dldipatch) have been modified to use the value of VERSION_STRING provided by the user. If the string is not provided, it tries to generate a version string in 2 different ways. If that fails, it defaults to "DEV".

    • Added a prototype Mbed TLS 3.6.4 package to the pacman repository. Note that the entropy generation isn't correct, so don't use this for any application that requires security for now!

    • All tools (except for dldipatch) now accept a -V flag. When the tools are run with -V they print the version string and exit right away. This flag has been selected because some tools were already using -v for other purposes (like verbose output).

    • The file $BLOCKSDS/version.txt will now contain the value of VERSION_STRING generated when building BlocksDS instead of the commit ID.

    • Update license information about DSWiFi.

    • To reduce the size of NDS ROMs the default ARM9-only Makefile now uses the default ARM7 core with maxmod but without DSWiFi. Programs that require DSWiFi need to select the right core by adding this line to the Makefile: ARM7ELF := $(BLOCKSDS)/sys/arm7/main_core/arm7_dswifi_maxmod.elf

    • Examples:

      • New example that lets you display the photos stored in the NAND of a DSi console. @edo9300
      • The DSWiFi examples have been updated to use DSi mode and connect to WPA2
        networks whenever possible.
      • There's a new example to show how to use the new version check helpers.

Version 1.14.2

17 Sep 20:55

Choose a tag to compare

  • libnds:

    • Improve error checking in nitroFSInit() when using official card commands to access NitroFS. nitroFSInit() now reads the new magic string stored by ndstool in the NDS ROM to check that the cartridge data can be read. The previous system was incorrect because the ROM header can't be read after the initial load of the ROM.
    • Prevent changing the filesystem label of DSi NAND partitions with fatSetVolumeLabel(). @edo9300
    • Add support for the photo partition of the DSi NAND. @edo9300
    • Save some RAM related to FatFs structs by moving them to TWL RAM. @edo9300
    • Some minor code cleanup.
  • DSWiFi:

    • Implemented inet_aton(), inet_addr(), inet_ntop() and inet_pton().
    • DSWiFi now prevents lwIP from updating its state before being connected to an access point.
    • Some minor code cleanup.
  • ndstool:

    • Add a magic string after the FAT filesystem table. This string can be used by libnds to check that card commands can read the cartridge data correctly.
    • The unit code and title ID of the DSi ROM header can now be set by the user independently.
    • The default title ID for DSi ROMs is now the DSiware code rather than the DSi gamecard code. This is a compatibility break with older versions. To get the same result as previous invocations of ndstool you need to use the argument -u 00030000. If you were using a different title ID already now you will need to specify the unit code. For example, -u 00030004 now becomes -u 00030004 -uc 3, and you can skip the -u 00030004 because that's the new default value.
  • SDK:

    • NitroFS now works when ROMs are loaded from Unlaunch (with some limitations, paths can only be up to 0x40 characters long, and file/folder names are in 8.3 name format). Thanks to @edo9300 for his device list support additions and his suggestions for ndstool.
    • The example that accessess all filesystems has been improved to check the nand2 filesystem as well.