Releases: blocksds/sdk
Releases · blocksds/sdk
Version 1.11.1
-
libnds:
- Fix a bug that would crash the application if
__aeabi_atexit()
was called when a dynamic library isn't being loaded.
- Fix a bug that would crash the application if
-
SDK:
- Fix linker scripts to include the picolibc hook that calls all functions registered with the
atexit()
family of functions. This also affected global destructors, which weren't called at exit. @asiekierka - Improve C++ example to test global destructors in addition to global constructors.
- Fix linker scripts to include the picolibc hook that calls all functions registered with the
Version 1.11.0
-
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()
andgrfLoadFileEx()
when passingNULL
inheader
. - 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.
-
Version 1.10.1
-
SDK:
-
Other:
- Global initializers have been fixed for picolibc 1.8.10.
- Fix conflicting types when including
math.h
instead ofcmath
from C++ files.
-
Version 1.10.0
-
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()
ormalloc()
. - Code that allocates memory now uses
calloc()
instead ofmalloc()
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:
-
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.
-
Version 1.9.1
-
libnds:
- A new function has been added to reduce the heap space from the end of RAM:
reduceHeapSize()
. - The sprite mapping enums have been simplified by removing a part of the value that wasn't used by anything.
- A few documentation improvements in backgrounds, sprites and FIFO definitions.
- A new function has been added to reduce the heap space from the end of RAM:
-
SDK:
-
Documentation:
- The memory map documentation has been updated.
-
Examples:
- The images used in 2D sprites and backgrounds examples have been improved.
- A new example has been added to show how to use main engine video mode 6.
- A new example has been added to show how to use extended affine backgrounds. There was only an example of how to use regular affine backgrounds.
- The example of sprites that use extended palettes has been updated to use multiple palettes per engine instead of just one.
-
Tests:
- A new test has been added to check the bounds of the heap compared to the bounds of DTCM. It also checks if
reduceHeapSize()
,malloc()
andfree()
interact the right way.
- A new test has been added to check the bounds of the heap compared to the bounds of DTCM. It also checks if
-
crts:
- A very old bug has been fixed where the heap end in DSi mode would allow malloc() to allocate memory inside DTCM (which is used by the stack, and would corrupt it). Thanks to @ds-sloth for the initial report that resulted in finding the bug.
-
Other:
-
Version 1.9.0
-
libnds:
- Add initial helpers to load dynamic libraries with
dlfcn.h
functions. Note that this is still experimental.dlopen()
,dlsym()
,dlerror()
anddlclose()
are supported. - Fixed global C++ constructors that require libnds and the cothread scheduler to be initialized. Some functions previously called from the crt0 have been moved to
cothread_main()
, which runs after there is a valid multithreading environment. - Deallocate memory reserved for the FAT file system cache if
fatInit()
fails. - Extend
statvfs()
to return theST_RDONLY
flag for read-only media. - File system operations should now return
EROFS
for read-only DLDI drivers. - Made
libndsCrash()
public. - Fix potential issues involving FAT file system cache initialization.
- Add some checks to libc system call functions like
open()
.
- Add initial helpers to load dynamic libraries with
-
DSWifi:
- Fix
ioctl(FIONREAD, x)
, which used to returnEINVAL
even when it succeeded. - Remove Access Points from the list of availabled APs after enough time has passed without receiving any beacon packet from them.
Wifi_GetData()
andWifi_GetAPData()
have been updated to work with the changed system. - The array that specifies the order in which channels are scanned has been modified so that each channel is scanned the same number of times. This makes it easier to determine which APs to remove from the list of APs because we aren't prioritizing APs from any channel. Also, scan mode now always start with channel 1.
- Old RSSI values of APs are now discarded instead of being used to average the value of the RSSI. This doesn't really affect how the values behave in real life that much, so this change saves memory with no noticeable change in the behaviour of the library.
- Return error on timeouts when writing to baseband chip.
- Add error checks when initializing RF chip.
- Print debug message if the ARM7 TX queue is full when the library tries to add a new packet to it.
- Some documentation improvements.
- Fix
-
dsltool:
- Introduced tool to the repository. This tool is used to convert dynamic libraries in ELF format to DSL format, which is similar to ELF, but simplified. This DSL format can be loaded by libnds with
dlopen()
.
- Introduced tool to the repository. This tool is used to convert dynamic libraries in ELF format to DSL format, which is similar to ELF, but simplified. This DSL format can be loaded by libnds with
-
teaktool:
- Ensure that ELF files are loaded correctly instead of crashing if they aren't loaded and the pointer is NULL.
- Fix format in a printf.
-
SDK:
-
Documentation:
- The new dynamic library system has been documented in the main documentation of BlocksDS.
-
Examples:
- Three new examples have been added to show how to use the new dynamic library system.
-
crts:
- Some initialization has been moved away from the crt0 of the ARM9 to libnds to fix global C++ constructors that require libnds and the cothread scheduler to be initialized.
- A new linkerscript to build dynamic libraries has been added.
-
Other:
- Libraries are now built with debug symbols (
-g
) to help debug applications made with them.
- Libraries are now built with debug symbols (
-
Version 1.8.1
-
libnds:
- Add a helper to convert UTF-16LE text (like the firmware player name and message) to UTF-8.
- Modify
assert()
on the ARM7 to send the information to the ARM9 instead of displaying it on the no$gba console. - Added
swiIntrWaitAUX()
for the ARM7. - The Doxygen documentation of interrupt functions has been fixed.
- The documentation of the firmware personal data has been improved with a warning saying that the struct may not be initialized right af the beginning of
main()
on the ARM9. - Always use
fake_heap_start
andfake_heap_end
insbrk()
. - Some assertions in the timer functions were missing checks for values lower than zero, this has been fixed.
- All instances of
sassert()
in common ARM7 and ARM9 code have been replaced byassert()
.
-
DSWifi:
- Add player name information to beacon packets, and add it to the
Wifi_AccessPoint
struct so that clients can see it. This name can be replaced by any string defined by the developer if required. - Add way to get the RSSI of the AP we're connected to. It can be done by calling
Wifi_GetData(WIFIGETDATA_RSSI)
. @snowshoe - Always include
ASSOCSTATUS_STRINGS
array in builds. It used to be removed in builds without sgIP. - Some minor documentation fixes.
- Add player name information to beacon packets, and add it to the
-
grit:
- Update documentation (command line interface and changelog).
- Let the build system define the version string compiled in the binary.
-
SDK:
-
Examples:
- In DSWifi examples, print multiplayer access points in color red when they aren't accepting new connections. Also, display the player name provided by the beacon frames.
- There's a new test to verify that
sbrk()
works correctly in both the ARM7 and ARM9. - Update the asserts example to show that asserts that happen in the ARM7 are sent to the ARM9 and displayed on the screen.
-
Documentation:
- Document flag used for "twl" sections in ndstool and the linkerscripts.
-
Other:
- Remove duplicated
__end__
entries in ARM7 linkerscript files. - The fake heap pointers are now setup on the ARM7, not only the ARM9.
- The fake heap limit setup has been documented.
- The R4RF DLDI driver included in the SDK has been updated.
- Update CMake build system to link the debug version of libnds in debug builds.
- Remove duplicated
-
Version 1.8.0
-
libnds:
- videoGL now tracks the number of textures using a palettes correctly. Previously, palettes would be deleted even when there were textures using them. @sillysagiri
scanf()
has been fixed so that it doesn't record modifier keys on the output string.- Fix
readFirmware()
andwriteFirmware()
on the ARM9. They would silently fail when the source or destination buffer wasn't in main RAM (for example, when the buffer was in the stack in DTCM) because the ARM7 can't access other memory regions. Now, the functions will allocate temporary buffers to transfer data between the ARM7 and ARM9. Also, now they use a mutex so that they are thread-safe. - FatFs has been updated to version R0.15ap1.
- The values used by
ledBlink()
have been documented as an enum. - There's a new define for the WiFi hardware in
REG_POWERCNT
. - There are new definitions for GRF files to specify background types.
consoleVprintf()
is now exposed on the ARM7.- In the GRF struct there used to be a byte of padding in the struct that wasn't documented. It has now been explicitly documented as padding.
- A helper has been added to check if a buffer is inside of main RAM.
- Some unused internal FIFO command names have been removed.
-
DSWifi:
- Local multiplayer support has been added (NiFi). One DS acts as a multiplayer host (Access Point) and the other consoles connect to it.
- The old operation mode has been renamed "Internet mode". It is possible to switch between Internet and local multiplayer modes depending on the needs of the application.
- Scan mode now works differently. In Internet mode it shows all Access Points. In local multiplayer mode it only lists multiplayer hosts, in Internet mode the behaviour remains unchanged.
- CMD/REPLY packet transmit support has been added to the library. This is a way to transfer data between a host and many clients more efficiently. However, regular data packets can still be sent between multiplayer clients and the host if the CMD/REPLY system isn't adequate for the application.
- Beacon packet transmission is now properly supported and documented. The packets advertise the number of players currently connected to a host DS and whether the host accepts new connections or not. It also shows the game ID defined by the user, which is used to identify the right AP for a game.
- When connecting to an Access Point, DSWifi is now honest about the transfer rates supported by the DS. If the AP rejects the connection, it will retry with all the rates defined in the IEEE 802.11b standard (even though only the first 2 out of the 4 are supported), which helps the AP accept the DS.
- Many new multiplayer-related functions have been added to the library.
- New documentation has been added, which explains how the library works internally, and how to use DSWifi in Internet and local multiplayer mode.
- Huge refactor of ARM7 code and the corresponding ARM9 code that communicates with the ARM7. sgIP has been largely untouched. The code has been split into several files, and there is now a clearer split between sgIP and the rest of DSWifi.
- The helper functions to read the firmware and to set the LED blink status have been removed. Now DSWifi calls the libnds functions instead.
- Functions have been documented, IEEE 802.11 frame formats have been documented.
- There are new defines for hardware registers based on GBATEK, and new defines for the fields in the hardware registers that are in used. The melonDS forums have a lot of information (by @Arisotura) that has also been used as source when documenting register fields (like
W_RXFILTER
andW_RXFILTER2
). - Debug messages have been added to the ARM7 code of the library. They are only available in debug builds.
- WEP password usage has been documented. It wasn't clear how to use Hex/ASCII passwords.
- Some unused fields of the
WifiData
struct have been removed. - Private definitions have been removed from public headers.
-
grit:
- Update GRF export code to use the new background type definitions proposed by @Garhoogin in ptexconv.
-
SDK
-
Examples:
- New DSWifi examples have been added, including local multiplayer examples that show how to send CMD/REPLY packets and regular data frames of arbitrary sizes.
- The WEP password input in the AP list example has been improved. The output of the example has also been improved.
- The "get website" example now uses socket-related functions the way DSWifi expects them (
closesocket()
instead ofclose()
). - The templates and examples now use the new LED defines.
-
Documentation:
- The documentation of DSWifi now explains how to use the Internet and local multiplayer modes, as well as how the library works internally.
- The licensing requirements of some libraries (picolibc, libstdc++) has been clarified by @asiekierka.
-
Other:
- New debug ARM7 cores have been added. They use the debug versions of libnds and DSWifi.
- The CMake build system now uses a linker group for the standard libraries to prevent linking errors due to circular dependencies. Also, banner title formation has been improved.
-
Version 1.7.3
-
libnds:
- Use custom version of
swiSoftReset()
instead of instructionswi #0
to prevent crashes on DSi mode, whereswi #0
isn't implemented. swi*()
functions that don't actually useswi
instructions (because of bugs in the implementation in the BIOS) have been documented.nitroFSInit()
now setserrno
correctly if there is no NitroFS filesystem in the ROM.- The DSi mode checks of
soundExtSetFrequencyTWL()
have been moved out oftwl
sections so that this function can be safely called even in DS mode (even if it doesn't have any effect). - Calling
irqSet(flags, NULL)
orirqSetAUX(flags, NULL)
is now safe. Previously, this would causeNULL
to be used as interrupt handler instead of disabling the interrupt handler as expected. - The type
IntFn
has been deprecated in favour ofVoidFn
. Even theinterrupts.h
header didn't useIntFn
, it was only used internally ininterrupts.c
.
- Use custom version of
-
SDK:
-
Docker:
- The Docker images are now built in a GitHub Actions pipeline in the SDK repository instead of locally in the computers of the developers.
-
Examples:
- In the LibXM7 example that uses NitroFS, set pointer to
NULL
when it stops being used so that the program keeps track of whether songs are playing or not. This fixes a crash when trying to start a song after stopping a song.
- In the LibXM7 example that uses NitroFS, set pointer to
-
Documentation:
- Document the release process for new BlocksDS versions.
- Document the existence minimal ARM7 core.
- Remove references to scripts related to the release process used before using GitHub Actions.
- Add link to
ndslib-archive
repository so that it can be used as reference to understand old NDS homebrew source code. - Clarify how to build examples in the setup instructions.
-
Other:
- Use the right system header in
dldipatch
to fix a compiler warning. - PAlib is now available as a pacman package:
blocksds-palib
- Use the right system header in
-
Version 1.7.2
-
libnds:
- Fix compilation error due to incorrect names of slot-2 rumble functions.
- Add debug assertions to check that
cothread_yield_irq()
is never called with interrupts disabled (whenIME
is 0). - Small optimization in
cothread_yield_irq()
wait loop on the ARM9. - Add helper constants for
swiUnpackBits()
. - Implement
getBatteryLevel()
on the ARM7 to mirror the ARM9 implementation. - Add function to check if FatFs cache has been initialized or not.
- Fix code to read official cartridges from the ARM7. The previous code wasn't able to read data when the destination was in the stack (DTCM isn't visible by the ARM7).
- Add error checks on the ARM7 to crash if DLDI is used before being setup.
- Fix undefined C behaviour with some left shifts.
- Add missing system include to ARM7 console header.
-
SDK:
-
ARM7:
- Restructure default ARM7 code to allow for multiple built-in ARM7 cores. Add
ARM7ELF
to the default makefiles to easily select the ARM7 core. Thanks, @GalaxyShard.
- Restructure default ARM7 code to allow for multiple built-in ARM7 cores. Add
-
Documentation:
- Document the new pre-built ARM7 cores.
-
Examples:
- Use the new pre-built ARM7 core in LibXM7 examples instead of custom ARM7 cores.
- Update the BIOS bit unpack example to use the new constants introduced to libnds.
-
Other:
- In the makefiles of DSWiFi, LibXM7 and Maxmod use
ar
from the ARM toolchain rather than the host to build the library. - Improve scripts to release new SDK versions.
- In the makefiles of DSWiFi, LibXM7 and Maxmod use
-