initial psp code, functional menu
[picodrive.git] / platform / psp / emu.c
1 #include <sys/stat.h>
2 #include <sys/types.h>
3 #include <sys/syslimits.h> // PATH_MAX
4
5 #include "../../Pico/PicoInt.h"
6
7 char romFileName[PATH_MAX];
8 unsigned char *PicoDraw2FB;  // temporary buffer for alt renderer ( (8+320)*(8+240+8) )
9 int engineState;
10
11
12 void emu_noticeMsgUpdated(void)
13 {
14 }
15
16 void emu_getMainDir(char *dst, int len)
17 {
18 }
19
20 void emu_stateCb(const char *str)
21 {
22 }
23
24 void emu_setDefaultConfig(void)
25 {
26 }
27
28 void emu_forcedFrame(void)
29 {
30 }
31
32 void emu_Init(void)
33 {
34         // make dirs for saves, cfgs, etc.
35         mkdir("mds", 0777);
36         mkdir("srm", 0777);
37         mkdir("brm", 0777);
38         mkdir("cfg", 0777);
39
40         PicoInit();
41 //      PicoMessage = emu_msg_cb;
42 //      PicoMCDopenTray = emu_msg_tray_open;
43 //      PicoMCDcloseTray = menu_loop_tray;
44 }
45
46 void emu_Deinit(void)
47 {
48         // save SRAM
49 /*      if ((currentConfig.EmuOpt & 1) && SRam.changed) {
50                 emu_SaveLoadGame(0, 1);
51                 SRam.changed = 0;
52         }
53
54         if (!(currentConfig.EmuOpt & 0x20)) {
55                 FILE *f = fopen(PicoConfigFile, "r+b");
56                 if (!f) emu_WriteConfig(0);
57                 else {
58                         // if we already have config, reload it, except last ROM
59                         fseek(f, sizeof(currentConfig.lastRomFile), SEEK_SET);
60                         fread(&currentConfig.EmuOpt, 1, sizeof(currentConfig) - sizeof(currentConfig.lastRomFile), f);
61                         fseek(f, 0, SEEK_SET);
62                         fwrite(&currentConfig, 1, sizeof(currentConfig), f);
63                         fflush(f);
64                         fclose(f);
65                 }
66         }
67 */
68         PicoExit();
69 }
70
71 void emu_ResetGame(void)
72 {
73         PicoReset(0);
74         //reset_timing = 1;
75 }
76