amips asm tile renderer
[libpicofe.git] / psp / main.c
CommitLineData
2951214e 1#include "psp.h"
2#include "emu.h"
3#include "menu.h"
4#include "../common/menu.h"
703e4c7b 5#include "../common/emu.h"
2951214e 6#include "../common/lprintf.h"
7
8int main()
9{
10 psp_init();
11
703e4c7b 12 emu_ReadConfig(0, 0);
2951214e 13 emu_Init();
14 menu_init();
15
16 engineState = PGS_Menu;
17
18 for (;;)
19 {
20 switch (engineState)
21 {
22 case PGS_Menu:
23 menu_loop();
24 break;
25
26 case PGS_ReloadRom:
2951214e 27 if (emu_ReloadRom())
28 engineState = PGS_Running;
29 else {
30 lprintf("PGS_ReloadRom == 0\n");
31 engineState = PGS_Menu;
32 }
2951214e 33 break;
34
35 case PGS_RestartRun:
36 engineState = PGS_Running;
37
38 case PGS_Running:
703e4c7b 39 emu_Loop();
2951214e 40 break;
41
42 case PGS_Quit:
43 goto endloop;
44
45 default:
46 lprintf("engine got into unknown state (%i), exitting\n", engineState);
47 goto endloop;
48 }
49 }
50
51 endloop:
52
53 emu_Deinit();
54 psp_finish();
55
56 return 0;
57}
58