#include <string.h>
|
|
|
|
#include "actor.h"
|
|
#include "game.h"
|
|
#include "sdk/hardware.h"
|
|
#include "sdk/oam.h"
|
|
|
|
game_state_t game_state;
|
|
|
|
void main() {
|
|
game_state = GAME_STATE_TITLE;
|
|
|
|
// Setup the OAM for sprite drawing
|
|
oam_init();
|
|
|
|
// Set up background & sprites
|
|
rBGP = 0b11100100;
|
|
rOBP0 = 0b11100100;
|
|
rOBP1 = 0b11100100;
|
|
rLCDC = LCDC_OBJON | LCDC_BGON | LCDC_BG8000;
|
|
|
|
// Setup the VBLANK interrupt, but we don't actually enable interrupt
|
|
// handling. We only do this so HALT waits for VBLANK.
|
|
rIF = 0;
|
|
rIE = IE_VBLANK;
|
|
|
|
while (1) {
|
|
switch (game_state) {
|
|
case GAME_STATE_TITLE:
|
|
title();
|
|
break;
|
|
|
|
case GAME_STATE_LEVEL:
|
|
level();
|
|
break;
|
|
}
|
|
}
|
|
}
|