restructure project

This commit is contained in:
Yanyan Jiang 2020-08-12 05:43:20 +00:00 committed by Zihao Yu
parent a317d8cce1
commit 960dc907e9
87 changed files with 23 additions and 17 deletions

View file

@ -136,20 +136,3 @@ void fce_update_screen() {
for (int i = 0; i < SCR_W * SCR_H; i ++) canvas[i] = bgc; for (int i = 0; i < SCR_W * SCR_H; i ++) canvas[i] = bgc;
} }
extern unsigned char rom_mario_nes[];
int main(const char *rom_name) {
ioe_init();
printf("Play: [%s] SELECT [%s] START [%s]\n"
" [%s] [%s] [%s] A [%s] B [%s]\n",
TOSTRING(KEY_UP), TOSTRING(KEY_SELECT), TOSTRING(KEY_START),
TOSTRING(KEY_LEFT), TOSTRING(KEY_DOWN), TOSTRING(KEY_RIGHT),
TOSTRING(KEY_A), TOSTRING(KEY_B));
fce_load_rom((void *)rom_mario_nes);
fce_init();
fce_run();
return 1;
}

View file

@ -8,6 +8,9 @@
#define SCR_H 240 #define SCR_H 240
void fce_update_screen(); void fce_update_screen();
int fce_load_rom(char *rom);
void fce_init();
void fce_run();
void draw(int x, int y, int idx); void draw(int x, int y, int idx);
static const uint32_t palette[64] = { static const uint32_t palette[64] = {

View file

@ -0,0 +1,20 @@
#include "common.h"
#include "fce.h"
#include "psg.h"
extern char rom_mario_nes[];
int main() {
ioe_init();
printf("Play: [%s] SELECT [%s] START [%s]\n"
" [%s] [%s] [%s] A [%s] B [%s]\n",
TOSTRING(KEY_UP), TOSTRING(KEY_SELECT), TOSTRING(KEY_START),
TOSTRING(KEY_LEFT), TOSTRING(KEY_DOWN), TOSTRING(KEY_RIGHT),
TOSTRING(KEY_A), TOSTRING(KEY_B));
fce_load_rom((void *)rom_mario_nes);
fce_init();
fce_run();
return 1;
}