Code Explanation
#include <mygba.h>
This is the main include that you'll need in all of your HAM programs.
ham_Init();
This is needed in every HAM program to initialize HAMlib and must
be the first HAM function called.
ham_InitText(0);
You can pass it background 0 - 3. You can only run the HAM text
system in background mode 0 - 2. Remember these are the tile modes.
NOTE: If backgrounds and background modes don't make sense
to you right now, come back after Day
4 or Day
6.
ham_DrawText(0,0,"Hello,
World!");
The first number passed is the column and the second is the row.
For example 0,3 would be the first column in the fourth row.
Horizontal Values: 0 - 29
Vertical Values: 0 - 19
while(1)
Without this, the program would just keep ending and rebooting.
Well, that's it for Day 2. I don't think there is anything difficult
about the code. Feel free to tinker with it before moving on to
Day 3. One more thing, you won't actually use this to display text when you make a "real" game. It's really only for debugging purposes. |