#include <strings.h>\r
#include <linux/limits.h>\r
\r
-#include "../gp2x/gp2x.h"\r
-#include "../gp2x/menu.h"\r
+#include "../gp2x/emu.h" // TODO rm\r
#include "../common/menu.h"\r
#include "../common/emu.h"\r
#include "../common/config.h"\r
-#include "../gp2x/emu.h"\r
+#include "../common/input.h"\r
#include "../gp2x/version.h"\r
+#include "pandora.h"\r
\r
\r
-extern int select_exits;\r
extern char *PicoConfigFile;\r
static int load_state_slot = -1;\r
-int mmuhack_status = 0; // TODO rm\r
char **g_argv;\r
\r
void parse_cmd_line(int argc, char *argv[])\r
if(strcasecmp(argv[x], "-config") == 0) {\r
if(x+1 < argc) { ++x; PicoConfigFile = argv[x]; }\r
}\r
- else if(strcasecmp(argv[x], "-selectexit") == 0) {\r
- select_exits = 1;\r
- }\r
else if(strcasecmp(argv[x], "-loadstate") == 0) {\r
if(x+1 < argc) { ++x; load_state_slot = atoi(argv[x]); }\r
}\r
} else {\r
/* External Frontend: ROM Name */\r
FILE *f;\r
- strncpy(romFileName, argv[x], PATH_MAX);\r
- romFileName[PATH_MAX-1] = 0;\r
- f = fopen(romFileName, "rb");\r
+ strncpy(rom_fname_reload, argv[x], sizeof(rom_fname_reload));\r
+ rom_fname_reload[sizeof(rom_fname_reload) - 1] = 0;\r
+ f = fopen(rom_fname_reload, "rb");\r
if (f) fclose(f);\r
else unrecognized = 1;\r
engineState = PGS_ReloadRom;\r
}\r
\r
if (unrecognized) {\r
- printf("\n\n\nPicoDrive v" VERSION " (c) notaz, 2006-2008\n");\r
+ printf("\n\n\nPicoDrive v" VERSION " (c) notaz, 2006-2009\n");\r
printf("usage: %s [options] [romfile]\n", argv[0]);\r
printf( "options:\n"\r
- "-menu <menu_path> launch a custom program on exit instead of default gp2xmenu\n"\r
- "-state <param> pass '-state param' to the menu program\n"\r
"-config <file> use specified config file instead of default 'picoconfig.bin'\n"\r
" see currentConfig_t structure in emu.h for the file format\n"\r
- "-selectexit pressing SELECT will exit the emu and start 'menu_path'\n"\r
"-loadstate <num> if ROM is specified, try loading slot <num>\n");\r
}\r
}\r
{\r
g_argv = argv;\r
\r
+ in_init();\r
emu_prepareDefaultConfig();\r
emu_ReadConfig(0, 0);\r
config_readlrom(PicoConfigFile);\r
\r
- gp2x_init();\r
+ in_probe();\r
+ in_debug_dump();\r
+ pnd_init();\r
emu_Init();\r
menu_init();\r
\r
\r
if (engineState == PGS_ReloadRom)\r
{\r
- if (emu_ReloadRom(romFileName)) {\r
+ if (emu_ReloadRom(rom_fname_reload)) {\r
engineState = PGS_Running;\r
if (load_state_slot >= 0) {\r
state_slot = load_state_slot;\r
break;\r
\r
case PGS_ReloadRom:\r
- if (emu_ReloadRom(romFileName))\r
+ if (emu_ReloadRom(rom_fname_reload))\r
engineState = PGS_Running;\r
else {\r
printf("PGS_ReloadRom == 0\n");\r
endloop:\r
\r
emu_Deinit();\r
+ pnd_exit();\r
\r
return 0;\r
}\r