UI adjustments, nub support
[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"
16e89bed 7#include "version.h"
2951214e 8
9int main()
10{
16e89bed 11 lprintf("\nPicoDrive v" VERSION " " __DATE__ " " __TIME__ "\n");
2951214e 12 psp_init();
13
703e4c7b 14 emu_ReadConfig(0, 0);
2951214e 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:
2951214e 29 if (emu_ReloadRom())
30 engineState = PGS_Running;
31 else {
32 lprintf("PGS_ReloadRom == 0\n");
33 engineState = PGS_Menu;
34 }
2951214e 35 break;
36
37 case PGS_RestartRun:
38 engineState = PGS_Running;
39
40 case PGS_Running:
703e4c7b 41 emu_Loop();
2951214e 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