50 lines
No EOL
891 B
C
50 lines
No EOL
891 B
C
#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"
|
|
|
|
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);
|
|
} |