Commit Graph

19 Commits

Author SHA1 Message Date
Antonio Niño Díaz
ba8ba3c3b3 library: Add helper to detect if a file exists 2023-12-24 03:05:33 +01:00
Antonio Niño Díaz
aef2292857 library: Share most code that loads file from the filesystem
Instead of repeating the same code whenever a file needs to be loaded,
move it to a function.
2023-05-30 22:50:22 +01:00
Antonio Niño Díaz
470c39d031 library: Add copyright notice 2023-05-29 23:25:36 +01:00
Antonio Niño Díaz
0428b7a1ea library: Translate file headers 2023-05-25 22:11:19 +01:00
Antonio Niño Díaz
e1506cc74f library: Cleanup of types
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).
2023-05-24 02:53:36 +01:00
Antonio Niño Díaz
5150862e16 library: Translate and cleanup more source files 2023-05-22 01:02:17 +01:00
Antonio Niño Díaz
c3d6122d95 library: Mark NF_Error as noreturn 2023-05-21 22:23:21 +01:00
Antonio Niño Díaz
b31a3e7d20 library: Make some functions static inline 2023-05-15 02:15:02 +01:00
Antonio Niño Díaz
64768e92d8 library: Fix header guards
Symbols that start with two underscores plus an uppercase letter are
reserved by the C standard.
2023-05-11 23:55:01 +01:00
Antonio Niño Díaz
c34dbb2912 library: Remove version number from source files
This is misleading unless it's updated every single time there is a
commit, which isn't realistic.
2023-05-11 23:49:33 +01:00
Antonio Niño Díaz
57cc1d519c library: Cleanup headers 2023-05-11 23:36:27 +01:00
Antonio Niño Díaz
9dde256592 doxygen: Create documentation groups 2023-04-30 02:15:43 +01:00
Antonio Niño Díaz
245db3169d doxygen: Remove HTML tags
Markdown is supported by Doxygen.
2023-04-29 12:38:53 +01:00
Antonio Niño Díaz
c693abda87 Increase size of NF_ROOTFOLDER 2023-04-28 01:40:33 +01:00
Antonio Niño Díaz
e1ed5b15ef Start using doxygen comments in library headers 2023-04-28 01:38:37 +01:00
Antonio Niño Díaz
151db13cc0 license: Fix licenses
- 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.
2023-04-01 19:56:45 +01:00
Antonio Niño Díaz
4711a6512f license: Change to CC BY 4.0
The previous license was CC BY-NC 4.0, which doesn't allow commercial
use of the library. Nowadays this exception isn't really helpful, and
it may discourage people that are thinking about using the library (and
may be thinking about maybe selling the ROM in websites like itch.io).
2023-04-01 12:25:33 +01:00
Antonio Niño Díaz
9aee0b0461 docs: Cleanup license text 2023-03-31 18:54:21 +01:00
Antonio Niño Díaz
daee0a3334 build: Reorganize directories
- Bring the source and include directories in nflib to the root of the
  repository to match the organization of other libraries.

- Expect users to install NFlib in the devkitPro folder.

- Update all Makefiles for modern devkitPro.

- Remove all redundant copies of NFlib in all examples. The only
  remaining copy of the library is in the extras/wifi example, but
  that one includes more files, so I have left it untouched for now.
2023-03-31 18:27:29 +01:00