X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=gp2x%2Fmenu.c;h=5ff8ac0aa28d2fcef6b522131bf87aeb7b76f750;hb=144a28a0684881e9bf431ec7785efd30e6de64c3;hp=ef54ed6322c3d1236f9f4a9ba802037589992bf2;hpb=bcf6c3497630d2ee44ee3015487ccf8ba5a84600;p=libpicofe.git diff --git a/gp2x/menu.c b/gp2x/menu.c index ef54ed6..5ff8ac0 100644 --- a/gp2x/menu.c +++ b/gp2x/menu.c @@ -169,7 +169,7 @@ void menu_romload_prepare(const char *rom_name) const char *p = rom_name + strlen(rom_name); while (p > rom_name && *p != '/') p--; - if (rom_data) gp2x_pd_clone_buffer2(); + if (rom_loaded) gp2x_pd_clone_buffer2(); else memset(gp2x_screen, 0, 320*240*2); smalltext_out16(1, 1, "Loading", 0xffff); @@ -215,7 +215,7 @@ static void draw_dirlist(char *curdir, struct dirent **namelist, int n, int sel) gp2x_pd_clone_buffer2(); - if (rom_data == NULL) { + if (!rom_loaded) { menu_darken_bg(gp2x_screen, 320*240, 0); } @@ -860,7 +860,7 @@ static void kc_sel_loop(void) case 1: key_config_loop(ctrl_actions, is_6button ? 12 : 8, 1); return; case 2: key_config_loop(emuctrl_actions, sizeof(emuctrl_actions)/sizeof(emuctrl_actions[0]), -1); return; - case 3: if (rom_data == NULL) emu_WriteConfig(0); return; + case 3: if (!rom_loaded) emu_WriteConfig(0); return; default: return; } } @@ -1294,7 +1294,7 @@ static int menu_loop_options(void) currentConfig.PsndRate = PsndRate; currentConfig.PicoRegion = PicoRegionOverride; - me_enable(opt_entries, OPT_ENTRY_COUNT, MA_OPT_SAVECFG_GAME, rom_data != NULL); + me_enable(opt_entries, OPT_ENTRY_COUNT, MA_OPT_SAVECFG_GAME, rom_loaded); me_enable(opt_entries, OPT_ENTRY_COUNT, MA_OPT_LOADCFG, config_slot != config_slot_current); menu_sel_max = me_count_enabled(opt_entries, OPT_ENTRY_COUNT) - 1; if (menu_sel > menu_sel_max) menu_sel = menu_sel_max; @@ -1485,10 +1485,10 @@ static void menu_loop_root(void) int ret, menu_sel_max; unsigned long inp = 0; - me_enable(main_entries, MAIN_ENTRY_COUNT, MA_MAIN_RESUME_GAME, rom_data != NULL); - me_enable(main_entries, MAIN_ENTRY_COUNT, MA_MAIN_SAVE_STATE, rom_data != NULL); - me_enable(main_entries, MAIN_ENTRY_COUNT, MA_MAIN_LOAD_STATE, rom_data != NULL); - me_enable(main_entries, MAIN_ENTRY_COUNT, MA_MAIN_RESET_GAME, rom_data != NULL); + me_enable(main_entries, MAIN_ENTRY_COUNT, MA_MAIN_RESUME_GAME, rom_loaded); + me_enable(main_entries, MAIN_ENTRY_COUNT, MA_MAIN_SAVE_STATE, rom_loaded); + me_enable(main_entries, MAIN_ENTRY_COUNT, MA_MAIN_LOAD_STATE, rom_loaded); + me_enable(main_entries, MAIN_ENTRY_COUNT, MA_MAIN_RESET_GAME, rom_loaded); me_enable(main_entries, MAIN_ENTRY_COUNT, MA_MAIN_PATCHES, PicoPatches != NULL); menu_sel_max = me_count_enabled(main_entries, MAIN_ENTRY_COUNT) - 1; @@ -1506,7 +1506,7 @@ static void menu_loop_root(void) if(inp & GP2X_DOWN) { menu_sel++; if (menu_sel > menu_sel_max) menu_sel = 0; } if((inp & (GP2X_L|GP2X_R)) == (GP2X_L|GP2X_R)) debug_menu_loop(); if(inp &(GP2X_SELECT|GP2X_X)){ - if (rom_data) { + if (rom_loaded) { while (gp2x_joystick_read(1) & (GP2X_SELECT|GP2X_X)) usleep(50*1000); // wait until select is released engineState = PGS_Running; break; @@ -1516,14 +1516,14 @@ static void menu_loop_root(void) switch (me_index2id(main_entries, MAIN_ENTRY_COUNT, menu_sel)) { case MA_MAIN_RESUME_GAME: - if (rom_data) { + if (rom_loaded) { while (gp2x_joystick_read(1) & GP2X_B) usleep(50*1000); engineState = PGS_Running; return; } break; case MA_MAIN_SAVE_STATE: - if (rom_data) { + if (rom_loaded) { if(savestate_menu_loop(0)) continue; engineState = PGS_Running; @@ -1531,7 +1531,7 @@ static void menu_loop_root(void) } break; case MA_MAIN_LOAD_STATE: - if (rom_data) { + if (rom_loaded) { if(savestate_menu_loop(1)) continue; engineState = PGS_Running; @@ -1539,7 +1539,7 @@ static void menu_loop_root(void) } break; case MA_MAIN_RESET_GAME: - if (rom_data) { + if (rom_loaded) { emu_ResetGame(); engineState = PGS_Running; return; @@ -1582,7 +1582,7 @@ static void menu_loop_root(void) engineState = PGS_Quit; return; case MA_MAIN_PATCHES: - if (rom_data && PicoPatches) { + if (rom_loaded && PicoPatches) { patches_menu_loop(); PicoPatchApply(); strcpy(menuErrorMsg, "Patches applied"); @@ -1641,7 +1641,7 @@ static void menu_prepare_bg(int use_game_bg) static void menu_gfx_prepare(void) { - menu_prepare_bg(rom_data != NULL); + menu_prepare_bg(rom_loaded); // switch to 16bpp gp2x_video_changemode2(16);