lol its in c
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
933 B

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. #include <string.h>
  2. #include "actor.h"
  3. #include "game.h"
  4. #include "player.h"
  5. #include "sdk/hardware.h"
  6. #include "sdk/oam.h"
  7. #include "vram.h"
  8. game_state_t game_state;
  9. void main() {
  10. game_state = GAME_STATE_TITLE;
  11. oam_init();
  12. vram_init();
  13. audio_init();
  14. // Set up background & sprites
  15. rBGP = 0b11100100;
  16. rOBP0 = 0b11100100;
  17. rOBP1 = 0b11100100;
  18. rLCDC = LCDC_OBJON | LCDC_BGON | LCDC_BG8000;
  19. // Setup the VBLANK interrupt, but we don't actually enable interrupt
  20. // handling. We only do this so HALT waits for VBLANK.
  21. rIF = 0;
  22. rIE = IE_VBLANK;
  23. // rIE = IE_VBLANK | IE_LCDC;
  24. // rSTAT |= STAT_LYCF;
  25. // rLYC = 0;
  26. ENABLE_INTERRUPTS();
  27. while (1) {
  28. switch (game_state) {
  29. case GAME_STATE_TITLE:
  30. title();
  31. break;
  32. case GAME_STATE_LEVEL:
  33. level();
  34. break;
  35. }
  36. }
  37. }