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.

46 lines
1023 B

2 years ago
2 years ago
2 years ago
  1. #include <string.h>
  2. #include "game.h"
  3. #include "hugedriver.h"
  4. #include "sdk/assets.h"
  5. #include "sdk/hardware.h"
  6. #include "sdk/joypad.h"
  7. #include "sdk/oam.h"
  8. #include "sdk/video.h"
  9. ASSET(bg_tiles, "bg/title.2bpp");
  10. ASSET(bg_map, "bg/title.map");
  11. void title(void) {
  12. // NOTE: Replace with lcdc_off() if necessary
  13. rLCDC &= ~LCDC_ON;
  14. // Copy title screen to VRAM
  15. memcpy((uint8_t *)_VRAM, &bg_tiles[0], bg_tiles_end - bg_tiles);
  16. uint8_t *vram_ptr = (uint8_t *)_SCRN0;
  17. const uint8_t *map_ptr = &bg_map[0];
  18. for (uint8_t y = 0; y < SCRN_Y_B; ++y) {
  19. memcpy(vram_ptr, map_ptr, SCRN_X_B);
  20. vram_ptr += SCRN_VX_B;
  21. map_ptr += SCRN_X_B;
  22. }
  23. rLCDC |= LCDC_ON;
  24. while (1) {
  25. joypad_update();
  26. if (joypad_state & PAD_START) {
  27. game_state = GAME_STATE_LEVEL;
  28. break;
  29. }
  30. // Wait for VBLANK. Clear IF since global interrupts are disabled.
  31. HALT();
  32. rIF = 0;
  33. hUGE_dosound();
  34. }
  35. audio_reset();
  36. }