// main #include #include #include "global.h" #include "controls.h" #include "background.h" #include "foreground.h" #include "bullets.h" #include "player.h" #include "chrome.h" // game loop static void loadInternals(){ JOY_init(); JOY_setEventHandler(&updateControls); SPR_init(127, 0, 0); VDP_setScreenWidth256(); VDP_setPalette(PAL1, nitori.palette -> data); VDP_setPalette(PAL2, wall1.palette -> data); VDP_setPalette(PAL3, font.palette -> data); VDP_loadFont(font.tileset, DMA); VDP_setTextPalette(3); } static void loadGame(){ loadBg(); loadChrome(); loadFg(); loadPlayer(); } static void updateGame(){ updatePlayer(); updateBullets(); updateBg(); updateFg(); updateChrome(); clock++; if(clock >= CLOCK_LIMIT) clock -= CLOCK_LIMIT; } // main loop int main(){ loadInternals(); loadGame(); while(1){ updateGame(); SPR_update(); SYS_doVBlankProcess(); } return(0); }