Currently it is needed to rename the extension of the collision maps
from .img and .map to .dat and .cmp for NFlib to find the files. This
patch makes it also try to load the original extensions so that the
renaming isn't required.
Currently it is needed to rename the extension of the font to .fnt from
.img for NFlib to find the files. This patch makes it also try to load a
.img file so that the renaming isn't required.
When a 3D sprite is created on top of a previously created 3D sprite, it
is needed to delete the previous one. If not, the sprite count will be
incorrect.
This doesn't happen with other subsystems of the library.
Only initialize the structure when a new sprite is created. The "inuse"
field of the struct is enough to disable it completely, and the state
is set to the default values when it is created again.
Types like u8 and u16 aren't always a good idea. For example:
void function(u8 x, u8 y)
{
u32 value = (x << 16) | y;
}
The left shift of x will overflow because x is 8 bits wide. It is better
to make both arguments 32 bit wide.
It may also cause the compiler to introduce bit masking operations at
the caller side because the caller doesn't know how the function
behaves internally.
In order to prevent this kind of issues, it's better to use 32 bit
variables unless there is a very good reason to use smaller types (like
in structs, to save RAM).
When accessing the filesystem, what a user normally wants is to access
the same drive that holds the NDS ROM being run.
On the DS it is easy. The only available drive is the one of the DLDI
driver.
On DSi, it isn't so easy. It is possible to run a ROM that is either on
the SD card or in a flashcard (accessed with DLDI).
The easiest way to determine the right drive to use is to use argv[0].
The loader stores the location of the NDS ROM there, including the
drive.
The trivial detection should only be used as a fallback mechanism if
argv[0] isn't present.
This removes dependency from the (frankly awful) libfilesystem, as well
as libfat.
fatInitDefault() or nitroFSInit() should be initialized outside of
NFlib, if one requires it. Within NFLib, we will only check whether
NitroFS is accessible, and fail otherwise.
This allows a user to still use libfat, libfilesystem or any other
NitroFS / FAT implementation, should one wish to use it, as long as the
implementation of NitroFS mounts to `nitro:/`, or the storage medium is
mounted to `sd:/` or `fat:/`.
This is a breaking change: users will need to update their code to
handle NitroFS and/or FAT inits on their own.
This also removes unnecessary filesystem.h and fat.h includes from all
other files.
- Creative Commons (except for CC0) shouldn't be used for code:
https://creativecommons.org/faq/#can-i-apply-a-creative-commons-license-to-software
MIT has the same spirit as the CC-BY license.
- CC-BY has been retained for the assets included in the repository.
- Also, the years were wrong, this library was started in 2009.
- Make all examples use the CC0 license.