psp bugfixes, refactoring, stuff
[picodrive.git] / platform / psp / main.c
CommitLineData
1820b5a7 1#include "psp.h"
2#include "emu.h"
3#include "menu.h"
4#include "../common/menu.h"
7d4906bf 5#include "../common/emu.h"
1820b5a7 6#include "../common/lprintf.h"
7
8int main()
9{
10 psp_init();
11
7d4906bf 12 emu_ReadConfig(0, 0);
1820b5a7 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:
1820b5a7 27 if (emu_ReloadRom())
28 engineState = PGS_Running;
29 else {
30 lprintf("PGS_ReloadRom == 0\n");
31 engineState = PGS_Menu;
32 }
1820b5a7 33 break;
34
35 case PGS_RestartRun:
36 engineState = PGS_Running;
37
38 case PGS_Running:
7d4906bf 39 emu_Loop();
1820b5a7 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