版本发布 8
- 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. - 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. - 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. - 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. - 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.
- 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`.
- 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.
- 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. - SDK: - NitroFS now works when ROMs are loaded from Unlaunch (with some limitations, paths can only be up to 40 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.
- libnds: - Rename symbols of FatFs inside libnds so that users can have their own copy of FatFs. - Improve `normalizef32()`: Fix normalization of large and small vectors and optimize its performance. @Kuratius, @19tracks - Fix base address of the bootstub struct. - Clarify documentation about how `keysDownRepeat()` works. - Move some key state handling to critical sections to prevent race conditions. - Fix implementation of `swiIntrWait()` on both CPUs. It has been rewritten in C and moved to the common folder so that both CPUs use the same implementation. - Two defines have been added for `swiIntrWait()`: `INTRWAIT_KEEP_FLAGS` and `INTRWAIT_CLEAR_FLAGS`. - Improve FIFO communications code: - In FIFO wait loops, don't discard current interrupts flags when calling `swiIntrWait()`. If a FIFO interrupt has happened, exit the wait loop right away. - In `fifoWait*()`, check `REG_IME` before calling `swiIntrWait()`. If interrupts are disabled, skip the wait. `swiIntrWait()` enables interrupts internally, and this may be an issue for code that relies on interrupts being disabled. The only side-effect of not calling `swiIntrWait()` is that the CPU won't be able to enter low-power mode. - Fix some race conditions by moving some code and checks to critical sections. - Add some new definitions related to FIFO interrupts that are clearer than the previous ones. - Prevent deadlocks in some situations. For example, if the software RX queue was almost full, the hardware RX queue is half emptied in the IRQ handler, but it can't be completely emptied, the FIFO code would never check the hardware RX queue again. There were similar situations with the TX queue. The new code adds checks for the RX and TX hardware queues in some other places (like `fifoCheck*()` or `fifoInternalSend()`) that are likely to be executed in any potential user wait loop. - The FIFO buffer has been renamed to global FIFO pool. The send and receive queues have been renamed to RX and TX queues. - Fix global pool corruption when the pool got filled with packets that hadn't been handled. The code that allocates and frees blocks from the pool can't handle the situation in which zero blocks are left, so the new code makes sure that there is always at least one free block in the pool. - The code has been documented, and things like the global pool of blocks have been refactored to be much clearer. - Unknown system FIFO commands will now crash the application instead of being ignored. - Improve cothread system: - Show a crash message when trying to remove a nonexistent cothread context. - Optimize `cothread_yield_irq()`. - Prevent `cothread_yield()`, `cothread_yield_irq()` and `cothread_yield_irq_aux()` from inside interrupt handlers. Instead of yielding, `cothread_yield()` returns right away, and the others call `swiIntrWait()` instead. - `swiIntrWait()` is now only called if `REG_IME=1`. If not, it is skipped. - Refactor global IRQ handler: - Remove the `irqDummy()` function, use `NULL` pointers instead. - Use fewer cycles to exit the handler when there isn't an user interrupt handler assigned to the interrupt. - Optimize code that wakes up threads waiting for an interrupt, preventing racen conditions. - Compile `getHeap*()` functions on the ARM7 too. @asiekierka - Maxmod: - Fix Portamento + Volume Slide effect. - Grit: - Crash if mode append is selected but it's not allowed due to other settings. In the past, grit would just overwrite the invalid setting without warning the user. - Add note to the documentation about how it is better to reduce quality of graphics before passing them to grit than to let grit reduce the quality. - SDK: - Documentation: - Add a section to the "Usage notes" page about how to move the DTCM user variables to the end of DTCM using the `__dtcm_data_size` symbol. - Examples: - Fix example of streaming audio with Maxmod. Instead of reading the file from the Maxmod callback handler (which is inside an interrupt handler) the example now keeps a circular buffer. The main loop writes new data read from the file and the interrupt handler reads the data and sends it to Maxmod. - Add example of displaying a 4 BPP tiled background. Rename the previous `bg_regular` example to `bg_regular_8bit` to clarify that it loads a 8 BPP tiled background. - Add example of creating an FPS counter. - Add example of how to use the VBL interrupt. - Improve C++ example to also run on the ARM7. - Add example of how to use DMA to do HBLANK scroll effects. - Add example of how to save and load data from the filesystem. - Improve `key_input` example to show the values returned by `keysDownRepeat()`. - Fix build of the example that prints no$gba debug messages from both CPUs. Floating point support has been removed from `printf()` on the ARM7 to save space. - Tests: - The exit to loader test has been fixed (even though the exit code doesn't work properly yet). - Add a test to see how to exit CPU halt state with IRQs. - Add a test to see the effect of deleting threads in different ways. - Add a test to check that CPU contexts are preserved after returning from a cothread yield. - Add a test to check the behaviour of the FIFO handling code when the FIFO hardware and software queues are full. - Some test folders have been moved around for clarity. - Add test of using the `__dtcm_data_size` symbol. - Other: - Modify the default makefiles to allow the user to specify additional `LDFLAGS` when including them.
- libnds: - Improve performance of camera driver significantly. - Support using TLS symbols from the main binary in dynamic libraries. - Support `R_ARM_JUMP24` relocation in dynamic libraries, which tends to be used for tail function calls in ARM mode. - Support global constructors and destructors in dynamic libraries. They are called when libraries are loaded and unloaded. - Add `dlmembase()` function to get the base address of a loaded dynamic library, which can be used to load the ELF file at the right address when debugging the program with GDB. - Add defines to manually place variables in ITCM. - The two variables placed in DTCM by the cothreads code have been moved to ITCM to help the stack grow (they were being placed at the start of DTCM, which stopped the stack from growing into main RAM). - Fix `grfLoadMemEx()` and `grfLoadFileEx()` when passing `NULL` in `header`. - A few improvements to `hw_sqrtf()`. @Kuratius - Minor documentation fixes. @Kuratius - Reintroduce list of copyright holders to the license file. @asiekierka - Uniformize license headers and update the list of copyright holders in the license file. - Maxmod: - Fix some size definitions in the GBA public headers. - Fix memory leaks when unloading modules. @ds-sloth - A lot of assembly code has been converted to C, particularly code related to the module player and effects handling. - Fix bug when stopping the playback of a module. This caused noise to be generated in the GBA port when a song was stopped. - The DS programming guide has been fixed. - mmutil: - Add readme to repository. - SDK: - dsltool: - Support using TLS symbols from the main binary in dynamic libraries. - Support `R_ARM_JUMP24` relocations. - Support loading ELF files with more than 256 symbols. @jonko0493 - Add link to documentation about relocations. - Support global constructors and destructors. - Provide `__dso_handle` in all dynamic libraries. - Examples: - Add C constructor to basic dynamic library example and improve it in general. - Add example of using C++ dynamic libraries. - Let user stop song in audio modes Maxmod example. - Other: - Document limitations of dynamic libraries and how to debug them. - Enable default exception handler in the default debug ARM7 cores. - Clarify hack used in the crt0 to reference some symbols and prevent the garbage collector of the linker from removing it.
- SDK: - Other: - Global initializers have been fixed for picolibc 1.8.10. - Fix conflicting types when including `math.h` instead of `cmath` from C++ files.
- Maxmod: - Most of the files of the library have been converted from assembly to C to help people understand, maintain and improve the code. The remaining assembly code is the software mixing code of the ARM7 (on both DS and GBA modes) and the song player code (which is too big to convert in one go and it will require more work in the future). Both the GBA and DS ports have been tested. Thanks to @Lorenzooone for all his work! - Some error checks have been added to code that didn't have it (like all code using `fopen()`, `fread()` or `malloc()`. - Code that allocates memory now uses `calloc()` instead of `malloc()` to clear the buffer before using it. - The unused Value32 FIFO handler code in the ARM7 has been removed. - Cache management has been fixed. The cache handling functions of Maxmod were incorrect, and they have been removed. Now Maxmod uses the functions of libnds. - IPC code that synchronized streaming between ARM7 and ARM9 has been improved. Instead of using shared memory to synchronize CPUs, new FIFO messages have been implemented. The old code required dangerous cache management that could corrupt variables surounding the "ready" flag used by the library. - SDK: - Other: - GCC has been updated to version 15.1.0 in Wonderful Toolchain. You can check the release notes [here](https://gcc.gnu.org/gcc-15/changes.html). An important addition is the support for `#embed`. - picolibc has been updated to version 1.8.10 in Wonderful Toolchain. Check the release notes [here](https://github.com/picolibc/picolibc/releases/tag/1.8.10). - Examples: - A new example of how to use sound effects with Maxmod has been added. - The Maxmod streaming example has been fixed to not hang in DSi consoles or DS consoles with DLDI running on the ARM7. - The reverb Maxmod example has bee improved with a new song that makes the effect more evident. - The "sprites" example has been renamed to "sprites_regular" for clarity. Also, 128 KB sprite mapping mode is now used in this example, as this is what most developers would want in their own code. - Some comments have been added to the libnds sound example. - A missing example description has been added.