|
|
- #include <string.h>
-
- #include "actor.h"
- #include "game.h"
- #include "player.h"
- #include "sdk/hardware.h"
- #include "sdk/oam.h"
- #include "vram.h"
-
- game_state_t game_state;
-
- void main() {
- game_state = GAME_STATE_TITLE;
-
- oam_init();
- vram_init();
- audio_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;
- // rIE = IE_VBLANK | IE_LCDC;
-
- // rSTAT |= STAT_LYCF;
- // rLYC = 0;
-
- ENABLE_INTERRUPTS();
-
- while (1) {
- switch (game_state) {
- case GAME_STATE_TITLE:
- title();
- break;
-
- case GAME_STATE_LEVEL:
- level();
- break;
- }
- }
- }
|