| GBC Tools | |
| GBDK C Compiler | |
|
We'll be using the Gameboy Development Toolkit (GBDK) 2.95-3. You may have already installed it. It's also on the developer CD I made way back when (in Tools\GBC I believe), but if you lost the CD, you can download it here. First note that the gbdk is a command line compiler and has no GUI, so we're going to treat it like gcc (in fact gbdk is based on gcc code). Now unzip it somewhere. For the rest of this walkthrough we're assuming it's unzipped to c:\gbdk. Now, what we're going to do is add the gbdk bin directory to our PATH environment variable (so we can compile our code without giving a directory in front of the executable). What we do is open C:\autoexec.bat in notepad (mine is l. Now, we go back to where we unzipped gbdk, and look for the bin directory. In this case, it's c:\gbdk\bin. We append this to the "SET PATH=..." line in autoexec.bat, in this example it's the second last line (scroll over, it should be at the end. Restart you computer. (Note: if you don't have an autoexec.bat - since I don't know how XP works - then you'll have to prepend the bin directory for gbdk in front of all the commands in the make.bat file, which we'll get to now).
Now, since gbdk is a command line compiler, to compile multiple files (which we'll of course be doing) we need some equivalent to a Makefile. Since we're developing in a Windows environment, we'll be using make.bat to put in all our command line stuff. Ok, so, just to test everything is set up properly execute this "Hello World" sample code - download.
All we have to do is double-click on make.bat and everything should compile nicely. We'll get the helloworld.gbc file which is a gameboy ROM. Run this in NO$GMB. Also, note that this is the last time we'll ever include stdio.h in our source code (i.e. no standard functions for us anymore). |
|
| Gameboy Map Builder (GBMB), Gameboy Tile Designer (GBTD) | |
|
We'll be using GBMB 1.8 and GBTD 2.2 (these are the latest versions and are on the CD). If you ever do lose the CD or happen to delete this stuff you can get both here. A few words about them though. For GBTD as you know we can use 8 pallettes. When making sprites, note that the first colour in each pallette is transparent (i.e. so we don't see a box around the sprite). It doesn't matter what you set the first colour to. So effectively we can have only really three colours per sprite. Also, when designing sprites that, say, can walk back and forth, only do the tiles for one side. We have the ability to flip the sprite (i.e. mirror it) if it ever has to go to the other side. Click here to view some comments I have made about GBMB. |
|
| Nocash Gameboy Emulator & Debugger (NO$GMB) | |
|
I hope you've already installed this. It's on the CD of course (with the crack...). If you don't have it, e-mail me. A few notes. To get rid of that annoying popup when it starts up click on Options->Various Other Options and then uncheck "Warn if older than 6 months". We're using 2.5, which is the latest, and probably the last version. Note that this is not just an emulator, but a debugger as well. In fact, it has other cool features. For example, if you're running a ROM, hit ESC and then hit F5, and the VRAM viewer window will pop up. As its name suggests, this shows you all the contents of VRAM, from the user screen, the background map, sprite info, tile info and pallettes. It's very useful. Here is a basic outline of the NO$GMB interface. Later on, when we learn about the internals we can use these sections for debugging and stuff.
|
|