X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmain.c;h=f629a13122247fd716dc9cc55ce86bdffac6b06c;hb=89d3ade57e85addac5eab0f3e8a795f23d518944;hp=d7a3308b5d0c281bacc8298b480e6bda8965df98;hpb=ffae5f4e018d05dac4b986497169039bbba46acf;p=gbajam21 diff --git a/src/main.c b/src/main.c index d7a3308..f629a13 100644 --- a/src/main.c +++ b/src/main.c @@ -2,6 +2,10 @@ #include "gbaregs.h" #include "intr.h" #include "debug.h" +#include "game.h" + +#include "AAS.h" +#include "data.h" #define RGB15(r, g, b) \ (((uint16_t)(r) & 0x1f) | \ @@ -10,26 +14,22 @@ int main(void) { - int i, j; - uint16_t *vptr; - - emuprint("\nStarting GBAJAM21\n-----------------\n"); - intr_init(); - REG_DISPCNT = 3 | DISPCNT_BG2; + REG_WAITCNT = WAITCNT_PREFETCH | WAITCNT_ROM_2_1; + +#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(); - vptr = (uint16_t*)VRAM_START_ADDR; - for(i=0; i<160; i++) { - for(j=0; j<240; j++) { - int xor = i ^ j; - int r = xor >> 2; - int g = xor >> 1; - int b = xor; + AAS_MOD_Play(AAS_DATA_MOD_popcorn); +#else + intr_enable(); +#endif - *vptr++ = RGB15(r, g, b); - } - } + gamescr(); for(;;); return 0;