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

#include <string.h>
#include "game.h"
#include "hugedriver.h"
#include "sdk/assets.h"
#include "sdk/hardware.h"
#include "sdk/joypad.h"
#include "sdk/oam.h"
#include "sdk/video.h"
ASSET(bg_tiles, "bg/title.2bpp");
ASSET(bg_map, "bg/title.map");
void title(void) {
// NOTE: Replace with lcdc_off() if necessary
rLCDC &= ~LCDC_ON;
// Copy title screen to VRAM
memcpy((uint8_t *)_VRAM, &bg_tiles[0], bg_tiles_end - bg_tiles);
uint8_t *vram_ptr = (uint8_t *)_SCRN0;
const uint8_t *map_ptr = &bg_map[0];
for (uint8_t y = 0; y < SCRN_Y_B; ++y) {
memcpy(vram_ptr, map_ptr, SCRN_X_B);
vram_ptr += SCRN_VX_B;
map_ptr += SCRN_X_B;
}
rLCDC |= LCDC_ON;
while (1) {
joypad_update();
if (joypad_state & PAD_START) {
game_state = GAME_STATE_LEVEL;
break;
}
// Wait for VBLANK. Clear IF since global interrupts are disabled.
HALT();
rIF = 0;
hUGE_dosound();
}
audio_reset();
}