X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=gp2x%2Fmain.c;h=2eed35bdb802708b71000cd1f72514fed92edeb3;hb=d572cbad9886a04f8c51edb825dc6aaec9b02e23;hp=0ea8e824c771f1df655311ca6e69a426d88d3a27;hpb=9c0d458840d6eb0216232eabd3ca29b57f638c92;p=libpicofe.git diff --git a/gp2x/main.c b/gp2x/main.c index 0ea8e82..2eed35b 100644 --- a/gp2x/main.c +++ b/gp2x/main.c @@ -10,7 +10,6 @@ #include #include -#include "gp2x.h" #include "../common/menu.h" #include "../common/emu.h" #include "../common/config.h" @@ -24,8 +23,6 @@ #include "cpuctrl.h" -extern char *ext_menu, *ext_state; -extern int select_exits; extern char *PicoConfigFile; static int load_state_slot = -1; int mmuhack_status = 0; @@ -35,24 +32,15 @@ void parse_cmd_line(int argc, char *argv[]) { int x, unrecognized = 0; - for(x = 1; x < argc; x++) + for (x = 1; x < argc; x++) { - if(argv[x][0] == '-') + if (argv[x][0] == '-') { - if(strcasecmp(argv[x], "-menu") == 0) { - if(x+1 < argc) { ++x; ext_menu = argv[x]; } /* External Frontend: Program Name */ + if (strcasecmp(argv[x], "-config") == 0) { + if (x+1 < argc) { ++x; PicoConfigFile = argv[x]; } } - else if(strcasecmp(argv[x], "-state") == 0) { - if(x+1 < argc) { ++x; ext_state = argv[x]; } /* External Frontend: Arguments */ - } - else 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]); } + else if (strcasecmp(argv[x], "-loadstate") == 0) { + if (x+1 < argc) { ++x; load_state_slot = atoi(argv[x]); } } else { unrecognized = 1; @@ -72,15 +60,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"); + printf("options:\n" + " -config use specified config file instead of default 'config.cfg'\n" + " -loadstate if ROM is specified, try loading slot \n"); } } @@ -89,22 +73,22 @@ int main(int argc, char *argv[]) { g_argv = argv; + /* in_init() must go before config, config accesses in_ fwk */ in_init(); emu_prepareDefaultConfig(); emu_ReadConfig(0, 0); config_readlrom(PicoConfigFile); + plat_init(); in_probe(); in_debug_dump(); - gp2x_init(); + if (currentConfig.EmuOpt&0x10) { int ret = mmuhack(); printf("squidge hack code finished and returned %i\n", ret); fflush(stdout); mmuhack_status = ret; } cpuctrl_init(); - // Reset940(1); - // Pause940(1); if (currentConfig.EmuOpt&0x100) { printf("setting RAM timings.. "); fflush(stdout); // craigix: --trc 6 --tras 4 --twr 1 --tmrd 1 --trfc 1 --trp 2 --trcd 2 @@ -169,8 +153,8 @@ int main(int argc, char *argv[]) emu_Deinit(); sharedmem_deinit(); cpuctrl_deinit(); - gp2x_deinit(); - if(mmuhack_status) + plat_finish(); + if (mmuhack_status) mmuunhack(); return 0;