Commit Graph

61 Commits

Author SHA1 Message Date
Antonio Niño Díaz
d52a92812e examples: Use BLOCKSDS environment variables to find tools
Only use the hardcoded paths if the variable isn't set to anything.
2025-03-24 21:18:00 +00:00
Antonio Niño Díaz
cb2e62f953 examples: Refresh pre-converted textures in the repository 2025-03-24 21:05:15 +00:00
Antonio Niño Díaz
5a10679dfb build: docs: Remove outdated devkitARM makefiles
Nitro Engine doesn't work with the current libraries of devkitARM. It's
better to remove the makefiles and to stop pretending that devkitARM is
supported. Updating the makefiles wouldn't be enough, though, it's likely
that the library will require code changes, as well as the examples.
2025-03-24 21:03:01 +00:00
Antonio Niño Díaz
39117696aa build: Uniformize all devkitARM makefiles
Add DATA and GRAPHICS directories to all of them so that it's easier to
maintain the files.
2024-12-31 16:20:02 +01:00
Antonio Niño Díaz
e5ae245674 examples: Fix build of example on devkitARM 2024-12-28 12:44:36 +01:00
Antonio Niño Díaz
fe6e4a0dcc examples: Add example of assigning a matrix to a model 2024-10-11 13:33:33 +02:00
Antonio Niño Díaz
1c752174e9 examples: Stop using NE_RGB5 in examples
This texture format sets bit 15 manually to 1. This is slow, and it's
better if the developer converts graphics in a way that the bit is already
set to 1.
2024-06-03 18:39:33 +01:00
Antonio Niño Díaz
935f7eb084 examples: Update binaries used by the examples
This isn't strictly required, but this way running the global assets.sh
won't cause lots of files to be marked as modified.
2024-06-02 21:55:32 +01:00
Antonio Niño Díaz
0f92fc9da7 build: Use BlocksDS paths for assets conversion scripts 2024-06-02 21:50:06 +01:00
Antonio Niño Díaz
3f4bfbdb25 examples: Remove unused files 2024-06-02 18:06:51 +01:00
Antonio Niño Díaz
3ba35ba48e docs: build: library: examples: Set BlocksDS as main toolchain
Until now the main makefiles of Nitro Engine have been the ones of
devkitPro, forcing users to go through extra steps to build everything
under BlocksDS.

Now, the easy makefiles are the BlocksDS ones, and additional notes have
been added to warn about the limitations of devkitPro:

- No GRF support in libnds.
- NitroFS doesn't work in melonDS.
2024-06-02 17:38:52 +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
47c8061168 examples: test: Refactor to avoid global variables
Using global variables is generally discouraged. Now that NE_ProcessArg()
and NE_ProcessDualArg() exist, it's better to show how to use them instead
of NE_Process() and NE_ProcessDual() while using global variables.

Also, switch from "int main(void)" to "int main(int argc, char *argv[])".
2024-03-08 18:44:02 +00:00
Antonio Niño Díaz
bf63ddea8a examples: Remove unneeded calls to NE_ShadowEnable()
This function wasn't required for regular shading, but for toon shading.
2024-03-07 01:49:07 +00:00
Antonio Niño Díaz
d432916f0a examples: Simplify GRF loading example 2024-01-27 19:43:27 +00:00
Antonio Niño Díaz
33f9bd4416 examples: Remove unneeded casts
They were needed in older versions of Nitro Engine, but now the functions
that take data arrays expect a void pointer, so casts are not needed.
2024-01-27 19:33:56 +00:00
Antonio Niño Díaz
55a53a91dc examples: Add warnings to BlocksDS makefiles 2024-01-27 18:31:17 +00:00
Antonio Niño Díaz
c037b79af4 examples: Stop using img2ds and switch to grit
img2ds is still required for the clear bitmap example because grit doesn't
support the clear depth format.
2024-01-27 18:25:38 +00:00
Antonio Niño Díaz
1d0b3058aa examples: Add example of loading GRF files 2024-01-25 18:28:13 +00:00
Antonio Niño Díaz
5fbe47c7fc examples: Refactor compressed texture example
Add PNG files that get converted to the binary data used by the NDS ROM.
2024-01-22 02:28:51 +00:00
Antonio Niño Díaz
142e1662b6 examples: Clarify Texel 4x4 format example 2024-01-21 17:00:57 +00:00
Antonio Niño Díaz
eca99150c4 examples: Add simple example of loading models from nitroFS 2024-01-03 00:52:33 +01:00
Antonio Niño Díaz
2ec91e1100 examples: Add missing include 2024-01-01 03:35:34 +01:00
Antonio Niño Díaz
6fde18d712 library: examples: Use stdint.h types 2023-11-17 01:00:40 +01:00
Antonio Niño Díaz
a4c1b40c7a build: Update makefiles of BlocksDS 2023-11-11 18:00:41 +00:00
Antonio Niño Díaz
d659bc8915 build: docs: Support BlocksDS 2023-04-01 15:15:02 +01:00
Antonio Niño Díaz
43a882e98f examples: Start adapting examples for BlocksDS
iprintf() is only present in newlib, not picolibc. It is a non-standard
function, so avoid using it.
2023-04-01 14:39:58 +01:00
Antonio Niño Díaz
8c42302c23 build: Small changes to assets.sh scripts and ROM titles 2023-04-01 14:35:09 +01:00
Antonio Niño Díaz
e3e7c8263d examples: Update animated model files for new md5_to_dsma 2023-04-01 14:35:09 +01:00
Antonio Niño Díaz
00568feec2 build: Add scripts to build assets in all examples 2023-04-01 13:33:38 +01:00
Antonio Niño Díaz
1acfca1a24 examples: Wait for VBL in the right place
This change is a bit pedantic, but it makes the ROMs run better in
DeSmuMe.

Some examples (particularly the dual 3D examples) used to flicker during
one or two seconds right after starting. In dual 3D examples the top and
bottom screen would start swapped, and they would eventually swap and
stop flickering. This would never happen in melonDS or real hardware.

I suspect this is because of the interaction between GFX_FLUSH and
swiWaitForVBlank(), where there would be some timing difference to reach
the first swiWaitForVBlank() or GFX_FLUSH, and that caused the desync.

This commit moves swiWaitForVBlank() to the beginning of the game loop.
This means that, even in the first iteration of the game loop, all
emulators and hardware will be synchronized. This doesn't actually
matter in any other situation, it just makes the first iteration
consistent.
2023-01-21 19:32:02 +00:00
Antonio Niño Díaz
7c614177f7 examples: Add example of OBJ model with color commands 2023-01-18 01:50:40 +00:00
Antonio Niño Díaz
9f6c719373 library: Decouple meshes from models
Until now, a mesh was always owned by one single model. This made it
very difficult to clone models, because the mesh was always owned by one
of them. Whenever you deleted that model, the mesh was also deleted, and
all the cloned models would be unusable.

With the new system, there is a list of meshes with counters of how many
models use them. This way no matter how many models use the mesh, the
mesh will only be deleted when the last model is deleted.

In addition, in a similar way as before, a mesh has a flag that signals
if free() has to be called on the mesh data when the mesh is deleted.
This is useful when the mesh is loaded from a filesystem and stored in a
buffer allocated with malloc(), which is what Nitro Engine does.

Note that this code should be considered experimental for the time
being, until some tests are added.
2022-11-18 01:23:57 +00:00
Antonio Niño Díaz
2ab65d19d4 examples: Clean both examples that show 16 balls 2022-11-15 00:12:08 +00:00
Antonio Niño Díaz
e557225cce examples: Fix some main() function prototypes 2022-11-15 00:00:51 +00:00
Antonio Niño Díaz
7b9b119f73 examples: Add example of loading compressed textures 2022-10-31 02:18:02 +00:00
Antonio Niño Díaz
8aa6b382d2 library: examples: Simplify texture loading code
This is done to make it easier to implement compressed texture loading.

The main change is to stop allowing widths that aren't a power of two:

- Supporting them complicates the loading code a lot.

- Compressed textures can't really be expanded because they are composed
  by many 4x4 sub-images.

- They don't save space in VRAM.

- They save space in the final ROM, but you can achieve the same effect
  compressing them with LZSS compression, for example.

The example incomplete_texture has been updated to reflect the new
limitations.
2022-10-29 02:13:21 +01:00
Antonio Niño Díaz
f1ed942ec9 example: Use new names of functions
The previous ones have just been deprecated.
2022-10-25 23:47:29 +01:00
Antonio Niño Díaz
82cc89df4c examples: Cleanup filesystem_animated_model example 2022-10-20 22:12:58 +01:00
Antonio Niño Díaz
82a4ab39f0 examples: Remove paletted_bmp example
This is redundant because other examples show how to load palettes
from the filesystem or from RAM, and using BMP textures isn't
recommended anyway.
2022-10-20 22:05:07 +01:00
Antonio Niño Díaz
c71313ca88 examples: Clean filesystem_multiple_textures example 2022-10-20 22:04:01 +01:00
Antonio Niño Díaz
3ebcac15ba library: examples: Add enums for texture formats and parameters
This helps discover the possible options.
2022-10-20 01:51:19 +01:00
Antonio Niño Díaz
185d477271 examples: Cleanup almost all remaining examples 2022-10-20 00:14:36 +01:00
Antonio Niño Díaz
4babec1292 examples: Cleanup more examples 2022-10-19 22:57:35 +01:00
Antonio Niño Díaz
139c44e04e examples: Add assets script to more examples 2022-10-19 02:44:01 +01:00
Antonio Niño Díaz
30363ef0aa examples: Refactor examples
- Provide the original assets for everything used in the examples. Add
  scripts to convert the original assets into the formats used by the DS
  instead of only providing the pre-converted files. The pre-converted
  assets are still provided for convenience.

- Move away from BMP files in the examples: They aren't a realistic way
  to use Nitro Engine to load textures. Use pre-converted PNG files
  instead.
2022-10-19 02:32:04 +01:00
Antonio Niño Díaz
50a0716938 examples: Add example of blended animations 2022-10-18 00:59:29 +01:00
Antonio Niño Díaz
da2be26de1 examples: Change license to CC0-1.0 2022-10-16 22:55:06 +01:00
Antonio Niño Díaz
db8add4d7e example: Cleanup source files 2022-10-16 22:03:41 +01:00
Antonio Niño Díaz
aa022b2a28 examples: Update example to use nitroFS 2022-10-13 22:00:20 +01:00