Releases: blocksds/sdk
Version 1.16.0
-
libnds:
glDeinit()has been implemented. This function frees all memory used by videoGL and stops the 3D hardware untilglInit()is called again.fsync()has been implemented.fflush()doesn't currently guarantee a flush to the disk, sofsync(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_xdefines. - Add defines
GL_TRANS_YSORTandGL_ZBUFFERINGforglFlush(). - Define
GL_SPECULAR_USE_TABLEhas been added so that it can be added toglMaterial()instead of using magic numbers. glMaterialShinyness()has been deprecated. The name is a typo, and the new name isglMaterialShininess(). The old name will be kept around forever because too many projects use it.- Add warning to material
GL_SHININESSbecause 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
GRFchunk of GRF files. - Support
PIDXchunks 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_modesexample.
- 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
-
grit:
- Remove size field from
GRFchunks 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 -mRtpto achieve the same effect.
- Remove size field from
-
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()andvdprintf()have been added to picolibc. -
Arguments
-std=gnu17and-std=gnu++17have been removed from all default and template makefiles. They prevented users from changing this themselves. -
dldipatchnow 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_rotationexample. 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_effectsfolder 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.
- Delete both examples about loading textures in GRF format and create a better example that doesn't hardcode any values (
-
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
-
libnds:
- Add a wait loop to
systemReboot()to give the power management hardware enough time to do the reboot (beforesystemShutDown()is called, which is faster to act). - Update FatFs to version R0.16p1.
- Add a wait loop to
-
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 usegetaddrinfo()instead, which returns IPv4 and IPv6 addresses. That way applications will be future-proof.- A new flag called
WFLAG_APDATA_CONFIG_IN_WFChas been added toWifi_AccessPoint.flagsto 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 toNULLfor 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 modifiedREG_IPC_SYNCtoo soon insidemain()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 usegetaddrinfo()instead. One of the examples has been moved to thetestsfolder to make sure we can still testgethostbyname()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
-
libnds:
- Fix
pianoIsInserted()always returningfalse. @exelotl - Fix sound playback helpers not starting or stopping sounds when requested.
- Fix
-
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 cleantarget 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
-
libnds:
- Split
systemShutDown()to createsystemReboot(). - 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_VCOUNTduring 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.
- Split
-
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.
- Drop lwIP packets if there isn't enough RAM to allocate a buffer for them (instead of crashing in an
-
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
-
libnds:
glTranslate3f32()has been converted from a define to astatic inlinefunction. 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.
- Don't crash on an
-
SDK:
- Support unusual
main()prototypes with 3 arguments instead of two. The third argument is set toNULL.
- Support unusual
Version 1.15.3
-
DSWiFi:
- IPv6 support has been added. The
ASSOCSTATUS_DHCPstate now waits for an IPv4 or an IPv6 address to be available (normally IPv4 is available first). FunctionWifi_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()andfcntl(), as well as the definesO_RDONLY,O_WRONLY,O_RDWRandO_NONBLOCK.
- IPv6 support has been added. The
-
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.
- Added a new package with libcurl named
Version 1.15.2
-
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. FunctionWifi_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_RANDOMwas used for WEP seeds, a bad handmade RNG was used for WPA2 handshakes, andrand()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_TxHeaderandWifi_RxHeaderstructs 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.
- Fix linker warning about the implementation of
Version 1.15.1
-
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
pbufstructs 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
-
libnds:
- Fix reading console ID with
SCFG_ROMregisters 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 descriptorsSTDOUT_FILENOandSTDERR_FILENO. - Fix potential cache corruption caused by
DC_InvalidateRange()inreadFirmware(). It has been replaced byDC_FlushRange(), and all calls toDC_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).
- Fix reading console ID with
-
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_MODEas one of the flags toWifi_InitDefault(). It's also possible to useWIFI_DS_MODE_ONLYto 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_AUTHLEVELandWIFI_CONNECT_STATEstate 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, fieldrssiis 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_ADHOCno longer works as ad hoc mode support has been removed (this is different from multiplayer mode, that's still supported). Fieldmacaddrhas been removed from structWifi_AccessPoint. - Unused define
WFLAG_APDATA_SHORTPREAMBLEhas been removed. - The strings of
ASSOCSTATUS_STRINGShave 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()andgetaddrinfo().
-
SDK:
-
Improve SDK version string generation. The makefiles of all tools (except for
dldipatch) have been modified to use the value ofVERSION_STRINGprovided 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-Vflag. When the tools are run with-Vthey print the version string and exit right away. This flag has been selected because some tools were already using-vfor other purposes (like verbose output). -
The file
$BLOCKSDS/version.txtwill now contain the value ofVERSION_STRINGgenerated 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
-
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.
- Improve error checking in
-
DSWiFi:
- Implemented
inet_aton(),inet_addr(),inet_ntop()andinet_pton(). - DSWiFi now prevents lwIP from updating its state before being connected to an access point.
- Some minor code cleanup.
- Implemented
-
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 00030004now becomes-u 00030004 -uc 3, and you can skip the-u 00030004because 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
nand2filesystem as well.