sprites 256c, shadow oam, sprite transforms, sinlut
[gbajam21] / src / main.c
1 #include <math.h>
2 #include "gbaregs.h"
3 #include "intr.h"
4 #include "debug.h"
5 #include "game.h"
6 #include "data.h"
7 #include "maxmod.h"
8
9 static void vblank(void);
10 static void nopfunc(void);
11
12 int main(void)
13 {
14         intr_init();
15
16         REG_WAITCNT = WAITCNT_PREFETCH | WAITCNT_ROM_2_1;
17
18 #ifndef NOSOUND
19         mmInitDefault(sound_data, 8);
20         mmStart(MOD_POPCORN, MM_PLAY_LOOP);
21 #endif
22
23         screen_vblank = nopfunc;
24
25         intr_disable();
26         interrupt(INTR_VBLANK, vblank);
27         REG_DISPSTAT |= DISPSTAT_IEN_VBLANK;
28         unmask(INTR_VBLANK);
29
30         intr_enable();
31         gamescr();
32
33         for(;;);
34         return 0;
35 }
36
37 static void vblank(void)
38 {
39         vblperf_count++;
40
41         screen_vblank();
42
43 #ifndef NOSOUND
44         mmVBlank();
45         mmFrame();
46 #endif
47 }
48
49 static void nopfunc(void)
50 {
51 }