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" |
9caf44b5 |
7 | #include "version.h" |
1820b5a7 |
8 | |
9 | int main() |
10 | { |
9caf44b5 |
11 | lprintf("\nPicoDrive v" VERSION " " __DATE__ " " __TIME__ "\n"); |
1820b5a7 |
12 | psp_init(); |
13 | |
7d4906bf |
14 | emu_ReadConfig(0, 0); |
1820b5a7 |
15 | emu_Init(); |
16 | menu_init(); |
17 | |
18 | engineState = PGS_Menu; |
19 | |
20 | for (;;) |
21 | { |
22 | switch (engineState) |
23 | { |
24 | case PGS_Menu: |
25 | menu_loop(); |
26 | break; |
27 | |
28 | case PGS_ReloadRom: |
1820b5a7 |
29 | if (emu_ReloadRom()) |
30 | engineState = PGS_Running; |
31 | else { |
32 | lprintf("PGS_ReloadRom == 0\n"); |
33 | engineState = PGS_Menu; |
34 | } |
1820b5a7 |
35 | break; |
36 | |
37 | case PGS_RestartRun: |
38 | engineState = PGS_Running; |
39 | |
40 | case PGS_Running: |
7d4906bf |
41 | emu_Loop(); |
1820b5a7 |
42 | break; |
43 | |
44 | case PGS_Quit: |
45 | goto endloop; |
46 | |
47 | default: |
48 | lprintf("engine got into unknown state (%i), exitting\n", engineState); |
49 | goto endloop; |
50 | } |
51 | } |
52 | |
53 | endloop: |
54 | |
55 | emu_Deinit(); |
56 | psp_finish(); |
57 | |
58 | return 0; |
59 | } |
60 | |