X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pandora%2Fmain.c;h=37a69feb7aaa51d0ffe338fb065825c0259e3478;hb=7fd581f40bb5273e81dc08afdd55224c26c8fb9e;hp=51f7f8e84758f774a0e16d129b0189be8d4ae8a2;hpb=3ffee69c504e786d66bff58e109534025701d86e;p=libpicofe.git diff --git a/pandora/main.c b/pandora/main.c index 51f7f8e..37a69fe 100644 --- a/pandora/main.c +++ b/pandora/main.c @@ -10,20 +10,17 @@ #include #include -#include "../gp2x/gp2x.h" -#include "../gp2x/menu.h" +#include "../gp2x/emu.h" // TODO rm #include "../common/menu.h" #include "../common/emu.h" #include "../common/config.h" #include "../common/input.h" -#include "../gp2x/emu.h" #include "../gp2x/version.h" +#include "pandora.h" -extern int select_exits; extern char *PicoConfigFile; static int load_state_slot = -1; -int mmuhack_status = 0; // TODO rm char **g_argv; void parse_cmd_line(int argc, char *argv[]) @@ -37,9 +34,6 @@ void parse_cmd_line(int argc, char *argv[]) if(strcasecmp(argv[x], "-config") == 0) { if(x+1 < argc) { ++x; PicoConfigFile = argv[x]; } } - else if(strcasecmp(argv[x], "-selectexit") == 0) { - select_exits = 1; - } else if(strcasecmp(argv[x], "-loadstate") == 0) { if(x+1 < argc) { ++x; load_state_slot = atoi(argv[x]); } } @@ -50,8 +44,8 @@ void parse_cmd_line(int argc, char *argv[]) } else { /* External Frontend: ROM Name */ FILE *f; - strncpy(rom_fname_reload, argv[x], PATH_MAX); - rom_fname_reload[PATH_MAX-1] = 0; + strncpy(rom_fname_reload, argv[x], sizeof(rom_fname_reload)); + rom_fname_reload[sizeof(rom_fname_reload) - 1] = 0; f = fopen(rom_fname_reload, "rb"); if (f) fclose(f); else unrecognized = 1; @@ -61,14 +55,11 @@ void parse_cmd_line(int argc, char *argv[]) } if (unrecognized) { - printf("\n\n\nPicoDrive v" VERSION " (c) notaz, 2006-2008\n"); + printf("\n\n\nPicoDrive v" VERSION " (c) notaz, 2006-2009\n"); printf("usage: %s [options] [romfile]\n", argv[0]); printf( "options:\n" - "-menu launch a custom program on exit instead of default gp2xmenu\n" - "-state pass '-state param' to the menu program\n" "-config use specified config file instead of default 'picoconfig.bin'\n" " see currentConfig_t structure in emu.h for the file format\n" - "-selectexit pressing SELECT will exit the emu and start 'menu_path'\n" "-loadstate if ROM is specified, try loading slot \n"); } } @@ -85,7 +76,7 @@ int main(int argc, char *argv[]) in_probe(); in_debug_dump(); - gp2x_init(); + pnd_init(); emu_Init(); menu_init(); @@ -141,6 +132,7 @@ int main(int argc, char *argv[]) endloop: emu_Deinit(); + pnd_exit(); return 0; }