Commit Graph

14 Commits

Author SHA1 Message Date
Antonio Niño Díaz
5dda97fe52 Use stdint.h types instead of libnds custom types 2024-07-29 00:09:41 +01:00
Antonio Niño Díaz
b0d9151455 library: Build some functions as ARM to increase performance
Using `mulf32()` while compiling functions to Thumb makes the compiler
add calls to `__aeabi_lmul()` once per multiplication. This routine is
quite slow, so the cost of any function that uses `mulf32()` a lot is
quite high.

Switching math-heavy functions to ARM increases performance and reduces
code size.
2024-03-16 03:04:02 +01:00
Antonio Niño Díaz
82171bbf69 chore: Simplify copyright years in notices
Instead of listing every individual year, keep only the first and last
years.
2024-03-09 01:42:29 +00:00
Antonio Niño Díaz
f57fa76576 library: Handle failures correctly
The previous code relied too much on assertions, even for things that
are just regular things that may happen while the application is running
(like running out of memory).

- Many assertions have been turned into permanent checks
- Some functions now return "success" or "failure".
- NE_Init3D() and NE_InitDual3D() (and others) have been reworked to
  handle failures gracefully.
2023-04-21 18:19:02 +01:00
Antonio Niño Díaz
9db4c5d61b library: Stop relying on LUT_MASK
It was only used in sinLerp and cosLerp because in the very early days
of the library libnds didn't have the functions and the arrays SIN_LUT
and COS_LUT were used directly. When libnds was updated and it stopped
exposing the arrays Nitro Engine had to adapt. The masking wasn't needed
back then either, it was a mistake, but I forgot to remove it then.

In the case of the noise screen effect, it was just being misused.
2023-04-20 18:25:46 +01:00
Antonio Niño Díaz
ae7e4104d4 library: Cleanup some more files 2022-10-15 00:36:28 +01:00
Antonio Niño Díaz
fd95ee34fe Replace malloc() by calloc() where it makes sense
If the memory is going to be cleared right away it is better to use
calloc(), as it does it automatically.
2019-06-10 17:17:08 +01:00
Antonio Niño Díaz
d28374fe2c Style fixes in Camera subsystem 2019-06-09 20:50:16 +01:00
Antonio Niño Díaz
976cf4d4c6 Simplify NE_DebugPrint messages
The function name is now part of the macro.
2019-06-05 14:19:04 +01:00
Antonio Niño Díaz
700971beef Simplify NE_AssertPointer messages
Now the name of the function is added as part of the macro.
2019-06-05 13:41:35 +01:00
Antonio Niño Díaz
68d90b44c9 Remove occurrences of inline keyword
Let the compiler decide about it.
2019-06-04 18:24:22 +01:00
Antonio Niño Díaz
51bacc1648 Fix compilation errors and warnings
Now the library can be compiled again.
2019-06-04 15:41:51 +01:00
Antonio Niño Díaz
5be032ed44 Fix coding style of library
With a bit of help of `indent -linux`, but mostly by hand. Also used
`iconv -f ISO-8859-1 -t UTF-8//TRANSLIT` to convert to UTF-8.

There is still some refactoring left to do.
2019-06-04 01:02:56 +01:00
Antonio Niño Díaz
f042d0be3e
Initial dump of code of v0.6.1
This commit is a simple dump of the files of [1]. This needs to undergo
some reorganization.

[1] http://www.skylyrac.net/old-site/nitroengine.html
2019-05-29 01:01:57 +01:00