sprites 256c, shadow oam, sprite transforms, sinlut
[gbajam21] / src / main.c
index e358302..e1c3af0 100644 (file)
@@ -3,34 +3,49 @@
 #include "intr.h"
 #include "debug.h"
 #include "game.h"
-
-#include "AAS.h"
 #include "data.h"
+#include "maxmod.h"
 
-#define RGB15(r, g, b) \
-       (((uint16_t)(r) & 0x1f) | \
-        (((uint16_t)(g) & 0x1f) << 5) | \
-        (((uint16_t)(b) & 0x1f) << 10))
+static void vblank(void);
+static void nopfunc(void);
 
 int main(void)
 {
-       emuprint("\nStarting GBAJAM21\n-----------------\n");
-
        intr_init();
 
-#ifndef NOSOUND
-       interrupt(INTR_TIMER1, AAS_Timer1InterruptHandler);
-       AAS_SetConfig(AAS_CONFIG_MIX_24KHZ, AAS_CONFIG_CHANS_8, AAS_CONFIG_SPATIAL_STEREO, AAS_CONFIG_DYNAMIC_ON);
-       unmask(INTR_TIMER1);
-       intr_enable();
+       REG_WAITCNT = WAITCNT_PREFETCH | WAITCNT_ROM_2_1;
 
-       AAS_MOD_Play(AAS_DATA_MOD_popcorn);
-#else
-       intr_enable();
+#ifndef NOSOUND
+       mmInitDefault(sound_data, 8);
+       mmStart(MOD_POPCORN, MM_PLAY_LOOP);
 #endif
 
+       screen_vblank = nopfunc;
+
+       intr_disable();
+       interrupt(INTR_VBLANK, vblank);
+       REG_DISPSTAT |= DISPSTAT_IEN_VBLANK;
+       unmask(INTR_VBLANK);
+
+       intr_enable();
        gamescr();
 
        for(;;);
        return 0;
 }
+
+static void vblank(void)
+{
+       vblperf_count++;
+
+       screen_vblank();
+
+#ifndef NOSOUND
+       mmVBlank();
+       mmFrame();
+#endif
+}
+
+static void nopfunc(void)
+{
+}