2012-04-21 21:13:50 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2012-01-22 00:43:54 +00:00
|
|
|
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
|
|
|
|
* Copyright (C) 2011-2012 - Daniel De Matteis
|
|
|
|
*
|
2012-04-21 21:13:50 +00:00
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
2012-01-22 00:43:54 +00:00
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
2012-04-21 21:13:50 +00:00
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
2012-01-22 00:43:54 +00:00
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
2012-04-21 21:31:57 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
2012-01-22 00:43:54 +00:00
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2012-01-23 21:22:54 +00:00
|
|
|
#include <stdint.h>
|
2012-01-24 00:06:12 +00:00
|
|
|
#include <crtdefs.h>
|
|
|
|
#include <tchar.h>
|
2012-01-22 00:43:54 +00:00
|
|
|
#include <xtl.h>
|
2012-06-22 05:38:53 +00:00
|
|
|
#include "../../console/fileio/file_browser.h"
|
2012-07-28 14:10:31 +00:00
|
|
|
|
2012-07-28 13:54:35 +00:00
|
|
|
#include "../../console/rarch_console.h"
|
2012-07-28 14:10:31 +00:00
|
|
|
#include "../../console/rarch_console_settings.h"
|
|
|
|
#include "../../console/rarch_console_video.h"
|
|
|
|
|
2012-07-08 19:42:26 +00:00
|
|
|
#include "../xdk_d3d9.h"
|
2012-01-22 01:05:09 +00:00
|
|
|
#include "menu.h"
|
2012-06-22 05:38:53 +00:00
|
|
|
#include "../../message.h"
|
2012-01-22 00:43:54 +00:00
|
|
|
|
2012-06-22 05:38:53 +00:00
|
|
|
#include "../../general.h"
|
2012-01-24 00:06:12 +00:00
|
|
|
|
2012-05-29 13:25:39 +00:00
|
|
|
CRetroArch app;
|
2012-05-22 01:10:56 +00:00
|
|
|
HXUIOBJ hCur;
|
2012-07-16 06:37:58 +00:00
|
|
|
filebrowser_t *browser;
|
|
|
|
filebrowser_t *tmp_browser;
|
2012-05-21 16:01:51 +00:00
|
|
|
uint32_t set_shader = 0;
|
2012-07-28 20:36:49 +00:00
|
|
|
|
2012-05-29 17:51:35 +00:00
|
|
|
wchar_t strw_buffer[PATH_MAX];
|
2012-07-28 20:36:49 +00:00
|
|
|
char_t str_buffer[PATH_MAX];
|
2012-01-22 20:47:34 +00:00
|
|
|
|
2012-01-22 00:43:54 +00:00
|
|
|
/* Register custom classes */
|
2012-04-21 21:48:05 +00:00
|
|
|
HRESULT CRetroArch::RegisterXuiClasses (void)
|
2012-01-22 00:43:54 +00:00
|
|
|
{
|
2012-04-21 22:11:48 +00:00
|
|
|
CRetroArchMain::Register();
|
|
|
|
CRetroArchFileBrowser::Register();
|
|
|
|
CRetroArchCoreBrowser::Register();
|
2012-05-21 16:01:51 +00:00
|
|
|
CRetroArchShaderBrowser::Register();
|
2012-04-21 22:11:48 +00:00
|
|
|
CRetroArchQuickMenu::Register();
|
2012-05-23 06:37:31 +00:00
|
|
|
CRetroArchControls::Register();
|
2012-04-21 22:11:48 +00:00
|
|
|
CRetroArchSettings::Register();
|
2012-04-10 19:23:42 +00:00
|
|
|
|
2012-05-29 02:39:54 +00:00
|
|
|
return 0;
|
2012-01-22 00:43:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Unregister custom classes */
|
2012-04-21 21:48:05 +00:00
|
|
|
HRESULT CRetroArch::UnregisterXuiClasses (void)
|
2012-01-22 00:43:54 +00:00
|
|
|
{
|
2012-04-21 22:11:48 +00:00
|
|
|
CRetroArchMain::Unregister();
|
|
|
|
CRetroArchCoreBrowser::Unregister();
|
2012-05-21 16:01:51 +00:00
|
|
|
CRetroArchShaderBrowser::Unregister();
|
2012-04-21 22:11:48 +00:00
|
|
|
CRetroArchFileBrowser::Unregister();
|
|
|
|
CRetroArchQuickMenu::Register();
|
2012-05-23 06:37:31 +00:00
|
|
|
CRetroArchControls::Register();
|
2012-04-21 22:11:48 +00:00
|
|
|
CRetroArchSettings::Unregister();
|
2012-04-10 19:23:42 +00:00
|
|
|
|
2012-05-29 02:39:54 +00:00
|
|
|
return 0;
|
2012-01-22 00:43:54 +00:00
|
|
|
}
|
|
|
|
|
2012-06-30 11:37:18 +00:00
|
|
|
static void filebrowser_fetch_directory_entries(const char *path,
|
|
|
|
filebrowser_t * browser, CXuiList * romlist, CXuiTextElement * rompath_title)
|
2012-02-04 19:33:51 +00:00
|
|
|
{
|
2012-04-10 19:23:42 +00:00
|
|
|
filebrowser_push_directory(browser, path, true);
|
|
|
|
|
2012-07-28 20:36:49 +00:00
|
|
|
convert_char_to_wchar(strw_buffer, path, sizeof(strw_buffer));
|
2012-05-29 17:51:35 +00:00
|
|
|
rompath_title->SetText(strw_buffer);
|
2012-04-10 19:23:42 +00:00
|
|
|
|
|
|
|
romlist->DeleteItems(0, romlist->GetItemCount());
|
2012-06-23 17:58:30 +00:00
|
|
|
romlist->InsertItems(0, browser->current_dir.list->size);
|
2012-06-30 11:37:18 +00:00
|
|
|
|
2012-06-23 17:58:30 +00:00
|
|
|
for(unsigned i = 0; i < browser->current_dir.list->size; i++)
|
2012-04-10 19:23:42 +00:00
|
|
|
{
|
2012-06-18 04:12:37 +00:00
|
|
|
char fname_tmp[256];
|
2012-06-23 17:58:30 +00:00
|
|
|
fill_pathname_base(fname_tmp, browser->current_dir.list->elems[i].data, sizeof(fname_tmp));
|
2012-07-28 20:36:49 +00:00
|
|
|
convert_char_to_wchar(strw_buffer, fname_tmp, sizeof(strw_buffer));
|
2012-05-29 17:51:35 +00:00
|
|
|
romlist->SetText(i, strw_buffer);
|
2012-04-10 19:23:42 +00:00
|
|
|
}
|
2012-02-08 14:23:12 +00:00
|
|
|
}
|
|
|
|
|
2012-04-21 22:11:48 +00:00
|
|
|
HRESULT CRetroArchFileBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
2012-02-08 14:23:12 +00:00
|
|
|
{
|
2012-04-10 19:23:42 +00:00
|
|
|
GetChildById(L"XuiRomList", &m_romlist);
|
|
|
|
GetChildById(L"XuiBackButton1", &m_back);
|
|
|
|
GetChildById(L"XuiTxtRomPath", &m_rompathtitle);
|
|
|
|
GetChildById(L"XuiBtnGameDir", &m_dir_game);
|
|
|
|
GetChildById(L"XuiBtnCacheDir", &m_dir_cache);
|
2012-02-08 14:23:12 +00:00
|
|
|
|
2012-07-16 06:37:58 +00:00
|
|
|
filebrowser_set_root(browser, g_console.default_rom_startup_dir);
|
|
|
|
strlcpy(tmp_browser->extensions, rarch_console_get_rom_ext(), sizeof(tmp_browser->extensions));
|
2012-06-30 11:37:18 +00:00
|
|
|
filebrowser_fetch_directory_entries(g_console.default_rom_startup_dir,
|
2012-07-16 06:37:58 +00:00
|
|
|
browser, &m_romlist, &m_rompathtitle);
|
2012-03-05 12:06:24 +00:00
|
|
|
|
2012-05-29 02:39:54 +00:00
|
|
|
return 0;
|
2012-03-05 12:06:24 +00:00
|
|
|
}
|
|
|
|
|
2012-04-21 22:11:48 +00:00
|
|
|
HRESULT CRetroArchCoreBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
2012-03-05 12:06:24 +00:00
|
|
|
{
|
2012-04-10 19:23:42 +00:00
|
|
|
GetChildById(L"XuiRomList", &m_romlist);
|
|
|
|
GetChildById(L"XuiBackButton1", &m_back);
|
|
|
|
GetChildById(L"XuiTxtRomPath", &m_rompathtitle);
|
|
|
|
|
2012-07-16 06:37:58 +00:00
|
|
|
filebrowser_set_root(tmp_browser, "game:");
|
|
|
|
strlcpy(tmp_browser->extensions, "xex|XEX", sizeof(tmp_browser->extensions));
|
|
|
|
filebrowser_fetch_directory_entries("game:", tmp_browser, &m_romlist, &m_rompathtitle);
|
2012-02-08 14:23:12 +00:00
|
|
|
|
2012-05-29 02:39:54 +00:00
|
|
|
return 0;
|
2012-02-04 19:33:51 +00:00
|
|
|
}
|
|
|
|
|
2012-05-21 16:01:51 +00:00
|
|
|
HRESULT CRetroArchShaderBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
|
|
|
{
|
|
|
|
GetChildById(L"XuiRomList", &m_shaderlist);
|
|
|
|
GetChildById(L"XuiBackButton1", &m_back);
|
|
|
|
GetChildById(L"XuiTxtRomPath", &m_shaderpathtitle);
|
|
|
|
|
2012-07-16 06:37:58 +00:00
|
|
|
filebrowser_set_root(tmp_browser, "game:\\media\\shaders");
|
|
|
|
strlcpy(tmp_browser->extensions, "cg|CG", sizeof(tmp_browser->extensions));
|
|
|
|
filebrowser_fetch_directory_entries("game:\\media\\shaders", tmp_browser,
|
2012-06-30 11:37:18 +00:00
|
|
|
&m_shaderlist, &m_shaderpathtitle);
|
2012-05-21 16:01:51 +00:00
|
|
|
|
2012-05-29 02:39:54 +00:00
|
|
|
return 0;
|
2012-05-21 16:01:51 +00:00
|
|
|
}
|
|
|
|
|
2012-05-23 06:37:31 +00:00
|
|
|
HRESULT CRetroArchControls::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
|
|
|
{
|
|
|
|
unsigned i;
|
|
|
|
int controlno;
|
|
|
|
char buttons[RARCH_FIRST_META_KEY][128];
|
|
|
|
|
|
|
|
GetChildById(L"XuiControlsList", &m_controlslist);
|
|
|
|
GetChildById(L"XuiBackButton", &m_back);
|
|
|
|
GetChildById(L"XuiControlNoSlider", &m_controlnoslider);
|
|
|
|
|
|
|
|
m_controlnoslider.SetValue(g_settings.input.currently_selected_controller_no);
|
|
|
|
m_controlnoslider.GetValue(&controlno);
|
|
|
|
|
|
|
|
for(i = 0; i < RARCH_FIRST_META_KEY; i++)
|
|
|
|
{
|
2012-06-30 11:37:18 +00:00
|
|
|
snprintf(buttons[i], sizeof(buttons[i]), "%s #%d: %s",
|
|
|
|
rarch_input_get_default_keybind_name(i), controlno,
|
|
|
|
rarch_input_find_platform_key_label(g_settings.input.binds[controlno][i].joykey));
|
2012-07-28 20:36:49 +00:00
|
|
|
convert_char_to_wchar(strw_buffer, buttons[i], sizeof(strw_buffer));
|
2012-05-29 17:51:35 +00:00
|
|
|
m_controlslist.SetText(i, strw_buffer);
|
2012-05-23 06:37:31 +00:00
|
|
|
}
|
|
|
|
|
2012-05-29 02:39:54 +00:00
|
|
|
return 0;
|
2012-05-23 06:37:31 +00:00
|
|
|
}
|
|
|
|
|
2012-06-30 11:37:18 +00:00
|
|
|
HRESULT CRetroArchControls::OnControlNavigate(
|
|
|
|
XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled)
|
2012-05-23 06:37:31 +00:00
|
|
|
{
|
|
|
|
char button[128];
|
|
|
|
char buttons[RARCH_FIRST_META_KEY][128];
|
|
|
|
int controlno, i, current_index;
|
|
|
|
|
|
|
|
current_index = m_controlslist.GetCurSel();
|
|
|
|
m_controlnoslider.GetValue(&controlno);
|
|
|
|
|
|
|
|
for(i = 0; i < RARCH_FIRST_META_KEY; i++)
|
|
|
|
{
|
2012-06-30 11:37:18 +00:00
|
|
|
snprintf(buttons[i], sizeof(buttons[i]), "%s #%d: %s",
|
|
|
|
rarch_input_get_default_keybind_name(i), controlno,
|
|
|
|
rarch_input_find_platform_key_label(g_settings.input.binds[controlno][i].joykey));
|
2012-07-28 20:36:49 +00:00
|
|
|
convert_char_to_wchar(strw_buffer, buttons[i], sizeof(strw_buffer));
|
2012-05-29 17:51:35 +00:00
|
|
|
m_controlslist.SetText(i, strw_buffer);
|
2012-05-23 06:37:31 +00:00
|
|
|
}
|
|
|
|
|
2012-05-29 13:25:39 +00:00
|
|
|
switch(pControlNavigateData->nControlNavigate)
|
|
|
|
{
|
|
|
|
case XUI_CONTROL_NAVIGATE_LEFT:
|
|
|
|
if(current_index > 0 && current_index != SETTING_CONTROLS_DEFAULT_ALL)
|
2012-05-29 17:51:35 +00:00
|
|
|
{
|
2012-05-29 13:25:39 +00:00
|
|
|
rarch_input_set_keybind(controlno, KEYBIND_DECREMENT, current_index);
|
2012-06-22 05:20:58 +00:00
|
|
|
snprintf(button, sizeof(button), "%s #%d: %s", rarch_input_get_default_keybind_name(current_index), controlno, rarch_input_find_platform_key_label(g_settings.input.binds[controlno][current_index].joykey));
|
2012-07-28 20:36:49 +00:00
|
|
|
convert_char_to_wchar(strw_buffer, button, sizeof(strw_buffer));
|
2012-05-29 17:51:35 +00:00
|
|
|
m_controlslist.SetText(current_index, strw_buffer);
|
|
|
|
}
|
|
|
|
break;
|
2012-05-29 13:25:39 +00:00
|
|
|
case XUI_CONTROL_NAVIGATE_RIGHT:
|
2012-05-29 17:51:35 +00:00
|
|
|
if(current_index < RARCH_FIRST_META_KEY && current_index != SETTING_CONTROLS_DEFAULT_ALL)
|
|
|
|
{
|
2012-05-29 13:25:39 +00:00
|
|
|
rarch_input_set_keybind(controlno, KEYBIND_INCREMENT, current_index);
|
2012-06-22 05:20:58 +00:00
|
|
|
snprintf(button, sizeof(button), "%s #%d: %s", rarch_input_get_default_keybind_name(current_index), controlno, rarch_input_find_platform_key_label(g_settings.input.binds[controlno][current_index].joykey));
|
2012-07-28 20:36:49 +00:00
|
|
|
convert_char_to_wchar(strw_buffer, button, sizeof(strw_buffer));
|
2012-05-29 17:51:35 +00:00
|
|
|
m_controlslist.SetText(current_index, strw_buffer);
|
|
|
|
}
|
|
|
|
break;
|
2012-05-29 13:25:39 +00:00
|
|
|
case XUI_CONTROL_NAVIGATE_UP:
|
|
|
|
case XUI_CONTROL_NAVIGATE_DOWN:
|
2012-05-29 17:51:35 +00:00
|
|
|
break;
|
2012-05-29 13:25:39 +00:00
|
|
|
}
|
2012-05-23 06:37:31 +00:00
|
|
|
|
2012-05-29 02:39:54 +00:00
|
|
|
return 0;
|
2012-05-23 06:37:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT CRetroArchControls::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
|
|
|
|
{
|
|
|
|
int current_index, i, controlno;
|
|
|
|
char buttons[RARCH_FIRST_META_KEY][128];
|
|
|
|
m_controlnoslider.GetValue(&controlno);
|
|
|
|
|
|
|
|
if ( hObjPressed == m_controlslist)
|
|
|
|
{
|
|
|
|
current_index = m_controlslist.GetCurSel();
|
|
|
|
|
|
|
|
switch(current_index)
|
|
|
|
{
|
|
|
|
case SETTING_CONTROLS_DEFAULT_ALL:
|
|
|
|
rarch_input_set_default_keybinds(0);
|
|
|
|
|
|
|
|
for(i = 0; i < RARCH_FIRST_META_KEY; i++)
|
|
|
|
{
|
2012-06-30 11:37:18 +00:00
|
|
|
snprintf(buttons[i], sizeof(buttons[i]), "%s #%d: %s",
|
|
|
|
rarch_input_get_default_keybind_name(i), controlno,
|
|
|
|
rarch_input_find_platform_key_label(
|
|
|
|
g_settings.input.binds[controlno][i].joykey));
|
2012-07-28 20:36:49 +00:00
|
|
|
convert_char_to_wchar(strw_buffer, buttons[i], sizeof(strw_buffer));
|
2012-05-29 17:51:35 +00:00
|
|
|
m_controlslist.SetText(i, strw_buffer);
|
2012-05-23 06:37:31 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
rarch_input_set_keybind(controlno, KEYBIND_DEFAULT, current_index);
|
2012-06-22 05:20:58 +00:00
|
|
|
snprintf(buttons[current_index], sizeof(buttons[current_index]), "%s #%d: %s", rarch_input_get_default_keybind_name(current_index), controlno, rarch_input_find_platform_key_label(g_settings.input.binds[controlno][current_index].joykey));
|
2012-07-28 20:36:49 +00:00
|
|
|
convert_char_to_wchar(strw_buffer, buttons[current_index], sizeof(strw_buffer));
|
2012-05-29 17:51:35 +00:00
|
|
|
m_controlslist.SetText(current_index, strw_buffer);
|
2012-05-23 06:37:31 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bHandled = TRUE;
|
2012-05-29 02:39:54 +00:00
|
|
|
return 0;
|
2012-05-23 06:37:31 +00:00
|
|
|
}
|
|
|
|
|
2012-04-21 22:11:48 +00:00
|
|
|
HRESULT CRetroArchSettings::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
2012-01-24 05:55:27 +00:00
|
|
|
{
|
2012-04-10 19:23:42 +00:00
|
|
|
GetChildById(L"XuiSettingsList", &m_settingslist);
|
|
|
|
GetChildById(L"XuiBackButton", &m_back);
|
2012-02-09 02:10:20 +00:00
|
|
|
|
2012-04-10 19:23:42 +00:00
|
|
|
m_settingslist.SetText(SETTING_EMU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF");
|
2012-05-28 21:19:40 +00:00
|
|
|
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");
|
2012-04-10 19:23:42 +00:00
|
|
|
m_settingslist.SetText(SETTING_GAMMA_CORRECTION_ENABLED, g_console.gamma_correction_enable ? L"Gamma correction: ON" : L"Gamma correction: OFF");
|
2012-05-08 02:22:53 +00:00
|
|
|
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");
|
2012-05-08 01:36:38 +00:00
|
|
|
m_settingslist.SetText(SETTING_SCALE_ENABLED, g_console.fbo_enabled ? L"Custom Scaling/Dual Shaders: ON" : L"Custom Scaling/Dual Shaders: OFF");
|
2012-06-23 20:55:46 +00:00
|
|
|
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_SHADER, sizeof(strw_buffer));
|
2012-05-29 17:51:35 +00:00
|
|
|
m_settingslist.SetText(SETTING_SHADER, strw_buffer);
|
2012-05-22 14:04:39 +00:00
|
|
|
m_settingslist.SetText(SETTING_COLOR_FORMAT, g_console.color_format ? L"Color format: 32bit ARGB" : L"Color format: 16bit RGBA");
|
2012-06-23 20:55:46 +00:00
|
|
|
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_SHADER_2, sizeof(strw_buffer));
|
2012-05-29 17:51:35 +00:00
|
|
|
m_settingslist.SetText(SETTING_SHADER_2, strw_buffer);
|
2012-06-23 20:55:46 +00:00
|
|
|
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_SCALE_FACTOR, sizeof(strw_buffer));
|
2012-05-29 17:51:35 +00:00
|
|
|
m_settingslist.SetText(SETTING_SCALE_FACTOR, strw_buffer);
|
2012-04-10 19:23:42 +00:00
|
|
|
|
2012-05-29 02:39:54 +00:00
|
|
|
return 0;
|
2012-01-24 05:55:27 +00:00
|
|
|
}
|
|
|
|
|
2012-05-24 09:34:10 +00:00
|
|
|
HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled)
|
|
|
|
{
|
|
|
|
int current_index;
|
2012-07-07 17:15:06 +00:00
|
|
|
xdk_d3d_video_t *vid = (xdk_d3d_video_t*)driver.video_data;
|
2012-05-24 09:34:10 +00:00
|
|
|
|
|
|
|
current_index = m_settingslist.GetCurSel();
|
|
|
|
|
2012-05-29 13:25:39 +00:00
|
|
|
switch(pControlNavigateData->nControlNavigate)
|
|
|
|
{
|
|
|
|
case XUI_CONTROL_NAVIGATE_LEFT:
|
|
|
|
switch(current_index)
|
2012-05-29 17:51:35 +00:00
|
|
|
{
|
2012-05-29 13:25:39 +00:00
|
|
|
case SETTING_SCALE_FACTOR:
|
|
|
|
if(vid->fbo_enabled)
|
2012-05-29 17:51:35 +00:00
|
|
|
{
|
2012-05-29 13:25:39 +00:00
|
|
|
if((g_settings.video.fbo_scale_x > MIN_SCALING_FACTOR))
|
2012-05-29 17:51:35 +00:00
|
|
|
{
|
2012-05-29 13:25:39 +00:00
|
|
|
rarch_settings_change(S_SCALE_FACTOR_DECREMENT);
|
2012-05-29 17:51:35 +00:00
|
|
|
//xdk360_gfx_init_fbo(vid);
|
2012-06-23 20:55:46 +00:00
|
|
|
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_SCALE_FACTOR, sizeof(strw_buffer));
|
2012-05-29 17:51:35 +00:00
|
|
|
m_settingslist.SetText(SETTING_SCALE_FACTOR, strw_buffer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case XUI_CONTROL_NAVIGATE_RIGHT:
|
|
|
|
switch(current_index)
|
|
|
|
{
|
2012-05-29 13:25:39 +00:00
|
|
|
case SETTING_SCALE_FACTOR:
|
2012-05-29 17:51:35 +00:00
|
|
|
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);
|
2012-06-23 20:55:46 +00:00
|
|
|
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_SCALE_FACTOR, sizeof(strw_buffer));
|
2012-05-29 17:51:35 +00:00
|
|
|
m_settingslist.SetText(SETTING_SCALE_FACTOR, strw_buffer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case XUI_CONTROL_NAVIGATE_UP:
|
|
|
|
case XUI_CONTROL_NAVIGATE_DOWN:
|
|
|
|
break;
|
2012-05-29 13:25:39 +00:00
|
|
|
}
|
2012-05-24 09:34:10 +00:00
|
|
|
|
2012-06-30 11:37:18 +00:00
|
|
|
bHandled = TRUE;
|
2012-05-29 17:00:13 +00:00
|
|
|
|
2012-06-30 11:37:18 +00:00
|
|
|
switch(pControlNavigateData->nControlNavigate)
|
|
|
|
{
|
|
|
|
case XUI_CONTROL_NAVIGATE_LEFT:
|
|
|
|
case XUI_CONTROL_NAVIGATE_RIGHT:
|
|
|
|
case XUI_CONTROL_NAVIGATE_UP:
|
|
|
|
case XUI_CONTROL_NAVIGATE_DOWN:
|
|
|
|
pControlNavigateData->hObjDest = pControlNavigateData->hObjSource;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2012-05-29 17:00:13 +00:00
|
|
|
}
|
|
|
|
|
2012-06-30 11:37:18 +00:00
|
|
|
return 0;
|
2012-05-24 09:34:10 +00:00
|
|
|
}
|
|
|
|
|
2012-04-21 22:11:48 +00:00
|
|
|
HRESULT CRetroArchQuickMenu::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
2012-02-14 01:41:35 +00:00
|
|
|
{
|
2012-04-10 19:23:42 +00:00
|
|
|
GetChildById(L"XuiQuickMenuList", &m_quickmenulist);
|
|
|
|
GetChildById(L"XuiBackButton", &m_back);
|
2012-05-29 13:25:39 +00:00
|
|
|
|
2012-06-23 20:55:46 +00:00
|
|
|
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
|
2012-05-29 19:29:32 +00:00
|
|
|
m_quickmenulist.SetText(MENU_ITEM_ORIENTATION, strw_buffer);
|
2012-05-29 13:25:39 +00:00
|
|
|
|
2012-06-23 20:55:46 +00:00
|
|
|
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
|
2012-05-29 17:51:35 +00:00
|
|
|
m_quickmenulist.SetText(MENU_ITEM_KEEP_ASPECT_RATIO, strw_buffer);
|
2012-05-29 19:40:45 +00:00
|
|
|
|
2012-06-23 20:55:46 +00:00
|
|
|
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_LOAD_STATE_SLOT, sizeof(strw_buffer));
|
2012-05-29 19:40:45 +00:00
|
|
|
m_quickmenulist.SetText(MENU_ITEM_LOAD_STATE, strw_buffer);
|
2012-05-29 20:12:28 +00:00
|
|
|
|
2012-06-23 20:55:46 +00:00
|
|
|
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_SAVE_STATE_SLOT, sizeof(strw_buffer));
|
2012-05-29 19:40:45 +00:00
|
|
|
m_quickmenulist.SetText(MENU_ITEM_SAVE_STATE, strw_buffer);
|
2012-04-10 19:23:42 +00:00
|
|
|
|
2012-05-29 02:39:54 +00:00
|
|
|
return 0;
|
2012-02-14 01:41:35 +00:00
|
|
|
}
|
|
|
|
|
2012-05-29 17:00:13 +00:00
|
|
|
HRESULT CRetroArchQuickMenu::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled)
|
|
|
|
{
|
|
|
|
bool aspectratio_changed = false;
|
|
|
|
int current_index;
|
2012-07-07 17:15:06 +00:00
|
|
|
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
|
2012-05-29 17:00:13 +00:00
|
|
|
|
|
|
|
current_index = m_quickmenulist.GetCurSel();
|
|
|
|
|
|
|
|
switch(pControlNavigateData->nControlNavigate)
|
|
|
|
{
|
|
|
|
case XUI_CONTROL_NAVIGATE_LEFT:
|
|
|
|
switch(current_index)
|
|
|
|
{
|
2012-05-29 19:40:45 +00:00
|
|
|
case MENU_ITEM_LOAD_STATE:
|
2012-06-30 11:37:18 +00:00
|
|
|
case MENU_ITEM_SAVE_STATE:
|
2012-05-29 19:40:45 +00:00
|
|
|
rarch_state_slot_decrease();
|
2012-06-23 20:55:46 +00:00
|
|
|
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_LOAD_STATE_SLOT, sizeof(strw_buffer));
|
2012-05-29 19:40:45 +00:00
|
|
|
m_quickmenulist.SetText(MENU_ITEM_LOAD_STATE, strw_buffer);
|
2012-06-23 20:55:46 +00:00
|
|
|
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_SAVE_STATE_SLOT, sizeof(strw_buffer));
|
2012-05-29 19:40:45 +00:00
|
|
|
m_quickmenulist.SetText(MENU_ITEM_SAVE_STATE, strw_buffer);
|
|
|
|
break;
|
2012-05-29 17:00:13 +00:00
|
|
|
case MENU_ITEM_KEEP_ASPECT_RATIO:
|
|
|
|
rarch_settings_change(S_ASPECT_RATIO_DECREMENT);
|
|
|
|
aspectratio_changed = true;
|
|
|
|
break;
|
2012-05-29 19:29:32 +00:00
|
|
|
case MENU_ITEM_ORIENTATION:
|
|
|
|
rarch_settings_change(S_ROTATION_DECREMENT);
|
2012-06-23 20:55:46 +00:00
|
|
|
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
|
2012-05-29 19:29:32 +00:00
|
|
|
m_quickmenulist.SetText(MENU_ITEM_ORIENTATION, strw_buffer);
|
2012-07-07 17:15:06 +00:00
|
|
|
video_xdk_d3d.set_rotation(driver.video_data, g_console.screen_orientation);
|
2012-05-29 19:29:32 +00:00
|
|
|
break;
|
2012-05-29 17:00:13 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case XUI_CONTROL_NAVIGATE_RIGHT:
|
|
|
|
switch(current_index)
|
|
|
|
{
|
2012-05-29 19:40:45 +00:00
|
|
|
case MENU_ITEM_LOAD_STATE:
|
2012-06-30 11:37:18 +00:00
|
|
|
case MENU_ITEM_SAVE_STATE:
|
2012-05-29 19:40:45 +00:00
|
|
|
rarch_state_slot_increase();
|
2012-06-23 20:55:46 +00:00
|
|
|
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_LOAD_STATE_SLOT, sizeof(strw_buffer));
|
2012-05-29 19:40:45 +00:00
|
|
|
m_quickmenulist.SetText(MENU_ITEM_LOAD_STATE, strw_buffer);
|
2012-06-23 20:55:46 +00:00
|
|
|
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_SAVE_STATE_SLOT, sizeof(strw_buffer));
|
2012-05-29 19:40:45 +00:00
|
|
|
m_quickmenulist.SetText(MENU_ITEM_SAVE_STATE, strw_buffer);
|
|
|
|
break;
|
2012-05-29 17:00:13 +00:00
|
|
|
case MENU_ITEM_KEEP_ASPECT_RATIO:
|
|
|
|
rarch_settings_change(S_ASPECT_RATIO_INCREMENT);
|
2012-06-30 11:37:18 +00:00
|
|
|
aspectratio_changed = true;
|
2012-05-29 17:00:13 +00:00
|
|
|
break;
|
2012-05-29 19:29:32 +00:00
|
|
|
case MENU_ITEM_ORIENTATION:
|
|
|
|
rarch_settings_change(S_ROTATION_INCREMENT);
|
2012-06-23 20:55:46 +00:00
|
|
|
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
|
2012-05-29 19:29:32 +00:00
|
|
|
m_quickmenulist.SetText(MENU_ITEM_ORIENTATION, strw_buffer);
|
2012-07-07 17:15:06 +00:00
|
|
|
video_xdk_d3d.set_rotation(driver.video_data, g_console.screen_orientation);
|
2012-05-29 19:29:32 +00:00
|
|
|
break;
|
2012-05-29 17:00:13 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case XUI_CONTROL_NAVIGATE_UP:
|
|
|
|
case XUI_CONTROL_NAVIGATE_DOWN:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(aspectratio_changed)
|
|
|
|
{
|
2012-07-07 12:41:58 +00:00
|
|
|
gfx_ctx_set_aspect_ratio(d3d, g_console.aspect_ratio_index);
|
2012-06-30 11:37:18 +00:00
|
|
|
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
|
2012-05-29 17:51:35 +00:00
|
|
|
m_quickmenulist.SetText(MENU_ITEM_KEEP_ASPECT_RATIO, strw_buffer);
|
2012-05-29 17:00:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bHandled = TRUE;
|
|
|
|
|
2012-06-30 11:37:18 +00:00
|
|
|
switch(pControlNavigateData->nControlNavigate)
|
|
|
|
{
|
|
|
|
case XUI_CONTROL_NAVIGATE_LEFT:
|
|
|
|
case XUI_CONTROL_NAVIGATE_RIGHT:
|
|
|
|
case XUI_CONTROL_NAVIGATE_UP:
|
|
|
|
case XUI_CONTROL_NAVIGATE_DOWN:
|
|
|
|
pControlNavigateData->hObjDest = pControlNavigateData->hObjSource;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2012-05-29 17:00:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-04-21 22:11:48 +00:00
|
|
|
HRESULT CRetroArchQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
|
2012-02-14 01:41:35 +00:00
|
|
|
{
|
2012-07-07 17:15:06 +00:00
|
|
|
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
|
2012-04-10 19:23:42 +00:00
|
|
|
int current_index;
|
|
|
|
|
|
|
|
if ( hObjPressed == m_quickmenulist)
|
|
|
|
{
|
|
|
|
current_index = m_quickmenulist.GetCurSel();
|
|
|
|
|
|
|
|
switch(current_index)
|
|
|
|
{
|
|
|
|
case MENU_ITEM_LOAD_STATE:
|
|
|
|
if (g_console.emulator_initialized)
|
2012-05-29 00:05:23 +00:00
|
|
|
{
|
2012-04-21 21:25:32 +00:00
|
|
|
rarch_load_state();
|
2012-05-29 00:05:23 +00:00
|
|
|
rarch_settings_change(S_RETURN_TO_GAME);
|
|
|
|
}
|
|
|
|
break;
|
2012-04-10 19:23:42 +00:00
|
|
|
case MENU_ITEM_SAVE_STATE:
|
2012-06-30 11:37:18 +00:00
|
|
|
if (g_console.emulator_initialized)
|
|
|
|
{
|
|
|
|
rarch_save_state();
|
|
|
|
rarch_settings_change(S_RETURN_TO_GAME);
|
|
|
|
}
|
2012-04-10 19:23:42 +00:00
|
|
|
break;
|
|
|
|
case MENU_ITEM_KEEP_ASPECT_RATIO:
|
2012-06-30 11:37:18 +00:00
|
|
|
rarch_settings_default(S_DEF_ASPECT_RATIO);
|
2012-07-07 12:41:58 +00:00
|
|
|
gfx_ctx_set_aspect_ratio(d3d, g_console.aspect_ratio_index);
|
2012-06-30 11:37:18 +00:00
|
|
|
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);
|
2012-04-10 19:23:42 +00:00
|
|
|
break;
|
|
|
|
case MENU_ITEM_OVERSCAN_AMOUNT:
|
2012-06-30 11:37:18 +00:00
|
|
|
if(g_console.info_msg_enable)
|
|
|
|
rarch_settings_msg(S_MSG_NOT_IMPLEMENTED, S_DELAY_180);
|
2012-04-10 19:23:42 +00:00
|
|
|
break;
|
|
|
|
case MENU_ITEM_ORIENTATION:
|
2012-06-30 11:37:18 +00:00
|
|
|
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);
|
2012-07-07 17:15:06 +00:00
|
|
|
video_xdk_d3d.set_rotation(driver.video_data, g_console.screen_orientation);
|
2012-04-10 19:23:42 +00:00
|
|
|
break;
|
|
|
|
case MENU_ITEM_RESIZE_MODE:
|
2012-05-28 20:43:08 +00:00
|
|
|
g_console.input_loop = INPUT_LOOP_RESIZE_MODE;
|
2012-06-30 11:37:18 +00:00
|
|
|
|
|
|
|
if (g_console.info_msg_enable)
|
|
|
|
rarch_settings_msg(S_MSG_RESIZE_SCREEN, S_DELAY_270);
|
2012-04-10 19:23:42 +00:00
|
|
|
break;
|
|
|
|
case MENU_ITEM_FRAME_ADVANCE:
|
|
|
|
if (g_console.emulator_initialized)
|
2012-05-29 13:25:39 +00:00
|
|
|
rarch_settings_change(S_FRAME_ADVANCE);
|
2012-04-10 19:23:42 +00:00
|
|
|
break;
|
|
|
|
case MENU_ITEM_SCREENSHOT_MODE:
|
2012-05-29 13:25:39 +00:00
|
|
|
if (g_console.info_msg_enable)
|
2012-05-29 14:45:37 +00:00
|
|
|
rarch_settings_msg(S_MSG_NOT_IMPLEMENTED, S_DELAY_180);
|
2012-04-10 19:23:42 +00:00
|
|
|
break;
|
|
|
|
case MENU_ITEM_RESET:
|
2012-06-30 11:37:18 +00:00
|
|
|
if (g_console.emulator_initialized)
|
|
|
|
{
|
|
|
|
rarch_settings_change(S_RETURN_TO_GAME);
|
|
|
|
rarch_game_reset();
|
|
|
|
}
|
2012-04-10 19:23:42 +00:00
|
|
|
break;
|
|
|
|
case MENU_ITEM_RETURN_TO_GAME:
|
|
|
|
if (g_console.emulator_initialized)
|
2012-05-29 13:25:39 +00:00
|
|
|
rarch_settings_change(S_RETURN_TO_GAME);
|
2012-04-10 19:23:42 +00:00
|
|
|
break;
|
|
|
|
case MENU_ITEM_RETURN_TO_DASHBOARD:
|
2012-05-29 00:17:35 +00:00
|
|
|
rarch_settings_change(S_RETURN_TO_DASHBOARD);
|
2012-04-10 19:23:42 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bHandled = TRUE;
|
2012-02-14 01:41:35 +00:00
|
|
|
|
2012-05-29 02:39:54 +00:00
|
|
|
return 0;
|
2012-02-14 01:41:35 +00:00
|
|
|
}
|
|
|
|
|
2012-04-21 22:11:48 +00:00
|
|
|
HRESULT CRetroArchMain::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
2012-01-23 23:02:02 +00:00
|
|
|
{
|
2012-04-10 19:23:42 +00:00
|
|
|
struct retro_system_info info;
|
|
|
|
retro_get_system_info(&info);
|
|
|
|
const char *id = info.library_name ? info.library_name : "Unknown";
|
|
|
|
|
|
|
|
GetChildById(L"XuiBtnRomBrowser", &m_filebrowser);
|
|
|
|
GetChildById(L"XuiBtnSettings", &m_settings);
|
|
|
|
GetChildById(L"XuiBtnQuickMenu", &m_quick_menu);
|
|
|
|
GetChildById(L"XuiBtnControls", &m_controls);
|
|
|
|
GetChildById(L"XuiBtnQuit", &m_quit);
|
|
|
|
GetChildById(L"XuiTxtTitle", &m_title);
|
|
|
|
GetChildById(L"XuiTxtCoreText", &m_core);
|
2012-07-07 15:08:55 +00:00
|
|
|
GetChildById(L"XuiBtnLibretroCore", &m_change_libretro_core);
|
2012-04-10 19:23:42 +00:00
|
|
|
|
|
|
|
char core_text[256];
|
2012-07-15 19:09:18 +00:00
|
|
|
snprintf(core_text, sizeof(core_text), "%s %s", id, info.library_version);
|
2012-05-21 17:06:31 +00:00
|
|
|
|
2012-07-28 20:36:49 +00:00
|
|
|
convert_char_to_wchar(strw_buffer, core_text, sizeof(strw_buffer));
|
2012-05-29 17:51:35 +00:00
|
|
|
m_core.SetText(strw_buffer);
|
2012-06-23 20:55:46 +00:00
|
|
|
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_RARCH_VERSION, sizeof(strw_buffer));
|
2012-05-29 17:51:35 +00:00
|
|
|
m_title.SetText(strw_buffer);
|
2012-04-10 19:23:42 +00:00
|
|
|
|
2012-05-29 02:39:54 +00:00
|
|
|
return 0;
|
2012-01-23 23:02:02 +00:00
|
|
|
}
|
|
|
|
|
2012-04-21 22:11:48 +00:00
|
|
|
HRESULT CRetroArchFileBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandled )
|
2012-02-04 19:33:51 +00:00
|
|
|
{
|
2012-05-28 15:34:58 +00:00
|
|
|
char path[PATH_MAX];
|
2012-04-10 19:23:42 +00:00
|
|
|
|
|
|
|
if(hObjPressed == m_romlist)
|
|
|
|
{
|
|
|
|
int index = m_romlist.GetCurSel();
|
2012-07-28 20:36:49 +00:00
|
|
|
convert_wchar_to_char(str_buffer, (const wchar_t *)m_romlist.GetText(index), sizeof(str_buffer));
|
2012-07-16 06:37:58 +00:00
|
|
|
if(path_file_exists(browser->current_dir.list->elems[index].data))
|
2012-04-10 19:23:42 +00:00
|
|
|
{
|
2012-07-28 20:36:49 +00:00
|
|
|
snprintf(path, sizeof(path), "%s\\%s", filebrowser_get_current_dir(browser), str_buffer);
|
2012-07-28 17:17:34 +00:00
|
|
|
rarch_console_load_game_wrap(path, g_console.zip_extract_mode, S_DELAY_45);
|
2012-04-10 19:23:42 +00:00
|
|
|
}
|
2012-07-16 06:37:58 +00:00
|
|
|
else if(browser->current_dir.list->elems[index].attr.b)
|
2012-04-10 19:23:42 +00:00
|
|
|
{
|
2012-07-28 20:36:49 +00:00
|
|
|
snprintf(path, sizeof(path), "%s\\%s", filebrowser_get_current_dir(browser), str_buffer);
|
2012-07-16 06:37:58 +00:00
|
|
|
filebrowser_fetch_directory_entries(path, browser, &m_romlist, &m_rompathtitle);
|
2012-04-10 19:23:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (hObjPressed == m_dir_game)
|
|
|
|
{
|
2012-07-16 06:37:58 +00:00
|
|
|
filebrowser_new(browser, g_console.default_rom_startup_dir, rarch_console_get_rom_ext());
|
|
|
|
filebrowser_fetch_directory_entries(g_console.default_rom_startup_dir, browser, &m_romlist, &m_rompathtitle);
|
2012-04-10 19:23:42 +00:00
|
|
|
}
|
2012-06-30 11:37:18 +00:00
|
|
|
#ifdef HAVE_HDD_CACHE_PARTITION
|
2012-04-10 19:23:42 +00:00
|
|
|
else if (hObjPressed == m_dir_cache)
|
|
|
|
{
|
2012-07-16 06:37:58 +00:00
|
|
|
filebrowser_new(browser, "cache:", rarch_console_get_rom_ext());
|
|
|
|
filebrowser_fetch_directory_entries("cache:", browser, &m_romlist, &m_rompathtitle);
|
2012-06-30 11:37:18 +00:00
|
|
|
|
2012-05-28 20:43:08 +00:00
|
|
|
if (g_console.info_msg_enable)
|
2012-05-29 14:45:37 +00:00
|
|
|
rarch_settings_msg(S_MSG_CACHE_PARTITION, S_DELAY_180);
|
2012-04-10 19:23:42 +00:00
|
|
|
}
|
2012-06-30 11:37:18 +00:00
|
|
|
#endif
|
2012-04-10 19:23:42 +00:00
|
|
|
|
|
|
|
bHandled = TRUE;
|
|
|
|
|
2012-05-29 02:39:54 +00:00
|
|
|
return 0;
|
2012-03-05 12:06:24 +00:00
|
|
|
}
|
|
|
|
|
2012-05-21 16:01:51 +00:00
|
|
|
HRESULT CRetroArchShaderBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandled )
|
|
|
|
{
|
2012-05-28 15:34:58 +00:00
|
|
|
char path[PATH_MAX];
|
2012-05-21 16:01:51 +00:00
|
|
|
|
|
|
|
if(hObjPressed == m_shaderlist)
|
|
|
|
{
|
|
|
|
int index = m_shaderlist.GetCurSel();
|
2012-07-16 06:37:58 +00:00
|
|
|
if(path_file_exists(tmp_browser->current_dir.list->elems[index].data))
|
2012-05-21 16:01:51 +00:00
|
|
|
{
|
2012-07-28 20:36:49 +00:00
|
|
|
convert_wchar_to_char(str_buffer, (const wchar_t *)m_shaderlist.GetText(index), sizeof(str_buffer));
|
2012-05-29 00:32:34 +00:00
|
|
|
|
|
|
|
switch(set_shader)
|
|
|
|
{
|
2012-05-28 20:43:08 +00:00
|
|
|
case 1:
|
2012-07-28 20:36:49 +00:00
|
|
|
snprintf(g_settings.video.cg_shader_path, sizeof(g_settings.video.cg_shader_path), "%s\\%s", filebrowser_get_current_dir(tmp_browser), str_buffer);
|
2012-06-28 15:35:20 +00:00
|
|
|
rarch_load_shader(set_shader, g_settings.video.cg_shader_path);
|
2012-05-29 00:32:34 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2012-07-28 20:36:49 +00:00
|
|
|
snprintf (g_settings.video.second_pass_shader, sizeof(g_settings.video.second_pass_shader), "%s\\%s", filebrowser_get_current_dir(tmp_browser), str_buffer);
|
2012-06-28 15:35:20 +00:00
|
|
|
rarch_load_shader(set_shader, g_settings.video.second_pass_shader);
|
2012-05-29 00:32:34 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2012-05-21 16:01:51 +00:00
|
|
|
}
|
2012-07-16 06:37:58 +00:00
|
|
|
else if(tmp_browser->current_dir.list->elems[index].attr.b)
|
2012-05-21 16:01:51 +00:00
|
|
|
{
|
2012-07-28 20:36:49 +00:00
|
|
|
convert_wchar_to_char(str_buffer, (const wchar_t *)m_shaderlist.GetText(index), sizeof(str_buffer));
|
|
|
|
snprintf(path, sizeof(path), "%s\\%s", filebrowser_get_current_dir(tmp_browser), str_buffer);
|
2012-07-16 06:37:58 +00:00
|
|
|
filebrowser_fetch_directory_entries(path, tmp_browser, &m_shaderlist, &m_shaderpathtitle);
|
2012-05-21 16:01:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bHandled = TRUE;
|
|
|
|
|
2012-05-29 02:39:54 +00:00
|
|
|
return 0;
|
2012-05-21 16:01:51 +00:00
|
|
|
}
|
|
|
|
|
2012-04-21 22:11:48 +00:00
|
|
|
HRESULT CRetroArchCoreBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandled )
|
2012-03-05 12:06:24 +00:00
|
|
|
{
|
2012-05-28 15:34:58 +00:00
|
|
|
char path[PATH_MAX];
|
2012-04-10 19:23:42 +00:00
|
|
|
|
|
|
|
if(hObjPressed == m_romlist)
|
|
|
|
{
|
|
|
|
int index = m_romlist.GetCurSel();
|
2012-07-16 06:37:58 +00:00
|
|
|
if(path_file_exists(tmp_browser->current_dir.list->elems[index].data))
|
2012-04-10 19:23:42 +00:00
|
|
|
{
|
2012-07-28 20:36:49 +00:00
|
|
|
convert_wchar_to_char(str_buffer, (const wchar_t *)m_romlist.GetText(index), sizeof(str_buffer));
|
|
|
|
snprintf(g_console.launch_app_on_exit, sizeof(g_console.launch_app_on_exit), "%s\\%s", filebrowser_get_current_dir(tmp_browser), str_buffer);
|
2012-05-29 18:01:29 +00:00
|
|
|
rarch_settings_change(S_RETURN_TO_LAUNCHER);
|
2012-04-10 19:23:42 +00:00
|
|
|
}
|
2012-07-16 06:37:58 +00:00
|
|
|
else if(tmp_browser->current_dir.list->elems[index].attr.b)
|
2012-04-10 19:23:42 +00:00
|
|
|
{
|
2012-07-28 20:36:49 +00:00
|
|
|
convert_wchar_to_char(str_buffer, (const wchar_t *)m_romlist.GetText(index), sizeof(str_buffer));
|
|
|
|
snprintf(path, sizeof(path), "%s%s\\", filebrowser_get_current_dir(tmp_browser), str_buffer);
|
2012-07-16 06:37:58 +00:00
|
|
|
filebrowser_fetch_directory_entries(path, tmp_browser, &m_romlist, &m_rompathtitle);
|
2012-04-10 19:23:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bHandled = TRUE;
|
2012-05-29 02:39:54 +00:00
|
|
|
return 0;
|
2012-02-04 19:33:51 +00:00
|
|
|
}
|
|
|
|
|
2012-04-21 22:11:48 +00:00
|
|
|
HRESULT CRetroArchSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
|
2012-01-24 05:55:27 +00:00
|
|
|
{
|
2012-04-10 19:23:42 +00:00
|
|
|
int current_index;
|
2012-05-21 16:01:51 +00:00
|
|
|
HRESULT hr;
|
2012-04-10 19:23:42 +00:00
|
|
|
|
|
|
|
if ( hObjPressed == m_settingslist)
|
|
|
|
{
|
|
|
|
current_index = m_settingslist.GetCurSel();
|
|
|
|
|
|
|
|
switch(current_index)
|
|
|
|
{
|
|
|
|
case SETTING_EMU_REWIND_ENABLED:
|
2012-05-29 01:49:19 +00:00
|
|
|
rarch_settings_change(S_REWIND);
|
2012-05-29 00:32:34 +00:00
|
|
|
m_settingslist.SetText(SETTING_EMU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF");
|
|
|
|
|
|
|
|
if (g_console.info_msg_enable)
|
2012-05-29 14:45:37 +00:00
|
|
|
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
|
2012-05-29 00:32:34 +00:00
|
|
|
break;
|
2012-05-28 21:19:40 +00:00
|
|
|
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");
|
|
|
|
break;
|
|
|
|
case SETTING_EMU_MENUS:
|
2012-05-29 13:25:39 +00:00
|
|
|
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");
|
|
|
|
break;
|
2012-04-10 19:23:42 +00:00
|
|
|
case SETTING_GAMMA_CORRECTION_ENABLED:
|
|
|
|
g_console.gamma_correction_enable = !g_console.gamma_correction_enable;
|
|
|
|
m_settingslist.SetText(SETTING_GAMMA_CORRECTION_ENABLED, g_console.gamma_correction_enable ? L"Gamma correction: ON" : L"Gamma correction: OFF");
|
2012-05-29 13:25:39 +00:00
|
|
|
if(g_console.info_msg_enable)
|
2012-05-29 14:45:37 +00:00
|
|
|
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
|
2012-04-10 19:23:42 +00:00
|
|
|
break;
|
2012-05-22 14:04:39 +00:00
|
|
|
case SETTING_COLOR_FORMAT:
|
2012-05-28 20:43:08 +00:00
|
|
|
g_console.color_format = !g_console.color_format;
|
2012-05-22 14:04:39 +00:00
|
|
|
m_settingslist.SetText(SETTING_COLOR_FORMAT, g_console.color_format ? L"Color format: 32bit ARGB" : L"Color format: 16bit RGBA");
|
2012-05-29 14:45:37 +00:00
|
|
|
if(g_console.info_msg_enable)
|
|
|
|
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
|
2012-05-28 20:43:08 +00:00
|
|
|
break;
|
2012-05-21 16:01:51 +00:00
|
|
|
case SETTING_SHADER:
|
2012-05-28 20:43:08 +00:00
|
|
|
set_shader = 1;
|
2012-05-28 21:19:40 +00:00
|
|
|
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);
|
2012-05-21 16:01:51 +00:00
|
|
|
|
2012-05-28 20:43:08 +00:00
|
|
|
if (hr < 0)
|
|
|
|
RARCH_ERR("Failed to load scene.\n");
|
2012-06-30 11:37:18 +00:00
|
|
|
|
2012-05-28 20:43:08 +00:00
|
|
|
hCur = app.hShaderBrowser;
|
2012-05-29 13:25:39 +00:00
|
|
|
|
2012-06-30 11:37:18 +00:00
|
|
|
if (g_console.info_msg_enable)
|
|
|
|
rarch_settings_msg(S_MSG_SELECT_SHADER, S_DELAY_180);
|
|
|
|
|
2012-05-28 20:43:08 +00:00
|
|
|
NavigateForward(app.hShaderBrowser);
|
|
|
|
break;
|
2012-05-21 16:01:51 +00:00
|
|
|
case SETTING_SHADER_2:
|
2012-05-29 00:32:34 +00:00
|
|
|
set_shader = 2;
|
2012-05-28 21:19:40 +00:00
|
|
|
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);
|
2012-05-28 20:43:08 +00:00
|
|
|
if (hr < 0)
|
2012-06-30 11:37:18 +00:00
|
|
|
RARCH_ERR("Failed to load scene.\n");
|
|
|
|
|
2012-05-28 20:43:08 +00:00
|
|
|
hCur = app.hShaderBrowser;
|
2012-06-30 11:37:18 +00:00
|
|
|
|
|
|
|
if (g_console.info_msg_enable)
|
|
|
|
rarch_settings_msg(S_MSG_SELECT_SHADER, S_DELAY_180);
|
|
|
|
|
2012-05-28 20:43:08 +00:00
|
|
|
NavigateForward(app.hShaderBrowser);
|
|
|
|
break;
|
2012-05-08 02:22:53 +00:00
|
|
|
case SETTING_HW_TEXTURE_FILTER:
|
2012-04-10 19:23:42 +00:00
|
|
|
g_settings.video.smooth = !g_settings.video.smooth;
|
2012-05-28 20:43:08 +00:00
|
|
|
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");
|
2012-05-08 02:22:53 +00:00
|
|
|
break;
|
|
|
|
case SETTING_HW_TEXTURE_FILTER_2:
|
|
|
|
g_settings.video.second_pass_smooth = !g_settings.video.second_pass_smooth;
|
2012-05-28 20:43:08 +00:00
|
|
|
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");
|
2012-04-10 19:23:42 +00:00
|
|
|
break;
|
2012-05-08 01:36:38 +00:00
|
|
|
case SETTING_SCALE_ENABLED:
|
2012-05-28 20:43:08 +00:00
|
|
|
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");
|
|
|
|
gfx_ctx_set_fbo(g_console.fbo_enabled);
|
|
|
|
break;
|
2012-04-10 19:23:42 +00:00
|
|
|
}
|
|
|
|
}
|
2012-02-14 01:41:35 +00:00
|
|
|
|
2012-04-10 19:23:42 +00:00
|
|
|
bHandled = TRUE;
|
2012-05-29 02:39:54 +00:00
|
|
|
return 0;
|
2012-01-24 05:55:27 +00:00
|
|
|
}
|
|
|
|
|
2012-04-21 22:11:48 +00:00
|
|
|
HRESULT CRetroArchMain::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
|
2012-01-23 23:02:02 +00:00
|
|
|
{
|
2012-07-07 17:15:06 +00:00
|
|
|
xdk_d3d_video_t *vid = (xdk_d3d_video_t*)driver.video_data;
|
2012-04-10 19:23:42 +00:00
|
|
|
|
2012-05-28 21:19:40 +00:00
|
|
|
bool hdmenus_allowed = g_console.menus_hd_enable;
|
2012-04-10 19:23:42 +00:00
|
|
|
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
if ( hObjPressed == m_filebrowser )
|
|
|
|
{
|
2012-04-21 21:25:32 +00:00
|
|
|
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_filebrowser.xur", NULL, &app.hFileBrowser);
|
2012-04-10 19:23:42 +00:00
|
|
|
|
2012-05-28 12:05:28 +00:00
|
|
|
if (hr < 0)
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_ERR("Failed to load scene.\n");
|
2012-05-28 20:43:08 +00:00
|
|
|
|
|
|
|
hCur = app.hFileBrowser;
|
2012-04-10 19:23:42 +00:00
|
|
|
NavigateForward(app.hFileBrowser);
|
|
|
|
}
|
|
|
|
else if ( hObjPressed == m_quick_menu)
|
|
|
|
{
|
2012-04-21 21:25:32 +00:00
|
|
|
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_quickmenu.xur", NULL, &app.hQuickMenu);
|
2012-04-10 19:23:42 +00:00
|
|
|
|
2012-05-28 12:05:28 +00:00
|
|
|
if (hr < 0)
|
2012-06-30 11:37:18 +00:00
|
|
|
{
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_ERR("Failed to load scene.\n");
|
2012-06-30 11:37:18 +00:00
|
|
|
}
|
2012-05-28 20:43:08 +00:00
|
|
|
|
|
|
|
hCur = app.hQuickMenu;
|
2012-04-10 19:23:42 +00:00
|
|
|
NavigateForward(app.hQuickMenu);
|
|
|
|
}
|
2012-05-22 02:52:12 +00:00
|
|
|
else if ( hObjPressed == m_controls)
|
|
|
|
{
|
2012-05-23 06:37:31 +00:00
|
|
|
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_controls.xur", NULL, &app.hControlsMenu);
|
|
|
|
|
2012-05-28 12:05:28 +00:00
|
|
|
if (hr < 0)
|
2012-06-30 11:37:18 +00:00
|
|
|
{
|
2012-05-23 06:37:31 +00:00
|
|
|
RARCH_ERR("Failed to load scene.\n");
|
2012-06-30 11:37:18 +00:00
|
|
|
}
|
2012-05-28 20:43:08 +00:00
|
|
|
|
|
|
|
hCur = app.hControlsMenu;
|
2012-06-30 11:37:18 +00:00
|
|
|
|
2012-05-28 20:43:08 +00:00
|
|
|
if (g_console.info_msg_enable)
|
2012-05-29 14:45:37 +00:00
|
|
|
rarch_settings_msg(S_MSG_CHANGE_CONTROLS, S_DELAY_180);
|
2012-06-30 11:37:18 +00:00
|
|
|
|
2012-05-23 06:37:31 +00:00
|
|
|
NavigateForward(app.hControlsMenu);
|
2012-05-22 02:52:12 +00:00
|
|
|
}
|
2012-04-21 22:34:33 +00:00
|
|
|
else if ( hObjPressed == m_change_libretro_core )
|
2012-04-10 19:23:42 +00:00
|
|
|
{
|
2012-04-21 22:34:33 +00:00
|
|
|
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_libretrocore_browser.xur", NULL, &app.hCoreBrowser);
|
2012-04-10 19:23:42 +00:00
|
|
|
|
2012-05-28 12:05:28 +00:00
|
|
|
if (hr < 0)
|
2012-04-10 19:23:42 +00:00
|
|
|
{
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_ERR("Failed to load scene.\n");
|
2012-04-10 19:23:42 +00:00
|
|
|
}
|
2012-05-28 20:43:08 +00:00
|
|
|
hCur = app.hCoreBrowser;
|
2012-05-29 00:32:34 +00:00
|
|
|
|
2012-05-28 20:43:08 +00:00
|
|
|
if (g_console.info_msg_enable)
|
2012-05-29 14:45:37 +00:00
|
|
|
rarch_settings_msg(S_MSG_SELECT_LIBRETRO_CORE, S_DELAY_180);
|
2012-06-30 11:37:18 +00:00
|
|
|
|
2012-04-10 19:23:42 +00:00
|
|
|
NavigateForward(app.hCoreBrowser);
|
|
|
|
}
|
|
|
|
else if ( hObjPressed == m_settings )
|
|
|
|
{
|
2012-04-21 22:11:48 +00:00
|
|
|
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_settings.xur", NULL, &app.hRetroArchSettings);
|
2012-04-10 19:23:42 +00:00
|
|
|
|
2012-05-28 12:05:28 +00:00
|
|
|
if (hr < 0)
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_ERR("Failed to load scene.\n");
|
2012-05-28 20:43:08 +00:00
|
|
|
|
|
|
|
hCur = app.hRetroArchSettings;
|
2012-04-21 22:11:48 +00:00
|
|
|
NavigateForward(app.hRetroArchSettings);
|
2012-04-10 19:23:42 +00:00
|
|
|
}
|
|
|
|
else if ( hObjPressed == m_quit )
|
2012-05-29 00:17:35 +00:00
|
|
|
rarch_settings_change(S_RETURN_TO_DASHBOARD);
|
2012-04-10 19:23:42 +00:00
|
|
|
|
|
|
|
bHandled = TRUE;
|
2012-05-28 12:05:28 +00:00
|
|
|
return 0;
|
2012-01-23 23:02:02 +00:00
|
|
|
}
|
|
|
|
|
2012-01-22 20:47:34 +00:00
|
|
|
int menu_init (void)
|
|
|
|
{
|
2012-04-10 19:23:42 +00:00
|
|
|
HRESULT hr;
|
2012-01-22 20:47:34 +00:00
|
|
|
|
2012-07-07 17:15:06 +00:00
|
|
|
xdk_d3d_video_t *vid = (xdk_d3d_video_t*)driver.video_data;
|
2012-04-10 19:23:42 +00:00
|
|
|
|
2012-06-05 19:01:25 +00:00
|
|
|
bool hdmenus_allowed = g_console.menus_hd_enable;
|
|
|
|
|
2012-04-17 03:23:54 +00:00
|
|
|
hr = app.InitShared(vid->d3d_render_device, &vid->d3dpp, XuiPNGTextureLoader);
|
2012-04-10 19:23:42 +00:00
|
|
|
|
2012-05-28 12:05:28 +00:00
|
|
|
if (hr < 0)
|
2012-04-10 19:23:42 +00:00
|
|
|
{
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_ERR("Failed initializing XUI application.\n");
|
2012-04-10 19:23:42 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Register font */
|
2012-04-21 21:53:43 +00:00
|
|
|
hr = app.RegisterDefaultTypeface(L"Arial Unicode MS", L"file://game:/media/rarch.ttf" );
|
2012-05-28 12:05:28 +00:00
|
|
|
if (hr < 0)
|
2012-04-10 19:23:42 +00:00
|
|
|
{
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_ERR("Failed to register default typeface.\n");
|
2012-04-10 19:23:42 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2012-04-21 21:25:32 +00:00
|
|
|
hr = app.LoadSkin( L"file://game:/media/rarch_scene_skin.xur");
|
2012-05-28 12:05:28 +00:00
|
|
|
if (hr < 0)
|
2012-04-10 19:23:42 +00:00
|
|
|
{
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_ERR("Failed to load skin.\n");
|
2012-04-10 19:23:42 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2012-06-05 19:01:25 +00:00
|
|
|
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_main.xur", NULL, &app.hMainScene);
|
2012-05-28 12:05:28 +00:00
|
|
|
if (hr < 0)
|
2012-04-10 19:23:42 +00:00
|
|
|
{
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_ERR("Failed to create scene 'rarch_main.xur'.\n");
|
2012-04-10 19:23:42 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2012-05-22 01:10:56 +00:00
|
|
|
hCur = app.hMainScene;
|
2012-04-10 19:23:42 +00:00
|
|
|
XuiSceneNavigateFirst(app.GetRootObj(), app.hMainScene, XUSER_INDEX_FOCUS);
|
|
|
|
|
2012-07-16 06:37:58 +00:00
|
|
|
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());
|
2012-04-10 19:23:42 +00:00
|
|
|
|
|
|
|
return 0;
|
2012-01-22 21:45:32 +00:00
|
|
|
}
|
|
|
|
|
2012-06-18 04:22:26 +00:00
|
|
|
void menu_free (void)
|
2012-04-17 03:35:25 +00:00
|
|
|
{
|
2012-07-16 06:37:58 +00:00
|
|
|
filebrowser_free(browser);
|
|
|
|
filebrowser_free(tmp_browser);
|
|
|
|
free(browser);
|
|
|
|
free(tmp_browser);
|
2012-05-29 13:25:39 +00:00
|
|
|
app.Uninit();
|
2012-04-17 03:35:25 +00:00
|
|
|
}
|
|
|
|
|
2012-06-28 16:53:35 +00:00
|
|
|
static void ingame_menu_resize (void)
|
|
|
|
{
|
2012-06-30 11:37:18 +00:00
|
|
|
XINPUT_STATE state;
|
|
|
|
|
|
|
|
XInputGetState(0, &state);
|
|
|
|
|
|
|
|
if(state.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_LEFT || state.Gamepad.sThumbLX < -DEADZONE)
|
|
|
|
g_console.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;
|
|
|
|
|
|
|
|
if (state.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP || state.Gamepad.sThumbLY > DEADZONE)
|
|
|
|
g_console.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;
|
|
|
|
|
|
|
|
if (state.Gamepad.sThumbRX < -DEADZONE || state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB)
|
|
|
|
g_console.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;
|
|
|
|
|
|
|
|
if (state.Gamepad.sThumbRY > DEADZONE || state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_SHOULDER)
|
|
|
|
g_console.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;
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
if(state.Gamepad.wButtons & XINPUT_GAMEPAD_B)
|
|
|
|
g_console.input_loop = INPUT_LOOP_MENU;
|
2012-06-28 16:53:35 +00:00
|
|
|
}
|
|
|
|
|
2012-01-22 21:45:32 +00:00
|
|
|
void menu_loop(void)
|
|
|
|
{
|
2012-04-10 19:23:42 +00:00
|
|
|
HRESULT hr;
|
2012-07-07 17:15:06 +00:00
|
|
|
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
|
2012-04-10 19:23:42 +00:00
|
|
|
|
2012-05-28 00:29:51 +00:00
|
|
|
g_console.menu_enable = true;
|
|
|
|
|
2012-07-07 12:41:58 +00:00
|
|
|
d3d->block_swap = true;
|
2012-04-10 19:23:42 +00:00
|
|
|
|
2012-05-22 00:19:40 +00:00
|
|
|
g_console.input_loop = INPUT_LOOP_MENU;
|
|
|
|
|
2012-04-10 19:23:42 +00:00
|
|
|
do
|
|
|
|
{
|
2012-05-29 14:45:37 +00:00
|
|
|
if(g_console.emulator_initialized)
|
2012-05-28 13:43:56 +00:00
|
|
|
rarch_render_cached_frame();
|
2012-06-30 11:37:18 +00:00
|
|
|
else
|
|
|
|
{
|
2012-07-07 12:41:58 +00:00
|
|
|
d3d->d3d_render_device->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0, 0, 0, 0), 1.0f, 0);
|
|
|
|
d3d->frame_count++;
|
2012-06-30 11:37:18 +00:00
|
|
|
}
|
2012-04-10 19:23:42 +00:00
|
|
|
|
|
|
|
XINPUT_STATE state;
|
|
|
|
XInputGetState(0, &state);
|
|
|
|
|
|
|
|
g_console.menu_enable = !((state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB)
|
2012-05-29 13:25:39 +00:00
|
|
|
&& (state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) && (g_console.emulator_initialized)
|
2012-07-07 12:41:58 +00:00
|
|
|
&& IS_TIMER_EXPIRED(d3d));
|
2012-05-29 13:25:39 +00:00
|
|
|
|
2012-04-10 19:23:42 +00:00
|
|
|
g_console.mode_switch = g_console.menu_enable ? MODE_MENU : MODE_EMULATION;
|
|
|
|
|
2012-05-29 13:25:39 +00:00
|
|
|
switch(g_console.input_loop)
|
|
|
|
{
|
2012-05-22 00:19:40 +00:00
|
|
|
case INPUT_LOOP_MENU:
|
2012-06-30 11:37:18 +00:00
|
|
|
app.RunFrame(); /* Update XUI */
|
2012-05-29 14:45:37 +00:00
|
|
|
if(state.Gamepad.wButtons & XINPUT_GAMEPAD_B && hCur != app.hMainScene)
|
2012-05-22 01:10:56 +00:00
|
|
|
XuiSceneNavigateBack(hCur, app.hMainScene, XUSER_INDEX_ANY);
|
2012-05-29 14:45:37 +00:00
|
|
|
break;
|
|
|
|
case INPUT_LOOP_RESIZE_MODE:
|
2012-06-28 16:53:35 +00:00
|
|
|
ingame_menu_resize();
|
2012-05-29 14:45:37 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2012-05-29 13:25:39 +00:00
|
|
|
}
|
2012-05-22 00:19:40 +00:00
|
|
|
|
2012-06-30 11:37:18 +00:00
|
|
|
hr = app.Render(); /* Render XUI */
|
|
|
|
hr = XuiTimersRun(); /* Update XUI timers */
|
2012-04-10 19:23:42 +00:00
|
|
|
|
|
|
|
if(g_console.mode_switch == MODE_EMULATION && !g_console.frame_advance_enable)
|
|
|
|
{
|
2012-07-07 12:41:58 +00:00
|
|
|
SET_TIMER_EXPIRATION(d3d, 30);
|
2012-04-10 19:23:42 +00:00
|
|
|
}
|
|
|
|
|
2012-05-29 14:45:37 +00:00
|
|
|
const char *message = msg_queue_pull(g_extern.msg_queue);
|
2012-05-22 13:21:45 +00:00
|
|
|
|
2012-05-29 14:45:37 +00:00
|
|
|
if (message)
|
2012-05-29 13:25:39 +00:00
|
|
|
{
|
2012-07-07 12:41:58 +00:00
|
|
|
if(IS_TIMER_EXPIRED(d3d))
|
2012-05-29 14:45:37 +00:00
|
|
|
{
|
|
|
|
xdk360_console_format(message);
|
2012-07-07 12:41:58 +00:00
|
|
|
SET_TIMER_EXPIRATION(d3d, 30);
|
2012-05-29 14:45:37 +00:00
|
|
|
}
|
|
|
|
xdk360_console_draw();
|
2012-05-29 13:25:39 +00:00
|
|
|
}
|
2012-05-22 13:21:45 +00:00
|
|
|
|
2012-05-28 00:29:51 +00:00
|
|
|
gfx_ctx_swap_buffers();
|
2012-04-10 19:23:42 +00:00
|
|
|
}while(g_console.menu_enable);
|
|
|
|
|
2012-07-07 12:41:58 +00:00
|
|
|
d3d->block_swap = false;
|
2012-02-13 21:45:28 +00:00
|
|
|
|
2012-04-10 19:23:42 +00:00
|
|
|
g_console.ingame_menu_enable = false;
|
2012-01-23 23:02:02 +00:00
|
|
|
}
|