This commit is contained in:
t. boddy 2026-02-14 19:31:58 -05:00
parent ab73e04b32
commit 0b905f2690
26 changed files with 1210 additions and 0 deletions

51
src/main.c Normal file
View file

@ -0,0 +1,51 @@
#include <genesis.h>
#include <resources.h>
#include "global.h"
#include "background.h"
#include "bullets.h"
#include "enemies.h"
#include "player.h"
#include "stage.h"
#include "chrome.h"
#include "start.h"
static void loadInternals(){
JOY_init();
JOY_setEventHandler(&updateControls);
SPR_init();
VDP_setPlaneSize(128, 32, TRUE);
VDP_loadFont(font.tileset, DMA);
PAL_setPalette(PAL0, font.palette->data, DMA);
PAL_setPalette(PAL1, shadow.palette->data, CPU);
VDP_setTextPriority(1);
}
void loadGame(){
loadBackground();
loadPlayer();
loadChrome();
loadStage();
}
static void updateGame(){
updateChrome();
updateBackground();
updateEnemies();
updatePlayer();
updateBullets();
}
int main(bool hardReset){
loadInternals();
loadGame();
// loadStart();
while(1){
updateGame();
clock++;
if(clock >= CLOCK_LIMIT) clock = 600;
SPR_update();
SYS_doVBlankProcess();
}
return(0);
}