mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-02-04 10:36:50 +00:00
(RARCH_CONSOLE) Get rid of emulator_initialized - replace with main_is_init
This commit is contained in:
parent
02514d509e
commit
e06583a45c
@ -778,14 +778,14 @@ HRESULT CRetroArchQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
|
||||
switch(current_index)
|
||||
{
|
||||
case MENU_ITEM_LOAD_STATE:
|
||||
if (g_extern.console.emulator_initialized)
|
||||
if (g_extern.main_is_init)
|
||||
{
|
||||
rarch_load_state();
|
||||
rarch_settings_change(S_RETURN_TO_GAME);
|
||||
}
|
||||
break;
|
||||
case MENU_ITEM_SAVE_STATE:
|
||||
if (g_extern.console.emulator_initialized)
|
||||
if (g_extern.main_is_init)
|
||||
{
|
||||
rarch_save_state();
|
||||
rarch_settings_change(S_RETURN_TO_GAME);
|
||||
@ -814,7 +814,7 @@ HRESULT CRetroArchQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
|
||||
rarch_settings_msg(S_MSG_RESIZE_SCREEN, S_DELAY_270);
|
||||
break;
|
||||
case MENU_ITEM_FRAME_ADVANCE:
|
||||
if (g_extern.console.emulator_initialized)
|
||||
if (g_extern.main_is_init)
|
||||
{
|
||||
g_extern.lifecycle_state |= (1ULL << RARCH_FRAMEADVANCE);
|
||||
rarch_settings_change(S_FRAME_ADVANCE);
|
||||
@ -825,14 +825,14 @@ HRESULT CRetroArchQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
|
||||
device_ptr->ctx_driver->rmenu_screenshot_dump(NULL);
|
||||
break;
|
||||
case MENU_ITEM_RESET:
|
||||
if (g_extern.console.emulator_initialized)
|
||||
if (g_extern.main_is_init)
|
||||
{
|
||||
rarch_settings_change(S_RETURN_TO_GAME);
|
||||
rarch_game_reset();
|
||||
}
|
||||
break;
|
||||
case MENU_ITEM_RETURN_TO_GAME:
|
||||
if (g_extern.console.emulator_initialized)
|
||||
if (g_extern.main_is_init)
|
||||
rarch_settings_change(S_RETURN_TO_GAME);
|
||||
break;
|
||||
case MENU_ITEM_QUIT_RARCH:
|
||||
@ -1166,7 +1166,7 @@ bool rmenu_iterate(void)
|
||||
XInputGetState(0, &state);
|
||||
|
||||
bool rmenu_enable = !((state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB)
|
||||
&& (state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) && (g_extern.console.emulator_initialized)
|
||||
&& (state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) && (g_extern.main_is_init)
|
||||
&& IS_TIMER_EXPIRED(0));
|
||||
|
||||
rarch_render_cached_frame();
|
||||
|
@ -85,7 +85,7 @@ bool rarch_startup (const char * config_path)
|
||||
|
||||
if(g_extern.console.initialize_rarch_enable)
|
||||
{
|
||||
if(g_extern.console.emulator_initialized)
|
||||
if(g_extern.main_is_init)
|
||||
rarch_main_deinit();
|
||||
|
||||
struct rarch_main_wrap args = {0};
|
||||
@ -104,14 +104,12 @@ bool rarch_startup (const char * config_path)
|
||||
|
||||
if(init_ret == 0)
|
||||
{
|
||||
g_extern.console.emulator_initialized = 1;
|
||||
g_extern.console.initialize_rarch_enable = 0;
|
||||
retval = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//failed to load the ROM for whatever reason
|
||||
g_extern.console.emulator_initialized = 0;
|
||||
g_extern.console.rmenu.mode = MODE_MENU;
|
||||
rarch_settings_msg(S_MSG_ROM_LOADING_ERROR, S_DELAY_180);
|
||||
}
|
||||
|
@ -397,7 +397,6 @@ void rarch_settings_set_default(void)
|
||||
g_extern.audio_data.mute = 0;
|
||||
g_extern.verbose = true;
|
||||
|
||||
g_extern.console.emulator_initialized = 0;
|
||||
g_extern.console.rmenu.mode = MODE_MENU;
|
||||
g_extern.console.rmenu.font_size = 1.0f;
|
||||
g_extern.console.sound.mode = SOUND_MODE_NORMAL;
|
||||
|
@ -82,7 +82,7 @@ void rarch_set_auto_viewport(unsigned width, unsigned height)
|
||||
|
||||
void rarch_set_core_viewport(void)
|
||||
{
|
||||
if (!g_extern.console.emulator_initialized)
|
||||
if (!g_extern.main_is_init)
|
||||
return;
|
||||
|
||||
// fallback to 1:1 pixel ratio if none provided
|
||||
|
@ -1049,7 +1049,7 @@ static void set_setting_action(void *data, unsigned switchvalue, uint64_t input)
|
||||
case SETTING_SHADER_PRESETS:
|
||||
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
|
||||
{
|
||||
if(g_extern.console.emulator_initialized)
|
||||
if(g_extern.main_is_init)
|
||||
{
|
||||
menu_stack_push(PRESET_CHOICE);
|
||||
filebrowser_set_root_and_ext(filebrowser, EXT_CGP_PRESETS, default_paths.cgp_dir);
|
||||
@ -2329,11 +2329,11 @@ void rmenu_input_process(void *data, void *state)
|
||||
{
|
||||
//we want to force exit when g_extern.console.mode is set to MODE_EXIT
|
||||
if(g_extern.console.rmenu.mode != MODE_EXIT)
|
||||
g_extern.console.rmenu.mode = (((rstate->old_state & (1ULL << RMENU_DEVICE_NAV_L3)) && (rstate->old_state & (1ULL << RMENU_DEVICE_NAV_R3)) && g_extern.console.emulator_initialized)) ? MODE_EMULATION : MODE_MENU;
|
||||
g_extern.console.rmenu.mode = (((rstate->old_state & (1ULL << RMENU_DEVICE_NAV_L3)) && (rstate->old_state & (1ULL << RMENU_DEVICE_NAV_R3)) && g_extern.main_is_init)) ? MODE_EMULATION : MODE_MENU;
|
||||
}
|
||||
else
|
||||
{
|
||||
bool rmenu_enable = !(((rstate->old_state & (1ULL << RMENU_DEVICE_NAV_L3)) && (rstate->old_state & (1ULL << RMENU_DEVICE_NAV_R3)) && g_extern.console.emulator_initialized));
|
||||
bool rmenu_enable = !(((rstate->old_state & (1ULL << RMENU_DEVICE_NAV_L3)) && (rstate->old_state & (1ULL << RMENU_DEVICE_NAV_R3)) && g_extern.main_is_init));
|
||||
g_extern.console.rmenu.mode = rmenu_enable ? MODE_MENU : MODE_EMULATION;
|
||||
}
|
||||
}
|
||||
|
@ -477,7 +477,6 @@ struct global
|
||||
{
|
||||
bool block_config_read;
|
||||
bool initialize_rarch_enable;
|
||||
unsigned emulator_initialized;
|
||||
rarch_frame_count_t general_timers[2];
|
||||
|
||||
struct
|
||||
|
@ -365,7 +365,7 @@ static bool rmenu_iterate(void)
|
||||
{
|
||||
if(goto_menu_key_pressed)
|
||||
{
|
||||
g_extern.console.rmenu.state.rmenu.enable = (goto_menu_key_pressed && g_extern.console.emulator_initialized) ? false : true;
|
||||
g_extern.console.rmenu.state.rmenu.enable = (goto_menu_key_pressed && g_extern.main_is_init) ? false : true;
|
||||
g_extern.console.rmenu.mode = g_extern.console.rmenu.state.rmenu.enable ? MODE_MENU : MODE_EMULATION;
|
||||
}
|
||||
}
|
||||
@ -596,7 +596,7 @@ begin_shutdown:
|
||||
config_save_file(default_paths.config_file);
|
||||
config_save_keybinds(input_path);
|
||||
|
||||
if(g_extern.console.emulator_initialized)
|
||||
if(g_extern.main_is_init)
|
||||
rarch_main_deinit();
|
||||
|
||||
input_gx.free(NULL);
|
||||
|
@ -367,7 +367,7 @@ begin_loop:
|
||||
begin_shutdown:
|
||||
config_save_file(default_paths.config_file);
|
||||
|
||||
if(g_extern.console.emulator_initialized)
|
||||
if(g_extern.main_is_init)
|
||||
rarch_main_deinit();
|
||||
|
||||
input_ps3.free(NULL);
|
||||
|
@ -193,7 +193,7 @@ begin_loop:
|
||||
begin_shutdown:
|
||||
config_save_file(default_paths.config_file);
|
||||
|
||||
if(g_extern.console.emulator_initialized)
|
||||
if(g_extern.main_is_init)
|
||||
rarch_main_deinit();
|
||||
|
||||
input_psp.free(NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user