Splitting Assets from Code

This first page will cover the important aspect of keeping your game assets separate from the game code (where assets are things like textures, models, sounds, etc...). Depending on how you've structured your project, or more importantly how far you are into it currently, this can be a relatively simple or relatively difficult task.

Start by looking at the original sample, before any modifications. It is a simple ROM with two rooms that can be switched between by pressing the A button, with a texture that is displayed in the middle.

If you take a look at the makefile, you will see that our textures ( and  ) are being compiled as C code and then being linked into the codesegment. It's not a big concern for this small project, but due to the 1MB IPL limit, this will become a problem as the project gets bigger. The idea here is that we want to have the assets elsewhere in the ROM, and we load them from the cartridge only as we need them.

So first and foremost, lets move our assets over to ROM.

Moving our assets to ROM
For simplification reasons, we're going to convert our textures to binary data, instead of keeping their current form as C arrays. You should be able to do this for pretty much any sort of assets your game will need, such as static display lists. The process of actually converting your data to binary form will not be covered here, as there are plenty of tools to do that for you already.

TODO

Having a buffer in the codesegment
TODO

Having a buffer somewhere in RAM
TODO