Get rid of lifecycle_mode_state and use g_extern.lifecycle_state

instead
This commit is contained in:
twinaphex 2013-11-07 21:44:44 +01:00
parent c6aebe7211
commit da8f8b6d63
25 changed files with 163 additions and 193 deletions

View File

@ -1268,7 +1268,7 @@ static void android_input_set_keybinds(void *data, unsigned device,
shift = 8 + (port * 8);
}
g_extern.lifecycle_mode_state |= (1ULL << MODE_INPUT_XPERIA_PLAY_HACK);
g_extern.lifecycle_state |= (1ULL << MODE_INPUT_XPERIA_PLAY_HACK);
android->keycode_lut[AKEYCODE_DPAD_CENTER] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
android->keycode_lut[AKEYCODE_BACK] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
@ -1794,7 +1794,7 @@ static void android_input_poll(void *data)
uint8_t unpacked = (android->keycode_lut[AKEYCODE_BACK] >> ((state_id+1) << 3)) - 1;
uint64_t input_state = (1ULL << unpacked);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INPUT_XPERIA_PLAY_HACK))
if (g_extern.lifecycle_state & (1ULL << MODE_INPUT_XPERIA_PLAY_HACK))
{
int meta = AKeyEvent_getMetaState(event);
if (!(meta & AMETA_ALT_ON))

View File

@ -45,9 +45,9 @@ void apple_event_set_state_slot(void* userdata)
void apple_event_show_rgui(void* userdata)
{
const bool in_menu = g_extern.lifecycle_mode_state & (1 << MODE_MENU);
g_extern.lifecycle_mode_state &= ~(1ULL << (in_menu ? MODE_MENU : MODE_GAME));
g_extern.lifecycle_mode_state |= (1ULL << (in_menu ? MODE_GAME : MODE_MENU));
const bool in_menu = g_extern.lifecycle_state & (1 << MODE_MENU);
g_extern.lifecycle_state &= ~(1ULL << (in_menu ? MODE_MENU : MODE_GAME));
g_extern.lifecycle_state |= (1ULL << (in_menu ? MODE_GAME : MODE_MENU));
}
static void event_reload_config(void* userdata)

View File

@ -801,12 +801,12 @@ bool rarch_environment_cb(unsigned cmd, void *data)
else
*g_extern.fullpath = '\0';
#if !defined( HAVE_DYNAMIC) && defined(RARCH_CONSOLE)
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME);
g_extern.lifecycle_mode_state |= (1ULL << MODE_EXITSPAWN);
g_extern.lifecycle_mode_state |= (1ULL << MODE_EXITSPAWN_START_GAME);
#if defined(RARCH_CONSOLE)
g_extern.lifecycle_state &= ~(1ULL << MODE_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_EXITSPAWN);
g_extern.lifecycle_state |= (1ULL << MODE_EXITSPAWN_START_GAME);
#elif defined(HAVE_DYNAMIC)
g_extern.lifecycle_mode_state |= (1ULL << MODE_LOAD_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_LOAD_GAME);
#endif
if (cmd == RETRO_ENVIRONMENT_EXEC_ESCAPE)

View File

@ -243,7 +243,7 @@ returntype main_entry(signature())
frontend_ctx->process_args(argc, argv, args);
if (!initial_lifecycle_state_preinit)
g_extern.lifecycle_mode_state |= initial_menu_lifecycle_state;
g_extern.lifecycle_state |= initial_menu_lifecycle_state;
if (attempt_load_game_push_history)
{
@ -259,18 +259,18 @@ returntype main_entry(signature())
{
break_loop;
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_LOAD_GAME))
else if (g_extern.lifecycle_state & (1ULL << MODE_LOAD_GAME))
{
load_menu_game_prepare();
// If ROM load fails, we exit RetroArch. On console it might make more sense to go back to menu though ...
if (load_menu_game())
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
else
{
g_extern.lifecycle_mode_state = attempt_load_game_fails;
g_extern.lifecycle_state = attempt_load_game_fails;
if (g_extern.lifecycle_mode_state & (1ULL << MODE_EXIT))
if (g_extern.lifecycle_state & (1ULL << MODE_EXIT))
{
if (frontend_ctx && frontend_ctx->shutdown)
frontend_ctx->shutdown(true);
@ -279,9 +279,9 @@ returntype main_entry(signature())
}
}
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_LOAD_GAME);
g_extern.lifecycle_state &= ~(1ULL << MODE_LOAD_GAME);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_GAME))
else if (g_extern.lifecycle_state & (1ULL << MODE_GAME))
{
if (driver.video_poke->set_aspect_ratio)
driver.video_poke->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
@ -291,16 +291,16 @@ returntype main_entry(signature())
if (frontend_ctx && frontend_ctx->process_events)
frontend_ctx->process_events(args);
if (!(g_extern.lifecycle_mode_state & (1ULL << MODE_GAME)))
if (!(g_extern.lifecycle_state & (1ULL << MODE_GAME)))
{
break_loop;
}
}
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME);
g_extern.lifecycle_state &= ~(1ULL << MODE_GAME);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU))
else if (g_extern.lifecycle_state & (1ULL << MODE_MENU))
{
g_extern.lifecycle_mode_state |= 1ULL << MODE_MENU_PREINIT;
g_extern.lifecycle_state |= 1ULL << MODE_MENU_PREINIT;
// Menu should always run with vsync on.
video_set_nonblock_state_func(false);
// Stop all rumbling when entering RGUI.
@ -324,7 +324,7 @@ returntype main_entry(signature())
if (frontend_ctx && frontend_ctx->process_events)
frontend_ctx->process_events(args);
if (!(g_extern.lifecycle_mode_state & (1ULL << MODE_MENU)))
if (!(g_extern.lifecycle_state & (1ULL << MODE_MENU)))
{
break_loop;
}
@ -338,7 +338,7 @@ returntype main_entry(signature())
g_extern.audio_active = false;
}
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU);
g_extern.lifecycle_state &= ~(1ULL << MODE_MENU);
// Restore libretro keyboard callback.
g_extern.system.key_event = key_event;
@ -384,7 +384,7 @@ returntype main_entry(signature())
if (frontend_ctx && frontend_ctx->deinit)
frontend_ctx->deinit(args);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_EXITSPAWN) && frontend_ctx
if (g_extern.lifecycle_state & (1ULL << MODE_EXITSPAWN) && frontend_ctx
&& frontend_ctx->exitspawn)
frontend_ctx->exitspawn();

View File

@ -74,28 +74,28 @@ static void mainloop(void)
g_extern.audio_active = false;
}
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU);
g_extern.lifecycle_state &= ~(1ULL << MODE_MENU);
}
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_LOAD_GAME))
else if (g_extern.lifecycle_state & (1ULL << MODE_LOAD_GAME))
{
load_menu_game_prepare();
// If ROM load fails, we exit RetroArch. On console it might make more sense to go back to menu though ...
if (load_menu_game())
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
else
{
#ifdef RARCH_CONSOLE
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU);
g_extern.lifecycle_state |= (1ULL << MODE_MENU);
#else
return;
#endif
}
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_LOAD_GAME);
g_extern.lifecycle_state &= ~(1ULL << MODE_LOAD_GAME);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_GAME))
else if (g_extern.lifecycle_state & (1ULL << MODE_GAME))
{
bool r;
if (g_extern.is_paused && !g_extern.is_oneshot)
@ -103,11 +103,11 @@ static void mainloop(void)
else
r = rarch_main_iterate();
if (!r)
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME);
g_extern.lifecycle_state &= ~(1ULL << MODE_GAME);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU))
else if (g_extern.lifecycle_state & (1ULL << MODE_MENU))
{
g_extern.lifecycle_mode_state |= 1ULL << MODE_MENU_PREINIT;
g_extern.lifecycle_state |= 1ULL << MODE_MENU_PREINIT;
// Menu should always run with vsync on.
video_set_nonblock_state_func(false);
@ -134,8 +134,8 @@ int main(int argc, char *argv[])
#ifdef HAVE_MENU
menu_init();
g_extern.lifecycle_mode_state |= 1ULL << MODE_GAME;
g_extern.lifecycle_mode_state |= 1ULL << MODE_GAME_ONESHOT;
g_extern.lifecycle_state |= 1ULL << MODE_GAME;
g_extern.lifecycle_state |= 1ULL << MODE_GAME_ONESHOT;
// If we started a ROM directly from command line,
// push it to ROM history.

View File

@ -1139,7 +1139,7 @@ static int rgui_iterate(void *data, unsigned action)
libretro_get_system_info(g_settings.libretro, &rgui->info,
&rgui->load_no_rom);
g_extern.lifecycle_mode_state |= (1ULL << MODE_LOAD_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_LOAD_GAME);
#else
rarch_environment_cb(RETRO_ENVIRONMENT_SET_LIBRETRO_PATH, (void*)g_settings.libretro);
rarch_environment_cb(RETRO_ENVIRONMENT_EXEC, (void*)g_extern.fullpath);
@ -1159,7 +1159,7 @@ static int rgui_iterate(void *data, unsigned action)
// No ROM needed for this core, load game immediately.
if (rgui->load_no_rom)
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_LOAD_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_LOAD_GAME);
*g_extern.fullpath = '\0';
rgui->msg_force = true;
ret = -1;
@ -1176,8 +1176,8 @@ static int rgui_iterate(void *data, unsigned action)
#else
fill_pathname_join(g_settings.libretro, dir, path, sizeof(g_settings.libretro));
#endif
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME);
g_extern.lifecycle_mode_state |= (1ULL << MODE_EXITSPAWN);
g_extern.lifecycle_state &= ~(1ULL << MODE_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_EXITSPAWN);
ret = -1;
#endif
@ -1215,7 +1215,7 @@ static int rgui_iterate(void *data, unsigned action)
fill_pathname_join(image, dir, path, sizeof(image));
rarch_disk_control_append_image(image);
g_extern.lifecycle_mode_state |= 1ULL << MODE_GAME;
g_extern.lifecycle_state |= 1ULL << MODE_GAME;
rgui_flush_menu_stack_type(rgui, RGUI_SETTINGS);
ret = -1;
@ -1310,7 +1310,7 @@ static int rgui_iterate(void *data, unsigned action)
rarch_environment_cb(RETRO_ENVIRONMENT_EXEC, (void*)g_extern.fullpath);
#endif
g_extern.lifecycle_mode_state |= (1ULL << MODE_LOAD_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_LOAD_GAME);
rgui_flush_menu_stack_type(rgui, RGUI_SETTINGS);
rgui->msg_force = true;
ret = -1;
@ -1325,7 +1325,7 @@ static int rgui_iterate(void *data, unsigned action)
else
{
fill_pathname_join(g_extern.fullpath, dir, path, sizeof(g_extern.fullpath));
g_extern.lifecycle_mode_state |= (1ULL << MODE_LOAD_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_LOAD_GAME);
rgui_flush_menu_stack_type(rgui, RGUI_SETTINGS);
rgui->msg_force = true;
@ -1381,10 +1381,10 @@ bool menu_iterate(void)
uint64_t input_state = 0;
int input_entry_ret = 0;
if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_PREINIT))
if (g_extern.lifecycle_state & (1ULL << MODE_MENU_PREINIT))
{
rgui->need_refresh = true;
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_PREINIT);
g_extern.lifecycle_state &= ~(1ULL << MODE_MENU_PREINIT);
rgui->old_input_state |= 1ULL << RARCH_MENU_TOGGLE;
}
@ -1395,7 +1395,7 @@ bool menu_iterate(void)
if (input_key_pressed_func(RARCH_QUIT_KEY) || !video_alive_func())
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
goto deinit;
}
@ -1513,7 +1513,7 @@ bool menu_replace_config(const char *path)
// Load dummy core.
*g_extern.fullpath = '\0';
*g_settings.libretro = '\0'; // Load core in new config.
g_extern.lifecycle_mode_state |= (1ULL << MODE_LOAD_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_LOAD_GAME);
rgui->load_no_rom = false;
return true;

View File

@ -361,7 +361,7 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
rarch_save_state();
else
rarch_load_state();
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
return -1;
}
else if (action == RGUI_ACTION_START)
@ -381,7 +381,7 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
if (action == RGUI_ACTION_OK)
{
rarch_game_reset();
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
return -1;
}
break;
@ -435,22 +435,22 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
fill_pathname_join(g_extern.fullpath, default_paths.core_dir, SALAMANDER_FILE,
sizeof(g_extern.fullpath));
#endif
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME);
g_extern.lifecycle_mode_state |= (1ULL << MODE_EXITSPAWN);
g_extern.lifecycle_state &= ~(1ULL << MODE_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_EXITSPAWN);
return -1;
}
break;
case RGUI_SETTINGS_RESUME_GAME:
if (action == RGUI_ACTION_OK)
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
return -1;
}
break;
case RGUI_SETTINGS_QUIT_RARCH:
if (action == RGUI_ACTION_OK)
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME);
g_extern.lifecycle_state &= ~(1ULL << MODE_GAME);
return -1;
}
break;
@ -930,12 +930,12 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
if (g_extern.console.screen.resolutions.list[g_extern.console.screen.resolutions.current.idx] == CELL_VIDEO_OUT_RESOLUTION_576)
{
if (g_extern.console.screen.pal_enable)
g_extern.lifecycle_mode_state |= (1ULL<< MODE_VIDEO_PAL_ENABLE);
g_extern.lifecycle_state |= (1ULL<< MODE_VIDEO_PAL_ENABLE);
}
else
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_PAL_ENABLE);
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE);
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_PAL_ENABLE);
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE);
}
driver.video->restart();
#ifdef HAVE_RMENU
@ -946,10 +946,10 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
#endif
#ifdef HW_RVL
case RGUI_SETTINGS_VIDEO_SOFT_FILTER:
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
if (g_extern.lifecycle_state & (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE))
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
else
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
if (driver.video_poke->apply_state_changes)
driver.video_poke->apply_state_changes(driver.video_data);
@ -1277,7 +1277,7 @@ void menu_set_settings_label(char *type_str, size_t type_str_size, unsigned *w,
break;
case RGUI_SETTINGS_VIDEO_SOFT_FILTER:
snprintf(type_str, type_str_size,
(g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE)) ? "ON" : "OFF");
(g_extern.lifecycle_state & (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE)) ? "ON" : "OFF");
break;
case RGUI_SETTINGS_VIDEO_FILTER:
if (g_settings.video.smooth)

View File

@ -263,7 +263,7 @@ static void rgui_render(void *data)
rgui_handle_t *rgui = (rgui_handle_t*)data;
if (rgui->need_refresh &&
(g_extern.lifecycle_mode_state & (1ULL << MODE_MENU))
(g_extern.lifecycle_state & (1ULL << MODE_MENU))
&& !rgui->msg_force)
return;
@ -537,7 +537,7 @@ static void *rgui_init(void)
RARCH_ERR("No font bitmap or binary, abort");
/* TODO - should be refactored - perhaps don't do rarch_fail but instead
* exit program */
g_extern.lifecycle_mode_state &= ~((1ULL << MODE_MENU) | (1ULL << MODE_GAME));
g_extern.lifecycle_state &= ~((1ULL << MODE_MENU) | (1ULL << MODE_GAME));
return NULL;
}
@ -561,7 +561,7 @@ int rgui_input_postprocess(void *data, uint64_t old_state)
g_extern.main_is_init &&
!g_extern.libretro_dummy)
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
ret = -1;
}

View File

@ -542,7 +542,7 @@ static void rmenu_render(void *data)
break;
case SETTING_PAL60_MODE:
strlcpy(text, "PAL60 Mode", sizeof(text));
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE))
if (g_extern.lifecycle_state & (1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE))
strlcpy(setting_text, "ON", sizeof(setting_text));
else
strlcpy(setting_text, "OFF", sizeof(setting_text));
@ -562,7 +562,7 @@ static void rmenu_render(void *data)
break;
case SETTING_SOFT_DISPLAY_FILTER:
strlcpy(text, "Soft Display Filter", sizeof(text));
snprintf(setting_text, sizeof(setting_text), (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE)) ? "ON" : "OFF");
snprintf(setting_text, sizeof(setting_text), (g_extern.lifecycle_state & (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE)) ? "ON" : "OFF");
break;
#endif
case SETTING_REFRESH_RATE:
@ -576,7 +576,7 @@ static void rmenu_render(void *data)
break;
case SETTING_TRIPLE_BUFFERING:
strlcpy(text, "Triple Buffering", sizeof(text));
snprintf(setting_text, sizeof(setting_text), (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE)) ? "ON" : "OFF");
snprintf(setting_text, sizeof(setting_text), (g_extern.lifecycle_state & (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE)) ? "ON" : "OFF");
break;
case SETTING_SOUND_MODE:
strlcpy(text, "Sound Output", sizeof(text));
@ -628,7 +628,7 @@ static void rmenu_render(void *data)
#endif
case SETTING_ENABLE_CUSTOM_BGM:
strlcpy(text, "Custom BGM Option", sizeof(text));
snprintf(setting_text, sizeof(setting_text), (g_extern.lifecycle_mode_state & (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE)) ? "ON" : "OFF");
snprintf(setting_text, sizeof(setting_text), (g_extern.lifecycle_state & (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE)) ? "ON" : "OFF");
break;
case SETTING_PATH_DEFAULT_ROM_DIRECTORY:
strlcpy(text, "Browser Directory", sizeof(text));
@ -1071,11 +1071,11 @@ static int select_file(void *data, uint64_t action)
break;
case LIBRETRO_CHOICE:
rarch_environment_cb(RETRO_ENVIRONMENT_SET_LIBRETRO_PATH, (void*)path);
g_extern.lifecycle_mode_state |= (1ULL << MODE_EXITSPAWN);
g_extern.lifecycle_state |= (1ULL << MODE_EXITSPAWN);
return -1;
case FILE_BROWSER_MENU:
strlcpy(g_extern.fullpath, path, sizeof(g_extern.fullpath));
g_extern.lifecycle_mode_state |= (1ULL << MODE_LOAD_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_LOAD_GAME);
return -1;
}
@ -1209,7 +1209,7 @@ static void set_keybind_digital(unsigned default_retro_joypad_id, uint64_t actio
static bool osk_callback_enter_rsound(void *data)
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_OSK_ENTRY_SUCCESS))
if (g_extern.lifecycle_state & (1ULL << MODE_OSK_ENTRY_SUCCESS))
{
RARCH_LOG("OSK - Applying input data.\n");
char tmp_str[256];
@ -1218,13 +1218,13 @@ static bool osk_callback_enter_rsound(void *data)
strlcpy(g_settings.audio.device, tmp_str, sizeof(g_settings.audio.device));
goto do_exit;
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_OSK_ENTRY_FAIL))
else if (g_extern.lifecycle_state & (1ULL << MODE_OSK_ENTRY_FAIL))
goto do_exit;
return false;
do_exit:
g_extern.lifecycle_mode_state &= ~((1ULL << MODE_OSK_ENTRY_SUCCESS) |
g_extern.lifecycle_state &= ~((1ULL << MODE_OSK_ENTRY_SUCCESS) |
(1ULL << MODE_OSK_ENTRY_FAIL));
return true;
}
@ -1240,7 +1240,7 @@ static bool osk_callback_enter_rsound_init(void *data)
static bool osk_callback_enter_filename(void *data)
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_OSK_ENTRY_SUCCESS))
if (g_extern.lifecycle_state & (1ULL << MODE_OSK_ENTRY_SUCCESS))
{
RARCH_LOG("OSK - Applying input data.\n");
char tmp_str[256];
@ -1269,12 +1269,12 @@ static bool osk_callback_enter_filename(void *data)
goto do_exit;
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_OSK_ENTRY_FAIL))
else if (g_extern.lifecycle_state & (1ULL << MODE_OSK_ENTRY_FAIL))
goto do_exit;
return false;
do_exit:
g_extern.lifecycle_mode_state &= ~((1ULL << MODE_OSK_ENTRY_SUCCESS) |
g_extern.lifecycle_state &= ~((1ULL << MODE_OSK_ENTRY_SUCCESS) |
(1ULL << MODE_OSK_ENTRY_FAIL));
return true;
}
@ -1344,15 +1344,15 @@ static int set_setting_action(void *data, uint8_t menu_type, unsigned switchvalu
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_PAL_ENABLE))
if (g_extern.lifecycle_state & (1ULL << MODE_VIDEO_PAL_ENABLE))
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE))
if (g_extern.lifecycle_state & (1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE))
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE);
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE);
}
else
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE);
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE);
}
driver.video->restart();
@ -1360,9 +1360,9 @@ static int set_setting_action(void *data, uint8_t menu_type, unsigned switchvalu
}
break;
case RGUI_ACTION_START:
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_PAL_ENABLE))
if (g_extern.lifecycle_state & (1ULL << MODE_VIDEO_PAL_ENABLE))
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE);
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE);
driver.video->restart();
rgui_init_textures(rgui);
@ -1419,13 +1419,13 @@ static int set_setting_action(void *data, uint8_t menu_type, unsigned switchvalu
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
if (g_extern.lifecycle_state & (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE))
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
else
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
break;
case RGUI_ACTION_START:
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
break;
}
break;
@ -1444,7 +1444,7 @@ static int set_setting_action(void *data, uint8_t menu_type, unsigned switchvalu
case RGUI_ACTION_START:
settings_set(1ULL << S_DEF_TRIPLE_BUFFERING);
if (!(g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE)))
if (!(g_extern.lifecycle_state & (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE)))
{
driver.video->restart();
rgui_init_textures(rgui);
@ -1523,11 +1523,11 @@ static int set_setting_action(void *data, uint8_t menu_type, unsigned switchvalu
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
#if (CELL_SDK_VERSION > 0x340000)
if (g_extern.lifecycle_mode_state & (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE);
if (g_extern.lifecycle_state & (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE))
g_extern.lifecycle_state &= ~(1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE);
else
g_extern.lifecycle_mode_state |= (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE))
g_extern.lifecycle_state |= (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE);
if (g_extern.lifecycle_state & (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE))
cellSysutilEnableBgmPlayback();
else
cellSysutilDisableBgmPlayback();
@ -1536,7 +1536,7 @@ static int set_setting_action(void *data, uint8_t menu_type, unsigned switchvalu
break;
case RGUI_ACTION_START:
#if (CELL_SDK_VERSION > 0x340000)
g_extern.lifecycle_mode_state |= (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE);
g_extern.lifecycle_state |= (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE);
#endif
break;
}
@ -1693,7 +1693,7 @@ static int set_setting_action(void *data, uint8_t menu_type, unsigned switchvalu
if (action == RGUI_ACTION_OK)
{
rarch_game_reset();
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
return -1;
}
break;
@ -1708,9 +1708,9 @@ static int set_setting_action(void *data, uint8_t menu_type, unsigned switchvalu
case INGAME_MENU_RETURN_TO_MULTIMAN:
if (action == RGUI_ACTION_OK)
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME);
g_extern.lifecycle_mode_state |= (1ULL << MODE_EXITSPAWN);
g_extern.lifecycle_mode_state |= (1ULL << MODE_EXITSPAWN_MULTIMAN);
g_extern.lifecycle_state &= ~(1ULL << MODE_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_EXITSPAWN);
g_extern.lifecycle_state |= (1ULL << MODE_EXITSPAWN_MULTIMAN);
return -1;
}
break;
@ -1953,7 +1953,7 @@ static int select_setting(void *data, uint64_t action)
case RGUI_ACTION_CANCEL:
if (rgui->menu_type == INGAME_MENU)
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
return -1;
}
@ -2134,7 +2134,7 @@ int rgui_input_postprocess(void *data, uint64_t old_state)
if ((rgui->trigger_state & (1ULL << RARCH_MENU_TOGGLE)) &&
g_extern.main_is_init)
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
ret = -1;
}

View File

@ -123,7 +123,7 @@ static void rgui_render(void *data)
font_params_t font_parms;
if (rgui->need_refresh &&
(g_extern.lifecycle_mode_state & (1ULL << MODE_MENU))
(g_extern.lifecycle_state & (1ULL << MODE_MENU))
&& !rgui->msg_force)
return; size_t begin = rgui->selection_ptr >= (ENTRIES_HEIGHT / 2) ? (rgui->selection_ptr - (ENTRIES_HEIGHT / 2)) : 0;
size_t end = (rgui->selection_ptr + ENTRIES_HEIGHT) <= rgui->selection_buf->size ?
@ -469,7 +469,7 @@ int rgui_input_postprocess(void *data, uint64_t old_state)
g_extern.main_is_init &&
!g_extern.libretro_dummy)
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
ret = -1;
}

View File

@ -271,7 +271,7 @@ HRESULT CRetroArchFileBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandle
if (path_file_exists(rgui->browser->list->elems[index].data))
{
fill_pathname_join(g_extern.fullpath, rgui->browser->current_dir.directory_path, str_buffer, sizeof(g_extern.fullpath));
g_extern.lifecycle_mode_state |= (1ULL << MODE_LOAD_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_LOAD_GAME);
process_input_ret = -1;
}
else if(rgui->browser->list->elems[index].attr.b)
@ -1057,7 +1057,7 @@ HRESULT CRetroArchCoreBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandle
fill_pathname_join(path, rgui->browser->current_dir.directory_path, str_buffer, sizeof(path));
rarch_environment_cb(RETRO_ENVIRONMENT_SET_LIBRETRO_PATH, (void*)path);
g_extern.lifecycle_mode_state |= (1ULL << MODE_EXITSPAWN);
g_extern.lifecycle_state |= (1ULL << MODE_EXITSPAWN);
process_input_ret = -1;
}
else if (rgui->browser->list->elems[index].attr.b)
@ -1093,7 +1093,7 @@ HRESULT CRetroArchMain::OnControlNavigate(XUIMessageControlNavigate *pControlNav
xdk_d3d_video_t *vid = (xdk_d3d_video_t*)driver.video_data;
HRESULT hr;
int current_index;
bool hdmenus_allowed = (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_HD));
bool hdmenus_allowed = (g_extern.lifecycle_state & (1ULL << MODE_MENU_HD));
current_index= XuiListGetCurSel(m_menulist, NULL);
@ -1264,7 +1264,7 @@ static void* rgui_init (void)
xdk_d3d_video_t *device_ptr = (xdk_d3d_video_t*)driver.video_data;
bool hdmenus_allowed = (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_HD));
bool hdmenus_allowed = (g_extern.lifecycle_state & (1ULL << MODE_MENU_HD));
if (hdmenus_allowed)
RARCH_LOG("HD menus enabled.\n");
@ -1397,7 +1397,7 @@ int rgui_input_postprocess(void *data, uint64_t old_state)
if ((rgui->trigger_state & (1ULL << RARCH_MENU_TOGGLE)) &&
g_extern.main_is_init)
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
process_input_ret = -1;
}

View File

@ -311,7 +311,7 @@ static void system_exitspawn(void)
system_exec(default_paths.libretro_path, gx_rom_path[0] != '\0' ? true : false);
#elif defined(HW_RVL)
bool should_load_game = false;
if (g_extern.lifecycle_mode_state & (1ULL << MODE_EXITSPAWN_START_GAME))
if (g_extern.lifecycle_state & (1ULL << MODE_EXITSPAWN_START_GAME))
should_load_game = true;
system_exec(g_settings.libretro, should_load_game);

View File

@ -146,7 +146,7 @@ static void callback_sysutil_exit(uint64_t status, uint64_t param, void *userdat
{
case CELL_SYSUTIL_REQUEST_EXITGAME:
gl->quitting = true;
g_extern.lifecycle_mode_state &= ~((1ULL << MODE_MENU) | (1ULL << MODE_GAME));
g_extern.lifecycle_state &= ~((1ULL << MODE_MENU) | (1ULL << MODE_GAME));
break;
#ifdef HAVE_OSKUTIL
case CELL_SYSUTIL_OSKDIALOG_LOADED:
@ -163,12 +163,12 @@ static void callback_sysutil_exit(uint64_t status, uint64_t param, void *userdat
if (osk->outputInfo.result == CELL_OSKDIALOG_INPUT_FIELD_RESULT_OK)
{
RARCH_LOG("Setting MODE_OSK_ENTRY_SUCCESS.\n");
g_extern.lifecycle_mode_state |= (1ULL << MODE_OSK_ENTRY_SUCCESS);
g_extern.lifecycle_state |= (1ULL << MODE_OSK_ENTRY_SUCCESS);
}
else
{
RARCH_LOG("Setting MODE_OSK_ENTRY_FAIL.\n");
g_extern.lifecycle_mode_state |= (1ULL << MODE_OSK_ENTRY_FAIL);
g_extern.lifecycle_state |= (1ULL << MODE_OSK_ENTRY_FAIL);
}
osk->flags &= ~OSK_IN_USE;
@ -208,7 +208,7 @@ static void get_environment_settings(int argc, char *argv[], void *args)
// second param is multiMAN SELF file
if(path_file_exists(argv[2]) && argc > 1 && (strcmp(argv[2], EMULATOR_CONTENT_DIR) == 0))
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_EXTLAUNCH_MULTIMAN);
g_extern.lifecycle_state |= (1ULL << MODE_EXTLAUNCH_MULTIMAN);
RARCH_LOG("Started from multiMAN, auto-game start enabled.\n");
}
else
@ -246,7 +246,7 @@ static void get_environment_settings(int argc, char *argv[], void *args)
ret = cellGameContentPermit(contentInfoPath, default_paths.port_dir);
#ifdef HAVE_MULTIMAN
if (g_extern.lifecycle_mode_state & (1ULL << MODE_EXTLAUNCH_MULTIMAN))
if (g_extern.lifecycle_state & (1ULL << MODE_EXTLAUNCH_MULTIMAN))
{
fill_pathname_join(contentInfoPath, "/dev_hdd0/game/", EMULATOR_CONTENT_DIR, sizeof(contentInfoPath));
snprintf(default_paths.port_dir, sizeof(default_paths.port_dir), "/dev_hdd0/game/%s/USRDIR", EMULATOR_CONTENT_DIR);
@ -335,7 +335,7 @@ static void system_init(void *data)
cellScreenShotEnable();
#endif
#ifdef HAVE_SYSUTILS
//if (g_extern.lifecycle_mode_state & (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE))
//if (g_extern.lifecycle_state & (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE))
cellSysutilEnableBgmPlayback();
#endif
#endif
@ -403,7 +403,7 @@ static void system_exitspawn(void)
#else
char core_launch[256];
#ifdef HAVE_MULTIMAN
if (g_extern.lifecycle_mode_state & (1ULL << MODE_EXITSPAWN_MULTIMAN))
if (g_extern.lifecycle_state & (1ULL << MODE_EXITSPAWN_MULTIMAN))
{
RARCH_LOG("Boot Multiman: %s.\n", MULTIMAN_SELF_FILE);
strlcpy(core_launch, MULTIMAN_SELF_FILE, sizeof(core_launch));
@ -412,7 +412,7 @@ static void system_exitspawn(void)
#endif
strlcpy(core_launch, g_settings.libretro, sizeof(core_launch));
bool should_load_game = false;
if (g_extern.lifecycle_mode_state & (1ULL << MODE_EXITSPAWN_START_GAME))
if (g_extern.lifecycle_state & (1ULL << MODE_EXITSPAWN_START_GAME))
should_load_game = true;
system_exec(core_launch, should_load_game);

View File

@ -312,7 +312,7 @@ static void system_exitspawn(void)
system_exec(default_paths.libretro_path, false);
#else
bool should_load_game = false;
if (g_extern.lifecycle_mode_state & (1ULL << MODE_EXITSPAWN_START_GAME))
if (g_extern.lifecycle_state & (1ULL << MODE_EXITSPAWN_START_GAME))
should_load_game = true;
system_exec(g_settings.libretro, should_load_game);

View File

@ -592,8 +592,6 @@ struct global
} console;
uint64_t lifecycle_state;
uint64_t lifecycle_mode_state;
// If this is non-NULL. RARCH_LOG and friends will write to this file.
FILE *log_file;

View File

@ -228,7 +228,7 @@ static bool gfx_ctx_init(void)
params.depthFormat = GL_NONE;
params.multisamplingMode = GL_MULTISAMPLING_NONE_SCE;
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE))
if (g_extern.lifecycle_state & (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE))
{
RARCH_LOG("[PSGL Context]: Setting triple buffering.\n");
params.enable |= PSGL_DEVICE_PARAMETERS_BUFFERING_MODE;
@ -244,13 +244,13 @@ static bool gfx_ctx_init(void)
if (params.width == 720 && params.height == 576)
{
RARCH_LOG("[PSGL Context]: 720x576 resolution detected, setting MODE_VIDEO_PAL_ENABLE.\n");
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_PAL_ENABLE);
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_PAL_ENABLE);
}
else
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_PAL_ENABLE);
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_PAL_ENABLE);
}
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE))
if (g_extern.lifecycle_state & (1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE))
{
RARCH_LOG("[PSGL Context]: Setting temporal PAL60 mode.\n");
params.enable |= PSGL_DEVICE_PARAMETERS_RESC_PAL_TEMPORAL_MODE;

View File

@ -111,19 +111,19 @@ static void gfx_ctx_xdk_get_video_size(unsigned *width, unsigned *height)
{
*width = 1280;
*height = 720;
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_HD);
g_extern.lifecycle_state |= (1ULL << MODE_MENU_HD);
}
else
{
*width = 640;
*height = 480;
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_HD);
g_extern.lifecycle_state &= ~(1ULL << MODE_MENU_HD);
}
if(video_mode.fIsWideScreen)
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_WIDESCREEN);
g_extern.lifecycle_state |= (1ULL << MODE_MENU_WIDESCREEN);
else
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_WIDESCREEN);
g_extern.lifecycle_state &= ~(1ULL << MODE_MENU_WIDESCREEN);
#elif defined(_XBOX1)
DWORD video_mode = XGetVideoFlags();
@ -146,10 +146,10 @@ static void gfx_ctx_xdk_get_video_size(unsigned *width, unsigned *height)
*width = 720;
*height = 576;
}
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_WIDESCREEN);
g_extern.lifecycle_state |= (1ULL << MODE_MENU_WIDESCREEN);
}
else
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_WIDESCREEN);
g_extern.lifecycle_state &= ~(1ULL << MODE_MENU_WIDESCREEN);
}
else
{
@ -158,10 +158,10 @@ static void gfx_ctx_xdk_get_video_size(unsigned *width, unsigned *height)
{
*width = 720;
*height = 480;
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_WIDESCREEN);
g_extern.lifecycle_state |= (1ULL << MODE_MENU_WIDESCREEN);
}
else
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_WIDESCREEN);
g_extern.lifecycle_state &= ~(1ULL << MODE_MENU_WIDESCREEN);
}
if(XGetAVPack() == XC_AV_PACK_HDTV)
@ -170,22 +170,22 @@ static void gfx_ctx_xdk_get_video_size(unsigned *width, unsigned *height)
{
*width = 640;
*height = 480;
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_WIDESCREEN);
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_HD);
g_extern.lifecycle_state &= ~(1ULL << MODE_MENU_WIDESCREEN);
g_extern.lifecycle_state |= (1ULL << MODE_MENU_HD);
}
else if(video_mode & XC_VIDEO_FLAGS_HDTV_720p)
{
*width = 1280;
*height = 720;
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_WIDESCREEN);
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_HD);
g_extern.lifecycle_state |= (1ULL << MODE_MENU_WIDESCREEN);
g_extern.lifecycle_state |= (1ULL << MODE_MENU_HD);
}
else if(video_mode & XC_VIDEO_FLAGS_HDTV_1080i)
{
*width = 1920;
*height = 1080;
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_WIDESCREEN);
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_HD);
g_extern.lifecycle_state |= (1ULL << MODE_MENU_WIDESCREEN);
g_extern.lifecycle_state |= (1ULL << MODE_MENU_HD);
}
}
#else

View File

@ -20,7 +20,7 @@
#include "../../general.h"
#include "../../xdk/xdk_resources.h"
#define FONT_SCALE ((g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_HD)) ? 2 : 1)
#define FONT_SCALE ((g_extern.lifecycle_state & (1ULL << MODE_MENU_HD)) ? 2 : 1)
typedef struct GLYPH_ATTR
{
@ -457,7 +457,7 @@ static void xdk_render_msg(void *driver, const char *str_msg, void *parms)
}
else
{
x = (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_HD)) ? 160 : 100;
x = (g_extern.lifecycle_state & (1ULL << MODE_MENU_HD)) ? 160 : 100;
y = 120;
}

View File

@ -472,15 +472,7 @@ static void gx_input_poll(void *data)
uint64_t *state_p1 = &gx->pad_state[0];
uint64_t *lifecycle_state = &g_extern.lifecycle_state;
*lifecycle_state &= ~(
(1ULL << RARCH_FAST_FORWARD_HOLD_KEY) |
(1ULL << RARCH_LOAD_STATE_KEY) |
(1ULL << RARCH_SAVE_STATE_KEY) |
(1ULL << RARCH_STATE_SLOT_PLUS) |
(1ULL << RARCH_STATE_SLOT_MINUS) |
(1ULL << RARCH_REWIND) |
(1ULL << RARCH_QUIT_KEY) |
(1ULL << RARCH_MENU_TOGGLE));
*lifecycle_state &= ~((1ULL << RARCH_MENU_TOGGLE));
if (g_menu)
{

View File

@ -682,12 +682,9 @@ static void gx_resize(void *data)
int x = 0, y = 0;
unsigned width = gx->vp.full_width, height = gx->vp.full_height;
uint64_t lifecycle_mode_state = g_extern.lifecycle_mode_state;
(void)lifecycle_mode_state;
#ifdef HW_RVL
VIDEO_SetTrapFilter(lifecycle_mode_state & (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE));
VIDEO_SetTrapFilter(g_extern.lifecycle_state & (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE));
#endif
GX_SetDispCopyGamma(g_extern.console.screen.gamma_correction);

View File

@ -146,14 +146,7 @@ static void ps3_input_poll(void *data)
uint64_t *state_p1 = &ps3->state[0];
uint64_t *lifecycle_state = &g_extern.lifecycle_state;
*lifecycle_state &= ~(
(1ULL << RARCH_FAST_FORWARD_HOLD_KEY) | (1ULL << RARCH_LOAD_STATE_KEY) |
(1ULL << RARCH_SAVE_STATE_KEY) |
(1ULL << RARCH_STATE_SLOT_PLUS) |
(1ULL << RARCH_STATE_SLOT_MINUS) |
(1ULL << RARCH_REWIND) |
(1ULL << RARCH_QUIT_KEY) |
(1ULL << RARCH_MENU_TOGGLE));
*lifecycle_state &= ~((1ULL << RARCH_MENU_TOGGLE));
if ((*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_L3)) && (*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R3)))
*lifecycle_state |= (1ULL << RARCH_MENU_TOGGLE);

View File

@ -3039,7 +3039,7 @@ static inline bool check_enter_rgui(void)
bool rmenu_toggle = input_key_pressed_func(RARCH_MENU_TOGGLE) || (g_extern.libretro_dummy && !old_rmenu_toggle);
if (rmenu_toggle && !old_rmenu_toggle)
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU);
g_extern.lifecycle_state |= (1ULL << MODE_MENU);
old_rmenu_toggle = true;
g_extern.system.frame_time_last = 0;
return true;

View File

@ -299,7 +299,7 @@ void config_set_defaults(void)
#endif
#ifdef RARCH_CONSOLE
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU);
g_extern.lifecycle_state |= (1ULL << MODE_MENU);
strlcpy(g_settings.system_directory, default_paths.system_dir, sizeof(g_settings.system_directory));
@ -310,10 +310,10 @@ void config_set_defaults(void)
// g_extern
strlcpy(g_extern.savefile_dir, default_paths.sram_dir, sizeof(g_extern.savefile_dir));
g_extern.console.screen.gamma_correction = DEFAULT_GAMMA;
g_extern.lifecycle_mode_state |= (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE);
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_FLICKER_FILTER_ENABLE);
g_extern.lifecycle_state |= (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE);
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_FLICKER_FILTER_ENABLE);
g_extern.console.screen.resolutions.current.id = 0;
strlcpy(g_extern.savestate_dir, default_paths.savestate_dir, sizeof(g_extern.savestate_dir));
@ -623,33 +623,33 @@ bool config_load_file(const char *path)
if (config_get_bool(conf, "triple_buffering_enable", &triple_buffering_enable))
{
if (triple_buffering_enable)
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
else
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
}
if (config_get_bool(conf, "custom_bgm_enable", &custom_bgm_enable))
{
if (custom_bgm_enable)
g_extern.lifecycle_mode_state |= (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE);
g_extern.lifecycle_state |= (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE);
else
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE);
g_extern.lifecycle_state &= ~(1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE);
}
if (config_get_bool(conf, "flicker_filter_enable", &flicker_filter_enable))
{
if (flicker_filter_enable)
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_FLICKER_FILTER_ENABLE);
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_FLICKER_FILTER_ENABLE);
else
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_FLICKER_FILTER_ENABLE);
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_FLICKER_FILTER_ENABLE);
}
if (config_get_bool(conf, "soft_filter_enable", &soft_filter_enable))
{
if (soft_filter_enable)
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
else
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
}
CONFIG_GET_INT_EXTERN(console.screen.flicker_filter_index, "flicker_filter_index");
@ -1115,9 +1115,9 @@ bool config_save_file(const char *path)
#ifdef _XBOX1
config_set_int(conf, "sound_volume_level", g_extern.console.sound.volume_level);
#endif
bool triple_buffering_enable_val = g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
bool soft_filter_enable_val = g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
bool flicker_filter_enable_val = g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_FLICKER_FILTER_ENABLE);
bool triple_buffering_enable_val = g_extern.lifecycle_state & (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
bool soft_filter_enable_val = g_extern.lifecycle_state & (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
bool flicker_filter_enable_val = g_extern.lifecycle_state & (1ULL << MODE_VIDEO_FLICKER_FILTER_ENABLE);
config_set_bool(conf, "triple_buffering_enable", triple_buffering_enable_val);
config_set_bool(conf, "soft_filter_enable", soft_filter_enable_val);
@ -1141,7 +1141,7 @@ bool config_save_file(const char *path)
config_set_int(conf, "state_slot", g_extern.state_slot);
config_set_int(conf, "audio_mute", g_extern.audio_data.mute);
bool custom_bgm_enable_val = g_extern.lifecycle_mode_state & (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE);
bool custom_bgm_enable_val = g_extern.lifecycle_state & (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE);
config_set_bool(conf, "custom_bgm_enable", custom_bgm_enable_val);
config_set_string(conf, "input_driver", g_settings.input.driver);
@ -1317,10 +1317,10 @@ void settings_set(uint64_t settings)
if (settings & (1ULL << S_TRIPLE_BUFFERING))
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
if (g_extern.lifecycle_state & (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE))
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
else
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
}
if (settings & (1ULL << S_REFRESH_RATE_DECREMENT))
@ -1354,7 +1354,7 @@ void settings_set(uint64_t settings)
g_settings.video.rotation = ORIENTATION_NORMAL;
if (settings & (1ULL << S_DEF_TRIPLE_BUFFERING))
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
if (settings & (1ULL << S_DEF_SAVE_STATE))
g_extern.state_slot = 0;

View File

@ -382,7 +382,6 @@ static bool xdk_d3d_set_shader(void *data, enum rarch_shader_type type, const ch
void xdk_d3d_generate_pp(D3DPRESENT_PARAMETERS *d3dpp, const video_info_t *video)
{
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
uint64_t lifecycle_mode_state = g_extern.lifecycle_mode_state;
memset(d3dpp, 0, sizeof(*d3dpp));
@ -428,14 +427,14 @@ void xdk_d3d_generate_pp(D3DPRESENT_PARAMETERS *d3dpp, const video_info_t *video
d3dpp->Flags = D3DPRESENTFLAG_INTERLACED;
}
if (lifecycle_mode_state & MODE_MENU_WIDESCREEN)
if (g_extern.lifecycle_state & MODE_MENU_WIDESCREEN)
d3dpp->Flags |= D3DPRESENTFLAG_WIDESCREEN;
d3dpp->BackBufferFormat = D3DFMT_X8R8G8B8;
d3dpp->FullScreen_PresentationInterval = d3d->vsync ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE;
d3dpp->SwapEffect = D3DSWAPEFFECT_COPY;
#elif defined(_XBOX360)
if (!(lifecycle_mode_state & (1ULL << MODE_MENU_WIDESCREEN)))
if (!(g_extern.lifecycle_state & (1ULL << MODE_MENU_WIDESCREEN)))
d3dpp->Flags |= D3DPRESENTFLAG_NO_LETTERBOX;
if (g_extern.console.screen.gamma_correction)
@ -831,7 +830,6 @@ static bool xdk_d3d_frame(void *data, const void *frame,
#endif
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)data;
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->d3d_render_device;
uint64_t lifecycle_mode_state = g_extern.lifecycle_mode_state;
#if 0 /* ifdef HAVE_FBO */
D3DSurface* pRenderTarget0;
#endif
@ -897,7 +895,7 @@ static bool xdk_d3d_frame(void *data, const void *frame,
{
#ifdef _XBOX1
d3dr->SetFlickerFilter(g_extern.console.screen.flicker_filter_index);
d3dr->SetSoftDisplayFilter(g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE));
d3dr->SetSoftDisplayFilter(g_extern.lifecycle_state & (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE));
#endif
xdk_d3d_set_viewport(false);
d3d->should_resize = false;
@ -1020,7 +1018,7 @@ NULL, NULL, NULL, 0);
float msg_width = 60;
float msg_height = 365;
#elif defined(_XBOX360)
float msg_width = (lifecycle_mode_state & (1ULL << MODE_MENU_HD)) ? 160 : 100;
float msg_width = (g_extern.lifecycle_state & (1ULL << MODE_MENU_HD)) ? 160 : 100;
float msg_height = 120;
#endif
font_params_t font_parms = {0};

View File

@ -161,15 +161,7 @@ static void xdk_input_poll(void *data)
uint64_t *state_p1 = &xdk->state[0];
uint64_t *lifecycle_state = &g_extern.lifecycle_state;
*lifecycle_state &= ~(
(1ULL << RARCH_FAST_FORWARD_HOLD_KEY) |
(1ULL << RARCH_LOAD_STATE_KEY) |
(1ULL << RARCH_SAVE_STATE_KEY) |
(1ULL << RARCH_STATE_SLOT_PLUS) |
(1ULL << RARCH_STATE_SLOT_MINUS) |
(1ULL << RARCH_REWIND) |
(1ULL << RARCH_QUIT_KEY) |
(1ULL << RARCH_MENU_TOGGLE));
*lifecycle_state &= ~((1ULL << RARCH_MENU_TOGGLE));
if((*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_L3)) && (*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R3)))
*lifecycle_state |= (1ULL << RARCH_MENU_TOGGLE);