(RARCH_CONSOLE) g_console struct removed now - console settings

now a part of g_extern and also compiled in for PC - will use
this for RMenu
This commit is contained in:
twinaphex 2012-10-15 06:24:39 +02:00
parent 11b9f039b2
commit 174c7d9d98
27 changed files with 1234 additions and 1205 deletions

View File

@ -160,7 +160,7 @@ HRESULT CRetroArchFileBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled
GetChildById(L"XuiBtnGameDir", &m_dir_game);
GetChildById(L"XuiBtnCacheDir", &m_dir_cache);
filebrowser_set_root_and_ext(browser, rarch_console_get_rom_ext(), g_console.default_rom_startup_dir);
filebrowser_set_root_and_ext(browser, rarch_console_get_rom_ext(), g_extern.console.main_wrap.paths.default_rom_startup_dir);
uint64_t action = (1 << RMENU_DEVICE_NAV_B);
filebrowser_fetch_directory_entries(browser, action, &m_romlist, &m_rompathtitle);
@ -191,7 +191,7 @@ HRESULT CRetroArchFileBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandle
}
else if (hObjPressed == m_dir_game)
{
filebrowser_set_root_and_ext(browser, rarch_console_get_rom_ext(), g_console.default_rom_startup_dir);
filebrowser_set_root_and_ext(browser, rarch_console_get_rom_ext(), g_extern.console.main_wrap.paths.default_rom_startup_dir);
uint64_t action = (1 << RMENU_DEVICE_NAV_B);
filebrowser_fetch_directory_entries(browser, action, &m_romlist, &m_rompathtitle);
}
@ -202,7 +202,7 @@ HRESULT CRetroArchFileBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandle
uint64_t action = (1 << RMENU_DEVICE_NAV_B);
filebrowser_fetch_directory_entries(browser, action, &m_romlist, &m_rompathtitle);
if (g_console.info_msg_enable)
if (g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_CACHE_PARTITION, S_DELAY_180);
}
#endif
@ -379,15 +379,15 @@ HRESULT CRetroArchSettings::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
GetChildById(L"XuiBackButton", &m_back);
m_settingslist.SetText(SETTING_EMU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF");
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, g_console.info_msg_enable ? L"Info messages: ON" : L"Info messages: OFF");
m_settingslist.SetText(SETTING_EMU_MENUS, g_console.menus_hd_enable ? L"Menus: HD" : L"Menus: SD");
m_settingslist.SetText(SETTING_GAMMA_CORRECTION_ENABLED, g_console.gamma_correction ? L"Gamma correction: ON" : L"Gamma correction: OFF");
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, g_extern.console.rmenu.state.msg_info.enable ? L"Info messages: ON" : L"Info messages: OFF");
m_settingslist.SetText(SETTING_EMU_MENUS, g_extern.console.rmenu.state.menus_hd.enable ? L"Menus: HD" : L"Menus: SD");
m_settingslist.SetText(SETTING_GAMMA_CORRECTION_ENABLED, g_extern.console.screen.gamma_correction ? L"Gamma correction: ON" : L"Gamma correction: OFF");
m_settingslist.SetText(SETTING_HW_TEXTURE_FILTER, g_settings.video.smooth ? L"Hardware filtering shader #1: Linear interpolation" : L"Hardware filtering shader #1: Point filtering");
m_settingslist.SetText(SETTING_HW_TEXTURE_FILTER_2, g_settings.video.second_pass_smooth ? L"Hardware filtering shader #2: Linear interpolation" : L"Hardware filtering shader #2: Point filtering");
m_settingslist.SetText(SETTING_SCALE_ENABLED, g_console.fbo_enabled ? L"Custom Scaling/Dual Shaders: ON" : L"Custom Scaling/Dual Shaders: OFF");
m_settingslist.SetText(SETTING_SCALE_ENABLED, g_settings.video.fbo.enable ? L"Custom Scaling/Dual Shaders: ON" : L"Custom Scaling/Dual Shaders: OFF");
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_SHADER, sizeof(strw_buffer));
m_settingslist.SetText(SETTING_SHADER, strw_buffer);
m_settingslist.SetText(SETTING_COLOR_FORMAT, g_console.color_format ? L"Color format: 32bit ARGB" : L"Color format: 16bit RGBA");
m_settingslist.SetText(SETTING_COLOR_FORMAT, g_settings.video.color_format ? L"Color format: 32bit ARGB" : L"Color format: 16bit RGBA");
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_SHADER_2, sizeof(strw_buffer));
m_settingslist.SetText(SETTING_SHADER_2, strw_buffer);
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_SCALE_FACTOR, sizeof(strw_buffer));
@ -413,52 +413,52 @@ HRESULT CRetroArchSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
rarch_settings_change(S_REWIND);
m_settingslist.SetText(SETTING_EMU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF");
if (g_console.info_msg_enable)
if (g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
break;
case SETTING_EMU_SHOW_INFO_MSG:
g_console.info_msg_enable = !g_console.info_msg_enable;
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, g_console.info_msg_enable ? L"Info messages: ON" : L"Info messages: OFF");
g_extern.console.rmenu.state.msg_info.enable = !g_settings.console.rmenu.state.msg_info.enable;
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, g_extern.console.rmenu.state.msg_info.enable ? L"Info messages: ON" : L"Info messages: OFF");
break;
case SETTING_EMU_MENUS:
g_console.menus_hd_enable = !g_console.menus_hd_enable;
m_settingslist.SetText(SETTING_EMU_MENUS, g_console.menus_hd_enable ? L"Menus: HD" : L"Menus: SD");
g_extern.console.rmenu.state.menus_hd.enable = !g_extern.console.rmenu.state.menus_hd.enable;
m_settingslist.SetText(SETTING_EMU_MENUS, g_extern.console.rmenu.state.menus_hd.enable ? L"Menus: HD" : L"Menus: SD");
break;
case SETTING_GAMMA_CORRECTION_ENABLED:
g_console.gamma_correction = g_console.gamma_correction ? 0 : 1;
m_settingslist.SetText(SETTING_GAMMA_CORRECTION_ENABLED, g_console.gamma_correction ? L"Gamma correction: ON" : L"Gamma correction: OFF");
if(g_console.info_msg_enable)
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
g_extern.console.screen.gamma_correction = g_extern.console.screen.gamma_correction ? 0 : 1;
m_settingslist.SetText(SETTING_GAMMA_CORRECTION_ENABLED, g_extern.console.screen.gamma_correction ? L"Gamma correction: ON" : L"Gamma correction: OFF");
if (g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
break;
case SETTING_COLOR_FORMAT:
g_console.color_format = !g_console.color_format;
m_settingslist.SetText(SETTING_COLOR_FORMAT, g_console.color_format ? L"Color format: 32bit ARGB" : L"Color format: 16bit RGBA");
if(g_console.info_msg_enable)
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
g_settings.video.color_format = !g_settings.video.color_format;
m_settingslist.SetText(SETTING_COLOR_FORMAT, g_settings.video.color_format ? L"Color format: 32bit ARGB" : L"Color format: 16bit RGBA");
if (g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
break;
case SETTING_SHADER:
set_shader = 1;
hr = XuiSceneCreate(g_console.menus_hd_enable ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_shader_browser.xur", NULL, &app.hShaderBrowser);
hr = XuiSceneCreate(g_extern.console.rmenu.state.menus_hd.enable ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_shader_browser.xur", NULL, &app.hShaderBrowser);
if (hr < 0)
RARCH_ERR("Failed to load scene.\n");
hCur = app.hShaderBrowser;
if (g_console.info_msg_enable)
if (g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_SELECT_SHADER, S_DELAY_180);
NavigateForward(app.hShaderBrowser);
break;
case SETTING_SHADER_2:
set_shader = 2;
hr = XuiSceneCreate(g_console.menus_hd_enable ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_shader_browser.xur", NULL, &app.hShaderBrowser);
hr = XuiSceneCreate(g_extern.console.rmenu.state.menus_hd.enable ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_shader_browser.xur", NULL, &app.hShaderBrowser);
if (hr < 0)
RARCH_ERR("Failed to load scene.\n");
hCur = app.hShaderBrowser;
if (g_console.info_msg_enable)
if (g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_SELECT_SHADER, S_DELAY_180);
NavigateForward(app.hShaderBrowser);
@ -472,9 +472,9 @@ HRESULT CRetroArchSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
m_settingslist.SetText(SETTING_HW_TEXTURE_FILTER_2, g_settings.video.second_pass_smooth ? L"Hardware filtering shader #2: Linear interpolation" : L"Hardware filtering shader #2: Point filtering");
break;
case SETTING_SCALE_ENABLED:
g_console.fbo_enabled = !g_console.fbo_enabled;
m_settingslist.SetText(SETTING_SCALE_ENABLED, g_console.fbo_enabled ? L"Custom Scaling/Dual Shaders: ON" : L"Custom Scaling/Dual Shaders: OFF");
context->set_fbo_enable(g_console.fbo_enabled);
g_settings.video.fbo.enable = !g_settings.video.fbo.enable;
m_settingslist.SetText(SETTING_SCALE_ENABLED, g_settings.video.fbo.enable ? L"Custom Scaling/Dual Shaders: ON" : L"Custom Scaling/Dual Shaders: OFF");
context->set_fbo_enable(g_settings.video.fbo.enable);
break;
case SETTING_ZIP_EXTRACT:
if(g_extern.filebrowser_state.zip_extract_mode < ZIP_EXTRACT_TO_CACHE_DIR)
@ -503,32 +503,32 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
case XUI_CONTROL_NAVIGATE_LEFT:
switch(current_index)
{
case SETTING_EMU_REWIND_ENABLED:
rarch_settings_change(S_REWIND);
m_settingslist.SetText(SETTING_EMU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF");
if (g_console.info_msg_enable)
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
break;
case SETTING_EMU_REWIND_ENABLED:
rarch_settings_change(S_REWIND);
m_settingslist.SetText(SETTING_EMU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF");
if (g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
break;
case SETTING_EMU_SHOW_INFO_MSG:
g_console.info_msg_enable = !g_console.info_msg_enable;
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, g_console.info_msg_enable ? L"Info messages: ON" : L"Info messages: OFF");
g_extern.console.rmenu.state.msg_info.enable = !g_extern.console.rmenu.state.msg_info.enable;
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, g_extern.console.rmenu.state.msg_info.enable ? L"Info messages: ON" : L"Info messages: OFF");
break;
case SETTING_EMU_MENUS:
g_console.menus_hd_enable = !g_console.menus_hd_enable;
m_settingslist.SetText(SETTING_EMU_MENUS, g_console.menus_hd_enable ? L"Menus: HD" : L"Menus: SD");
g_extern.console.rmenu.state.menus_hd_enable = !g_extern.console.rmenu.state.menus_hd_enable;
m_settingslist.SetText(SETTING_EMU_MENUS, g_extern.console.rmenu.state.menus_hd.enable ? L"Menus: HD" : L"Menus: SD");
break;
case SETTING_GAMMA_CORRECTION_ENABLED:
g_console.gamma_correction = g_console.gamma_correction ? 0 : 1;
m_settingslist.SetText(SETTING_GAMMA_CORRECTION_ENABLED, g_console.gamma_correction ? L"Gamma correction: ON" : L"Gamma correction: OFF");
if(g_console.info_msg_enable)
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
g_extern.console.screen.gamma_correction = g_extern.console.screen.gamma_correction ? 0 : 1;
m_settingslist.SetText(SETTING_GAMMA_CORRECTION_ENABLED, g_extern.console.screen.gamma_correction ? L"Gamma correction: ON" : L"Gamma correction: OFF");
if (g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
break;
case SETTING_COLOR_FORMAT:
g_console.color_format = !g_console.color_format;
m_settingslist.SetText(SETTING_COLOR_FORMAT, g_console.color_format ? L"Color format: 32bit ARGB" : L"Color format: 16bit RGBA");
if(g_console.info_msg_enable)
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
g_settings.video.color_format = !g_settings.video.color_format;
m_settingslist.SetText(SETTING_COLOR_FORMAT, g_settings.video.color_format ? L"Color format: 32bit ARGB" : L"Color format: 16bit RGBA");
if (g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
break;
case SETTING_SCALE_FACTOR:
if(vid->fbo_enabled)
@ -541,12 +541,12 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
m_settingslist.SetText(SETTING_SCALE_FACTOR, strw_buffer);
}
}
break;
case SETTING_ZIP_EXTRACT:
if(g_extern.filebrowser_state.zip_extract_mode)
g_extern.filebrowser_state.zip_extract_mode--;
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_ZIP_EXTRACT, sizeof(strw_buffer));
m_settingslist.SetText(SETTING_ZIP_EXTRACT, strw_buffer);
break;
case SETTING_ZIP_EXTRACT:
if(g_extern.filebrowser_state.zip_extract_mode)
g_extern.filebrowser_state.zip_extract_mode--;
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_ZIP_EXTRACT, sizeof(strw_buffer));
m_settingslist.SetText(SETTING_ZIP_EXTRACT, strw_buffer);
break;
case SETTING_HW_TEXTURE_FILTER:
g_settings.video.smooth = !g_settings.video.smooth;
@ -557,9 +557,9 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
m_settingslist.SetText(SETTING_HW_TEXTURE_FILTER_2, g_settings.video.second_pass_smooth ? L"Hardware filtering shader #2: Linear interpolation" : L"Hardware filtering shader #2: Point filtering");
break;
case SETTING_SCALE_ENABLED:
g_console.fbo_enabled = !g_console.fbo_enabled;
m_settingslist.SetText(SETTING_SCALE_ENABLED, g_console.fbo_enabled ? L"Custom Scaling/Dual Shaders: ON" : L"Custom Scaling/Dual Shaders: OFF");
context->set_fbo_enable(g_console.fbo_enabled);
g_settings.video.fbo.enable = !g_settings.video.fbo.enable;
m_settingslist.SetText(SETTING_SCALE_ENABLED, g_settings.video.fbo.enable ? L"Custom Scaling/Dual Shaders: ON" : L"Custom Scaling/Dual Shaders: OFF");
context->set_fbo_enable(g_settings.video.fbo.enable);
break;
default:
break;
@ -569,50 +569,50 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
switch(current_index)
{
case SETTING_EMU_SHOW_INFO_MSG:
g_console.info_msg_enable = !g_console.info_msg_enable;
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, g_console.info_msg_enable ? L"Info messages: ON" : L"Info messages: OFF");
g_extern.console.rmenu.state.msg_info.enable = !g_extern.console.rmenu.state.msg_info.enable;
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, g_extern.console.rmenu.state.msg_info.enable ? L"Info messages: ON" : L"Info messages: OFF");
break;
case SETTING_EMU_MENUS:
g_console.menus_hd_enable = !g_console.menus_hd_enable;
m_settingslist.SetText(SETTING_EMU_MENUS, g_console.menus_hd_enable ? L"Menus: HD" : L"Menus: SD");
g_extern.console.rmenu.state.menus_hd.enable = !g_extern.console.rmenu.state.menus_hd.enable;
m_settingslist.SetText(SETTING_EMU_MENUS, g_extern.console.rmenu.state.menus_hd.enable ? L"Menus: HD" : L"Menus: SD");
break;
case SETTING_GAMMA_CORRECTION_ENABLED:
g_console.gamma_correction = g_console.gamma_correction ? 0 : 1;
m_settingslist.SetText(SETTING_GAMMA_CORRECTION_ENABLED, g_console.gamma_correction ? L"Gamma correction: ON" : L"Gamma correction: OFF");
if(g_console.info_msg_enable)
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
g_extern.console.screen.gamma_correction = g_extern.console.screen.gamma_correction ? 0 : 1;
m_settingslist.SetText(SETTING_GAMMA_CORRECTION_ENABLED, g_extern.console.screen.gamma_correction ? L"Gamma correction: ON" : L"Gamma correction: OFF");
if (g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
break;
case SETTING_COLOR_FORMAT:
g_console.color_format = !g_console.color_format;
m_settingslist.SetText(SETTING_COLOR_FORMAT, g_console.color_format ? L"Color format: 32bit ARGB" : L"Color format: 16bit RGBA");
if(g_console.info_msg_enable)
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
g_settings.video.color_format = !g_settings.video.color_format;
m_settingslist.SetText(SETTING_COLOR_FORMAT, g_settings.video.color_format ? L"Color format: 32bit ARGB" : L"Color format: 16bit RGBA");
if (g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
break;
case SETTING_EMU_REWIND_ENABLED:
rarch_settings_change(S_REWIND);
m_settingslist.SetText(SETTING_EMU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF");
if (g_console.info_msg_enable)
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
break;
case SETTING_SCALE_FACTOR:
if(vid->fbo_enabled)
{
if((g_settings.video.fbo_scale_x < MAX_SCALING_FACTOR))
{
case SETTING_EMU_REWIND_ENABLED:
rarch_settings_change(S_REWIND);
m_settingslist.SetText(SETTING_EMU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF");
if (g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
break;
case SETTING_SCALE_FACTOR:
if(vid->fbo_enabled)
{
if((g_settings.video.fbo_scale_x < MAX_SCALING_FACTOR))
{
rarch_settings_change(S_SCALE_FACTOR_INCREMENT);
//xdk360_gfx_init_fbo(vid);
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_SCALE_FACTOR, sizeof(strw_buffer));
m_settingslist.SetText(SETTING_SCALE_FACTOR, strw_buffer);
}
}
break;
case SETTING_ZIP_EXTRACT:
if(g_extern.filebrowser_state.zip_extract_mode < ZIP_EXTRACT_TO_CACHE_DIR)
g_extern.filebrowser_state.zip_extract_mode++;
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_ZIP_EXTRACT, sizeof(strw_buffer));
m_settingslist.SetText(SETTING_ZIP_EXTRACT, strw_buffer);
break;
//xdk360_gfx_init_fbo(vid);
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_SCALE_FACTOR, sizeof(strw_buffer));
m_settingslist.SetText(SETTING_SCALE_FACTOR, strw_buffer);
}
}
break;
case SETTING_ZIP_EXTRACT:
if(g_extern.filebrowser_state.zip_extract_mode < ZIP_EXTRACT_TO_CACHE_DIR)
g_extern.filebrowser_state.zip_extract_mode++;
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_ZIP_EXTRACT, sizeof(strw_buffer));
m_settingslist.SetText(SETTING_ZIP_EXTRACT, strw_buffer);
break;
case SETTING_HW_TEXTURE_FILTER:
g_settings.video.smooth = !g_settings.video.smooth;
m_settingslist.SetText(SETTING_HW_TEXTURE_FILTER, g_settings.video.smooth ? L"Hardware filtering shader #1: Linear interpolation" : L"Hardware filtering shader #1: Point filtering");
@ -622,12 +622,12 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
m_settingslist.SetText(SETTING_HW_TEXTURE_FILTER_2, g_settings.video.second_pass_smooth ? L"Hardware filtering shader #2: Linear interpolation" : L"Hardware filtering shader #2: Point filtering");
break;
case SETTING_SCALE_ENABLED:
g_console.fbo_enabled = !g_console.fbo_enabled;
m_settingslist.SetText(SETTING_SCALE_ENABLED, g_console.fbo_enabled ? L"Custom Scaling/Dual Shaders: ON" : L"Custom Scaling/Dual Shaders: OFF");
context->set_fbo_enable(g_console.fbo_enabled);
g_settings.video.fbo.enable = !g_settings.video.fbo.enable;
m_settingslist.SetText(SETTING_SCALE_ENABLED, g_settings.video.fbo.enable ? L"Custom Scaling/Dual Shaders: ON" : L"Custom Scaling/Dual Shaders: OFF");
context->set_fbo_enable(g_settings.video.fbo.enable);
break;
default:
break;
default:
break;
}
break;
case XUI_CONTROL_NAVIGATE_UP:
@ -701,7 +701,7 @@ HRESULT CRetroArchQuickMenu::OnControlNavigate(XUIMessageControlNavigate *pContr
rarch_settings_change(S_ROTATION_DECREMENT);
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_ITEM_ORIENTATION, strw_buffer);
video_xdk_d3d.set_rotation(driver.video_data, g_console.screen_orientation);
video_xdk_d3d.set_rotation(driver.video_data, g_extern.console.screen.orientation);
break;
default:
break;
@ -726,7 +726,7 @@ HRESULT CRetroArchQuickMenu::OnControlNavigate(XUIMessageControlNavigate *pContr
rarch_settings_change(S_ROTATION_INCREMENT);
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_ITEM_ORIENTATION, strw_buffer);
video_xdk_d3d.set_rotation(driver.video_data, g_console.screen_orientation);
video_xdk_d3d.set_rotation(driver.video_data, g_extern.console.screen.orientation);
break;
default:
break;
@ -739,7 +739,7 @@ HRESULT CRetroArchQuickMenu::OnControlNavigate(XUIMessageControlNavigate *pContr
if(aspectratio_changed)
{
context->set_aspect_ratio(g_console.aspect_ratio_index);
context->set_aspect_ratio(g_settings.video.aspect_ratio_idx);
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_ITEM_KEEP_ASPECT_RATIO, strw_buffer);
}
@ -773,14 +773,14 @@ HRESULT CRetroArchQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
switch(current_index)
{
case MENU_ITEM_LOAD_STATE:
if (g_console.emulator_initialized)
if (g_extern.console.emulator_initialized)
{
rarch_load_state();
rarch_settings_change(S_RETURN_TO_GAME);
}
break;
case MENU_ITEM_SAVE_STATE:
if (g_console.emulator_initialized)
if (g_extern.console.emulator_initialized)
{
rarch_save_state();
rarch_settings_change(S_RETURN_TO_GAME);
@ -788,43 +788,43 @@ HRESULT CRetroArchQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
break;
case MENU_ITEM_KEEP_ASPECT_RATIO:
rarch_settings_default(S_DEF_ASPECT_RATIO);
context->set_aspect_ratio(g_console.aspect_ratio_index);
context->set_aspect_ratio(g_settings.video.aspect_ratio_idx);
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_ITEM_KEEP_ASPECT_RATIO, strw_buffer);
break;
case MENU_ITEM_OVERSCAN_AMOUNT:
if(g_console.info_msg_enable)
if (g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_NOT_IMPLEMENTED, S_DELAY_180);
break;
case MENU_ITEM_ORIENTATION:
rarch_settings_default(S_DEF_ROTATION);
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_ITEM_ORIENTATION, strw_buffer);
video_xdk_d3d.set_rotation(driver.video_data, g_console.screen_orientation);
video_xdk_d3d.set_rotation(driver.video_data, g_extern.console.screen.orientation);
break;
case MENU_ITEM_RESIZE_MODE:
g_console.input_loop = INPUT_LOOP_RESIZE_MODE;
g_extern.console.input_loop = INPUT_LOOP_RESIZE_MODE;
if (g_console.info_msg_enable)
if (g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_RESIZE_SCREEN, S_DELAY_270);
break;
case MENU_ITEM_FRAME_ADVANCE:
if (g_console.emulator_initialized)
if (g_extern.console.emulator_initialized)
rarch_settings_change(S_FRAME_ADVANCE);
break;
case MENU_ITEM_SCREENSHOT_MODE:
if (g_console.info_msg_enable)
gfx_ctx_xdk_screenshot_dump(NULL);
if (g_extern.console.rmenu.state.msg_info.enable)
gfx_ctx_xdk_screenshot_dump(NULL);
break;
case MENU_ITEM_RESET:
if (g_console.emulator_initialized)
if (g_extern.console.emulator_initialized)
{
rarch_settings_change(S_RETURN_TO_GAME);
rarch_game_reset();
}
break;
case MENU_ITEM_RETURN_TO_GAME:
if (g_console.emulator_initialized)
if (g_extern.console.emulator_initialized)
rarch_settings_change(S_RETURN_TO_GAME);
break;
case MENU_ITEM_QUIT_RARCH:
@ -914,7 +914,7 @@ HRESULT CRetroArchCoreBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandle
convert_wchar_to_char(str_buffer, (const wchar_t *)m_romlist.GetText(index), sizeof(str_buffer));
if(path_file_exists(tmp_browser->current_dir.list->elems[index].data))
{
snprintf(g_console.launch_app_on_exit, sizeof(g_console.launch_app_on_exit), "%s\\%s", filebrowser_get_current_dir(tmp_browser), str_buffer);
snprintf(g_extern.console.external_launch.launch_app, sizeof(g_extern.console.external_launch.launch_app), "%s\\%s", filebrowser_get_current_dir(tmp_browser), str_buffer);
rarch_settings_change(S_RETURN_TO_LAUNCHER);
}
else if(tmp_browser->current_dir.list->elems[index].attr.b)
@ -954,7 +954,7 @@ HRESULT CRetroArchMain::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_RARCH_VERSION, sizeof(strw_buffer));
m_title.SetText(strw_buffer);
g_console.input_loop = INPUT_LOOP_NONE;
g_extern.console.input_loop = INPUT_LOOP_NONE;
return 0;
}
@ -963,13 +963,13 @@ HRESULT CRetroArchMain::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
{
xdk_d3d_video_t *vid = (xdk_d3d_video_t*)driver.video_data;
bool hdmenus_allowed = g_console.menus_hd_enable;
bool hdmenus_allowed = g_extern.console.rmenu.state.menus_hd.enable;
HRESULT hr;
if ( hObjPressed == m_filebrowser )
{
g_console.input_loop = INPUT_LOOP_FILEBROWSER;
g_extern.console.rmenu.input_loop = INPUT_LOOP_FILEBROWSER;
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_filebrowser.xur", NULL, &app.hFileBrowser);
if (hr < 0)
@ -1001,7 +1001,7 @@ HRESULT CRetroArchMain::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
hCur = app.hControlsMenu;
if (g_console.info_msg_enable)
if (g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_CHANGE_CONTROLS, S_DELAY_180);
NavigateForward(app.hControlsMenu);
@ -1016,7 +1016,7 @@ HRESULT CRetroArchMain::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
}
hCur = app.hCoreBrowser;
if (g_console.info_msg_enable)
if (g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_SELECT_LIBRETRO_CORE, S_DELAY_180);
NavigateForward(app.hCoreBrowser);
@ -1046,7 +1046,7 @@ void menu_init (void)
xdk_d3d_video_t *vid = (xdk_d3d_video_t*)driver.video_data;
bool hdmenus_allowed = g_console.menus_hd_enable;
bool hdmenus_allowed = g_extern.console.rmenu.state.menus_hd.enable;
hr = app.InitShared(vid->d3d_render_device, &vid->d3dpp, XuiPNGTextureLoader);
@ -1083,7 +1083,7 @@ void menu_init (void)
browser = (filebrowser_t*)malloc(1 * sizeof(filebrowser_t));
tmp_browser = (filebrowser_t*)malloc(1 * sizeof(filebrowser_t));
filebrowser_new(browser, g_console.default_rom_startup_dir, rarch_console_get_rom_ext());
filebrowser_new(browser, g_extern.console.main_wrap.paths.default_rom_startup_dir, rarch_console_get_rom_ext());
}
void menu_free (void)
@ -1102,34 +1102,34 @@ static void ingame_menu_resize (void)
XInputGetState(0, &state);
if(state.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_LEFT || state.Gamepad.sThumbLX < -DEADZONE)
g_console.viewports.custom_vp.x -= 1;
g_extern.console.screen.viewports.custom_vp.x -= 1;
else if (state.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_RIGHT || state.Gamepad.sThumbLX > DEADZONE)
g_console.viewports.custom_vp.x += 1;
g_extern.console.screen.viewports.custom_vp.x += 1;
if (state.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP || state.Gamepad.sThumbLY > DEADZONE)
g_console.viewports.custom_vp.y += 1;
g_extern.console.screen.viewports.custom_vp.y += 1;
else if (state.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_DOWN || state.Gamepad.sThumbLY < -DEADZONE)
g_console.viewports.custom_vp.y -= 1;
g_extern.console.screen.viewports.custom_vp.y -= 1;
if (state.Gamepad.sThumbRX < -DEADZONE || state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB)
g_console.viewports.custom_vp.width -= 1;
g_extern.console.screen.viewports.custom_vp.width -= 1;
else if (state.Gamepad.sThumbRX > DEADZONE || state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB)
g_console.viewports.custom_vp.width += 1;
g_extern.console.screen.viewports.custom_vp.width += 1;
if (state.Gamepad.sThumbRY > DEADZONE || state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_SHOULDER)
g_console.viewports.custom_vp.height += 1;
g_extern.console.screen.viewports.custom_vp.height += 1;
else if (state.Gamepad.sThumbRY < -DEADZONE || state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_SHOULDER)
g_console.viewports.custom_vp.height -= 1;
g_extern.console.screen.viewports.custom_vp.height -= 1;
if (state.Gamepad.wButtons & XINPUT_GAMEPAD_Y)
{
g_console.viewports.custom_vp.x = 0;
g_console.viewports.custom_vp.y = 0;
g_console.viewports.custom_vp.width = 1280; //FIXME: hardcoded
g_console.viewports.custom_vp.height = 720; //FIXME: hardcoded
g_extern.console.screen.viewports.custom_vp.x = 0;
g_extern.console.screen.viewports.custom_vp.y = 0;
g_extern.console.screen.viewports.custom_vp.width = 1280; //FIXME: hardcoded
g_extern.console.screen.viewports.custom_vp.height = 720; //FIXME: hardcoded
}
if(state.Gamepad.wButtons & XINPUT_GAMEPAD_B)
g_console.input_loop = INPUT_LOOP_MENU;
g_extern.console.rmenu.input_loop = INPUT_LOOP_MENU;
}
void menu_loop(void)
@ -1137,15 +1137,15 @@ void menu_loop(void)
HRESULT hr;
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
g_console.menu_enable = true;
g_extern.console.rmenu.state.rmenu.enable = true;
d3d->block_swap = true;
g_console.input_loop = INPUT_LOOP_MENU;
g_extern.console.rmenu.input_loop = INPUT_LOOP_MENU;
do
{
if(g_console.emulator_initialized)
if(g_extern.console.emulator_initialized)
rarch_render_cached_frame();
else
{
@ -1156,13 +1156,13 @@ void menu_loop(void)
XINPUT_STATE state;
XInputGetState(0, &state);
g_console.menu_enable = !((state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB)
&& (state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) && (g_console.emulator_initialized)
g_extern.console.rmenu.state.rmenu.enable = !((state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB)
&& (state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) && (g_extern.console.emulator_initialized)
&& IS_TIMER_EXPIRED(d3d));
g_extern.console.mode = g_console.menu_enable ? MODE_MENU : MODE_EMULATION;
g_extern.console.mode = g_extern.console.rmenu.state.rmenu.enable ? MODE_MENU : MODE_EMULATION;
switch(g_console.input_loop)
switch(g_extern.console.input_loop)
{
case INPUT_LOOP_FILEBROWSER:
/*
@ -1188,7 +1188,7 @@ void menu_loop(void)
hr = app.Render(); /* Render XUI */
hr = XuiTimersRun(); /* Update XUI timers */
if(g_extern.console.mode == MODE_EMULATION && !g_console.frame_advance_enable)
if(g_extern.console.mode == MODE_EMULATION && !g_extern.console.screen.state.frame_advance.enable)
{
SET_TIMER_EXPIRATION(d3d, 30);
}
@ -1202,9 +1202,9 @@ void menu_loop(void)
}
context->swap_buffers();
}while(g_console.menu_enable);
}while(g_extern.console.rmenu.state.rmenu.enable);
d3d->block_swap = false;
g_console.ingame_menu_enable = false;
g_extern.console.rmenu.state.ingame_menu.enable = false;
}

View File

@ -354,7 +354,7 @@ static void *dsound_init(const char *device, unsigned rate, unsigned latency)
IDirectSoundBuffer_SetVolume(ds->dsb, DSBVOLUME_MAX);
#ifdef _XBOX
if(g_console.sound_volume_level == 1)
if(g_extern.console.sound.volume_level == 1)
{
dsmb.dwMixBinCount = 8;
dsmb.lpMixBinVolumePairs = dsmbvp;

View File

@ -63,12 +63,5 @@
#define CONFIG_GET_STRING_EXTERN(var, key) CONFIG_GET_STRING_BASE(conf, g_extern, var, key)
#define CONFIG_GET_PATH_EXTERN(var, key) CONFIG_GET_PATH_BASE(conf, g_extern, var, key)
#ifdef RARCH_CONSOLE
#define CONFIG_GET_BOOL_CONSOLE(var, key) CONFIG_GET_BOOL_BASE(conf, g_console, var, key)
#define CONFIG_GET_INT_CONSOLE(var, key) CONFIG_GET_INT_BASE(conf, g_console, var, key)
#define CONFIG_GET_FLOAT_CONSOLE(var, key) CONFIG_GET_FLOAT_BASE(conf, g_console, var, key)
#define CONFIG_GET_STRING_CONSOLE(var, key) CONFIG_GET_STRING_BASE(conf, g_console, var, key)
#endif
#endif

View File

@ -54,13 +54,17 @@ void rarch_config_load(const char *conf_name, bool upgrade_core_succeeded)
CONFIG_GET_STRING(video.cg_shader_path, "video_cg_shader");
#ifdef HAVE_FBO
CONFIG_GET_STRING(video.second_pass_shader, "video_second_pass_shader");
CONFIG_GET_FLOAT(video.fbo_scale_x, "video_fbo_scale_x");
CONFIG_GET_FLOAT(video.fbo_scale_y, "video_fbo_scale_y");
CONFIG_GET_FLOAT(video.fbo.scale_x, "video_fbo_scale_x");
CONFIG_GET_FLOAT(video.fbo.scale_y, "video_fbo_scale_y");
CONFIG_GET_BOOL(video.render_to_texture, "video_render_to_texture");
CONFIG_GET_BOOL(video.second_pass_smooth, "video_second_pass_smooth");
#endif
CONFIG_GET_BOOL(video.smooth, "video_smooth");
#ifdef HAVE_FBO
CONFIG_GET_BOOL(video.fbo.enable, "fbo_enabled");
#endif
CONFIG_GET_BOOL(video.vsync, "video_vsync");
CONFIG_GET_INT(video.aspect_ratio_idx, "aspect_ratio_index");
CONFIG_GET_FLOAT(video.aspect_ratio, "video_aspect_ratio");
CONFIG_GET_STRING(audio.device, "audio_device");
CONFIG_GET_BOOL(audio.rate_control, "audio_rate_control");
@ -75,46 +79,37 @@ void rarch_config_load(const char *conf_name, bool upgrade_core_succeeded)
CONFIG_GET_INT(input.device[i], cfg);
}
// g_console
#ifdef HAVE_FBO
CONFIG_GET_BOOL_CONSOLE(fbo_enabled, "fbo_enabled");
// g_extern
CONFIG_GET_STRING_EXTERN(console.main_wrap.paths.default_rom_startup_dir, "default_rom_startup_dir");
CONFIG_GET_BOOL_EXTERN(console.screen.gamma_correction, "gamma_correction");
CONFIG_GET_BOOL_EXTERN(console.rmenu.state.msg_info.enable, "info_msg_enable");
CONFIG_GET_BOOL_EXTERN(console.screen.state.screenshots.enable, "screenshots_enable");
CONFIG_GET_BOOL_EXTERN(console.screen.state.throttle.enable, "throttle_enable");
CONFIG_GET_BOOL_EXTERN(console.screen.state.triple_buffering.enable, "triple_buffering_enable");
CONFIG_GET_BOOL_EXTERN(console.screen.state.overscan.enable, "overscan_enable");
CONFIG_GET_BOOL_EXTERN(console.sound.custom_bgm.enable, "custom_bgm_enable");
CONFIG_GET_FLOAT_EXTERN(console.screen.overscan_amount, "overscan_amount");
#ifdef _XBOX1
CONFIG_GET_INT_EXTERN(console.screen.state.flicker_filter.enable, "flicker_filter");
CONFIG_GET_INT_EXTERN(console.sound.volume_level, "sound_volume_level");
#endif
#ifdef __CELLOS_LV2__
CONFIG_GET_BOOL_CONSOLE(custom_bgm_enable, "custom_bgm_enable");
#endif
CONFIG_GET_BOOL_CONSOLE(overscan_enable, "overscan_enable");
CONFIG_GET_BOOL_CONSOLE(screenshots_enable, "screenshots_enable");
CONFIG_GET_BOOL_CONSOLE(throttle_enable, "throttle_enable");
CONFIG_GET_BOOL_CONSOLE(triple_buffering_enable, "triple_buffering_enable");
CONFIG_GET_BOOL_CONSOLE(info_msg_enable, "info_msg_enable");
CONFIG_GET_INT_CONSOLE(aspect_ratio_index, "aspect_ratio_index");
CONFIG_GET_INT_CONSOLE(current_resolution_id, "current_resolution_id");
CONFIG_GET_INT_CONSOLE(viewports.custom_vp.x, "custom_viewport_x");
CONFIG_GET_INT_CONSOLE(viewports.custom_vp.y, "custom_viewport_y");
CONFIG_GET_INT_CONSOLE(viewports.custom_vp.width, "custom_viewport_width");
CONFIG_GET_INT_CONSOLE(viewports.custom_vp.height, "custom_viewport_height");
CONFIG_GET_INT_CONSOLE(screen_orientation, "screen_orientation");
CONFIG_GET_INT_CONSOLE(sound_mode, "sound_mode");
#ifdef HAVE_ZLIB
CONFIG_GET_INT_EXTERN(filebrowser_state.zip_extract_mode, "zip_extract_mode");
CONFIG_GET_INT_EXTERN(file_state.zip_extract_mode, "zip_extract_mode");
#endif
#ifdef _XBOX360
CONFIG_GET_INT_CONSOLE(color_format, "color_format");
CONFIG_GET_INT(video.color_format, "color_format");
#endif
CONFIG_GET_BOOL_CONSOLE(gamma_correction, "gamma_correction");
#ifdef _XBOX1
CONFIG_GET_INT_CONSOLE(flicker_filter, "flicker_filter");
CONFIG_GET_INT_CONSOLE(sound_volume_level, "sound_volume_level");
#endif
CONFIG_GET_BOOL_CONSOLE(soft_display_filter_enable, "soft_display_filter_enable");
CONFIG_GET_STRING_CONSOLE(default_rom_startup_dir, "default_rom_startup_dir");
CONFIG_GET_FLOAT_EXTERN(console.font_size, "menu_font_size");
CONFIG_GET_FLOAT_CONSOLE(overscan_amount, "overscan_amount");
// g_extern
CONFIG_GET_INT_EXTERN(console.screen.resolutions.current.id, "current_resolution_id");
CONFIG_GET_INT_EXTERN(state_slot, "state_slot");
CONFIG_GET_INT_EXTERN(audio_data.mute, "audio_mute");
CONFIG_GET_BOOL_EXTERN(console.screen.state.soft_filter.enable, "soft_display_filter_enable");
CONFIG_GET_INT_EXTERN(console.screen.orientation, "screen_orientation");
CONFIG_GET_INT_EXTERN(console.sound.mode, "sound_mode");
CONFIG_GET_INT_EXTERN(console.screen.viewports.custom_vp.x, "custom_viewport_x");
CONFIG_GET_INT_EXTERN(console.screen.viewports.custom_vp.y, "custom_viewport_y");
CONFIG_GET_INT_EXTERN(console.screen.viewports.custom_vp.width, "custom_viewport_width");
CONFIG_GET_INT_EXTERN(console.screen.viewports.custom_vp.height, "custom_viewport_height");
CONFIG_GET_FLOAT_EXTERN(console.rmenu.font_size, "menu_font_size");
if(upgrade_core_succeeded)
{
@ -143,14 +138,17 @@ void rarch_config_save(const char * conf_name)
config_set_string(conf, "video_cg_shader", g_settings.video.cg_shader_path);
config_set_float(conf, "video_aspect_ratio", g_settings.video.aspect_ratio);
#ifdef HAVE_FBO
config_set_float(conf, "video_fbo_scale_x", g_settings.video.fbo_scale_x);
config_set_float(conf, "video_fbo_scale_y", g_settings.video.fbo_scale_y);
config_set_float(conf, "video_fbo_scale_x", g_settings.video.fbo.scale_x);
config_set_float(conf, "video_fbo_scale_y", g_settings.video.fbo.scale_y);
config_set_string(conf, "video_second_pass_shader", g_settings.video.second_pass_shader);
config_set_bool(conf, "video_render_to_texture", g_settings.video.render_to_texture);
config_set_bool(conf, "video_second_pass_smooth", g_settings.video.second_pass_smooth);
config_set_bool(conf, "fbo_enabled", g_settings.video.fbo.enable);
#endif
config_set_bool(conf, "video_smooth", g_settings.video.smooth);
config_set_bool(conf, "video_vsync", g_settings.video.vsync);
config_set_int(conf, "aspect_ratio_index", g_settings.video.aspect_ratio_idx);
config_set_int(conf, "color_format", g_settings.video.color_format);
config_set_string(conf, "audio_device", g_settings.audio.device);
config_set_bool(conf, "audio_rate_control", g_settings.audio.rate_control);
config_set_float(conf, "audio_rate_control_delta", g_settings.audio.rate_control_delta);
@ -164,44 +162,35 @@ void rarch_config_save(const char * conf_name)
config_set_int(conf, cfg, g_settings.input.device[i]);
}
#ifdef RARCH_CONSOLE
config_set_bool(conf, "fbo_enabled", g_console.fbo_enabled);
#ifdef __CELLOS_LV2__
config_set_bool(conf, "custom_bgm_enable", g_console.custom_bgm_enable);
#endif
config_set_bool(conf, "overscan_enable", g_console.overscan_enable);
config_set_bool(conf, "screenshots_enable", g_console.screenshots_enable);
config_set_bool(conf, "gamma_correction", g_console.gamma_correction);
#ifdef _XBOX360
config_set_int(conf, "color_format", g_console.color_format);
#endif
config_set_bool(conf, "soft_display_filter_enable", g_console.soft_display_filter_enable);
config_set_bool(conf, "overscan_enable", g_extern.console.screen.state.overscan.enable);
config_set_bool(conf, "screenshots_enable", g_extern.console.screen.state.screenshots.enable);
config_set_bool(conf, "gamma_correction", g_extern.console.screen.gamma_correction);
#ifdef _XBOX1
config_set_int(conf, "flicker_filter", g_console.flicker_filter);
config_set_int(conf, "sound_volume_level", g_console.sound_volume_level);
config_set_int(conf, "flicker_filter", g_extern.console.screen.state.flicker_filter.value);
config_set_int(conf, "sound_volume_level", g_extern.console.sound.volume_level);
#endif
config_set_bool(conf, "throttle_enable", g_console.throttle_enable);
config_set_bool(conf, "triple_buffering_enable", g_console.triple_buffering_enable);
config_set_bool(conf, "info_msg_enable", g_console.info_msg_enable);
config_set_int(conf, "sound_mode", g_console.sound_mode);
config_set_int(conf, "aspect_ratio_index", g_console.aspect_ratio_index);
config_set_int(conf, "current_resolution_id", g_console.current_resolution_id);
config_set_int(conf, "custom_viewport_width", g_console.viewports.custom_vp.width);
config_set_int(conf, "custom_viewport_height", g_console.viewports.custom_vp.height);
config_set_int(conf, "custom_viewport_x", g_console.viewports.custom_vp.x);
config_set_int(conf, "custom_viewport_y", g_console.viewports.custom_vp.y);
config_set_int(conf, "screen_orientation", g_console.screen_orientation);
config_set_string(conf, "default_rom_startup_dir", g_console.default_rom_startup_dir);
config_set_float(conf, "menu_font_size", g_extern.console.font_size);
config_set_float(conf, "overscan_amount", g_console.overscan_amount);
config_set_bool(conf, "throttle_enable", g_extern.console.screen.state.throttle.enable);
config_set_bool(conf, "triple_buffering_enable", g_extern.console.screen.state.triple_buffering.enable);
config_set_bool(conf, "info_msg_enable", g_extern.console.rmenu.state.msg_info.enable);
config_set_int(conf, "current_resolution_id", g_extern.console.screen.resolutions.current.id);
config_set_int(conf, "custom_viewport_width", g_extern.console.screen.viewports.custom_vp.width);
config_set_int(conf, "custom_viewport_height", g_extern.console.screen.viewports.custom_vp.height);
config_set_int(conf, "custom_viewport_x", g_extern.console.screen.viewports.custom_vp.x);
config_set_int(conf, "custom_viewport_y", g_extern.console.screen.viewports.custom_vp.y);
config_set_string(conf, "default_rom_startup_dir", g_extern.console.main_wrap.paths.default_rom_startup_dir);
config_set_float(conf, "menu_font_size", g_extern.console.rmenu.font_size);
config_set_float(conf, "overscan_amount", g_extern.console.screen.overscan_amount);
#ifdef HAVE_ZLIB
config_set_int(conf, "zip_extract_mode", g_extern.filebrowser_state.zip_extract_mode);
#endif
config_set_int(conf, "zip_extract_mode", g_extern.file_state.zip_extract_mode);
#endif
// g_extern
config_set_int(conf, "sound_mode", g_extern.console.sound.mode);
config_set_int(conf, "state_slot", g_extern.state_slot);
config_set_int(conf, "audio_mute", g_extern.audio_data.mute);
config_set_bool(conf, "soft_display_filter_enable", g_extern.console.screen.state.soft_filter.enable);
config_set_int(conf, "screen_orientation", g_extern.console.screen.orientation);
config_set_bool(conf, "custom_bgm_enable", g_extern.console.sound.custom_bgm.enable);
if (!config_file_write(conf, conf_name))
RARCH_ERR("Failed to write config file to \"%s\". Check permissions.\n", conf_name);

View File

@ -83,18 +83,18 @@ bool rarch_startup (const char * config_path)
{
bool retval = false;
if(g_console.initialize_rarch_enable)
if(g_extern.console.initialize_rarch_enable)
{
if(g_console.emulator_initialized)
if(g_extern.console.emulator_initialized)
rarch_main_deinit();
struct rarch_main_wrap args = {0};
args.verbose = g_extern.verbose;
args.config_path = config_path;
args.sram_path = g_console.default_sram_dir_enable ? g_console.default_sram_dir : NULL,
args.state_path = g_console.default_savestate_dir_enable ? g_console.default_savestate_dir : NULL,
args.rom_path = g_extern.filebrowser_state.rom_path;
args.sram_path = g_extern.console.main_wrap.state.default_sram_dir.enable ? g_extern.console.main_wrap.paths.default_sram_dir : NULL,
args.state_path = g_extern.console.main_wrap.state.default_savestate_dir.enable ? g_extern.console.main_wrap.paths.default_savestate_dir : NULL,
args.rom_path = g_extern.file_state.rom_path;
#ifdef HAVE_DYLIB
args.libretro_path = g_settings.libretro;
#endif
@ -104,15 +104,15 @@ bool rarch_startup (const char * config_path)
if(init_ret == 0)
{
g_console.emulator_initialized = 1;
g_console.initialize_rarch_enable = 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_console.emulator_initialized = 0;
g_extern.console.mode = MODE_MENU;
g_extern.console.emulator_initialized = 0;
g_extern.console.rmenu.mode = MODE_MENU;
rarch_settings_msg(S_MSG_ROM_LOADING_ERROR, S_DELAY_180);
}
}

View File

@ -34,7 +34,7 @@
static void rarch_console_load_game(const char *path)
{
snprintf(g_extern.filebrowser_state.rom_path, sizeof(g_extern.filebrowser_state.rom_path), path);
snprintf(g_extern.file_state.rom_path, sizeof(g_extern.file_state.rom_path), path);
rarch_settings_change(S_START_RARCH);
}
@ -68,12 +68,12 @@ void rarch_console_load_game_wrap(const char *path, unsigned extract_zip_mode, u
fill_pathname_basedir(dir_path_temp, rom_path_temp, sizeof(dir_path_temp));
rarch_extract_zipfile(rom_path_temp, dir_path_temp, first_file_inzip, sizeof(first_file_inzip), extract_zip_mode);
if(g_console.info_msg_enable)
if(g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_EXTRACTED_ZIPFILE, S_DELAY_180);
}
extract_zip_and_load_game_cond = (extract_zip_cond &&
g_extern.filebrowser_state.zip_extract_mode == ZIP_EXTRACT_TO_CURRENT_DIR_AND_LOAD_FIRST_FILE);
g_extern.file_state.zip_extract_mode == ZIP_EXTRACT_TO_CURRENT_DIR_AND_LOAD_FIRST_FILE);
load_game = (extract_zip_and_load_game_cond) || (!extract_zip_cond);
if(extract_zip_and_load_game_cond)
@ -86,7 +86,7 @@ void rarch_console_load_game_wrap(const char *path, unsigned extract_zip_mode, u
{
rarch_console_load_game(game_to_load);
if(g_console.info_msg_enable)
if(g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_LOADING_ROM, delay);
}
}

View File

@ -27,12 +27,12 @@ void rarch_settings_change(unsigned setting)
switch(setting)
{
case S_ASPECT_RATIO_DECREMENT:
if(g_console.aspect_ratio_index > 0)
g_console.aspect_ratio_index--;
if(g_settings.video.aspect_ratio_idx > 0)
g_settings.video.aspect_ratio_idx--;
break;
case S_ASPECT_RATIO_INCREMENT:
if(g_console.aspect_ratio_index < LAST_ASPECT_RATIO)
g_console.aspect_ratio_index++;
if(g_settings.video.aspect_ratio_idx < LAST_ASPECT_RATIO)
g_settings.video.aspect_ratio_idx++;
break;
case S_AUDIO_MUTE:
g_extern.audio_data.mute = !g_extern.audio_data.mute;
@ -51,9 +51,9 @@ void rarch_settings_change(unsigned setting)
g_settings.audio.rate_control = true;
break;
case S_FRAME_ADVANCE:
g_extern.console.frame_advance_enable = true;
g_extern.console.enable = false;
g_extern.console.mode = MODE_EMULATION;
g_extern.console.screen.state.frame_advance.enable = true;
g_extern.console.rmenu.state.rmenu.enable = false;
g_extern.console.rmenu.mode = MODE_EMULATION;
break;
case S_HW_TEXTURE_FILTER:
g_settings.video.smooth = !g_settings.video.smooth;
@ -62,69 +62,69 @@ void rarch_settings_change(unsigned setting)
g_settings.video.second_pass_smooth = !g_settings.video.second_pass_smooth;
break;
case S_OVERSCAN_DECREMENT:
g_console.overscan_amount -= 0.01f;
g_console.overscan_enable = true;
if(g_console.overscan_amount == 0.0f)
g_console.overscan_enable = false;
g_extern.console.screen.overscan_amount -= 0.01f;
g_extern.console.screen.state.overscan.enable = true;
if(g_extern.console.screen.overscan_amount == 0.0f)
g_extern.console.screen.state.overscan.enable = false;
break;
case S_OVERSCAN_INCREMENT:
g_console.overscan_amount += 0.01f;
g_console.overscan_enable = true;
if(g_console.overscan_amount == 0.0f)
g_console.overscan_enable = 0;
g_extern.console.screen.overscan_amount += 0.01f;
g_extern.console.screen.state.overscan.enable = true;
if(g_extern.console.screen.overscan_amount == 0.0f)
g_extern.console.screen.state.overscan.enable = 0;
break;
case S_RESOLUTION_PREVIOUS:
if (g_console.current_resolution_index)
if (g_extern.console.screen.resolutions.current.idx)
{
g_console.current_resolution_index--;
g_console.current_resolution_id = g_console.supported_resolutions[g_console.current_resolution_index];
g_extern.console.screen.resolutions.current.idx--;
g_extern.console.screen.resolutions.current.id = g_extern.console.screen.resolutions.list[g_extern.console.screen.resolutions.current.idx];
}
break;
case S_RESOLUTION_NEXT:
if (g_console.current_resolution_index + 1 < g_console.supported_resolutions_count)
if (g_extern.console.screen.resolutions.current.idx + 1 < g_extern.console.screen.resolutions.count)
{
g_console.current_resolution_index++;
g_console.current_resolution_id = g_console.supported_resolutions[g_console.current_resolution_index];
g_extern.console.screen.resolutions.current.idx++;
g_extern.console.screen.resolutions.current.id = g_extern.console.screen.resolutions.list[g_extern.console.screen.resolutions.current.idx];
}
break;
case S_QUIT:
g_extern.console.enable = false;
g_extern.console.ingame_menu_enable = false;
g_extern.console.mode = MODE_EXIT;
g_extern.console.rmenu.state.rmenu.enable = false;
g_extern.console.rmenu.state.ingame_menu.enable = false;
g_extern.console.rmenu.mode = MODE_EXIT;
break;
case S_QUIT_RARCH:
g_extern.console.enable = false;
g_console.initialize_rarch_enable = false;
g_extern.console.mode = MODE_EXIT;
g_extern.console.rmenu.state.rmenu.enable = false;
g_extern.console.initialize_rarch_enable = false;
g_extern.console.rmenu.mode = MODE_EXIT;
break;
case S_RETURN_TO_GAME:
g_extern.console.frame_advance_enable = false;
g_extern.console.enable = false;
g_extern.console.mode = MODE_EMULATION;
g_extern.console.screen.state.frame_advance.enable = false;
g_extern.console.rmenu.state.rmenu.enable = false;
g_extern.console.rmenu.mode = MODE_EMULATION;
break;
case S_RETURN_TO_LAUNCHER:
g_console.return_to_launcher = true;
g_extern.console.enable = false;
g_console.initialize_rarch_enable = false;
g_extern.console.mode = MODE_EXIT;
g_extern.console.external_launch.enable = true;
g_extern.console.rmenu.state.rmenu.enable = false;
g_extern.console.initialize_rarch_enable = false;
g_extern.console.rmenu.mode = MODE_EXIT;
break;
case S_RETURN_TO_MENU:
g_extern.console.enable = false;
g_extern.console.ingame_menu_item = 0;
g_extern.console.mode = MODE_MENU;
g_extern.console.rmenu.state.rmenu.enable = false;
g_extern.console.rmenu.ingame_menu.idx = 0;
g_extern.console.rmenu.mode = MODE_MENU;
break;
case S_ROTATION_DECREMENT:
if(g_console.screen_orientation > 0)
g_console.screen_orientation--;
if(g_extern.console.screen.orientation > 0)
g_extern.console.screen.orientation--;
break;
case S_ROTATION_INCREMENT:
if(g_console.screen_orientation < LAST_ORIENTATION)
g_console.screen_orientation++;
if(g_extern.console.screen.orientation < LAST_ORIENTATION)
g_extern.console.screen.orientation++;
break;
case S_START_RARCH:
g_extern.console.enable = false;
g_console.initialize_rarch_enable = 1;
g_extern.console.mode = MODE_EMULATION;
g_extern.console.rmenu.state.rmenu.enable = false;
g_extern.console.initialize_rarch_enable = 1;
g_extern.console.rmenu.mode = MODE_EMULATION;
break;
case S_REWIND:
g_settings.rewind_enable = !g_settings.rewind_enable;
@ -137,22 +137,24 @@ void rarch_settings_change(unsigned setting)
g_extern.state_slot++;
break;
case S_SCALE_ENABLED:
g_console.fbo_enabled = !g_console.fbo_enabled;
g_settings.video.fbo.enable = !g_settings.video.fbo.enable;
break;
case S_SCALE_FACTOR_DECREMENT:
g_settings.video.fbo_scale_x -= 1.0f;
g_settings.video.fbo_scale_y -= 1.0f;
g_settings.video.fbo.scale_x -= 1.0f;
g_settings.video.fbo.scale_y -= 1.0f;
break;
case S_SCALE_FACTOR_INCREMENT:
g_settings.video.fbo_scale_x += 1.0f;
g_settings.video.fbo_scale_y += 1.0f;
g_settings.video.fbo.scale_x += 1.0f;
g_settings.video.fbo.scale_y += 1.0f;
break;
case S_THROTTLE:
if(!g_extern.system.force_nonblock)
g_console.throttle_enable = !g_console.throttle_enable;
g_extern.console.screen.state.throttle.enable =
!g_extern.console.screen.state.throttle.enable;
break;
case S_TRIPLE_BUFFERING:
g_console.triple_buffering_enable = !g_console.triple_buffering_enable;
g_extern.console.screen.state.triple_buffering.enable =
!g_extern.console.screen.state.triple_buffering.enable;
break;
}
}
@ -162,7 +164,7 @@ void rarch_settings_default(unsigned setting)
switch(setting)
{
case S_DEF_ASPECT_RATIO:
g_console.aspect_ratio_index = ASPECT_RATIO_4_3;
g_settings.video.aspect_ratio_idx = ASPECT_RATIO_4_3;
break;
case S_DEF_AUDIO_MUTE:
g_extern.audio_data.mute = false;
@ -183,30 +185,30 @@ void rarch_settings_default(unsigned setting)
g_settings.video.second_pass_smooth = 1;
break;
case S_DEF_OVERSCAN:
g_console.overscan_amount = 0.0f;
g_console.overscan_enable = false;
g_extern.console.screen.overscan_amount = 0.0f;
g_extern.console.screen.state.overscan.enable = false;
break;
case S_DEF_ROTATION:
g_console.screen_orientation = ORIENTATION_NORMAL;
g_extern.console.screen.orientation = ORIENTATION_NORMAL;
break;
case S_DEF_THROTTLE:
if(!g_extern.system.force_nonblock)
g_console.throttle_enable = true;
g_extern.console.screen.state.throttle.enable = true;
break;
case S_DEF_TRIPLE_BUFFERING:
g_console.triple_buffering_enable = true;
g_extern.console.screen.state.triple_buffering.enable = true;
break;
case S_DEF_SAVE_STATE:
g_extern.state_slot = 0;
break;
case S_DEF_SCALE_ENABLED:
g_console.fbo_enabled = true;
g_settings.video.fbo_scale_x = 2.0f;
g_settings.video.fbo_scale_y = 2.0f;
g_settings.video.fbo.enable = true;
g_settings.video.fbo.scale_x = 2.0f;
g_settings.video.fbo.scale_y = 2.0f;
break;
case S_DEF_SCALE_FACTOR:
g_settings.video.fbo_scale_x = 2.0f;
g_settings.video.fbo_scale_y = 2.0f;
g_settings.video.fbo.scale_x = 2.0f;
g_settings.video.fbo.scale_y = 2.0f;
break;
}
}
@ -227,7 +229,7 @@ void rarch_settings_msg(unsigned setting, unsigned delay)
snprintf(str, sizeof(str), "INFO - Press LEFT/RIGHT to change the controls, and press\n[RetroPad Start] to reset a button to default values.");
break;
case S_MSG_EXTRACTED_ZIPFILE:
switch(g_extern.filebrowser_state.zip_extract_mode)
switch(g_extern.file_state.zip_extract_mode)
{
case ZIP_EXTRACT_TO_CURRENT_DIR:
snprintf(str, sizeof(str), "INFO - ZIP file successfully extracted to current directory.");
@ -243,7 +245,7 @@ void rarch_settings_msg(unsigned setting, unsigned delay)
}
break;
case S_MSG_LOADING_ROM:
fill_pathname_base(tmp, g_extern.filebrowser_state.rom_path, sizeof(tmp));
fill_pathname_base(tmp, g_extern.file_state.rom_path, sizeof(tmp));
snprintf(str, sizeof(str), "INFO - Loading %s...", tmp);
break;
case S_MSG_DIR_LOADING_ERROR:
@ -288,7 +290,7 @@ void rarch_settings_create_menu_item_label(char * str, unsigned setting, size_t
switch (setting)
{
case S_LBL_ASPECT_RATIO:
snprintf(str, size, "Aspect Ratio: %s", aspectratio_lut[g_console.aspect_ratio_index].name);
snprintf(str, size, "Aspect Ratio: %s", aspectratio_lut[g_settings.video.aspect_ratio_idx].name);
break;
case S_LBL_SHADER:
snprintf(str, size, "Shader #1: %s", g_settings.video.cg_shader_path);
@ -300,10 +302,10 @@ void rarch_settings_create_menu_item_label(char * str, unsigned setting, size_t
snprintf(str, size, "RetroArch %s", PACKAGE_VERSION);
break;
case S_LBL_SCALE_FACTOR:
snprintf(str, size, "Scale Factor: %f (X) / %f (Y)", g_settings.video.fbo_scale_x, g_settings.video.fbo_scale_y);
snprintf(str, size, "Scale Factor: %f (X) / %f (Y)", g_settings.video.fbo.scale_x, g_settings.video.fbo.scale_y);
break;
case S_LBL_ROTATION:
snprintf(str, size, "Rotation: %s", rotation_lut[g_console.screen_orientation]);
snprintf(str, size, "Rotation: %s", rotation_lut[g_extern.console.screen.orientation]);
break;
case S_LBL_LOAD_STATE_SLOT:
snprintf(str, size, "Load State #%d", g_extern.state_slot);
@ -314,7 +316,7 @@ void rarch_settings_create_menu_item_label(char * str, unsigned setting, size_t
case S_LBL_ZIP_EXTRACT:
{
char msg[128];
switch(g_extern.filebrowser_state.zip_extract_mode)
switch(g_extern.file_state.zip_extract_mode)
{
case ZIP_EXTRACT_TO_CURRENT_DIR:
snprintf(msg, sizeof(msg), "Current dir");
@ -353,8 +355,8 @@ void rarch_settings_set_default(void)
#endif
#ifdef HAVE_FBO
g_settings.video.fbo_scale_x = 2.0f;
g_settings.video.fbo_scale_y = 2.0f;
g_settings.video.fbo.scale_x = 2.0f;
g_settings.video.fbo.scale_y = 2.0f;
#endif
#ifdef GEKKO
@ -372,56 +374,53 @@ void rarch_settings_set_default(void)
g_settings.video.msg_pos_x = 0.05f;
g_settings.video.msg_pos_y = 0.90f;
g_settings.video.aspect_ratio = -1.0f;
// g_console
g_console.block_config_read = true;
g_extern.console.frame_advance_enable = false;
g_console.emulator_initialized = 0;
g_console.screenshots_enable = true;
g_console.throttle_enable = true;
g_console.initialize_rarch_enable = false;
g_console.triple_buffering_enable = true;
g_console.default_savestate_dir_enable = false;
g_console.default_sram_dir_enable = false;
#ifdef HAVE_FBO
g_console.fbo_enabled = true;
#else
g_console.fbo_enabled = false;
#endif
g_extern.console.mode = MODE_MENU;
g_console.screen_orientation = ORIENTATION_NORMAL;
g_console.current_resolution_id = 0;
strlcpy(g_console.default_rom_startup_dir, default_paths.filebrowser_startup_dir, sizeof(g_console.default_rom_startup_dir));
strlcpy(g_console.default_savestate_dir, default_paths.savestate_dir, sizeof(g_console.default_savestate_dir));
strlcpy(g_console.default_sram_dir, default_paths.sram_dir, sizeof(g_console.default_sram_dir));
g_console.aspect_ratio_index = 0;
g_extern.console.font_size = 1.0f;
g_console.overscan_enable = false;
g_console.overscan_amount = 0.0f;
g_console.sound_mode = SOUND_MODE_NORMAL;
g_console.viewports.custom_vp.width = 0;
g_console.viewports.custom_vp.height = 0;
g_console.viewports.custom_vp.x = 0;
g_console.viewports.custom_vp.y = 0;
g_console.custom_bgm_enable = true;
g_console.info_msg_enable = true;
#ifdef _XBOX360
g_console.color_format = 0;
#endif
g_console.gamma_correction = DEFAULT_GAMMA;
#ifdef _XBOX1
g_console.flicker_filter = 1;
g_console.sound_volume_level = 0;
#endif
g_console.soft_display_filter_enable = true;
#ifdef HAVE_ZLIB
g_extern.filebrowser_state.zip_extract_mode = 0;
g_settings.video.color_format = 0;
#endif
// g_extern
strlcpy(g_extern.console.main_wrap.paths.default_sram_dir, default_paths.sram_dir, sizeof(g_extern.console.main_wrap.paths.default_sram_dir));
g_extern.console.screen.state.overscan.enable = false;
g_extern.console.screen.overscan_amount = 0.0f;
g_extern.console.sound.custom_bgm.enable = true;
g_extern.console.screen.gamma_correction = DEFAULT_GAMMA;
g_extern.console.initialize_rarch_enable = false;
g_extern.console.screen.state.screenshots.enable = true;
g_extern.console.screen.state.throttle.enable = true;
g_extern.console.rmenu.state.msg_info.enable = true;
g_extern.console.screen.state.triple_buffering.enable = true;
g_extern.console.main_wrap.state.default_savestate_dir.enable = false;
g_extern.console.main_wrap.state.default_sram_dir.enable = false;
g_extern.console.screen.orientation = ORIENTATION_NORMAL;
g_extern.console.screen.resolutions.current.id = 0;
strlcpy(g_extern.console.main_wrap.paths.default_rom_startup_dir, default_paths.filebrowser_startup_dir, sizeof(g_extern.console.main_wrap.paths.default_rom_startup_dir));
strlcpy(g_extern.console.main_wrap.paths.default_savestate_dir, default_paths.savestate_dir, sizeof(g_extern.console.main_wrap.paths.default_savestate_dir));
#ifdef HAVE_FBO
g_settings.video.fbo.enable = true;
#else
g_settings.video.fbo.enable = false;
#endif
g_settings.video.aspect_ratio_idx = 0;
g_extern.console.block_config_read = true;
g_extern.console.screen.state.frame_advance.enable = false;
g_extern.state_slot = 0;
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;
g_extern.console.screen.viewports.custom_vp.width = 0;
g_extern.console.screen.viewports.custom_vp.height = 0;
g_extern.console.screen.viewports.custom_vp.x = 0;
g_extern.console.screen.viewports.custom_vp.y = 0;
#ifdef _XBOX1
g_extern.console.screen.state.flicker_filter.enable = 1;
g_extern.console.sound.volume_level = 0;
#endif
g_extern.console.screen.state.soft_filter.enable = true;
#ifdef HAVE_ZLIB
g_extern.file_state.zip_extract_mode = 0;
#endif
}

View File

@ -82,7 +82,7 @@ void rarch_set_auto_viewport(unsigned width, unsigned height)
void rarch_set_core_viewport()
{
if (!g_console.emulator_initialized)
if (!g_extern.console.emulator_initialized)
return;
// fallback to 1:1 pixel ratio if none provided
@ -103,7 +103,7 @@ void rarch_load_shader(unsigned slot, const char *path)
RARCH_WARN("Shader support is not implemented for this build.\n");
#endif
if (g_console.info_msg_enable)
if (g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, S_DELAY_180);
}
#endif

View File

@ -17,9 +17,9 @@
#ifndef RARCH_CONSOLE_VIDEO_H__
#define RARCH_CONSOLE_VIDEO_H__
#define IS_TIMER_NOT_EXPIRED(handle) ((handle)->frame_count < g_console.timer_expiration_frame_count)
#define IS_TIMER_NOT_EXPIRED(handle) ((handle)->frame_count < g_extern.console.timers.general_timer.expire_frame)
#define IS_TIMER_EXPIRED(handle) (!(IS_TIMER_NOT_EXPIRED((handle))))
#define SET_TIMER_EXPIRATION(handle, value) (g_console.timer_expiration_frame_count = (handle)->frame_count + (value))
#define SET_TIMER_EXPIRATION(handle, value) (g_extern.console.timers.general_timer.expire_frame = (handle)->frame_count + (value))
#define MIN_SCALING_FACTOR (1.0f)

View File

@ -310,7 +310,7 @@ static void render_messagebox(rgui_handle_t *rgui, const char *message)
static void render_text(rgui_handle_t *rgui)
{
if (rgui->need_refresh && g_console.mode_switch == MODE_MENU && !rgui->msg_force)
if (rgui->need_refresh && g_extern.console.rmenu.mode == MODE_MENU && !rgui->msg_force)
return;
size_t begin = rgui->directory_ptr >= TERM_HEIGHT / 2 ?
@ -377,7 +377,7 @@ static void render_text(rgui_handle_t *rgui)
break;
#ifdef HW_RVL
case RGUI_SETTINGS_VIDEO_SOFT_FILTER:
snprintf(type_str, sizeof(type_str), g_console.soft_display_filter_enable ? "ON" : "OFF");
snprintf(type_str, sizeof(type_str), g_extern.console.screen.state.soft_filter.enable ? "ON" : "OFF");
break;
#endif
#ifdef GEKKO
@ -386,13 +386,13 @@ static void render_text(rgui_handle_t *rgui)
break;
#endif
case RGUI_SETTINGS_VIDEO_GAMMA:
snprintf(type_str, sizeof(type_str), "%d", g_console.gamma_correction);
snprintf(type_str, sizeof(type_str), "%d", g_extern.console.screen.gamma_correction);
break;
case RGUI_SETTINGS_VIDEO_ASPECT_RATIO:
snprintf(type_str, sizeof(type_str), "%s", aspectratio_lut[g_console.aspect_ratio_index].name);
snprintf(type_str, sizeof(type_str), "%s", aspectratio_lut[g_settings.video.aspect_ratio_idx].name);
break;
case RGUI_SETTINGS_VIDEO_OVERSCAN:
snprintf(type_str, sizeof(type_str), "%.2f", g_console.overscan_amount);
snprintf(type_str, sizeof(type_str), "%.2f", g_extern.console.screen.overscan_amount);
break;
case RGUI_SETTINGS_VIDEO_ROTATION:
{
@ -408,7 +408,7 @@ static void render_text(rgui_handle_t *rgui)
snprintf(type_str, sizeof(type_str), "%.3f", g_settings.audio.rate_control_delta);
break;
case RGUI_SETTINGS_ZIP_EXTRACT:
switch(g_console.zip_extract_mode)
switch(g_extern.file_state.zip_extract_mode)
{
case ZIP_EXTRACT_TO_CURRENT_DIR:
snprintf(type_str, sizeof(type_str), "Current");
@ -422,7 +422,7 @@ static void render_text(rgui_handle_t *rgui)
}
break;
case RGUI_SETTINGS_DEBUG_TEXT:
snprintf(type_str, sizeof(type_str), g_console.fps_info_msg_enable ? "ON" : "OFF");
snprintf(type_str, sizeof(type_str), g_extern.console.rmenu.state.msg_fps.enable ? "ON" : "OFF");
break;
case RGUI_SETTINGS_CUSTOM_VIEWPORT:
case RGUI_SETTINGS_CORE:
@ -566,7 +566,7 @@ static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t
#ifdef HW_RVL
case RGUI_SETTINGS_VIDEO_SOFT_FILTER:
{
g_console.soft_display_filter_enable = !g_console.soft_display_filter_enable;
g_extern.console.screen.state.soft_filter.enable = !g_extern.console.screen.state.soft_filter.enable;
driver.video->apply_state_changes();
}
break;
@ -594,22 +594,22 @@ static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t
case RGUI_SETTINGS_VIDEO_GAMMA:
if (action == RGUI_ACTION_START)
{
g_console.gamma_correction = 0;
g_extern.console.screen.gamma_correction = 0;
driver.video->apply_state_changes();
}
else if (action == RGUI_ACTION_LEFT)
{
if(g_console.gamma_correction > 0)
if(g_extern.console.screen.gamma_correction > 0)
{
g_console.gamma_correction--;
g_extern.console.screen.gamma_correction--;
driver.video->apply_state_changes();
}
}
else if (action == RGUI_ACTION_RIGHT)
{
if(g_console.gamma_correction < MAX_GAMMA_SETTING)
if(g_extern.console.screen.gamma_correction < MAX_GAMMA_SETTING)
{
g_console.gamma_correction++;
g_extern.console.screen.gamma_correction++;
driver.video->apply_state_changes();
}
}
@ -621,23 +621,23 @@ static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t
rarch_settings_change(S_ASPECT_RATIO_DECREMENT);
else if (action == RGUI_ACTION_RIGHT)
rarch_settings_change(S_ASPECT_RATIO_INCREMENT);
video_set_aspect_ratio_func(g_console.aspect_ratio_index);
video_set_aspect_ratio_func(g_settings.video.aspect_ratio_idx);
break;
case RGUI_SETTINGS_VIDEO_ROTATION:
if (action == RGUI_ACTION_START)
{
rarch_settings_default(S_DEF_AUDIO_CONTROL_RATE);
video_set_rotation_func(g_console.screen_orientation);
video_set_rotation_func(g_extern.console.screen.orientation);
}
else if (action == RGUI_ACTION_LEFT)
{
rarch_settings_change(S_ROTATION_DECREMENT);
video_set_rotation_func(g_console.screen_orientation);
video_set_rotation_func(g_extern.console.screen.orientation);
}
else if (action == RGUI_ACTION_RIGHT)
{
rarch_settings_change(S_ROTATION_INCREMENT);
video_set_rotation_func(g_console.screen_orientation);
video_set_rotation_func(g_extern.console.screen.orientation);
}
break;
case RGUI_SETTINGS_VIDEO_OVERSCAN:
@ -673,23 +673,23 @@ static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t
break;
case RGUI_SETTINGS_ZIP_EXTRACT:
if (action == RGUI_ACTION_START)
g_console.zip_extract_mode = ZIP_EXTRACT_TO_CURRENT_DIR;
else if (action == RGUI_ACTION_LEFT && g_console.zip_extract_mode > 0)
g_console.zip_extract_mode--;
else if (action == RGUI_ACTION_RIGHT && g_console.zip_extract_mode < LAST_ZIP_EXTRACT)
g_console.zip_extract_mode++;
g_extern.file_state.zip_extract_mode = ZIP_EXTRACT_TO_CURRENT_DIR;
else if (action == RGUI_ACTION_LEFT && g_extern.file_state.zip_extract_mode > 0)
g_extern.file_state.zip_extract_mode--;
else if (action == RGUI_ACTION_RIGHT && g_extern.file_state.zip_extract_mode < LAST_ZIP_EXTRACT)
g_extern.file_state.zip_extract_mode++;
break;
case RGUI_SETTINGS_DEBUG_TEXT:
if (action == RGUI_ACTION_START || action == RGUI_ACTION_LEFT)
g_console.fps_info_msg_enable = false;
g_extern.console.rmenu.state.msg_fps.enable = false;
else if (action == RGUI_ACTION_RIGHT)
g_console.fps_info_msg_enable = true;
g_extern.console.rmenu.state.msg_fps.enable = true;
break;
case RGUI_SETTINGS_RESTART_EMULATOR:
if (action == RGUI_ACTION_OK)
{
#ifdef GEKKO
snprintf(g_console.launch_app_on_exit, sizeof(g_console.launch_app_on_exit), "%s/boot.dol", default_paths.core_dir);
snprintf(g_extern.console.external_launch.launch_app, sizeof(g_extern.console.external_launch.launch_app), "%s/boot.dol", default_paths.core_dir);
#endif
rarch_settings_change(S_RETURN_TO_LAUNCHER);
}
@ -764,7 +764,7 @@ static void rgui_settings_populate_entries(rgui_handle_t *rgui)
{
rgui_list_clear(rgui->folder_buf);
if (g_console.ingame_menu_enable)
if (g_extern.console.rmenu.state.ingame_menu.enable)
{
RGUI_MENU_ITEM("Save State", RGUI_SETTINGS_SAVESTATE_SAVE);
RGUI_MENU_ITEM("Load State", RGUI_SETTINGS_SAVESTATE_LOAD);
@ -834,52 +834,44 @@ void rgui_viewport_iterate(rgui_handle_t *rgui, rgui_action_t action)
case RGUI_ACTION_UP:
if (menu_type == RGUI_SETTINGS_CUSTOM_VIEWPORT)
{
g_console.viewports.custom_vp.y -= 1;
g_console.viewports.custom_vp.height += 1;
g_extern.console.screen.viewports.custom_vp.y -= 1;
g_extern.console.screen.viewports.custom_vp.height += 1;
}
else
{
g_console.viewports.custom_vp.height -= 1;
}
g_extern.console.screen.viewports.custom_vp.height -= 1;
driver.video->apply_state_changes();
break;
case RGUI_ACTION_DOWN:
if (menu_type == RGUI_SETTINGS_CUSTOM_VIEWPORT)
{
g_console.viewports.custom_vp.y += 1;
g_console.viewports.custom_vp.height -= 1;
g_extern.console.screen.viewports.custom_vp.y += 1;
g_extern.console.screen.viewports.custom_vp.height -= 1;
}
else
{
g_console.viewports.custom_vp.height += 1;
}
g_extern.console.screen.viewports.custom_vp.height += 1;
driver.video->apply_state_changes();
break;
case RGUI_ACTION_LEFT:
if (menu_type == RGUI_SETTINGS_CUSTOM_VIEWPORT)
{
g_console.viewports.custom_vp.x -= 1;
g_console.viewports.custom_vp.width += 1;
g_extern.console.screen.viewports.custom_vp.x -= 1;
g_extern.console.screen.viewports.custom_vp.width += 1;
}
else
{
g_console.viewports.custom_vp.width -= 1;
}
g_extern.console.screen.viewports.custom_vp.width -= 1;
driver.video->apply_state_changes();
break;
case RGUI_ACTION_RIGHT:
if (menu_type == RGUI_SETTINGS_CUSTOM_VIEWPORT)
{
g_console.viewports.custom_vp.x += 1;
g_console.viewports.custom_vp.width -= 1;
g_extern.console.screen.viewports.custom_vp.x += 1;
g_extern.console.screen.viewports.custom_vp.width -= 1;
}
else
{
g_console.viewports.custom_vp.width += 1;
}
g_extern.console.screen.viewports.custom_vp.width += 1;
driver.video->apply_state_changes();
break;
@ -911,15 +903,15 @@ void rgui_viewport_iterate(rgui_handle_t *rgui, rgui_action_t action)
#ifdef GEKKO
if (menu_type == RGUI_SETTINGS_CUSTOM_VIEWPORT)
{
g_console.viewports.custom_vp.width += g_console.viewports.custom_vp.x;
g_console.viewports.custom_vp.height += g_console.viewports.custom_vp.y;
g_console.viewports.custom_vp.x = 0;
g_console.viewports.custom_vp.y = 0;
g_extern.console.screen.viewports.custom_vp.width += g_extern.console.screen.viewports.custom_vp.x;
g_extern.console.screen.viewports.custom_vp.height += g_extern.console.screen.viewports.custom_vp.y;
g_extern.console.screen.viewports.custom_vp.x = 0;
g_extern.console.screen.viewports.custom_vp.y = 0;
}
else
{
g_console.viewports.custom_vp.width = gx->win_width - g_console.viewports.custom_vp.x;
g_console.viewports.custom_vp.height = gx->win_height - g_console.viewports.custom_vp.y;
g_extern.console.screen.viewports.custom_vp.width = gx->win_width - g_extern.console.screen.viewports.custom_vp.x;
g_extern.console.screen.viewports.custom_vp.height = gx->win_height - g_extern.console.screen.viewports.custom_vp.y;
}
#endif
driver.video->apply_state_changes();
@ -999,13 +991,11 @@ void rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t action)
else if (type == RGUI_SETTINGS_CUSTOM_VIEWPORT && action == RGUI_ACTION_OK)
{
rgui_list_push(rgui->path_stack, "", type, rgui->directory_ptr);
g_console.aspect_ratio_index = ASPECT_RATIO_CUSTOM;
video_set_aspect_ratio_func(g_console.aspect_ratio_index);
g_settings.video.aspect_ratio_idx = ASPECT_RATIO_CUSTOM;
video_set_aspect_ratio_func(g_settings.video.aspect_ratio_idx);
}
else
{
rgui_settings_toggle_setting(type, action, menu_type);
}
break;
case RGUI_ACTION_REFRESH:
@ -1135,7 +1125,7 @@ void rgui_iterate(rgui_handle_t *rgui, rgui_action_t action)
else
{
snprintf(rgui->path_buf, sizeof(rgui->path_buf), "%s/%s", dir, path);
rarch_console_load_game_wrap(rgui->path_buf, g_console.zip_extract_mode, S_DELAY_1);
rarch_console_load_game_wrap(rgui->path_buf, g_extern.file_state.zip_extract_mode, S_DELAY_1);
rgui->need_refresh = true; // in case of zip extract
rgui->msg_force = true;
}
@ -1173,7 +1163,7 @@ void rgui_iterate(rgui_handle_t *rgui, rgui_action_t action)
// refresh values in case the stack changed
rgui_list_back(rgui->path_stack, &dir, &menu_type, &directory_ptr);
if (rgui->need_refresh && (menu_type == RGUI_FILE_DIRECTORY || menu_type == RGUI_FILE_DEVICE || menu_type == RGUI_SETTINGS_CORE) && g_console.mode_switch == MODE_MENU)
if (rgui->need_refresh && (menu_type == RGUI_FILE_DIRECTORY || menu_type == RGUI_FILE_DEVICE || menu_type == RGUI_SETTINGS_CORE) && g_extern.console.rmenu.mode == MODE_MENU)
{
rgui->need_refresh = false;
rgui_list_clear(rgui->folder_buf);

View File

@ -43,7 +43,7 @@
#define CURRENT_PATH_Y_POSITION 0.15f
#define CURRENT_PATH_FONT_SIZE FONT_SIZE
#define FONT_SIZE (g_extern.console.font_size)
#define FONT_SIZE (g_extern.console.rmenu.font_size)
#define NUM_ENTRY_PER_PAGE 15

File diff suppressed because it is too large Load Diff

234
general.h
View File

@ -92,15 +92,26 @@ struct settings
bool crop_overscan;
float aspect_ratio;
bool aspect_ratio_auto;
unsigned aspect_ratio_idx;
char cg_shader_path[PATH_MAX];
char bsnes_shader_path[PATH_MAX];
char filter_path[PATH_MAX];
enum rarch_shader_type shader_type;
float refresh_rate;
#ifdef RARCH_CONSOLE
unsigned color_format;
#endif
bool render_to_texture;
float fbo_scale_x;
float fbo_scale_y;
struct
{
float scale_x;
float scale_y;
bool enable;
} fbo;
char second_pass_shader[PATH_MAX];
bool second_pass_smooth;
char shader_dir[PATH_MAX];
@ -155,6 +166,7 @@ struct settings
#ifdef RARCH_CONSOLE
unsigned currently_selected_controller_no;
unsigned dpad_emulation[MAX_PLAYERS];
unsigned map_dpad_to_stick;
unsigned device[MAX_PLAYERS];
#endif
bool netplay_client_swap_input;
@ -188,73 +200,6 @@ struct settings
bool stdin_cmd_enable;
};
// Settings and/or global state that is specific to a console-style implementation.
#ifdef RARCH_CONSOLE
typedef struct
{
int x;
int y;
unsigned width;
unsigned height;
} rarch_viewport_t;
struct console_settings
{
bool custom_bgm_enable;
bool check_available_resolutions;
bool block_config_read;
bool default_sram_dir_enable;
bool default_savestate_dir_enable;
bool fbo_enabled;
bool fps_info_msg_enable;
#ifdef _XBOX1
unsigned flicker_filter;
unsigned sound_volume_level;
#endif
bool soft_display_filter_enable;
bool initialize_rarch_enable;
bool info_msg_enable;
bool overscan_enable;
bool return_to_launcher;
bool screenshots_enable;
bool throttle_enable;
bool triple_buffering_enable;
float overscan_amount;
unsigned aspect_ratio_index;
struct
{
rarch_viewport_t custom_vp;
} viewports;
unsigned gamma_correction;
unsigned emulator_initialized;
unsigned external_launcher_support;
unsigned screen_orientation;
unsigned current_resolution_index;
unsigned current_resolution_id;
unsigned initial_resolution_id;
unsigned map_dpad_to_stick;
unsigned sound_mode;
uint32_t *supported_resolutions;
unsigned supported_resolutions_count;
unsigned control_timer_expiration_frame_count;
unsigned timer_expiration_frame_count;
unsigned input_loop;
#ifdef _XBOX
unsigned color_format;
DWORD volume_device_type;
#endif
char cgp_path[PATH_MAX];
char input_cfg_path[PATH_MAX];
char default_rom_startup_dir[PATH_MAX];
char default_savestate_dir[PATH_MAX];
char default_sram_dir[PATH_MAX];
char launch_app_on_exit[PATH_MAX];
#ifdef HAVE_OSKUTIL
oskutil_params oskutil_handle;
#endif
};
#endif
enum rarch_game_type
{
RARCH_CART_NORMAL = 0,
@ -264,6 +209,34 @@ enum rarch_game_type
RARCH_CART_SUFAMI
};
typedef struct
{
bool enable;
unsigned value;
} rarch_boolean_state_t;
typedef struct
{
bool is_expired;
unsigned expire_frame;
unsigned current;
} rarch_frame_count_t;
typedef struct
{
unsigned idx;
unsigned id;
} rarch_resolution_t;
typedef struct
{
int x;
int y;
unsigned width;
unsigned height;
} rarch_viewport_t;
// All run-time- / command line flag-related globals go here.
struct global
{
@ -465,26 +438,128 @@ struct global
char sha256[64 + 1];
/* FIXME: too much hassle ifndeffing this now for HAVE_RMENU */
// Settings and/or global state that is specific to a console-style implementation.
struct
{
bool menus_hd_enable;
bool frame_advance_enable;
bool ingame_menu_enable;
bool enable;
unsigned ingame_menu_item;
unsigned mode;
float font_size;
bool block_config_read;
bool initialize_rarch_enable;
unsigned emulator_initialized;
struct
{
struct
{
unsigned idx;
} ingame_menu;
unsigned mode;
unsigned input_loop;
float font_size;
struct
{
rarch_boolean_state_t msg_fps;
rarch_boolean_state_t msg_info;
rarch_boolean_state_t ingame_menu;
rarch_boolean_state_t rmenu;
rarch_boolean_state_t rmenu_hd;
} state;
} rmenu;
struct
{
rarch_frame_count_t control_timer;
rarch_frame_count_t general_timer;
} timers;
struct
{
bool enable;
char launch_app[PATH_MAX];
unsigned support;
} external_launch;
struct
{
struct
{
rarch_resolution_t current;
rarch_resolution_t initial;
uint32_t *list;
unsigned count;
bool check;
} resolutions;
struct
{
rarch_viewport_t custom_vp;
} viewports;
unsigned orientation;
float overscan_amount;
unsigned gamma_correction;
struct
{
rarch_boolean_state_t frame_advance;
rarch_boolean_state_t triple_buffering;
rarch_boolean_state_t overscan;
rarch_boolean_state_t flicker_filter;
rarch_boolean_state_t soft_filter;
rarch_boolean_state_t screenshots;
rarch_boolean_state_t throttle;
} state;
} screen;
struct
{
rarch_boolean_state_t custom_bgm;
unsigned mode;
#ifdef _XBOX1
unsigned volume_level;
#endif
} sound;
struct
{
struct
{
char default_rom_startup_dir[PATH_MAX];
char default_savestate_dir[PATH_MAX];
char default_sram_dir[PATH_MAX];
} paths;
struct
{
rarch_boolean_state_t default_sram_dir;
rarch_boolean_state_t default_savestate_dir;
} state;
} main_wrap;
#ifdef HAVE_OSKUTIL
struct
{
oskutil_params oskutil_handle;
} misc;
#endif
} console;
struct
{
char rom_path[PATH_MAX];
char cgp_path[PATH_MAX];
char input_cfg_path[PATH_MAX];
#ifdef HAVE_ZLIB
unsigned zip_extract_mode;
#endif
} filebrowser_state;
#ifdef _XBOX
DWORD volume_device_type;
#endif
} file_state;
#ifdef HAVE_XML
cheat_manager_t *cheat;
@ -527,9 +602,6 @@ void rarch_state_slot_decrease(void);
// Public data structures
extern struct settings g_settings;
extern struct global g_extern;
#ifdef RARCH_CONSOLE
extern struct console_settings g_console;
#endif
/////////
#include "retroarch_logger.h"

View File

@ -84,7 +84,7 @@ static void gfx_ctx_get_available_resolutions (void)
uint32_t resolution_count;
uint16_t num_videomodes;
if (g_console.check_available_resolutions)
if (g_extern.console.screen.resolutions.check)
return;
defaultresolution = true;
@ -109,30 +109,30 @@ static void gfx_ctx_get_available_resolutions (void)
resolution_count++;
}
g_console.supported_resolutions = malloc(resolution_count * sizeof(uint32_t));
g_console.supported_resolutions_count = 0;
g_extern.console.screen.resolutions.list = malloc(resolution_count * sizeof(uint32_t));
g_extern.console.screen.resolutions.count = 0;
for (unsigned i = 0; i < num_videomodes; i++)
{
if(gfx_ctx_check_resolution(videomode[i]))
{
g_console.supported_resolutions[g_console.supported_resolutions_count++] = videomode[i];
g_console.initial_resolution_id = videomode[i];
g_extern.console.screen.resolutions.list[g_extern.console.screen.resolutions.count++] = videomode[i];
g_extern.console.screen.resolutions.initial.id = videomode[i];
if (g_console.current_resolution_id == videomode[i])
if (g_extern.console.screen.resolutions.current.id == videomode[i])
{
defaultresolution = false;
g_console.current_resolution_index = g_console.supported_resolutions_count-1;
g_extern.console.screen.resolutions.current.idx = g_extern.console.screen.resolutions.count-1;
}
}
}
/* In case we didn't specify a resolution - make the last resolution
that was added to the list (the highest resolution) the default resolution */
if (g_console.current_resolution_id > num_videomodes || defaultresolution)
g_console.current_resolution_index = g_console.supported_resolutions_count - 1;
if (g_extern.console.screen.resolutions.current.id > num_videomodes || defaultresolution)
g_extern.console.screen.resolutions.current.idx = g_extern.console.screen.resolutions.count - 1;
g_console.check_available_resolutions = true;
g_extern.console.screen.resolutions.check = true;
}
static void gfx_ctx_set_swap_interval(unsigned interval)
@ -265,17 +265,17 @@ static bool gfx_ctx_init(void)
params.depthFormat = GL_NONE;
params.multisamplingMode = GL_MULTISAMPLING_NONE_SCE;
if (g_console.triple_buffering_enable)
if (g_extern.console.screen.state.triple_buffering.enable)
{
params.enable |= PSGL_DEVICE_PARAMETERS_BUFFERING_MODE;
params.bufferingMode = PSGL_BUFFERING_MODE_TRIPLE;
}
if (g_console.current_resolution_id)
if (g_extern.console.screen.resolutions.current.id)
{
params.enable |= PSGL_DEVICE_PARAMETERS_WIDTH_HEIGHT;
params.width = gfx_ctx_get_resolution_width(g_console.current_resolution_id);
params.height = gfx_ctx_get_resolution_height(g_console.current_resolution_id);
params.width = gfx_ctx_get_resolution_width(g_extern.console.screen.resolutions.current.id);
params.height = gfx_ctx_get_resolution_height(g_extern.console.screen.resolutions.current.id);
}
gl_device = psglCreateDeviceExtended(&params);

View File

@ -94,8 +94,8 @@ static void gfx_ctx_xdk_clear(void)
{
xdk_d3d_video_t *device_ptr = (xdk_d3d_video_t*)driver.video_data;
#ifdef _XBOX1
unsigned flicker_filter = g_console.flicker_filter;
bool soft_filter_enable = g_console.soft_display_filter_enable;
unsigned flicker_filter = g_extern.console.screen.state.flicker_filter.value;
bool soft_filter_enable = g_extern.console.screen.state.soft_filter.enable;
#endif
device_ptr->d3d_render_device->Clear(0, NULL, D3DCLEAR_TARGET,
@ -213,7 +213,7 @@ static bool gfx_ctx_xdk_init(void)
// Safe mode
d3d->d3dpp.BackBufferWidth = 640;
d3d->d3dpp.BackBufferHeight = 480;
g_console.menus_hd_enable = false;
g_extern.console.rmenu.state.menus_hd.enable = false;
// Only valid in PAL mode, not valid for HDTV modes!
if(XGetVideoStandard() == XC_VIDEO_STANDARD_PAL_I)
@ -252,25 +252,25 @@ static bool gfx_ctx_xdk_init(void)
{
if(d3d->video_mode & XC_VIDEO_FLAGS_HDTV_480p)
{
g_console.menus_hd_enable = false;
g_extern.console.rmenu.state.menus_hd.enable = false;
d3d->d3dpp.BackBufferWidth = 640;
d3d->d3dpp.BackBufferHeight = 480;
d3d->d3dpp.Flags = D3DPRESENTFLAG_PROGRESSIVE;
}
else if(d3d->video_mode & XC_VIDEO_FLAGS_HDTV_720p)
{
g_console.menus_hd_enable = true;
d3d->d3dpp.BackBufferWidth = 1280;
d3d->d3dpp.BackBufferHeight = 720;
d3d->d3dpp.Flags = D3DPRESENTFLAG_PROGRESSIVE;
}
else if(d3d->video_mode & XC_VIDEO_FLAGS_HDTV_1080i)
{
g_console.menus_hd_enable = true;
d3d->d3dpp.BackBufferWidth = 1920;
d3d->d3dpp.BackBufferHeight = 1080;
d3d->d3dpp.Flags = D3DPRESENTFLAG_INTERLACED;
}
else if(d3d->video_mode & XC_VIDEO_FLAGS_HDTV_720p)
{
g_extern.console.rmenu.state.menus_hd.enable = true;
d3d->d3dpp.BackBufferWidth = 1280;
d3d->d3dpp.BackBufferHeight = 720;
d3d->d3dpp.Flags = D3DPRESENTFLAG_PROGRESSIVE;
}
else if(d3d->video_mode & XC_VIDEO_FLAGS_HDTV_1080i)
{
g_extern.console.rmenu.state.menus_hd.enable = true;
d3d->d3dpp.BackBufferWidth = 1920;
d3d->d3dpp.BackBufferHeight = 1080;
d3d->d3dpp.Flags = D3DPRESENTFLAG_INTERLACED;
}
}
d3d->win_width = d3d->d3dpp.BackBufferWidth;
@ -345,19 +345,19 @@ static bool gfx_ctx_xdk_init(void)
if(!d3d->video_mode.fIsWideScreen)
d3d->d3dpp.Flags |= D3DPRESENTFLAG_NO_LETTERBOX;
g_console.menus_hd_enable = d3d->video_mode.fIsHiDef;
g_extern.console.rmenu.state.menus_hd.enable = d3d->video_mode.fIsHiDef;
d3d->d3dpp.BackBufferWidth = d3d->video_mode.fIsHiDef ? 1280 : 640;
d3d->d3dpp.BackBufferHeight = d3d->video_mode.fIsHiDef ? 720 : 480;
if(g_console.gamma_correction)
if(g_extern.console.screen.gamma_correction)
{
d3d->d3dpp.BackBufferFormat = g_console.color_format ? (D3DFORMAT)MAKESRGBFMT(D3DFMT_A8R8G8B8) : (D3DFORMAT)MAKESRGBFMT(D3DFMT_LIN_A1R5G5B5);
d3d->d3dpp.BackBufferFormat = g_settings.video.color_format ? (D3DFORMAT)MAKESRGBFMT(D3DFMT_A8R8G8B8) : (D3DFORMAT)MAKESRGBFMT(D3DFMT_LIN_A1R5G5B5);
d3d->d3dpp.FrontBufferFormat = (D3DFORMAT)MAKESRGBFMT(D3DFMT_LE_X8R8G8B8);
}
else
{
d3d->d3dpp.BackBufferFormat = g_console.color_format ? D3DFMT_A8R8G8B8 : D3DFMT_LIN_A1R5G5B5;
d3d->d3dpp.BackBufferFormat = g_settings.video.color_format ? D3DFMT_A8R8G8B8 : D3DFMT_LIN_A1R5G5B5;
d3d->d3dpp.FrontBufferFormat = D3DFMT_LE_X8R8G8B8;
}
d3d->d3dpp.MultiSampleQuality = 0;
@ -422,11 +422,11 @@ static bool gfx_ctx_xdk_init(void)
vp.MaxZ = 1.0f;
d3d->d3d_render_device->SetViewport(&vp);
if(g_console.viewports.custom_vp.width == 0)
g_console.viewports.custom_vp.width = vp.Width;
if(g_extern.console.screen.viewports.custom_vp.width == 0)
g_extern.console.screen.viewports.custom_vp.width = vp.Width;
if(g_console.viewports.custom_vp.height == 0)
g_console.viewports.custom_vp.height = vp.Height;
if(g_extern.console.screen.viewports.custom_vp.height == 0)
g_extern.console.screen.viewports.custom_vp.height = vp.Height;
return true;
}

View File

@ -531,8 +531,8 @@ void gl_init_fbo(gl_t *gl, unsigned width, unsigned height)
if (!scale.valid)
{
scale.scale_x = g_settings.video.fbo_scale_x;
scale.scale_y = g_settings.video.fbo_scale_y;
scale.scale_x = g_settings.video.fbo.scale_x;
scale.scale_y = g_settings.video.fbo.scale_y;
scale.type_x = scale.type_y = RARCH_SCALE_INPUT;
scale.valid = true;
}
@ -576,11 +576,11 @@ void gl_init_fbo(gl_t *gl, unsigned width, unsigned height)
void gl_set_projection(gl_t *gl, struct gl_ortho *ortho, bool allow_rotate)
{
#ifdef RARCH_CONSOLE
if (g_console.overscan_enable)
if (g_extern.console.screen.state.overscan.enable)
{
ortho->left = -g_console.overscan_amount / 2;
ortho->right = 1 + g_console.overscan_amount / 2;
ortho->bottom = -g_console.overscan_amount / 2;
ortho->left = -g_extern.console.screen.overscan_amount / 2;
ortho->right = 1 + g_extern.console.screen.overscan_amount / 2;
ortho->bottom = -g_extern.console.screen.overscan_amount / 2;
}
#endif
@ -618,12 +618,12 @@ void gl_set_viewport(gl_t *gl, unsigned width, unsigned height, bool force_full,
float delta;
#ifdef RARCH_CONSOLE
if (g_console.aspect_ratio_index == ASPECT_RATIO_CUSTOM)
if (g_settings.video.aspect_ratio_idx == ASPECT_RATIO_CUSTOM)
{
x = g_console.viewports.custom_vp.x;
y = g_console.viewports.custom_vp.y;
width = g_console.viewports.custom_vp.width;
height = g_console.viewports.custom_vp.height;
x = g_extern.console.screen.viewports.custom_vp.x;
y = g_extern.console.screen.viewports.custom_vp.y;
width = g_extern.console.screen.viewports.custom_vp.width;
height = g_extern.console.screen.viewports.custom_vp.height;
}
else
#endif
@ -1487,16 +1487,16 @@ static void gl_start(void)
video_info.smooth = g_settings.video.smooth;
video_info.input_scale = 2;
video_info.fullscreen = true;
if (g_console.aspect_ratio_index == ASPECT_RATIO_CUSTOM)
if (g_settings.video.aspect_ratio_idx == ASPECT_RATIO_CUSTOM)
{
video_info.width = g_console.viewports.custom_vp.width;
video_info.height = g_console.viewports.custom_vp.height;
video_info.width = g_extern.console.screen.viewports.custom_vp.width;
video_info.height = g_extern.console.screen.viewports.custom_vp.height;
}
driver.video_data = gl_init(&video_info, NULL, NULL);
gl_t *gl = (gl_t*)driver.video_data;
gl->ctx_driver->set_fbo(g_console.fbo_enabled);
gl->ctx_driver->set_fbo(g_settings.video.fbo.enable);
gl->ctx_driver->get_available_resolutions();
if (gl->ctx_driver->menu_init)
gl->ctx_driver->menu_init();
@ -1504,7 +1504,7 @@ static void gl_start(void)
#ifdef HAVE_FBO
// FBO mode has to be enabled once even if FBO mode has to be
// turned off
if (!g_console.fbo_enabled)
if (!g_settings.video.fbo.enable)
{
gl->ctx_driver->apply_fbo_state_changes(FBO_DEINIT);
gl->ctx_driver->apply_fbo_state_changes(FBO_INIT);
@ -1563,12 +1563,12 @@ static void gl_set_aspect_ratio(void *data, unsigned aspectratio_index)
(void)data;
gl_t *gl = driver.video_data;
if (g_console.aspect_ratio_index == ASPECT_RATIO_AUTO)
if (g_settings.video.aspect_ratio_idx == ASPECT_RATIO_AUTO)
rarch_set_auto_viewport(g_extern.frame_cache.width, g_extern.frame_cache.height);
else if(g_console.aspect_ratio_index == ASPECT_RATIO_CORE)
else if(g_settings.video.aspect_ratio_idx == ASPECT_RATIO_CORE)
rarch_set_core_viewport();
g_settings.video.aspect_ratio = aspectratio_lut[g_console.aspect_ratio_index].value;
g_settings.video.aspect_ratio = aspectratio_lut[g_settings.video.aspect_ratio_idx].value;
g_settings.video.force_aspect = false;
gl->keep_aspect = true;
gl->should_resize = true;

View File

@ -284,7 +284,7 @@ static void menu_loop(void)
bool first_held = false;
bool initial_held = true;
g_extern.console.enable = true;
g_extern.console.rmenu.state.rmenu.enable = true;
gx->menu_render = true;
do
@ -363,34 +363,34 @@ static void menu_loop(void)
if(IS_TIMER_EXPIRED(gx))
{
// if we want to force goto the emulation loop, skip this
if(g_extern.console.mode != MODE_EMULATION)
if(g_extern.console.rmenu.mode != MODE_EMULATION)
{
if(goto_menu_key_pressed)
{
g_extern.console.enable = (goto_menu_key_pressed && g_console.emulator_initialized) ? false : true;
g_extern.console.mode = g_extern.console.enable ? MODE_MENU : MODE_EMULATION;
g_extern.console.rmenu.state.rmenu.enable = (goto_menu_key_pressed && g_extern.console.emulator_initialized) ? false : true;
g_extern.console.rmenu.mode = g_extern.console.rmenu.state.rmenu.enable ? MODE_MENU : MODE_EMULATION;
}
}
}
if(quit_key_pressed)
{
g_extern.console.enable = false;
g_extern.console.mode = MODE_EXIT;
g_extern.console.rmenu.state.rmenu.enable = false;
g_extern.console.rmenu.mode = MODE_EXIT;
}
// set a timer delay so that we don't instantly switch back to the menu when
// press and holding QUIT in the emulation loop (lasts for 30 frame ticks)
if(g_extern.console.mode == MODE_EMULATION)
if(g_extern.console.rmenu.mode == MODE_EMULATION)
{
SET_TIMER_EXPIRATION(gx, 30);
}
}while(g_extern.console.enable);
}while(g_extern.console.rmenu.state.rmenu.enable);
gx->menu_render = false;
g_extern.console.ingame_menu_enable = false;
g_extern.console.rmenu.state.ingame_menu.enable = false;
}
static void menu_init(void)
@ -399,7 +399,7 @@ static void menu_init(void)
menu_framebuf, RGUI_WIDTH * sizeof(uint16_t),
NULL /* _binary_console_font_bmp_start */, _binary_console_font_bin_start, folder_cb, NULL);
g_extern.console.mode = MODE_MENU;
g_extern.console.rmenu.mode = MODE_MENU;
rgui_iterate(rgui, RGUI_ACTION_REFRESH);
}
@ -548,10 +548,10 @@ int main(int argc, char *argv[])
if (argc > 2 && argv[1] != NULL && argv[2] != NULL)
{
char rom[PATH_MAX];
g_console.external_launcher_support = EXTERN_LAUNCHER_CHANNEL;
g_extern.console.external_launch.support = EXTERN_LAUNCHER_CHANNEL;
snprintf(rom, sizeof(rom), "%s%s", argv[1], argv[2]);
g_extern.filebrowser_state.zip_extract_mode = ZIP_EXTRACT_TO_CURRENT_DIR_AND_LOAD_FIRST_FILE;
rarch_console_load_game_wrap(rom, g_extern.filebrowser_state.zip_extract_mode, S_DELAY_1);
g_extern.file_state.zip_extract_mode = ZIP_EXTRACT_TO_CURRENT_DIR_AND_LOAD_FIRST_FILE;
rarch_console_load_game_wrap(rom, g_extern.file_state.zip_extract_mode, S_DELAY_1);
rgui_iterate(rgui, RGUI_ACTION_MESSAGE);
gx->menu_render = true;
@ -561,30 +561,30 @@ int main(int argc, char *argv[])
rarch_startup(default_paths.config_file);
}
else
g_console.external_launcher_support = EXTERN_LAUNCHER_SALAMANDER;
g_extern.console.external_launch.support = EXTERN_LAUNCHER_SALAMANDER;
begin_loop:
if(g_extern.console.mode == MODE_EMULATION)
if(g_extern.console.rmenu.mode == MODE_EMULATION)
{
bool repeat = false;
input_gx.poll(NULL);
video_set_aspect_ratio_func(g_console.aspect_ratio_index);
video_set_aspect_ratio_func(g_settings.video.aspect_ratio_idx);
audio_start_func();
do{
repeat = rarch_main_iterate();
}while(repeat && !g_extern.console.frame_advance_enable);
}while(repeat && !g_extern.console.screen.state.frame_advance.enable);
audio_stop_func();
}
else if(g_extern.console.mode == MODE_MENU)
else if(g_extern.console.rmenu.mode == MODE_MENU)
{
menu_loop();
if (g_extern.console.mode != MODE_EXIT)
if (g_extern.console.rmenu.mode != MODE_EXIT)
rarch_startup(default_paths.config_file);
}
else
@ -595,7 +595,7 @@ begin_shutdown:
rarch_config_save(default_paths.config_file);
config_save_keybinds(input_path);
if(g_console.emulator_initialized)
if(g_extern.console.emulator_initialized)
rarch_main_deinit();
input_gx.free(NULL);
@ -609,8 +609,8 @@ begin_shutdown:
fclose(log_fp);
#endif
if(g_console.return_to_launcher)
rarch_console_exec(g_console.launch_app_on_exit);
if(g_extern.console.external_launch.enable)
rarch_console_exec(g_extern.console.external_launch.launch_app);
exit(0);
}

View File

@ -472,19 +472,19 @@ static bool gx_key_pressed(void *data, int key)
);
uint64_t quit_rarch = pad_state[0] & GX_QUIT_KEY;
bool retval = false;
g_console.menu_enable = ((quit_rarch || goto_menu_pressed) && IS_TIMER_EXPIRED(gx));
g_extern.console.rmenu.state.rmenu.enable = ((quit_rarch || goto_menu_pressed) && IS_TIMER_EXPIRED(gx));
if(g_console.menu_enable)
if(g_extern.console.rmenu.state.rmenu.enable)
{
g_console.mode_switch = MODE_MENU;
g_console.ingame_menu_enable = true;
g_extern.console.rmenu.mode = MODE_MENU;
g_extern.console.rmenu.state.ingame_menu.enable = true;
SET_TIMER_EXPIRATION(gx, 30);
}
if(quit_rarch)
g_console.mode_switch = MODE_EXIT;
g_extern.console.rmenu.mode = MODE_EXIT;
retval = g_console.menu_enable;
retval = g_extern.console.rmenu.state.rmenu.enable;
return retval;
}
default:

View File

@ -251,12 +251,12 @@ void gx_set_aspect_ratio(void *data, unsigned aspectratio_idx)
{
gx_video_t *gx = (gx_video_t*)driver.video_data;
if (g_console.aspect_ratio_index == ASPECT_RATIO_AUTO)
if (g_settings.video.aspect_ratio_idx == ASPECT_RATIO_AUTO)
rarch_set_auto_viewport(g_extern.frame_cache.width, g_extern.frame_cache.height);
else if(g_console.aspect_ratio_index == ASPECT_RATIO_CORE)
else if(g_settings.video.aspect_ratio_idx == ASPECT_RATIO_CORE)
rarch_set_core_viewport();
g_settings.video.aspect_ratio = aspectratio_lut[g_console.aspect_ratio_index].value;
g_settings.video.aspect_ratio = aspectratio_lut[g_settings.video.aspect_ratio_idx].value;
g_settings.video.force_aspect = false;
gx->keep_aspect = true;
gx->should_resize = true;
@ -603,9 +603,9 @@ static void gx_resize(gx_video_t *gx)
unsigned width = gx->win_width, height = gx->win_height;
#ifdef HW_RVL
VIDEO_SetTrapFilter(g_console.soft_display_filter_enable);
VIDEO_SetTrapFilter(g_extern.console.screen.state.soft_filter.enable);
#endif
GX_SetDispCopyGamma(g_console.gamma_correction);
GX_SetDispCopyGamma(g_extern.console.screen.gamma_correction);
if (gx->keep_aspect && gx_mode.efbHeight >= 480) // ingore this for custom resolutions
{
@ -622,20 +622,20 @@ static void gx_resize(gx_video_t *gx)
float delta;
#ifdef RARCH_CONSOLE
if (g_console.aspect_ratio_index == ASPECT_RATIO_CUSTOM)
if (g_settings.video.aspect_ratio_idx == ASPECT_RATIO_CUSTOM)
{
if (!g_console.viewports.custom_vp.width || !g_console.viewports.custom_vp.height)
if (!g_extern.console.screen.viewports.custom_vp.width || !g_extern.console.screen.viewports.custom_vp.height)
{
g_console.viewports.custom_vp.x = 0;
g_console.viewports.custom_vp.y = 0;
g_console.viewports.custom_vp.width = gx->win_width;
g_console.viewports.custom_vp.height = gx->win_height;
g_extern.console.screen.viewports.custom_vp.x = 0;
g_extern.console.screen.viewports.custom_vp.y = 0;
g_extern.console.screen.viewports.custom_vp.width = gx->win_width;
g_extern.console.screen.viewports.custom_vp.height = gx->win_height;
}
x = g_console.viewports.custom_vp.x;
y = g_console.viewports.custom_vp.y;
width = g_console.viewports.custom_vp.width;
height = g_console.viewports.custom_vp.height;
x = g_extern.console.screen.viewports.custom_vp.x;
y = g_extern.console.screen.viewports.custom_vp.y;
width = g_extern.console.screen.viewports.custom_vp.width;
height = g_extern.console.screen.viewports.custom_vp.height;
}
else
#endif
@ -664,12 +664,12 @@ static void gx_resize(gx_video_t *gx)
Mtx44 m1, m2;
float top = 1, bottom = -1, left = -1, right = 1;
if (g_console.overscan_enable)
if (g_extern.console.screen.state.overscan.enable)
{
top -= g_console.overscan_amount / 2;
left += g_console.overscan_amount / 2;
right -= g_console.overscan_amount / 2;
bottom += g_console.overscan_amount / 2;
top -= g_extern.console.screen.overscan_amount / 2;
left += g_extern.console.screen.overscan_amount / 2;
right -= g_extern.console.screen.overscan_amount / 2;
bottom += g_extern.console.screen.overscan_amount / 2;
}
guOrtho(m1, top, bottom, left, right, 0, 1);
unsigned degrees;
@ -839,7 +839,7 @@ static bool gx_frame(void *data, const void *frame,
GX_DrawDone();
}
if (g_console.fps_info_msg_enable)
if (g_extern.console.rmenu.state.msg_fps.enable)
{
static char fps_txt[128];
char mem1_txt[128];

View File

@ -70,7 +70,7 @@ static void callback_sysutil_exit(uint64_t status, uint64_t param, void *userdat
(void) param;
(void) userdata;
#ifdef HAVE_OSKUTIL
oskutil_params *osk = &g_console.oskutil_handle;
oskutil_params *osk = &g_extern.console.misc.oskutil_handle;
#endif
gl_t *gl = driver.video_data;
@ -138,13 +138,13 @@ static void get_environment_settings(int argc, char *argv[])
if(path_file_exists(default_paths.multiman_self_file) && argc > 1 && path_file_exists(argv[1]))
{
g_console.external_launcher_support = EXTERN_LAUNCHER_MULTIMAN;
g_extern.console.external_launch.support = EXTERN_LAUNCHER_MULTIMAN;
RARCH_LOG("Started from multiMAN, auto-game start enabled.\n");
}
else
#endif
{
g_console.external_launcher_support = EXTERN_LAUNCHER_SALAMANDER;
g_extern.console.external_launch.support = EXTERN_LAUNCHER_SALAMANDER;
RARCH_WARN("Not started from multiMAN, auto-game start disabled.\n");
}
@ -177,7 +177,7 @@ static void get_environment_settings(int argc, char *argv[])
ret = cellGameContentPermit(contentInfoPath, default_paths.port_dir);
#ifdef HAVE_MULTIMAN
if(g_console.external_launcher_support == EXTERN_LAUNCHER_MULTIMAN)
if(g_extern.console.external_launch.support == EXTERN_LAUNCHER_MULTIMAN)
{
snprintf(contentInfoPath, sizeof(contentInfoPath), "/dev_hdd0/game/%s", EMULATOR_CONTENT_DIR);
snprintf(default_paths.port_dir, sizeof(default_paths.port_dir), "/dev_hdd0/game/%s/USRDIR", EMULATOR_CONTENT_DIR);
@ -294,7 +294,7 @@ int main(int argc, char *argv[])
input_ps3.post_init();
#if (CELL_SDK_VERSION > 0x340000) && !defined(__PSL1GHT__)
if (g_console.screenshots_enable)
if (g_extern.console.screen.state.screenshots.enable)
{
#ifdef HAVE_SYSMODULES
cellSysmoduleLoadModule(CELL_SYSMODULE_SYSUTIL_SCREENSHOT);
@ -309,7 +309,7 @@ int main(int argc, char *argv[])
#endif
}
#ifdef HAVE_SYSUTILS
if (g_console.custom_bgm_enable)
if (g_extern.console.sound.custom_bgm.enable)
cellSysutilEnableBgmPlayback();
#endif
#endif
@ -318,21 +318,21 @@ int main(int argc, char *argv[])
driver.video = &video_gl;
#ifdef HAVE_OSKUTIL
oskutil_params *osk = &g_console.oskutil_handle;
oskutil_params *osk = &g_extern.console.misc.oskutil_handle;
oskutil_init(osk, 0);
#endif
menu_init();
switch(g_console.external_launcher_support)
switch(g_extern.console.external_launch.support)
{
case EXTERN_LAUNCHER_SALAMANDER:
g_extern.console.mode = MODE_MENU;
g_extern.console.rmenu.mode = MODE_MENU;
break;
#ifdef HAVE_MULTIMAN
case EXTERN_LAUNCHER_MULTIMAN:
RARCH_LOG("Started from multiMAN, will auto-start game.\n");
strlcpy(g_extern.filebrowser_state.rom_path, argv[1], sizeof(g_extern.filebrowser_state.rom_path));
strlcpy(g_extern.file_state.rom_path, argv[1], sizeof(g_extern.file_state.rom_path));
rarch_settings_change(S_START_RARCH);
rarch_startup(default_paths.config_file);
break;
@ -342,23 +342,23 @@ int main(int argc, char *argv[])
}
begin_loop:
if(g_extern.console.mode == MODE_EMULATION)
if(g_extern.console.rmenu.mode == MODE_EMULATION)
{
bool repeat = false;
input_ps3.poll(NULL);
driver.video->set_aspect_ratio(driver.video_data, g_console.aspect_ratio_index);
driver.video->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
do{
repeat = rarch_main_iterate();
}while(repeat && !g_extern.console.frame_advance_enable);
}while(repeat && !g_extern.console.screen.state.frame_advance.enable);
}
else if(g_extern.console.mode == MODE_MENU)
else if(g_extern.console.rmenu.mode == MODE_MENU)
{
menu_loop();
if (g_extern.console.mode != MODE_EXIT)
if (g_extern.console.rmenu.mode != MODE_EXIT)
rarch_startup(default_paths.config_file);
}
else
@ -369,7 +369,7 @@ begin_loop:
begin_shutdown:
rarch_config_save(default_paths.config_file);
if(g_console.emulator_initialized)
if(g_extern.console.emulator_initialized)
rarch_main_deinit();
input_ps3.free(NULL);
@ -398,7 +398,7 @@ begin_shutdown:
/* screenshot PRX */
#ifndef __PSL1GHT__
if(g_console.screenshots_enable)
if(g_extern.console.screen.state.screenshots.enable)
cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_SCREENSHOT);
#endif
@ -423,8 +423,8 @@ begin_shutdown:
#endif
#ifdef HAVE_RARCH_EXEC
if(g_console.return_to_launcher)
rarch_console_exec(g_console.launch_app_on_exit);
if(g_extern.console.external_launch.enable)
rarch_console_exec(g_extern.console.external_launch.launch_app);
#endif
return 1;

View File

@ -95,7 +95,7 @@ static void *ps3_audio_init(const char *device, unsigned rate, unsigned latency)
params.numChannels = AUDIO_CHANNELS;
params.numBlocks = AUDIO_BLOCKS;
#ifdef HAVE_HEADSET
if(g_console.sound_mode == SOUND_MODE_HEADSET)
if(g_extern.console.sound.mode == SOUND_MODE_HEADSET)
params.param_attrib = CELL_AUDIO_PORTATTR_OUT_SECONDARY;
else
#endif

View File

@ -443,11 +443,11 @@ static bool ps3_key_pressed(void *data, int key)
case RARCH_STATE_SLOT_MINUS:
return ((state[0] & PS3_GAMEPAD_RSTICK_LEFT_MASK) && (state[0] & PS3_GAMEPAD_R2));
case RARCH_FRAMEADVANCE:
if(g_extern.console.frame_advance_enable)
if(g_extern.console.screen.state.frame_advance.enable)
{
g_extern.console.enable = true;
g_extern.console.ingame_menu_enable = true;
g_extern.console.mode = MODE_MENU;
g_extern.console.rmenu.state.rmenu.enable = true;
g_extern.console.rmenu.state.ingame_menu.enable = true;
g_extern.console.rmenu.mode = MODE_MENU;
}
return false;
case RARCH_REWIND:
@ -459,17 +459,17 @@ static bool ps3_key_pressed(void *data, int key)
uint32_t r3_pressed = state[0] & PS3_GAMEPAD_R3;
uint32_t l3_pressed = state[0] & PS3_GAMEPAD_L3;
bool retval = false;
g_extern.console.enable = (r3_pressed && l3_pressed && IS_TIMER_EXPIRED(gl));
g_extern.console.ingame_menu_enable = r3_pressed && !l3_pressed;
g_extern.console.rmenu.state.rmenu.enable = (r3_pressed && l3_pressed && IS_TIMER_EXPIRED(gl));
g_extern.console.rmenu.state.ingame_menu.enable = r3_pressed && !l3_pressed;
if(g_extern.console.enable || (g_extern.console.ingame_menu_enable && !g_extern.console.enable))
if(g_extern.console.rmenu.state.rmenu.enable || (g_extern.console.rmenu.state.ingame_menu.enable && !g_extern.console.rmenu.state.rmenu.enable))
{
g_extern.console.mode = MODE_MENU;
g_extern.console.rmenu.mode = MODE_MENU;
SET_TIMER_EXPIRATION(gl, 30);
retval = g_extern.console.enable;
retval = g_extern.console.rmenu.state.rmenu.enable;
}
retval = g_extern.console.ingame_menu_enable ? g_extern.console.ingame_menu_enable : g_extern.console.enable;
retval = g_extern.console.rmenu.state.ingame_menu.enable ? g_extern.console.rmenu.state.ingame_menu.enable : g_extern.console.rmenu.state.rmenu.enable;
return retval;
}
#endif

View File

@ -2458,10 +2458,6 @@ void rarch_main_clear_state(void)
free(g_extern.system.environment_split);
memset(&g_extern, 0, sizeof(g_extern));
#ifdef RARCH_CONSOLE
memset(&g_console, 0, sizeof(g_console));
#endif
init_state();
}
@ -2618,7 +2614,7 @@ bool rarch_main_iterate(void)
if (g_extern.system.shutdown)
{
#ifdef HAVE_RMENU
g_extern.console.mode = MODE_EXIT;
g_extern.console.rmenu.mode = MODE_EXIT;
#endif
return false;
}

View File

@ -29,9 +29,6 @@
struct settings g_settings;
struct global g_extern;
#ifdef RARCH_CONSOLE
struct console_settings g_console;
#endif
const char *config_get_default_audio(void)
{
@ -173,8 +170,8 @@ void config_set_defaults(void)
#if defined(HAVE_CG) || defined(HAVE_XML)
g_settings.video.render_to_texture = render_to_texture;
g_settings.video.fbo_scale_x = fbo_scale_x;
g_settings.video.fbo_scale_y = fbo_scale_y;
g_settings.video.fbo.scale_x = fbo_scale_x;
g_settings.video.fbo.scale_y = fbo_scale_y;
g_settings.video.second_pass_smooth = second_pass_smooth;
#endif
@ -238,7 +235,7 @@ static void parse_config_file(void);
void config_load(void)
{
#ifdef RARCH_CONSOLE
if (!g_console.block_config_read)
if (!g_extern.console.block_config_read)
#endif
{
config_set_defaults();
@ -388,8 +385,8 @@ bool config_load_file(const char *path)
CONFIG_GET_PATH(video.bsnes_shader_path, "video_bsnes_shader");
CONFIG_GET_PATH(video.second_pass_shader, "video_second_pass_shader");
CONFIG_GET_BOOL(video.render_to_texture, "video_render_to_texture");
CONFIG_GET_FLOAT(video.fbo_scale_x, "video_fbo_scale_x");
CONFIG_GET_FLOAT(video.fbo_scale_y, "video_fbo_scale_y");
CONFIG_GET_FLOAT(video.fbo.scale_x, "video_fbo_scale_x");
CONFIG_GET_FLOAT(video.fbo.scale_y, "video_fbo_scale_y");
CONFIG_GET_BOOL(video.second_pass_smooth, "video_second_pass_smooth");
CONFIG_GET_BOOL(video.allow_rotate, "video_allow_rotate");

View File

@ -81,9 +81,9 @@ static void get_environment_settings (void)
}
else
{
XContentQueryVolumeDeviceType("GAME",&g_console.volume_device_type, NULL);
XContentQueryVolumeDeviceType("GAME",&g_extern.file_state.volume_device_type, NULL);
switch(g_console.volume_device_type)
switch(g_extern.file_state.volume_device_type)
{
case XCONTENTDEVICETYPE_HDD:
RARCH_LOG("RetroArch was launched from a content package on HDD.\n");
@ -188,7 +188,7 @@ begin_loop:
input_xinput.poll(NULL);
driver.video->set_aspect_ratio(driver.video_data, g_console.aspect_ratio_index);
driver.video->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
do{
repeat = rarch_main_iterate();
@ -217,8 +217,8 @@ begin_shutdown:
#endif
input_xinput.free(NULL);
if(g_console.return_to_launcher)
rarch_console_exec(g_console.launch_app_on_exit);
if(g_extern.console.external_launch.enable)
rarch_console_exec(g_extern.console.external_launch.launch_app);
return 0;
}

View File

@ -397,13 +397,13 @@ static void xdk_d3d_set_viewport(bool force_full)
float delta;
// If the aspect ratios of screen and desired aspect ratio are sufficiently equal (floating point stuff),
if(g_console.aspect_ratio_index == ASPECT_RATIO_CUSTOM)
if(g_settings.video.aspect_ratio_idx == ASPECT_RATIO_CUSTOM)
{
delta = (desired_aspect / device_aspect - 1.0) / 2.0 + 0.5;
m_viewport_x_temp = g_console.viewports.custom_vp.x;
m_viewport_y_temp = g_console.viewports.custom_vp.y;
m_viewport_width_temp = g_console.viewports.custom_vp.width;
m_viewport_height_temp = g_console.viewports.custom_vp.height;
m_viewport_x_temp = g_extern.console.screen.viewports.custom_vp.x;
m_viewport_y_temp = g_extern.console.screen.viewports.custom_vp.y;
m_viewport_width_temp = g_extern.console.screen.viewports.custom_vp.width;
m_viewport_height_temp = g_extern.console.screen.viewports.custom_vp.height;
}
else if (device_aspect > desired_aspect)
{
@ -492,13 +492,13 @@ static void xdk_d3d_init_fbo(xdk_d3d_video_t *d3d)
}
d3d->d3d_render_device->CreateTexture(512 * g_settings.video.fbo_scale_x, 512 * g_settings.video.fbo_scale_y,
1, 0, g_console.gamma_correction ? ( D3DFORMAT )MAKESRGBFMT( D3DFMT_A8R8G8B8 ) : D3DFMT_A8R8G8B8,
1, 0, g_extern.console.screen.gamma_correction ? ( D3DFORMAT )MAKESRGBFMT( D3DFMT_A8R8G8B8 ) : D3DFMT_A8R8G8B8,
0, &d3d->lpTexture_ot
, NULL
);
d3d->d3d_render_device->CreateRenderTarget(512 * g_settings.video.fbo_scale_x, 512 * g_settings.video.fbo_scale_y,
g_console.gamma_correction ? ( D3DFORMAT )MAKESRGBFMT( D3DFMT_A8R8G8B8 ) : D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE,
g_extern.console.screen.gamma_correction ? ( D3DFORMAT )MAKESRGBFMT( D3DFMT_A8R8G8B8 ) : D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE,
0, 0, &d3d->lpSurface, NULL);
d3d->lpTexture_ot_as16srgb = *d3d->lpTexture_ot;
@ -557,7 +557,7 @@ static void *xdk_d3d_init(const video_info_t *video, const input_driver_t **inpu
xdk_d3d_init_fbo(d3d);
#endif
xdk_d3d_set_rotation(d3d, g_console.screen_orientation);
xdk_d3d_set_rotation(d3d, g_extern.console.screen.orientation);
#if defined(_XBOX1)
/* load debug fonts */
@ -592,11 +592,11 @@ static bool xdk_d3d_frame(void *data, const void *frame,
#ifdef HAVE_FBO
D3DSurface* pRenderTarget0;
#endif
bool menu_enabled = g_console.menu_enable;
bool menu_enabled = g_extern.console.rmenu.state.rmenu.enable;
#ifdef _XBOX1
bool fps_enable = g_console.fps_info_msg_enable;
unsigned flicker_filter = g_console.flicker_filter;
bool soft_filter_enable = g_console.soft_display_filter_enable;
bool fps_enable = g_extern.console.rmenu.state.msg_fps.enable;
unsigned flicker_filter = g_extern.console.screen.state.flicker_filter.value;
bool soft_filter_enable = g_extern.console.screen.soft_filter.enable;
#endif
if (d3d->last_width != width || d3d->last_height != height)
@ -873,12 +873,12 @@ static void xdk_d3d_set_aspect_ratio(void *data, unsigned aspectratio_index)
(void)data;
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
if(g_console.aspect_ratio_index == ASPECT_RATIO_AUTO)
if(g_settings.video.aspect_ratio_idx == ASPECT_RATIO_AUTO)
rarch_set_auto_viewport(g_extern.frame_cache.width, g_extern.frame_cache.height);
else if(g_console.aspect_ratio_index == ASPECT_RATIO_CORE)
else if(g_settings.video.aspect_ratio_idx == ASPECT_RATIO_CORE)
rarch_set_core_viewport();
g_settings.video.aspect_ratio = aspectratio_lut[g_console.aspect_ratio_index].value;
g_settings.video.aspect_ratio = aspectratio_lut[g_settings.video.aspect_ratio_idx].value;
g_settings.video.force_aspect = false;
d3d->should_resize = true;
}

View File

@ -328,11 +328,11 @@ static bool xinput_input_key_pressed(void *data, int key)
case RARCH_STATE_SLOT_MINUS:
return ((state[0] & XINPUT1_GAMEPAD_RSTICK_LEFT_MASK) && (state[0] & XINPUT1_GAMEPAD_RIGHT_TRIGGER));
case RARCH_FRAMEADVANCE:
if(g_console.frame_advance_enable)
if(g_extern.console.screen.state.frame_advance.enable)
{
g_console.menu_enable = true;
g_console.ingame_menu_enable = true;
g_console.mode_switch = MODE_MENU;
g_extern.console.rmenu.state.rmenu.enable = true;
g_extern.console.rmenu.mode = MODE_MENU;
g_extern.console.screen.state.ingame_menu.enable = true;
}
return false;
case RARCH_REWIND:
@ -343,16 +343,16 @@ static bool xinput_input_key_pressed(void *data, int key)
uint32_t left_thumb_pressed = (state[0] & (1 << RETRO_DEVICE_ID_JOYPAD_L3));
uint32_t right_thumb_pressed = (state[0] & (1 << RETRO_DEVICE_ID_JOYPAD_R3));
g_console.menu_enable = right_thumb_pressed && left_thumb_pressed && IS_TIMER_EXPIRED(d3d);
g_console.ingame_menu_enable = right_thumb_pressed && !left_thumb_pressed;
g_extern.console.rmenu.state.rmenu.enable = right_thumb_pressed && left_thumb_pressed && IS_TIMER_EXPIRED(d3d);
g_extern.console.screen.state.ingame_menu.enable = right_thumb_pressed && !left_thumb_pressed;
if(g_console.menu_enable || (g_console.ingame_menu_enable && !g_console.menu_enable))
if(g_extern.console.rmenu.state.rmenu.enable || (g_extern.console.screen.ingame_menu.enable && !g_extern.console.rmenu.state.rmenu.enable))
{
g_console.mode_switch = MODE_MENU;
g_extern.console.rmenu.mode = MODE_MENU;
SET_TIMER_EXPIRATION(d3d, 30);
retval = g_console.menu_enable;
retval = g_extern.console.rmenu.state.rmenu.enable;
}
retval = g_console.ingame_menu_enable ? g_console.ingame_menu_enable : g_console.menu_enable;
retval = g_extern.console.screen.state.ingame_menu.enable ? g_extern.console.screen.state.ingame_menu.enable : g_extern.console.rmenu.state.rmenu.enable;
}
}