A grit demo, part I


Grit demo menu.

I think I finally have a nice demonstration of the capabilities and use of grit again. The figure on the right shows its main menu. Each entry shows one or more capabilities of grit and how to make use of the data it outputs. Pressing start returns to the menu.

The source for the project is included in the demo, as is the most recent tonclib because the demo would not have been possible without it (at least not with a lot more code in the project itself). In a sense, it's a tonclib demo as well.

The way that grit is invoked and how its output is made available is pretty neat. I'm running a separate makefile called gfxmake which runs grit, assembles its output into a library called libgfx.a. It also collects all the separate headers into a main header file called all_gfx.h, so there will be no need to include dozens of graphics headers – just the one. I also have three sets of grit rules in here: for bitmap+.grit pairs, for .grit-less bitmaps (which use the directories main grit file) and fully custom rules for really special occasions. Like I said, pretty neat ^_^. I am pulling a few Clever Tricks in gfxmake to get all of this done and I hope to discuss these in more detail at a later time.

I'll probably add a few more examples in this demo (feel free to suggest some), but the way grit's invoked here will probably stay. Using a secondary makefile means a minimum of interference with the template makefiles and it also makes it easy to customize your projects w.r.t. graphics. As far as I'm concerned, this is the recommended path … until anyone informs me of a better plan.


Download link: /files/gritdemo.zip


Note to quirky: sorry, no palette merging in this demo yet. It will be in its follow-up.

3 thoughts on “A grit demo, part I

  1. You've got a little bug there, dude. The blending registers aren't reset, causing the main menu to darken considerably after watching the map demos.

  2. I know. However, this is a VBA bug, not a demo bug. I'm using RegisterRamReset() for clearing everything and VBA doesn't like that if you're not using a GBA bios file.

Leave a Reply

Your email address will not be published. Required fields are marked *