mirror of
https://github.com/libretro/RetroArch
synced 2025-04-17 02:43:03 +00:00
Merge branch 'master' of https://github.com/Themaister/RetroArch
This commit is contained in:
commit
ab15b89247
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,8 +1,12 @@
|
||||
*.o
|
||||
*.bmpobj
|
||||
*.binobj
|
||||
*.so
|
||||
*.dll
|
||||
*.a
|
||||
*.elf
|
||||
*.dol
|
||||
*.map
|
||||
/retroarch
|
||||
/retroarch.*
|
||||
/config.h
|
||||
@ -17,3 +21,4 @@ Debug
|
||||
Release
|
||||
ipch
|
||||
*.user
|
||||
/wii/app_booter/app_booter.bin
|
||||
|
@ -39,6 +39,35 @@ uint32_t set_shader = 0;
|
||||
wchar_t strw_buffer[PATH_MAX];
|
||||
char str_buffer[PATH_MAX];
|
||||
|
||||
enum
|
||||
{
|
||||
RMENU_DEVICE_NAV_UP = 0,
|
||||
RMENU_DEVICE_NAV_DOWN,
|
||||
RMENU_DEVICE_NAV_LEFT,
|
||||
RMENU_DEVICE_NAV_RIGHT,
|
||||
RMENU_DEVICE_NAV_UP_ANALOG_L,
|
||||
RMENU_DEVICE_NAV_DOWN_ANALOG_L,
|
||||
RMENU_DEVICE_NAV_LEFT_ANALOG_L,
|
||||
RMENU_DEVICE_NAV_RIGHT_ANALOG_L,
|
||||
RMENU_DEVICE_NAV_UP_ANALOG_R,
|
||||
RMENU_DEVICE_NAV_DOWN_ANALOG_R,
|
||||
RMENU_DEVICE_NAV_LEFT_ANALOG_R,
|
||||
RMENU_DEVICE_NAV_RIGHT_ANALOG_R,
|
||||
RMENU_DEVICE_NAV_B,
|
||||
RMENU_DEVICE_NAV_A,
|
||||
RMENU_DEVICE_NAV_X,
|
||||
RMENU_DEVICE_NAV_Y,
|
||||
RMENU_DEVICE_NAV_START,
|
||||
RMENU_DEVICE_NAV_SELECT,
|
||||
RMENU_DEVICE_NAV_L1,
|
||||
RMENU_DEVICE_NAV_R1,
|
||||
RMENU_DEVICE_NAV_L2,
|
||||
RMENU_DEVICE_NAV_R2,
|
||||
RMENU_DEVICE_NAV_L3,
|
||||
RMENU_DEVICE_NAV_R3,
|
||||
RMENU_DEVICE_NAV_LAST
|
||||
};
|
||||
|
||||
/* Register custom classes */
|
||||
HRESULT CRetroArch::RegisterXuiClasses (void)
|
||||
{
|
||||
@ -67,12 +96,44 @@ HRESULT CRetroArch::UnregisterXuiClasses (void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void filebrowser_fetch_directory_entries(const char *path,
|
||||
filebrowser_t * browser, CXuiList * romlist, CXuiTextElement * rompath_title)
|
||||
static void browser_update(filebrowser_t * b, uint64_t input, const char *extensions)
|
||||
{
|
||||
filebrowser_push_directory(browser, path, true);
|
||||
bool ret = true;
|
||||
filebrowser_action_t action = FILEBROWSER_ACTION_NOOP;
|
||||
|
||||
convert_char_to_wchar(strw_buffer, path, sizeof(strw_buffer));
|
||||
if (input & (1 << RMENU_DEVICE_NAV_DOWN))
|
||||
action = FILEBROWSER_ACTION_DOWN;
|
||||
else if (input & (1 << RMENU_DEVICE_NAV_UP))
|
||||
action = FILEBROWSER_ACTION_UP;
|
||||
else if (input & (1 << RMENU_DEVICE_NAV_RIGHT))
|
||||
action = FILEBROWSER_ACTION_RIGHT;
|
||||
else if (input & (1 << RMENU_DEVICE_NAV_LEFT))
|
||||
action = FILEBROWSER_ACTION_LEFT;
|
||||
else if (input & (1 << RMENU_DEVICE_NAV_R2))
|
||||
action = FILEBROWSER_ACTION_SCROLL_DOWN;
|
||||
else if (input & (1 << RMENU_DEVICE_NAV_L2))
|
||||
action = FILEBROWSER_ACTION_SCROLL_UP;
|
||||
else if (input & (1 << RMENU_DEVICE_NAV_A))
|
||||
action = FILEBROWSER_ACTION_CANCEL;
|
||||
else if (input & (1 << RMENU_DEVICE_NAV_START))
|
||||
{
|
||||
action = FILEBROWSER_ACTION_RESET;
|
||||
filebrowser_set_root(b, default_paths.filesystem_root_dir);
|
||||
strlcpy(b->extensions, extensions, sizeof(b->extensions));
|
||||
}
|
||||
|
||||
if(action != FILEBROWSER_ACTION_NOOP)
|
||||
ret = filebrowser_iterate(b, action);
|
||||
|
||||
if(!ret)
|
||||
rarch_settings_msg(S_MSG_DIR_LOADING_ERROR, S_DELAY_180);
|
||||
}
|
||||
|
||||
static void filebrowser_fetch_directory_entries(filebrowser_t * browser, uint64_t action, CXuiList * romlist, CXuiTextElement * rompath_title)
|
||||
{
|
||||
browser_update(browser, action, browser->extensions);
|
||||
|
||||
convert_char_to_wchar(strw_buffer, filebrowser_get_current_dir(browser), sizeof(strw_buffer));
|
||||
rompath_title->SetText(strw_buffer);
|
||||
|
||||
romlist->DeleteItems(0, romlist->GetItemCount());
|
||||
@ -81,7 +142,7 @@ static void filebrowser_fetch_directory_entries(const char *path,
|
||||
for(unsigned i = 0; i < browser->current_dir.list->size; i++)
|
||||
{
|
||||
char fname_tmp[256];
|
||||
fill_pathname_base(fname_tmp, browser->current_dir.list->elems[i].data, sizeof(fname_tmp));
|
||||
fill_pathname_base(fname_tmp, browser->current_dir.list->elems[i].data, sizeof(fname_tmp));
|
||||
convert_char_to_wchar(strw_buffer, fname_tmp, sizeof(strw_buffer));
|
||||
romlist->SetText(i, strw_buffer);
|
||||
}
|
||||
@ -95,37 +156,54 @@ HRESULT CRetroArchFileBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled
|
||||
GetChildById(L"XuiBtnGameDir", &m_dir_game);
|
||||
GetChildById(L"XuiBtnCacheDir", &m_dir_cache);
|
||||
|
||||
filebrowser_set_root(browser, g_console.default_rom_startup_dir);
|
||||
strlcpy(tmp_browser->extensions, rarch_console_get_rom_ext(), sizeof(tmp_browser->extensions));
|
||||
filebrowser_fetch_directory_entries(g_console.default_rom_startup_dir,
|
||||
browser, &m_romlist, &m_rompathtitle);
|
||||
filebrowser_set_root_and_ext(browser, rarch_console_get_rom_ext(), g_console.default_rom_startup_dir);
|
||||
|
||||
uint64_t action = (1 << RMENU_DEVICE_NAV_B);
|
||||
filebrowser_fetch_directory_entries(browser, action, &m_romlist, &m_rompathtitle);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
HRESULT CRetroArchCoreBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
||||
HRESULT CRetroArchFileBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandled )
|
||||
{
|
||||
GetChildById(L"XuiRomList", &m_romlist);
|
||||
GetChildById(L"XuiBackButton1", &m_back);
|
||||
GetChildById(L"XuiTxtRomPath", &m_rompathtitle);
|
||||
char path[PATH_MAX];
|
||||
|
||||
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);
|
||||
if(hObjPressed == m_romlist)
|
||||
{
|
||||
int index = m_romlist.GetCurSel();
|
||||
convert_wchar_to_char(str_buffer, (const wchar_t *)m_romlist.GetText(index), sizeof(str_buffer));
|
||||
if(path_file_exists(browser->current_dir.list->elems[index].data))
|
||||
{
|
||||
snprintf(path, sizeof(path), "%s\\%s", filebrowser_get_current_dir(browser), str_buffer);
|
||||
rarch_console_load_game_wrap(path, g_console.zip_extract_mode, S_DELAY_45);
|
||||
}
|
||||
else if(browser->current_dir.list->elems[index].attr.b)
|
||||
{
|
||||
snprintf(path, sizeof(path), "%s\\%s", filebrowser_get_current_dir(browser), str_buffer);
|
||||
uint64_t action = (1 << RMENU_DEVICE_NAV_B);
|
||||
filebrowser_set_root_and_ext(browser, rarch_console_get_rom_ext(), path);
|
||||
filebrowser_fetch_directory_entries(browser, action, &m_romlist, &m_rompathtitle);
|
||||
}
|
||||
}
|
||||
else if (hObjPressed == m_dir_game)
|
||||
{
|
||||
filebrowser_set_root_and_ext(browser, rarch_console_get_rom_ext(), g_console.default_rom_startup_dir);
|
||||
uint64_t action = (1 << RMENU_DEVICE_NAV_B);
|
||||
filebrowser_fetch_directory_entries(browser, action, &m_romlist, &m_rompathtitle);
|
||||
}
|
||||
#ifdef HAVE_HDD_CACHE_PARTITION
|
||||
else if (hObjPressed == m_dir_cache)
|
||||
{
|
||||
filebrowser_set_root_and_ext(browser, rarch_console_get_rom_ext(), "cache:");
|
||||
uint64_t action = (1 << RMENU_DEVICE_NAV_B);
|
||||
filebrowser_fetch_directory_entries(browser, action, &m_romlist, &m_rompathtitle);
|
||||
|
||||
return 0;
|
||||
}
|
||||
if (g_console.info_msg_enable)
|
||||
rarch_settings_msg(S_MSG_CACHE_PARTITION, S_DELAY_180);
|
||||
}
|
||||
#endif
|
||||
|
||||
HRESULT CRetroArchShaderBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
||||
{
|
||||
GetChildById(L"XuiRomList", &m_shaderlist);
|
||||
GetChildById(L"XuiBackButton1", &m_back);
|
||||
GetChildById(L"XuiTxtRomPath", &m_shaderpathtitle);
|
||||
|
||||
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,
|
||||
&m_shaderlist, &m_shaderpathtitle);
|
||||
bHandled = TRUE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -151,6 +229,11 @@ HRESULT CRetroArchControls::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
||||
convert_char_to_wchar(strw_buffer, buttons[i], sizeof(strw_buffer));
|
||||
m_controlslist.SetText(i, strw_buffer);
|
||||
}
|
||||
|
||||
snprintf(buttons[0], sizeof(buttons[0]), "D-Pad Emulation: %s", rarch_dpad_emulation_name_lut[g_settings.input.dpad_emulation[controlno]]);
|
||||
convert_char_to_wchar(strw_buffer, buttons[0], sizeof(strw_buffer));
|
||||
m_controlslist.SetText(SETTING_CONTROLS_DPAD_EMULATION, strw_buffer);
|
||||
m_controlslist.SetText(SETTING_CONTROLS_DEFAULT_ALL, L"Reset all buttons to default");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -177,28 +260,67 @@ HRESULT CRetroArchControls::OnControlNavigate(
|
||||
switch(pControlNavigateData->nControlNavigate)
|
||||
{
|
||||
case XUI_CONTROL_NAVIGATE_LEFT:
|
||||
if(current_index > 0 && current_index != SETTING_CONTROLS_DEFAULT_ALL)
|
||||
{
|
||||
rarch_input_set_keybind(controlno, KEYBIND_DECREMENT, current_index);
|
||||
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));
|
||||
convert_char_to_wchar(strw_buffer, button, sizeof(strw_buffer));
|
||||
m_controlslist.SetText(current_index, strw_buffer);
|
||||
}
|
||||
switch(current_index)
|
||||
{
|
||||
case SETTING_CONTROLS_DPAD_EMULATION:
|
||||
switch(g_settings.input.dpad_emulation[controlno])
|
||||
{
|
||||
case DPAD_EMULATION_NONE:
|
||||
break;
|
||||
case DPAD_EMULATION_LSTICK:
|
||||
input_xinput.set_analog_dpad_mapping(0, DPAD_EMULATION_NONE, controlno);
|
||||
break;
|
||||
case DPAD_EMULATION_RSTICK:
|
||||
input_xinput.set_analog_dpad_mapping(0, DPAD_EMULATION_LSTICK, controlno);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case SETTING_CONTROLS_DEFAULT_ALL:
|
||||
break;
|
||||
default:
|
||||
rarch_input_set_keybind(controlno, KEYBIND_DECREMENT, current_index);
|
||||
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));
|
||||
convert_char_to_wchar(strw_buffer, button, sizeof(strw_buffer));
|
||||
m_controlslist.SetText(current_index, strw_buffer);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case XUI_CONTROL_NAVIGATE_RIGHT:
|
||||
if(current_index < RARCH_FIRST_META_KEY && current_index != SETTING_CONTROLS_DEFAULT_ALL)
|
||||
{
|
||||
rarch_input_set_keybind(controlno, KEYBIND_INCREMENT, current_index);
|
||||
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));
|
||||
convert_char_to_wchar(strw_buffer, button, sizeof(strw_buffer));
|
||||
m_controlslist.SetText(current_index, strw_buffer);
|
||||
}
|
||||
switch(current_index)
|
||||
{
|
||||
case SETTING_CONTROLS_DPAD_EMULATION:
|
||||
switch(g_settings.input.dpad_emulation[controlno])
|
||||
{
|
||||
case DPAD_EMULATION_NONE:
|
||||
input_xinput.set_analog_dpad_mapping(0, DPAD_EMULATION_LSTICK, controlno);
|
||||
break;
|
||||
case DPAD_EMULATION_LSTICK:
|
||||
input_xinput.set_analog_dpad_mapping(0, DPAD_EMULATION_RSTICK, controlno);
|
||||
break;
|
||||
case DPAD_EMULATION_RSTICK:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case SETTING_CONTROLS_DEFAULT_ALL:
|
||||
break;
|
||||
default:
|
||||
rarch_input_set_keybind(controlno, KEYBIND_INCREMENT, current_index);
|
||||
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));
|
||||
convert_char_to_wchar(strw_buffer, button, sizeof(strw_buffer));
|
||||
m_controlslist.SetText(current_index, strw_buffer);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case XUI_CONTROL_NAVIGATE_UP:
|
||||
case XUI_CONTROL_NAVIGATE_DOWN:
|
||||
break;
|
||||
}
|
||||
|
||||
snprintf(button, sizeof(button), "D-Pad Emulation: %s", rarch_dpad_emulation_name_lut[g_settings.input.dpad_emulation[controlno]]);
|
||||
convert_char_to_wchar(strw_buffer, button, sizeof(strw_buffer));
|
||||
m_controlslist.SetText(SETTING_CONTROLS_DPAD_EMULATION, strw_buffer);
|
||||
m_controlslist.SetText(SETTING_CONTROLS_DEFAULT_ALL, L"Reset all buttons to default");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -214,6 +336,8 @@ HRESULT CRetroArchControls::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
|
||||
|
||||
switch(current_index)
|
||||
{
|
||||
case SETTING_CONTROLS_DPAD_EMULATION:
|
||||
break;
|
||||
case SETTING_CONTROLS_DEFAULT_ALL:
|
||||
rarch_input_set_default_keybinds(0);
|
||||
|
||||
@ -236,6 +360,11 @@ HRESULT CRetroArchControls::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
|
||||
}
|
||||
}
|
||||
|
||||
snprintf(buttons[current_index], sizeof(buttons[current_index]), "D-Pad Emulation: %s", rarch_dpad_emulation_name_lut[g_settings.input.dpad_emulation[controlno]]);
|
||||
convert_char_to_wchar(strw_buffer, buttons[current_index], sizeof(strw_buffer));
|
||||
m_controlslist.SetText(SETTING_CONTROLS_DPAD_EMULATION, strw_buffer);
|
||||
m_controlslist.SetText(SETTING_CONTROLS_DEFAULT_ALL, L"Reset all buttons to default");
|
||||
|
||||
bHandled = TRUE;
|
||||
return 0;
|
||||
}
|
||||
@ -248,7 +377,7 @@ HRESULT CRetroArchSettings::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
||||
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_enable ? L"Gamma correction: ON" : L"Gamma correction: OFF");
|
||||
m_settingslist.SetText(SETTING_GAMMA_CORRECTION_ENABLED, g_console.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");
|
||||
@ -259,10 +388,105 @@ HRESULT CRetroArchSettings::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
||||
m_settingslist.SetText(SETTING_SHADER_2, strw_buffer);
|
||||
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_SCALE_FACTOR, sizeof(strw_buffer));
|
||||
m_settingslist.SetText(SETTING_SCALE_FACTOR, strw_buffer);
|
||||
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_ZIP_EXTRACT, sizeof(strw_buffer));
|
||||
m_settingslist.SetText(SETTING_ZIP_EXTRACT, strw_buffer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
HRESULT CRetroArchSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
|
||||
{
|
||||
int current_index;
|
||||
HRESULT hr;
|
||||
|
||||
if ( hObjPressed == m_settingslist)
|
||||
{
|
||||
current_index = m_settingslist.GetCurSel();
|
||||
|
||||
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_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:
|
||||
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;
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
|
||||
if (hr < 0)
|
||||
RARCH_ERR("Failed to load scene.\n");
|
||||
|
||||
hCur = app.hShaderBrowser;
|
||||
|
||||
if (g_console.info_msg_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);
|
||||
if (hr < 0)
|
||||
RARCH_ERR("Failed to load scene.\n");
|
||||
|
||||
hCur = app.hShaderBrowser;
|
||||
|
||||
if (g_console.info_msg_enable)
|
||||
rarch_settings_msg(S_MSG_SELECT_SHADER, S_DELAY_180);
|
||||
|
||||
NavigateForward(app.hShaderBrowser);
|
||||
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");
|
||||
break;
|
||||
case SETTING_HW_TEXTURE_FILTER_2:
|
||||
g_settings.video.second_pass_smooth = !g_settings.video.second_pass_smooth;
|
||||
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");
|
||||
gfx_ctx_set_fbo(g_console.fbo_enabled);
|
||||
break;
|
||||
case SETTING_ZIP_EXTRACT:
|
||||
if(g_console.zip_extract_mode < ZIP_EXTRACT_TO_CACHE_DIR)
|
||||
g_console.zip_extract_mode++;
|
||||
else
|
||||
g_console.zip_extract_mode = 0;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
bHandled = TRUE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled)
|
||||
{
|
||||
int current_index;
|
||||
@ -275,6 +499,33 @@ 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_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:
|
||||
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;
|
||||
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);
|
||||
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);
|
||||
break;
|
||||
case SETTING_SCALE_FACTOR:
|
||||
if(vid->fbo_enabled)
|
||||
{
|
||||
@ -286,6 +537,26 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
|
||||
m_settingslist.SetText(SETTING_SCALE_FACTOR, strw_buffer);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SETTING_ZIP_EXTRACT:
|
||||
if(g_console.zip_extract_mode)
|
||||
g_console.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");
|
||||
break;
|
||||
case SETTING_HW_TEXTURE_FILTER_2:
|
||||
g_settings.video.second_pass_smooth = !g_settings.video.second_pass_smooth;
|
||||
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");
|
||||
gfx_ctx_set_fbo(g_console.fbo_enabled);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -293,6 +564,33 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
|
||||
case XUI_CONTROL_NAVIGATE_RIGHT:
|
||||
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");
|
||||
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");
|
||||
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);
|
||||
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);
|
||||
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)
|
||||
{
|
||||
@ -304,6 +602,26 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
|
||||
m_settingslist.SetText(SETTING_SCALE_FACTOR, strw_buffer);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SETTING_ZIP_EXTRACT:
|
||||
if(g_console.zip_extract_mode < ZIP_EXTRACT_TO_CACHE_DIR)
|
||||
g_console.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");
|
||||
break;
|
||||
case SETTING_HW_TEXTURE_FILTER_2:
|
||||
g_settings.video.second_pass_smooth = !g_settings.video.second_pass_smooth;
|
||||
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");
|
||||
gfx_ctx_set_fbo(g_console.fbo_enabled);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -492,7 +810,7 @@ HRESULT CRetroArchQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
|
||||
break;
|
||||
case MENU_ITEM_SCREENSHOT_MODE:
|
||||
if (g_console.info_msg_enable)
|
||||
rarch_settings_msg(S_MSG_NOT_IMPLEMENTED, S_DELAY_180);
|
||||
gfx_ctx_xdk_screenshot_dump(NULL);
|
||||
break;
|
||||
case MENU_ITEM_RESET:
|
||||
if (g_console.emulator_initialized)
|
||||
@ -505,8 +823,8 @@ HRESULT CRetroArchQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
|
||||
if (g_console.emulator_initialized)
|
||||
rarch_settings_change(S_RETURN_TO_GAME);
|
||||
break;
|
||||
case MENU_ITEM_RETURN_TO_DASHBOARD:
|
||||
rarch_settings_change(S_RETURN_TO_DASHBOARD);
|
||||
case MENU_ITEM_QUIT_RARCH:
|
||||
rarch_settings_change(S_QUIT_RARCH);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -516,68 +834,15 @@ HRESULT CRetroArchQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
|
||||
return 0;
|
||||
}
|
||||
|
||||
HRESULT CRetroArchMain::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
||||
HRESULT CRetroArchShaderBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
||||
{
|
||||
struct retro_system_info info;
|
||||
retro_get_system_info(&info);
|
||||
const char *id = info.library_name ? info.library_name : "Unknown";
|
||||
GetChildById(L"XuiRomList", &m_shaderlist);
|
||||
GetChildById(L"XuiBackButton1", &m_back);
|
||||
GetChildById(L"XuiTxtRomPath", &m_shaderpathtitle);
|
||||
|
||||
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);
|
||||
GetChildById(L"XuiBtnLibretroCore", &m_change_libretro_core);
|
||||
|
||||
char core_text[256];
|
||||
snprintf(core_text, sizeof(core_text), "%s %s", id, info.library_version);
|
||||
|
||||
convert_char_to_wchar(strw_buffer, core_text, sizeof(strw_buffer));
|
||||
m_core.SetText(strw_buffer);
|
||||
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_RARCH_VERSION, sizeof(strw_buffer));
|
||||
m_title.SetText(strw_buffer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
HRESULT CRetroArchFileBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandled )
|
||||
{
|
||||
char path[PATH_MAX];
|
||||
|
||||
if(hObjPressed == m_romlist)
|
||||
{
|
||||
int index = m_romlist.GetCurSel();
|
||||
convert_wchar_to_char(str_buffer, (const wchar_t *)m_romlist.GetText(index), sizeof(str_buffer));
|
||||
if(path_file_exists(browser->current_dir.list->elems[index].data))
|
||||
{
|
||||
snprintf(path, sizeof(path), "%s\\%s", filebrowser_get_current_dir(browser), str_buffer);
|
||||
rarch_console_load_game_wrap(path, g_console.zip_extract_mode, S_DELAY_45);
|
||||
}
|
||||
else if(browser->current_dir.list->elems[index].attr.b)
|
||||
{
|
||||
snprintf(path, sizeof(path), "%s\\%s", filebrowser_get_current_dir(browser), str_buffer);
|
||||
filebrowser_fetch_directory_entries(path, browser, &m_romlist, &m_rompathtitle);
|
||||
}
|
||||
}
|
||||
else if (hObjPressed == m_dir_game)
|
||||
{
|
||||
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);
|
||||
}
|
||||
#ifdef HAVE_HDD_CACHE_PARTITION
|
||||
else if (hObjPressed == m_dir_cache)
|
||||
{
|
||||
filebrowser_new(browser, "cache:", rarch_console_get_rom_ext());
|
||||
filebrowser_fetch_directory_entries("cache:", browser, &m_romlist, &m_rompathtitle);
|
||||
|
||||
if (g_console.info_msg_enable)
|
||||
rarch_settings_msg(S_MSG_CACHE_PARTITION, S_DELAY_180);
|
||||
}
|
||||
#endif
|
||||
|
||||
bHandled = TRUE;
|
||||
filebrowser_set_root_and_ext(tmp_browser, "cg|CG", "game:\\media\\shaders");
|
||||
uint64_t action = (1 << RMENU_DEVICE_NAV_B);
|
||||
filebrowser_fetch_directory_entries(tmp_browser, action, &m_shaderlist, &m_shaderpathtitle);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -611,7 +876,9 @@ HRESULT CRetroArchShaderBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHand
|
||||
{
|
||||
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);
|
||||
filebrowser_fetch_directory_entries(path, tmp_browser, &m_shaderlist, &m_shaderpathtitle);
|
||||
filebrowser_set_root_and_ext(tmp_browser, "cg|CG", path);
|
||||
uint64_t action = (1 << RMENU_DEVICE_NAV_B);
|
||||
filebrowser_fetch_directory_entries(tmp_browser, action, &m_shaderlist, &m_shaderpathtitle);
|
||||
}
|
||||
}
|
||||
|
||||
@ -620,6 +887,19 @@ HRESULT CRetroArchShaderBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHand
|
||||
return 0;
|
||||
}
|
||||
|
||||
HRESULT CRetroArchCoreBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
||||
{
|
||||
GetChildById(L"XuiRomList", &m_romlist);
|
||||
GetChildById(L"XuiBackButton1", &m_back);
|
||||
GetChildById(L"XuiTxtRomPath", &m_rompathtitle);
|
||||
|
||||
filebrowser_set_root_and_ext(tmp_browser, "xex|XEX", "game:");
|
||||
uint64_t action = (1 << RMENU_DEVICE_NAV_B);
|
||||
filebrowser_fetch_directory_entries(tmp_browser, action, &m_romlist, &m_rompathtitle);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
HRESULT CRetroArchCoreBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandled )
|
||||
{
|
||||
char path[PATH_MAX];
|
||||
@ -627,17 +907,18 @@ HRESULT CRetroArchCoreBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandle
|
||||
if(hObjPressed == m_romlist)
|
||||
{
|
||||
int index = m_romlist.GetCurSel();
|
||||
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))
|
||||
{
|
||||
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);
|
||||
rarch_settings_change(S_RETURN_TO_LAUNCHER);
|
||||
}
|
||||
else if(tmp_browser->current_dir.list->elems[index].attr.b)
|
||||
{
|
||||
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);
|
||||
filebrowser_fetch_directory_entries(path, tmp_browser, &m_romlist, &m_rompathtitle);
|
||||
snprintf(path, sizeof(path), "%s\\%s", filebrowser_get_current_dir(tmp_browser), str_buffer);
|
||||
filebrowser_set_root_and_ext(tmp_browser, "xex|XEX", path);
|
||||
uint64_t action = (1 << RMENU_DEVICE_NAV_B);
|
||||
filebrowser_fetch_directory_entries(tmp_browser, action, &m_romlist, &m_rompathtitle);
|
||||
}
|
||||
}
|
||||
|
||||
@ -645,88 +926,32 @@ HRESULT CRetroArchCoreBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandle
|
||||
return 0;
|
||||
}
|
||||
|
||||
HRESULT CRetroArchSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
|
||||
HRESULT CRetroArchMain::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
||||
{
|
||||
int current_index;
|
||||
HRESULT hr;
|
||||
struct retro_system_info info;
|
||||
retro_get_system_info(&info);
|
||||
const char *id = info.library_name ? info.library_name : "Unknown";
|
||||
|
||||
if ( hObjPressed == m_settingslist)
|
||||
{
|
||||
current_index = m_settingslist.GetCurSel();
|
||||
GetChildById(L"XuiLogo", &m_logoimage);
|
||||
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);
|
||||
GetChildById(L"XuiBtnLibretroCore", &m_change_libretro_core);
|
||||
|
||||
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_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:
|
||||
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;
|
||||
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");
|
||||
if(g_console.info_msg_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);
|
||||
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);
|
||||
char core_text[256];
|
||||
snprintf(core_text, sizeof(core_text), "%s %s", id, info.library_version);
|
||||
|
||||
if (hr < 0)
|
||||
RARCH_ERR("Failed to load scene.\n");
|
||||
convert_char_to_wchar(strw_buffer, core_text, sizeof(strw_buffer));
|
||||
m_core.SetText(strw_buffer);
|
||||
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_RARCH_VERSION, sizeof(strw_buffer));
|
||||
m_title.SetText(strw_buffer);
|
||||
|
||||
hCur = app.hShaderBrowser;
|
||||
g_console.input_loop = INPUT_LOOP_NONE;
|
||||
|
||||
if (g_console.info_msg_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);
|
||||
if (hr < 0)
|
||||
RARCH_ERR("Failed to load scene.\n");
|
||||
|
||||
hCur = app.hShaderBrowser;
|
||||
|
||||
if (g_console.info_msg_enable)
|
||||
rarch_settings_msg(S_MSG_SELECT_SHADER, S_DELAY_180);
|
||||
|
||||
NavigateForward(app.hShaderBrowser);
|
||||
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");
|
||||
break;
|
||||
case SETTING_HW_TEXTURE_FILTER_2:
|
||||
g_settings.video.second_pass_smooth = !g_settings.video.second_pass_smooth;
|
||||
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");
|
||||
gfx_ctx_set_fbo(g_console.fbo_enabled);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bHandled = TRUE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -740,6 +965,7 @@ HRESULT CRetroArchMain::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
|
||||
|
||||
if ( hObjPressed == m_filebrowser )
|
||||
{
|
||||
g_console.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)
|
||||
@ -802,13 +1028,13 @@ HRESULT CRetroArchMain::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
|
||||
NavigateForward(app.hRetroArchSettings);
|
||||
}
|
||||
else if ( hObjPressed == m_quit )
|
||||
rarch_settings_change(S_RETURN_TO_DASHBOARD);
|
||||
rarch_settings_change(S_QUIT_RARCH);
|
||||
|
||||
bHandled = TRUE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int menu_init (void)
|
||||
void menu_init (void)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
@ -821,7 +1047,7 @@ int menu_init (void)
|
||||
if (hr < 0)
|
||||
{
|
||||
RARCH_ERR("Failed initializing XUI application.\n");
|
||||
return 1;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Register font */
|
||||
@ -829,21 +1055,21 @@ int menu_init (void)
|
||||
if (hr < 0)
|
||||
{
|
||||
RARCH_ERR("Failed to register default typeface.\n");
|
||||
return 1;
|
||||
return;
|
||||
}
|
||||
|
||||
hr = app.LoadSkin( L"file://game:/media/rarch_scene_skin.xur");
|
||||
if (hr < 0)
|
||||
{
|
||||
RARCH_ERR("Failed to load skin.\n");
|
||||
return 1;
|
||||
return;
|
||||
}
|
||||
|
||||
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_main.xur", NULL, &app.hMainScene);
|
||||
if (hr < 0)
|
||||
{
|
||||
RARCH_ERR("Failed to create scene 'rarch_main.xur'.\n");
|
||||
return 1;
|
||||
return;
|
||||
}
|
||||
|
||||
hCur = app.hMainScene;
|
||||
@ -852,8 +1078,6 @@ int 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());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void menu_free (void)
|
||||
@ -934,9 +1158,18 @@ void menu_loop(void)
|
||||
|
||||
switch(g_console.input_loop)
|
||||
{
|
||||
case INPUT_LOOP_FILEBROWSER:
|
||||
/*
|
||||
if(((state.Gamepad.wButtons & XINPUT_GAMEPAD_Y) && hCur != app.hMainScene))
|
||||
{
|
||||
uint64_t action = (1 << RMENU_DEVICE_NAV_A);
|
||||
browser_update(browser, action, rarch_console_get_rom_ext());
|
||||
SET_TIMER_EXPIRATION(d3d, 15);
|
||||
}
|
||||
*/
|
||||
case INPUT_LOOP_MENU:
|
||||
app.RunFrame(); /* Update XUI */
|
||||
if(state.Gamepad.wButtons & XINPUT_GAMEPAD_B && hCur != app.hMainScene)
|
||||
if((state.Gamepad.wButtons & XINPUT_GAMEPAD_B) && hCur != app.hMainScene)
|
||||
XuiSceneNavigateBack(hCur, app.hMainScene, XUSER_INDEX_ANY);
|
||||
break;
|
||||
case INPUT_LOOP_RESIZE_MODE:
|
||||
@ -958,11 +1191,7 @@ void menu_loop(void)
|
||||
|
||||
if (message)
|
||||
{
|
||||
if(IS_TIMER_EXPIRED(d3d))
|
||||
{
|
||||
xdk360_console_format(message);
|
||||
SET_TIMER_EXPIRATION(d3d, 30);
|
||||
}
|
||||
xdk360_console_format(message);
|
||||
xdk360_console_draw();
|
||||
}
|
||||
|
||||
|
@ -17,10 +17,8 @@
|
||||
#ifndef _MENU_XUI_H_
|
||||
#define _MENU_XUI_H_
|
||||
|
||||
#ifdef _XBOX360
|
||||
#include <xui.h>
|
||||
#include <xuiapp.h>
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
@ -34,7 +32,8 @@ enum
|
||||
SETTING_HW_TEXTURE_FILTER,
|
||||
SETTING_HW_TEXTURE_FILTER_2,
|
||||
SETTING_SCALE_ENABLED,
|
||||
SETTING_SCALE_FACTOR
|
||||
SETTING_SCALE_FACTOR,
|
||||
SETTING_ZIP_EXTRACT,
|
||||
};
|
||||
|
||||
enum
|
||||
@ -55,16 +54,18 @@ enum
|
||||
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_R2,
|
||||
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_L3,
|
||||
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_R3,
|
||||
SETTING_CONTROLS_DPAD_EMULATION,
|
||||
SETTING_CONTROLS_DEFAULT_ALL
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
INPUT_LOOP_NONE = 0,
|
||||
INPUT_LOOP_MENU,
|
||||
INPUT_LOOP_RESIZE_MODE
|
||||
INPUT_LOOP_RESIZE_MODE,
|
||||
INPUT_LOOP_FILEBROWSER
|
||||
};
|
||||
|
||||
#ifdef _XBOX360
|
||||
class CRetroArch : public CXuiModule
|
||||
{
|
||||
public:
|
||||
@ -91,6 +92,7 @@ class CRetroArchMain: public CXuiSceneImpl
|
||||
CXuiControl m_quit;
|
||||
CXuiTextElement m_title;
|
||||
CXuiTextElement m_core;
|
||||
CXuiControl m_logoimage;
|
||||
public:
|
||||
HRESULT OnInit( XUIMessageInit* pInitData, int & bHandled );
|
||||
HRESULT OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled );
|
||||
@ -217,7 +219,4 @@ class CRetroArchControls: public CXuiSceneImpl
|
||||
XUI_IMPLEMENT_CLASS(CRetroArchControls, L"RetroArchControls", XUI_CLASS_SCENE)
|
||||
};
|
||||
|
||||
extern CRetroArch app;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -8,7 +8,7 @@
|
||||
<Id>XuiScene1</Id>
|
||||
<Width>776.000061</Width>
|
||||
<Height>512.000061</Height>
|
||||
<Position>200.000015,112.000008,0.000000</Position>
|
||||
<Position>245.000015,112.000008,0.000000</Position>
|
||||
<ClassOverride>RetroArchControls</ClassOverride>
|
||||
</Properties>
|
||||
<XuiText>
|
||||
@ -47,6 +47,7 @@ RetroPad Button L2:
|
||||
RetroPad Button R2:
|
||||
RetroPad Button L3:
|
||||
RetroPad Button R3:
|
||||
D-Pad Emulation:
|
||||
Reset all buttons to default
|
||||
</ItemsText>
|
||||
</Properties>
|
||||
@ -278,6 +279,30 @@ Reset all buttons to default
|
||||
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
|
||||
</Properties>
|
||||
</XuiListItem>
|
||||
<XuiListItem>
|
||||
<Properties>
|
||||
<Id>control_ListItem</Id>
|
||||
<Width>226.000000</Width>
|
||||
<Height>45.000000</Height>
|
||||
<Position>7.000000,22.000000,0.000000</Position>
|
||||
<Anchor>5</Anchor>
|
||||
<Show>false</Show>
|
||||
<Visual>XuiButton</Visual>
|
||||
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
|
||||
</Properties>
|
||||
</XuiListItem>
|
||||
<XuiListItem>
|
||||
<Properties>
|
||||
<Id>control_ListItem</Id>
|
||||
<Width>226.000000</Width>
|
||||
<Height>45.000000</Height>
|
||||
<Position>7.000000,22.000000,0.000000</Position>
|
||||
<Anchor>5</Anchor>
|
||||
<Show>false</Show>
|
||||
<Visual>XuiButton</Visual>
|
||||
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
|
||||
</Properties>
|
||||
</XuiListItem>
|
||||
</XuiCommonList>
|
||||
<XuiBackButton>
|
||||
<Properties>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<Id>XuiSceneFileBrowser</Id>
|
||||
<Width>1000.000061</Width>
|
||||
<Height>552.000000</Height>
|
||||
<Position>118.000031,88.000015,0.000000</Position>
|
||||
<Position>144.873901,88.000015,0.000000</Position>
|
||||
<ClassOverride>RetroArchFileBrowser</ClassOverride>
|
||||
</Properties>
|
||||
<XuiText>
|
||||
@ -141,6 +141,18 @@
|
||||
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
|
||||
</Properties>
|
||||
</XuiListItem>
|
||||
<XuiListItem>
|
||||
<Properties>
|
||||
<Id>control_ListItem</Id>
|
||||
<Width>226.000000</Width>
|
||||
<Height>45.000000</Height>
|
||||
<Position>7.000000,22.000000,0.000000</Position>
|
||||
<Anchor>5</Anchor>
|
||||
<Show>false</Show>
|
||||
<Visual>XuiButton</Visual>
|
||||
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
|
||||
</Properties>
|
||||
</XuiListItem>
|
||||
</XuiCommonList>
|
||||
<XuiBackButton>
|
||||
<Properties>
|
||||
|
@ -71,7 +71,7 @@
|
||||
<XuiText>
|
||||
<Properties>
|
||||
<Id>XuiTxtCoreText</Id>
|
||||
<Width>224.399963</Width>
|
||||
<Width>388.629150</Width>
|
||||
<Height>34.000000</Height>
|
||||
<Position>134.944031,324.391998,0.000000</Position>
|
||||
<TextColor>0xff0f0f0f</TextColor>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<Id>XuiScene1</Id>
|
||||
<Width>824.000061</Width>
|
||||
<Height>496.000061</Height>
|
||||
<Position>32.029999,76.040001,0.000000</Position>
|
||||
<Position>225.521820,110.438545,0.000000</Position>
|
||||
<ClassOverride>RetroArchQuickMenu</ClassOverride>
|
||||
</Properties>
|
||||
<XuiText>
|
||||
@ -139,6 +139,18 @@ Return to Dashboard
|
||||
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
|
||||
</Properties>
|
||||
</XuiListItem>
|
||||
<XuiListItem>
|
||||
<Properties>
|
||||
<Id>control_ListItem</Id>
|
||||
<Width>226.000000</Width>
|
||||
<Height>45.000000</Height>
|
||||
<Position>7.000000,22.000000,0.000000</Position>
|
||||
<Anchor>5</Anchor>
|
||||
<Show>false</Show>
|
||||
<Visual>XuiButton</Visual>
|
||||
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
|
||||
</Properties>
|
||||
</XuiListItem>
|
||||
</XuiCommonList>
|
||||
<XuiBackButton>
|
||||
<Properties>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<Id>XuiScene1</Id>
|
||||
<Width>776.000061</Width>
|
||||
<Height>512.000061</Height>
|
||||
<Position>198.000031,112.000023,0.000000</Position>
|
||||
<Position>238.000031,112.000023,0.000000</Position>
|
||||
<ClassOverride>RetroArchSettings</ClassOverride>
|
||||
</Properties>
|
||||
<XuiText>
|
||||
@ -41,6 +41,7 @@ Hardware filtering shader #1:
|
||||
Hardware filtering shader #2:
|
||||
Custom Scaling/Dual Shaders:
|
||||
Custom Scaling Factor:
|
||||
Extract ZIP:
|
||||
</ItemsText>
|
||||
</Properties>
|
||||
<XuiListItem>
|
||||
@ -211,6 +212,30 @@ Custom Scaling Factor:
|
||||
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
|
||||
</Properties>
|
||||
</XuiListItem>
|
||||
<XuiListItem>
|
||||
<Properties>
|
||||
<Id>control_ListItem</Id>
|
||||
<Width>226.000000</Width>
|
||||
<Height>45.000000</Height>
|
||||
<Position>7.000000,22.000000,0.000000</Position>
|
||||
<Anchor>5</Anchor>
|
||||
<Show>false</Show>
|
||||
<Visual>XuiButton</Visual>
|
||||
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
|
||||
</Properties>
|
||||
</XuiListItem>
|
||||
<XuiListItem>
|
||||
<Properties>
|
||||
<Id>control_ListItem</Id>
|
||||
<Width>226.000000</Width>
|
||||
<Height>45.000000</Height>
|
||||
<Position>7.000000,22.000000,0.000000</Position>
|
||||
<Anchor>5</Anchor>
|
||||
<Show>false</Show>
|
||||
<Visual>XuiButton</Visual>
|
||||
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
|
||||
</Properties>
|
||||
</XuiListItem>
|
||||
</XuiCommonList>
|
||||
<XuiBackButton>
|
||||
<Properties>
|
||||
|
@ -47,6 +47,7 @@ RetroPad Button L2:
|
||||
RetroPad Button R2:
|
||||
RetroPad Button L3:
|
||||
RetroPad Button R3:
|
||||
D-Pad Emulation:
|
||||
Reset all buttons to defaults
|
||||
</ItemsText>
|
||||
</Properties>
|
||||
@ -278,6 +279,18 @@ Reset all buttons to defaults
|
||||
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
|
||||
</Properties>
|
||||
</XuiListItem>
|
||||
<XuiListItem>
|
||||
<Properties>
|
||||
<Id>control_ListItem</Id>
|
||||
<Width>226.000000</Width>
|
||||
<Height>45.000000</Height>
|
||||
<Position>7.000000,22.000000,0.000000</Position>
|
||||
<Anchor>5</Anchor>
|
||||
<Show>false</Show>
|
||||
<Visual>XuiButton</Visual>
|
||||
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
|
||||
</Properties>
|
||||
</XuiListItem>
|
||||
</XuiCommonList>
|
||||
<XuiBackButton>
|
||||
<Properties>
|
||||
|
@ -71,7 +71,7 @@
|
||||
<XuiText>
|
||||
<Properties>
|
||||
<Id>XuiTxtCoreText</Id>
|
||||
<Width>224.399963</Width>
|
||||
<Width>391.399933</Width>
|
||||
<Height>34.000000</Height>
|
||||
<Position>134.944031,324.391998,0.000000</Position>
|
||||
<TextColor>0xff0f0f0f</TextColor>
|
||||
|
@ -41,6 +41,7 @@ Hardware filtering shader #1:
|
||||
Hardware filtering shader #2:
|
||||
Cutom Scaling/Dual Shaders:
|
||||
Cutom Scaling Factor:
|
||||
Extract ZIP:
|
||||
</ItemsText>
|
||||
</Properties>
|
||||
<XuiListItem>
|
||||
@ -199,6 +200,18 @@ Cutom Scaling Factor:
|
||||
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
|
||||
</Properties>
|
||||
</XuiListItem>
|
||||
<XuiListItem>
|
||||
<Properties>
|
||||
<Id>control_ListItem</Id>
|
||||
<Width>226.000000</Width>
|
||||
<Height>45.000000</Height>
|
||||
<Position>7.000000,22.000000,0.000000</Position>
|
||||
<Anchor>5</Anchor>
|
||||
<Show>false</Show>
|
||||
<Visual>XuiButton</Visual>
|
||||
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
|
||||
</Properties>
|
||||
</XuiListItem>
|
||||
</XuiCommonList>
|
||||
<XuiBackButton>
|
||||
<Properties>
|
||||
|
@ -456,13 +456,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_enable ? ( D3DFORMAT )MAKESRGBFMT( D3DFMT_A8R8G8B8 ) : D3DFMT_A8R8G8B8,
|
||||
1, 0, g_console.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_enable ? ( D3DFORMAT )MAKESRGBFMT( D3DFMT_A8R8G8B8 ) : D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE,
|
||||
g_console.gamma_correction ? ( D3DFORMAT )MAKESRGBFMT( D3DFMT_A8R8G8B8 ) : D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE,
|
||||
0, 0, &d3d->lpSurface, NULL);
|
||||
|
||||
d3d->lpTexture_ot_as16srgb = *d3d->lpTexture_ot;
|
||||
@ -504,7 +504,7 @@ static void *xdk_d3d_init(const video_info_t *video, const input_driver_t **inpu
|
||||
d3d->d3dpp.BackBufferWidth = d3d->video_mode.fIsHiDef ? 1280 : 640;
|
||||
d3d->d3dpp.BackBufferHeight = d3d->video_mode.fIsHiDef ? 720 : 480;
|
||||
|
||||
if(g_console.gamma_correction_enable)
|
||||
if(g_console.gamma_correction)
|
||||
{
|
||||
d3d->d3dpp.BackBufferFormat = g_console.color_format ? (D3DFORMAT)MAKESRGBFMT(D3DFMT_A8R8G8B8) : (D3DFORMAT)MAKESRGBFMT(D3DFMT_LIN_A1R5G5B5);
|
||||
d3d->d3dpp.FrontBufferFormat = (D3DFORMAT)MAKESRGBFMT(D3DFMT_LE_X8R8G8B8);
|
||||
@ -742,11 +742,7 @@ static bool xdk_d3d_frame(void *data, const void *frame,
|
||||
/* XBox 360 specific font code */
|
||||
if (msg && !menu_enabled)
|
||||
{
|
||||
if(IS_TIMER_EXPIRED(d3d))
|
||||
{
|
||||
xdk360_console_format(msg);
|
||||
SET_TIMER_EXPIRATION(d3d, 30);
|
||||
}
|
||||
xdk360_console_format(msg);
|
||||
|
||||
xdk360_console_draw();
|
||||
}
|
||||
@ -817,6 +813,12 @@ static void xdk_d3d_stop(void)
|
||||
xdk_d3d_free(data);
|
||||
}
|
||||
|
||||
static void xdk_d3d_apply_state_changes(void)
|
||||
{
|
||||
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
|
||||
d3d->should_resize = true;
|
||||
}
|
||||
|
||||
const video_driver_t video_xdk_d3d = {
|
||||
xdk_d3d_init,
|
||||
xdk_d3d_frame,
|
||||
@ -829,5 +831,6 @@ const video_driver_t video_xdk_d3d = {
|
||||
xdk_d3d_start,
|
||||
xdk_d3d_stop,
|
||||
xdk_d3d_restart,
|
||||
xdk_d3d_apply_state_changes,
|
||||
xdk_d3d_set_rotation,
|
||||
};
|
||||
|
36
Makefile
36
Makefile
@ -49,7 +49,6 @@ endif
|
||||
|
||||
ifneq ($(findstring Linux,$(OS)),)
|
||||
LIBS += -lrt
|
||||
DEFINES += -DIS_LINUX
|
||||
OBJ += input/linuxraw_input.o
|
||||
endif
|
||||
|
||||
@ -125,24 +124,49 @@ ifeq ($(HAVE_COREAUDIO), 1)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SDL), 1)
|
||||
OBJ += gfx/sdl_gfx.o gfx/context/sdl_ctx.o input/sdl_input.o audio/sdl_audio.o fifo_buffer.o
|
||||
OBJ += gfx/sdl_gfx.o input/sdl_input.o audio/sdl_audio.o fifo_buffer.o
|
||||
OBJ += gfx/scaler/scaler.o gfx/scaler/pixconv.o gfx/scaler/scaler_int.o gfx/scaler/filter.o
|
||||
DEFINES += $(SDL_CFLAGS) $(BSD_LOCAL_INC)
|
||||
LIBS += $(SDL_LIBS)
|
||||
|
||||
ifeq ($(SCALER_NO_SIMD), 1)
|
||||
DEFINES += -DSCALER_NO_SIMD
|
||||
endif
|
||||
ifeq ($(SCALER_PERF), 1)
|
||||
DEFINES += -DSCALER_PERF
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_X11), 1)
|
||||
LIBS += $(X11_LIBS)
|
||||
DEFINES += $(X11_CFLAGS)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_OPENGL), 1)
|
||||
OBJ += gfx/gl.o gfx/fonts/freetype.o
|
||||
OBJ += gfx/gl.o gfx/fonts/freetype.o gfx/math/matrix.o
|
||||
|
||||
ifeq ($(OSX),1)
|
||||
LIBS += -framework OpenGL
|
||||
else
|
||||
ifeq ($(HAVE_GLES), 1)
|
||||
LIBS += -lGLESv2 -lEGL
|
||||
DEFINES += -DHAVE_OPENGLES -DHAVE_OPENGLES2
|
||||
else
|
||||
LIBS += -lGL
|
||||
OBJ += gfx/context/sdl_ctx.o
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_KMS), 1)
|
||||
OBJ += gfx/context/drm_egl_ctx.o
|
||||
DEFINES += $(GBM_CFLAGS) $(DRM_CFLAGS)
|
||||
LIBS += $(GBM_LIBS) $(DRM_LIBS)
|
||||
else
|
||||
ifeq ($(HAVE_GLES), 1)
|
||||
OBJ += gfx/context/xegl_ctx.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RPI), 1)
|
||||
OBJ += gfx/rpi.o
|
||||
@ -199,8 +223,8 @@ endif
|
||||
|
||||
ifeq ($(HAVE_FFMPEG), 1)
|
||||
OBJ += record/ffemu.o
|
||||
LIBS += $(AVCODEC_LIBS) $(AVFORMAT_LIBS) $(AVUTIL_LIBS) $(SWSCALE_LIBS)
|
||||
DEFINES += $(AVCODEC_CFLAGS) $(AVFORMAT_CFLAGS) $(AVUTIL_CFLAGS) $(SWSCALE_CFLAGS)
|
||||
LIBS += $(AVCODEC_LIBS) $(AVFORMAT_LIBS) $(AVUTIL_LIBS)
|
||||
DEFINES += $(AVCODEC_CFLAGS) $(AVFORMAT_CFLAGS) $(AVUTIL_CFLAGS)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_DYNAMIC), 1)
|
||||
@ -295,8 +319,10 @@ clean:
|
||||
rm -f conf/*.o
|
||||
rm -f gfx/*.o
|
||||
rm -f gfx/fonts/*.o
|
||||
rm -f gfx/math/*.o
|
||||
rm -f gfx/context/*.o
|
||||
rm -f gfx/py_state/*.o
|
||||
rm -f gfx/scaler/*.o
|
||||
rm -f compat/*.o
|
||||
rm -f record/*.o
|
||||
rm -f input/*.o
|
||||
|
22
Makefile.android
Normal file
22
Makefile.android
Normal file
@ -0,0 +1,22 @@
|
||||
###
|
||||
##
|
||||
# Makefile for RetroArch Android.
|
||||
##
|
||||
|
||||
all:
|
||||
ndk-build
|
||||
|
||||
clean:
|
||||
ndk-build clean
|
||||
|
||||
headers:
|
||||
javah -o android/com_retroarch_rruntime.h -classpath android/bin/classes com.retroarch.rruntime
|
||||
|
||||
install:
|
||||
adb install retroarch-android.apk
|
||||
|
||||
uninstall:
|
||||
adb uninstall com.retroarch
|
||||
|
||||
test_shader:
|
||||
cgc -ogles -profile glslf $(FILE)
|
89
Makefile.ngc
Normal file
89
Makefile.ngc
Normal file
@ -0,0 +1,89 @@
|
||||
###
|
||||
##
|
||||
# Makefile for RetroArch GameCube.
|
||||
##
|
||||
|
||||
DEBUG = 0
|
||||
HAVE_LOGGER = 1
|
||||
HAVE_FILE_LOGGER = 0
|
||||
|
||||
PC_DEVELOPMENT_IP_ADDRESS = "192.168.1.7"
|
||||
PC_DEVELOPMENT_UDP_PORT = 3490
|
||||
|
||||
# system platform
|
||||
system_platform = unix
|
||||
ifeq ($(shell uname -a),)
|
||||
EXE_EXT = .exe
|
||||
system_platform = win
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
system_platform = osx
|
||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||
system_platform = win
|
||||
endif
|
||||
|
||||
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
|
||||
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
|
||||
LD = $(DEVKITPPC)/bin/powerpc-eabi-ld$(EXE_EXT)
|
||||
ELF2DOL = $(DEVKITPPC)/bin/elf2dol$(EXE_EXT)
|
||||
|
||||
DOL_TARGET := retroarch_ngc.dol
|
||||
ELF_TARGET := retroarch_ngc.elf
|
||||
|
||||
INCLUDE := -I. -I$(DEVKITPRO)/libogc/include
|
||||
LIBDIRS := -L$(DEVKITPRO)/libogc/lib/cube -L.
|
||||
|
||||
MACHDEP := -DGEKKO -DHW_DOL -mogc -mcpu=750 -meabi -mhard-float
|
||||
CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(INCLUDE)
|
||||
LDFLAGS := $(MACHDEP) -Wl,-Map,$(notdir $(ELF_TARGET)).map -T gx/ld/ogc.ld
|
||||
LIBS := -lfat -lretro_ngc -logc
|
||||
|
||||
OBJ = console/griffin/griffin.o console/font.binobj console/rzlib/rzlib.o
|
||||
|
||||
ifeq ($(HAVE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_LOGGER
|
||||
CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
||||
CFLAGS += -Iconsole/logger
|
||||
OBJ += console/logger/logger.o
|
||||
LIBS += -lbba
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_FILE_LOGGER
|
||||
CFLAGS += -Iconsole/logger
|
||||
endif
|
||||
|
||||
CFLAGS += -std=gnu99 -DHAVE_DEFAULT_RETROPAD_INPUT -DHAVE_RGUI -DHAVE_THREAD -DRARCH_CONSOLE -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RARCH_EXEC -DHAVE_CONFIGFILE=1 -DGEKKO -DHAVE_ZLIB -DHAVE_RARCH_MAIN_WRAP -DHAVE_GRIFFIN=1 -DHAVE_SCREENSHOTS -DPACKAGE_VERSION=\"0.9.7\" -Dmain=rarch_main -Wno-char-subscripts
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -O0 -g
|
||||
else
|
||||
CFLAGS += -O3
|
||||
endif
|
||||
|
||||
all: $(DOL_TARGET)
|
||||
|
||||
%.dol: %.elf
|
||||
$(ELF2DOL) $< $@
|
||||
|
||||
$(ELF_TARGET): $(OBJ)
|
||||
$(CXX) -o $@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(LIBS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
%.binobj: %.bin
|
||||
$(LD) -r -b binary -o $@ $<
|
||||
|
||||
%.bmpobj: %.bmp
|
||||
$(LD) -r -b binary -o $@ $<
|
||||
|
||||
pkg: all
|
||||
cp -r $(DOL_TARGET) ngc/pkg/CORE.dol
|
||||
|
||||
clean:
|
||||
rm -f $(DOL_TARGET)
|
||||
rm -f $(ELF_TARGET)
|
||||
rm -f $(OBJ)
|
||||
|
||||
.PHONY: clean
|
||||
|
83
Makefile.ngc.salamander
Normal file
83
Makefile.ngc.salamander
Normal file
@ -0,0 +1,83 @@
|
||||
|
||||
##
|
||||
# Makefile for RetroArch GameCube.
|
||||
##
|
||||
|
||||
DEBUG = 0
|
||||
HAVE_LOGGER = 0
|
||||
HAVE_FILE_LOGGER = 0
|
||||
|
||||
# system platform
|
||||
system_platform = unix
|
||||
ifeq ($(shell uname -a),)
|
||||
EXE_EXT = .exe
|
||||
system_platform = win
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
system_platform = osx
|
||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||
system_platform = win
|
||||
endif
|
||||
|
||||
PC_DEVELOPMENT_IP_ADDRESS = "192.168.1.7"
|
||||
PC_DEVELOPMENT_UDP_PORT = 3490
|
||||
|
||||
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
|
||||
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
|
||||
LD = $(DEVKITPPC)/bin/powerpc-eabi-ld$(EXE_EXT)
|
||||
ELF2DOL = $(DEVKITPPC)/bin/elf2dol$(EXE_EXT)
|
||||
|
||||
DOL_TARGET := retroarch-salamander_ngc.dol
|
||||
ELF_TARGET := retroarch-salamander_ngc.elf
|
||||
|
||||
INCLUDE := -I. -I$(DEVKITPRO)/libogc/include
|
||||
LIBDIRS := -L$(DEVKITPRO)/libogc/lib/cube -L.
|
||||
|
||||
MACHDEP := -DGEKKO -DHW_DOL -mogc -mcpu=750 -meabi -mhard-float
|
||||
CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(INCLUDE)
|
||||
LDFLAGS := $(MACHDEP) -Wl,-Map,$(notdir $(ELF_TARGET)).map
|
||||
LIBS := -lfat -logc
|
||||
|
||||
OBJ = gx/salamander/main.o console/rarch_console_exec.o console/rarch_console_libretro_mgmt.o file_path.o compat/compat.o conf/config_file.o ngc/ssaram.o ngc/sidestep.o
|
||||
|
||||
ifeq ($(HAVE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_LOGGER
|
||||
CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
||||
CFLAGS += -Iconsole/logger
|
||||
OBJ += console/logger/logger.o
|
||||
LIBS += -lbba
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_FILE_LOGGER
|
||||
CFLAGS += -Iconsole/logger
|
||||
endif
|
||||
|
||||
CFLAGS += -std=gnu99 -DHAVE_DEFAULT_RETROPAD_INPUT -DIS_SALAMANDER -DRARCH_CONSOLE -DHAVE_RARCH_EXEC -DHAVE_CONFIGFILE=1 -DGEKKO -DPACKAGE_VERSION=\"0.9.7\" -Wno-char-subscripts
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -O0 -g
|
||||
else
|
||||
CFLAGS += -O3
|
||||
endif
|
||||
|
||||
all: $(DOL_TARGET)
|
||||
|
||||
%.dol: %.elf
|
||||
$(ELF2DOL) $< $@
|
||||
|
||||
$(ELF_TARGET): $(OBJ)
|
||||
$(CXX) -o $@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(LIBS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
pkg: all
|
||||
cp -r $(DOL_TARGET) ngc/pkg/boot.dol
|
||||
|
||||
clean:
|
||||
rm -f $(DOL_TARGET)
|
||||
rm -f $(ELF_TARGET)
|
||||
rm -f $(OBJ)
|
||||
|
||||
.PHONY: clean
|
||||
|
37
Makefile.ps3
37
Makefile.ps3
@ -1,4 +1,4 @@
|
||||
RARCH_VERSION = "0.9.6"
|
||||
RARCH_VERSION = "0.9.7"
|
||||
|
||||
#which compiler to build with - GCC or SNC
|
||||
#set to GCC for debug builds for use with debugger
|
||||
@ -21,8 +21,8 @@ PC_DEVELOPMENT_UDP_PORT = 3490
|
||||
CELL_MK_DIR ?= $(CELL_SDK)/samples/mk
|
||||
include $(CELL_MK_DIR)/sdk.makedef.mk
|
||||
|
||||
PPU_TARGET = retroarch.elf
|
||||
SALAMANDER_TARGET = retroarch-salamander.elf
|
||||
PPU_TARGET = retroarch_ps3.elf
|
||||
SALAMANDER_TARGET = retroarch-salamander_ps3.elf
|
||||
|
||||
EBOOT_PATH = ps3/pkg/USRDIR/EBOOT.BIN
|
||||
CORE_PATH = ps3/pkg/USRDIR/cores/CORE.SELF
|
||||
@ -30,6 +30,17 @@ CORE_PATH = ps3/pkg/USRDIR/cores/CORE.SELF
|
||||
LDDIRS = -L. -L$(CELL_SDK)/target/ppu/lib/PSGL/RSX/ultra-opt
|
||||
INCDIRS = -I. -Ips3 -Icommon
|
||||
|
||||
# system platform
|
||||
system_platform = unix
|
||||
ifeq ($(shell uname -a),)
|
||||
EXE_EXT = .exe
|
||||
system_platform = win
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
system_platform = osx
|
||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||
system_platform = win
|
||||
endif
|
||||
|
||||
PKG_SCRIPT = ps3/ps3py/pkg.py
|
||||
ifeq ($(shell uname), Linux)
|
||||
PKG_FINALIZE = package_finalize
|
||||
@ -45,11 +56,11 @@ PYTHON2 = python2.exe
|
||||
GIT = git.exe
|
||||
endif
|
||||
|
||||
PPU_SRCS = ps3/frontend/main.c ps3/frontend/menu.c
|
||||
PPU_SRCS = ps3/frontend/main.c
|
||||
|
||||
ifeq ($(HAVE_RGL), 1)
|
||||
DEFINES = -DHAVE_RGL
|
||||
GL_LIBS := -lrgl_ps3
|
||||
GL_LIBS := -L. -lrgl_ps3
|
||||
else
|
||||
GL_LIBS := -L$(CELL_SDK)/target/ppu/lib/PSGL/RSX/ultra-opt -lPSGL -lPSGLcgc
|
||||
endif
|
||||
@ -59,15 +70,17 @@ ifeq ($(CELL_BUILD_TOOLS), SNC)
|
||||
PPU_CXX = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
|
||||
PPU_CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
|
||||
else
|
||||
ifneq($(system_platform), win)
|
||||
PPU_CXX = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-g++.exe
|
||||
PPU_CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
|
||||
PPU_CXXLD = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ld.exe
|
||||
PPU_CCLD = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ld.exe
|
||||
endif
|
||||
|
||||
|
||||
PPU_LDLIBS = -ldbgfont $(GL_LIBS) -lretroarch_ps3 -lretro_ps3 -lcgc -lgcm_cmd -lgcm_sys_stub -lresc_stub -lm -lio_stub -lfs_stub -lsysutil_stub -lsysutil_game_stub -lsysutil_screenshot_stub -lsysutil_np_stub -lpngdec_stub -ljpgdec_stub -lsysmodule_stub -laudio_stub -lnet_stub -lnetctl_stub -lpthread
|
||||
|
||||
DEFINES += -DHAVE_DEFAULT_RETROPAD_INPUT -DHAVE_THREAD -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_OPENGL_TEXREF -DHAVE_HEADSET -DHAVE_VID_CONTEXT -DHAVE_OPENGLES -DHAVE_CG -DHAVE_CG_MENU -DHAVE_FILEBROWSER -DHAVE_HDD_CACHE_PARTITION -DHAVE_FBO -DHAVE_RARCH_MAIN_WRAP -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RGL -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RSOUND -DHAVE_ZLIB -D__CELLOS_LV2__ -DHAVE_CONFIGFILE=1 -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_OSKUTIL -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
||||
DEFINES += -DHAVE_DEFAULT_RETROPAD_INPUT -DHAVE_THREAD -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_PSGL -DHAVE_HEADSET -DHAVE_VID_CONTEXT -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_MENU -DHAVE_FILEBROWSER -DHAVE_HDD_CACHE_PARTITION -DHAVE_FBO -DHAVE_RARCH_MAIN_WRAP -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RGL -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RSOUND -DHAVE_ZLIB -D__CELLOS_LV2__ -DHAVE_CONFIGFILE=1 -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_OSKUTIL -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
PPU_OPTIMIZE_LV := -O0 -g
|
||||
@ -119,6 +132,8 @@ create-npdrm-salamander:
|
||||
create-salamander:
|
||||
$(MAKE_SELF) $(SALAMANDER_TARGET) $(EBOOT_PATH) $(CONTENT_ID_FULL)
|
||||
|
||||
copy-media-files:
|
||||
@cp console/rmenu/images/main-menu_1080p.png ps3/pkg/USRDIR/cores/borders/Menu/main-menu.png
|
||||
|
||||
create-shaders:
|
||||
ifeq ($(DOWNLOAD_SHADERS),1)
|
||||
@ -126,21 +141,21 @@ ifeq ($(DOWNLOAD_SHADERS),1)
|
||||
$(GIT) clone git://github.com/libretro/common-shaders.git ps3/pkg/USRDIR/cores/shaders
|
||||
endif
|
||||
|
||||
pkg: $(PPU_TARGET) create-shaders create-npdrm-salamander create-npdrm-core
|
||||
pkg: $(PPU_TARGET) copy-media-files create-shaders create-npdrm-salamander create-npdrm-core
|
||||
$(MAKE_PACKAGE_NPDRM) ps3/pkg/package.conf ps3/pkg
|
||||
|
||||
pkg-signed: $(PPU_TARGET) create-shaders create-salamander create-core
|
||||
pkg-signed: $(PPU_TARGET) copy-media-files create-shaders create-salamander create-core
|
||||
$(PYTHON2) $(PKG_SCRIPT) --contentid $(CONTENT_ID_FULL) ps3/pkg/ retroarch-ps3-cfw-$(RARCH_VERSION).pkg
|
||||
|
||||
pkg-signed-standalone: $(PPU_TARGET) create-shaders create-core
|
||||
pkg-signed-standalone: $(PPU_TARGET) copy-media-files create-shaders create-core
|
||||
$(MAKE_SELF) $(PPU_TARGET) $(EBOOT_PATH) $(CONTENT_ID)
|
||||
$(PYTHON2) $(PKG_SCRIPT) --contentid $(CONTENT_ID_FULL) ps3/pkg/ retroarch-ps3-cfw-$(RARCH_VERSION).pkg
|
||||
|
||||
pkg-signed-cfw: $(PPU_TARGET) create-shaders create-salamander create-core
|
||||
pkg-signed-cfw: $(PPU_TARGET) copy-media-files create-shaders create-salamander create-core
|
||||
$(PYTHON2) $(PKG_SCRIPT) --contentid $(CONTENT_ID_FULL) ps3/pkg/ retroarch-ps3-cfw-$(RARCH_VERSION)-kmeaw.pkg
|
||||
$(PKG_FINALIZE) retroarch-ps3-cfw-$(RARCH_VERSION)-kmeaw.pkg
|
||||
|
||||
pkg-signed-cfw-standalone: $(PPU_TARGET) create-shaders create-core
|
||||
pkg-signed-cfw-standalone: $(PPU_TARGET) copy-media-files create-shaders create-core
|
||||
$(MAKE_SELF) $(PPU_TARGET) $(EBOOT_PATH) $(CONTENT_ID)
|
||||
$(PYTHON2) $(PKG_SCRIPT) --contentid $(CONTENT_ID_FULL) ps3/pkg/ retroarch-ps3-cfw-$(RARCH_VERSION).pkg
|
||||
$(PKG_FINALIZE) retroarch-ps3-cfw-$(RARCH_VERSION)-kmeaw.pkg
|
||||
|
@ -1,4 +1,4 @@
|
||||
RARCH_VERSION = "0.9.6"
|
||||
RARCH_VERSION = "0.9.7"
|
||||
|
||||
#which compiler to build with - GCC or SNC
|
||||
#set to GCC for debug builds for use with debugger
|
||||
@ -16,6 +16,17 @@ PC_DEVELOPMENT_UDP_PORT = 3490
|
||||
CELL_MK_DIR ?= $(CELL_SDK)/samples/mk
|
||||
include $(CELL_MK_DIR)/sdk.makedef.mk
|
||||
|
||||
# system platform
|
||||
system_platform = unix
|
||||
ifeq ($(shell uname -a),)
|
||||
EXE_EXT = .exe
|
||||
system_platform = win
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
system_platform = osx
|
||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||
system_platform = win
|
||||
endif
|
||||
|
||||
PPU_LIB_TARGET = libretroarch_ps3.a
|
||||
|
||||
LDDIRS = -L. -L$(CELL_SDK)/target/ppu/lib/PSGL/RSX/ultra-opt
|
||||
@ -36,14 +47,16 @@ ifeq ($(CELL_BUILD_TOOLS), SNC)
|
||||
PPU_CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
|
||||
SNC_PPU_AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe
|
||||
else
|
||||
ifneq($(system_platform), win)
|
||||
PPU_CXX = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-g++.exe
|
||||
PPU_CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
|
||||
PPU_CXXLD = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ld.exe
|
||||
PPU_AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
|
||||
endif
|
||||
|
||||
PPU_RANLIB = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ranlib.exe
|
||||
|
||||
DEFINES += -DHAVE_DEFAULT_RETROPAD_INPUT -DHAVE_THREAD -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_OPENGL_TEXREF -DHAVE_HEADSET -DHAVE_VID_CONTEXT -DHAVE_OPENGLES11 -DHAVE_CG -DHAVE_CG_MENU -DHAVE_FILEBROWSER -DHAVE_HDD_CACHE_PARTITION -DHAVE_FBO -DHAVE_RARCH_MAIN_WRAP -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RGL -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RSOUND -DHAVE_ZLIB -D__CELLOS_LV2__ -DHAVE_CONFIGFILE=1 -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_OSKUTIL -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
||||
DEFINES += -DHAVE_DEFAULT_RETROPAD_INPUT -DHAVE_THREAD -DRARCH_CONSOLE -DHAVE_RMENU -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_PSGL -DHAVE_HEADSET -DHAVE_VID_CONTEXT -DHAVE_OPENGLES1 -DHAVE_CG -DHAVE_CG_MENU -DHAVE_FILEBROWSER -DHAVE_HDD_CACHE_PARTITION -DHAVE_FBO -DHAVE_RARCH_MAIN_WRAP -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RGL -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RSOUND -DHAVE_ZLIB -D__CELLOS_LV2__ -DHAVE_CONFIGFILE=1 -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_OSKUTIL -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
PPU_OPTIMIZE_LV := -O0 -g
|
||||
|
@ -5,28 +5,39 @@ CELL_MK_DIR ?= $(CELL_SDK)/samples/mk
|
||||
|
||||
include $(CELL_MK_DIR)/sdk.makedef.mk
|
||||
|
||||
# system platform
|
||||
system_platform = unix
|
||||
ifeq ($(shell uname -a),)
|
||||
EXE_EXT = .exe
|
||||
system_platform = win
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
system_platform = osx
|
||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||
system_platform = win
|
||||
endif
|
||||
|
||||
STRIP = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-strip.exe
|
||||
|
||||
PPU_CFLAGS += -I. -D__CELLOS_LV2__ -DIS_SALAMANDER
|
||||
PPU_SRCS = console/salamander/main.c console/rarch_console_exec.c console/rarch_console_libretro_mgmt.c file_path.c compat/compat.c conf/config_file.c
|
||||
PPU_CFLAGS += -I. -D__CELLOS_LV2__ -DIS_SALAMANDER -DRARCH_CONSOLE
|
||||
PPU_SRCS = ps3/salamander/main.c console/rarch_console_exec.c console/rarch_console_libretro_mgmt.c file_path.c compat/compat.c conf/config_file.c
|
||||
|
||||
ifeq ($(HAVE_LOGGER), 1)
|
||||
PPU_CFLAGS += -DHAVE_LOGGER -Iconsole/logger
|
||||
PPU_SRCS += console/logger/logger.c
|
||||
endif
|
||||
|
||||
PPU_TARGET = retroarch-salamander.elf
|
||||
PPU_TARGET = retroarch-salamander_ps3.elf
|
||||
|
||||
ifeq ($(CELL_BUILD_TOOLS),SNC)
|
||||
PPU_CFLAGS += -Xbranchless=1 -Xfastmath=1 -Xassumecorrectsign=1 -Xassumecorrectalignment=1 -Xunroll=1 -Xautovecreg=1
|
||||
PPU_CXXFLAGS += -Xbranchless=1 -Xfastmath=1 -Xassumecorrectsign=1 -Xassumecorrectalignment=1 -Xunroll=1 -Xautovecreg=1
|
||||
PPU_CXXLD = $(CELL_SDK)/host-win32/sn/bin/ps3ppuld.exe
|
||||
PPU_CXX = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
|
||||
PPU_CLD = $(CELL_SDK)/host-win32/sn/bin/ps3ppuld.exe
|
||||
PPU_CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
|
||||
else
|
||||
PPU_CXX = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-g++.exe
|
||||
ifneq($(system_platform), win)
|
||||
PPU_CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
|
||||
PPU_CXXLD = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ld.exe
|
||||
PPU_CLD = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ld.exe
|
||||
endif
|
||||
|
||||
PPU_LDLIBS += -lm -lnet_stub -lnetctl_stub -lio_stub -lsysmodule_stub -lsysutil_stub -lsysutil_game_stub -lfs_stub -lsysutil_np_stub
|
||||
|
@ -2,6 +2,7 @@
|
||||
##
|
||||
# Makefile for RetroArch PSL1GHT.
|
||||
##
|
||||
RARCH_VERSION = "0.9.7"
|
||||
|
||||
DEBUG = 0
|
||||
HAVE_LOGGER = 0
|
||||
@ -14,7 +15,11 @@ CC = $(PS3DEV)/ppu/bin/ppu-gcc
|
||||
CXX = $(PS3DEV)/ppu/bin/ppu-g++
|
||||
LD = $(PS3DEV)/ppu/bin/ppu-ld
|
||||
|
||||
CONTENT_ID_FULL = UP0001-SSNE10000_00-0000000000000001
|
||||
|
||||
ELF_TARGET := retroarch_psl1ght.elf
|
||||
EBOOT_PATH = ps3/pkg/USRDIR/EBOOT.BIN
|
||||
CORE_PATH = ps3/pkg/USRDIR/cores/CORE.SELF
|
||||
|
||||
INCLUDE := -I. -I$(PS3DEV)/ppu/include
|
||||
LIBDIRS := -L$(PS3DEV)/ppu/lib -L$(PS3DEV)/portlibs/ppu/lib -L.
|
||||
@ -22,16 +27,68 @@ LIBDIRS := -L$(PS3DEV)/ppu/lib -L$(PS3DEV)/portlibs/ppu/lib -L.
|
||||
MACHDEP := -D__CELLOS_LV2__ -D__PSL1GHT__
|
||||
CFLAGS += -Wall $(MACHDEP) $(INCLUDE)
|
||||
LDFLAGS := $(MACHDEP)
|
||||
LIBS := -lretro_psl1ght -laudio -lEGL -lGL -lio -lm -ljpgdec -lpngdec -lsysutil
|
||||
LIBS := -lretro_psl1ght -laudio -lGL -lEGL -lrsx -lgcm_sys -lnet -lio -lsysutil -lsysmodule -lm -ljpgdec -lpngdec -llv2 -lnet -lnetctl
|
||||
|
||||
# system platform
|
||||
system_platform = unix
|
||||
ifeq ($(shell uname -a),)
|
||||
EXE_EXT = .exe
|
||||
system_platform = win
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
system_platform = osx
|
||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||
system_platform = win
|
||||
endif
|
||||
|
||||
PKG_SCRIPT = ps3/ps3py/pkg.py
|
||||
ifeq ($(shell uname), Linux)
|
||||
PKG_FINALIZE = package_finalize
|
||||
MAKE_SELF_WC = make_self_wc
|
||||
MAKE_SELF = make_self_npdrm
|
||||
PYTHON2 = python2
|
||||
GIT = git
|
||||
else
|
||||
PKG_FINALIZE = package_finalize.exe
|
||||
MAKE_SELF_WC = make_self_wc.exe
|
||||
MAKE_SELF = make_self_npdrm.exe
|
||||
PYTHON2 = python2.exe
|
||||
GIT = git.exe
|
||||
endif
|
||||
# system platform
|
||||
system_platform = unix
|
||||
ifeq ($(shell uname -a),)
|
||||
EXE_EXT = .exe
|
||||
system_platform = win
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
system_platform = osx
|
||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||
system_platform = win
|
||||
endif
|
||||
|
||||
PKG_SCRIPT = ps3/ps3py/pkg.py
|
||||
ifeq ($(shell uname), Linux)
|
||||
PKG_FINALIZE = package_finalize
|
||||
MAKE_SELF_WC = make_self_wc
|
||||
MAKE_SELF = make_self_npdrm
|
||||
PYTHON2 = python2
|
||||
GIT = git
|
||||
else
|
||||
PKG_FINALIZE = package_finalize.exe
|
||||
MAKE_SELF_WC = make_self_wc.exe
|
||||
MAKE_SELF = make_self_npdrm.exe
|
||||
PYTHON2 = python2.exe
|
||||
GIT = git.exe
|
||||
endif
|
||||
|
||||
MAKE_FSELF_NPDRM = $(CELL_SDK)/host-win32/bin/make_fself_npdrm.exe
|
||||
MAKE_PACKAGE_NPDRM = $(CELL_SDK)/host-win32/bin/make_package_npdrm.exe
|
||||
|
||||
OBJ = console/griffin/griffin.o console/rzlib/rzlib.o
|
||||
|
||||
OBJ += console/rgl/ps3/device_ctx.o console/rgl/ps3/rgl.o console/rgl/ps3/cgbio.o console/rgl/ps3/cgnv2rt.o
|
||||
|
||||
ifeq ($(HAVE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_LOGGER
|
||||
CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
||||
OBJ += console/logger/logger.o
|
||||
CFLAGS += -Iconsole/logger
|
||||
OBJ += console/logger/psl1ght_logger.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
@ -40,21 +97,21 @@ endif
|
||||
|
||||
RSXGL_DEFINES = -D__RSX__ -DGL3_PROTOTYPES
|
||||
|
||||
SHARED_FLAGS := -DHAVE_FILEBROWSER $(RSXGL_DEFINES) -DHAVE_OSKUTIL -DHAVE_MOUSE -DHAVE_DEFAULT_RETROPAD_INPUT -DRARCH_CONSOLE -DHAVE_CONFIGFILE=1 -DHAVE_ZLIB -DHAVE_RARCH_MAIN_WRAP -DHAVE_GRIFFIN=1 -DPACKAGE_VERSION=\"0.9.6\" -Dmain=rarch_main -Wno-char-subscripts
|
||||
SHARED_FLAGS := -DHAVE_FILEBROWSER $(RSXGL_DEFINES) -DHAVE_OPENGL -DHAVE_EGL -DHAVE_OPENGL_MODERN -DHAVE_GLSL -DHAVE_VID_CONTEXT -DHAVE_FBO -DHAVE_MOUSE -DHAVE_DEFAULT_RETROPAD_INPUT -DRARCH_CONSOLE -DHAVE_CONFIGFILE=1 -DHAVE_ZLIB -DHAVE_RARCH_MAIN_WRAP -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_GRIFFIN=1 -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DPACKAGE_VERSION=\"0.9.7\" -Dmain=rarch_main -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -Wno-char-subscripts
|
||||
CFLAGS += -std=gnu99 $(SHARED_FLAGS)
|
||||
CXXFLAGS += $(SHARED_FLAGS)
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -O0 -g
|
||||
else
|
||||
CFLAGS += -O3
|
||||
CXXFLAGS += -03
|
||||
CFLAGS += -O3 -g
|
||||
CXXFLAGS += -03 -g
|
||||
endif
|
||||
|
||||
all: $(ELF_TARGET)
|
||||
|
||||
$(ELF_TARGET): $(OBJ)
|
||||
$(CC) -o $@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(LIBS)
|
||||
$(CXX) -o $@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(LIBS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
@ -62,6 +119,18 @@ $(ELF_TARGET): $(OBJ)
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
create-npdrm-core:
|
||||
$(MAKE_FSELF_NPDRM) $(ELF_TARGET) $(CORE_PATH)
|
||||
|
||||
create-core:
|
||||
$(MAKE_SELF_WC) $(ELF_TARGET) $(CORE_PATH)
|
||||
|
||||
pkg: $(ELF_TARGET) create-npdrm-core
|
||||
$(MAKE_PACKAGE_NPDRM) ps3/pkg/package.conf ps3/pkg
|
||||
|
||||
pkg-signed: $(ELF_TARGET) create-core
|
||||
$(PYTHON2) $(PKG_SCRIPT) --contentid $(CONTENT_ID_FULL) ps3/pkg/ retroarch-ps3-cfw-$(RARCH_VERSION).pkg
|
||||
|
||||
clean:
|
||||
rm -f $(ELF_TARGET)
|
||||
rm -f $(OBJ)
|
||||
|
41
Makefile.wii
41
Makefile.wii
@ -10,22 +10,36 @@ HAVE_FILE_LOGGER = 0
|
||||
PC_DEVELOPMENT_IP_ADDRESS = "192.168.1.7"
|
||||
PC_DEVELOPMENT_UDP_PORT = 3490
|
||||
|
||||
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc
|
||||
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++
|
||||
LD = $(DEVKITPPC)/bin/powerpc-eabi-ld
|
||||
# system platform
|
||||
system_platform = unix
|
||||
ifeq ($(shell uname -a),)
|
||||
EXE_EXT = .exe
|
||||
system_platform = win
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
system_platform = osx
|
||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||
system_platform = win
|
||||
endif
|
||||
|
||||
DOL_TARGET := retroarch.dol
|
||||
ELF_TARGET := retroarch.elf
|
||||
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
|
||||
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
|
||||
LD = $(DEVKITPPC)/bin/powerpc-eabi-ld$(EXE_EXT)
|
||||
ELF2DOL = $(DEVKITPPC)/bin/elf2dol$(EXE_EXT)
|
||||
|
||||
DOL_TARGET := retroarch_wii.dol
|
||||
ELF_TARGET := retroarch_wii.elf
|
||||
|
||||
INCLUDE := -I. -I$(DEVKITPRO)/libogc/include
|
||||
LIBDIRS := -L$(DEVKITPRO)/libogc/lib/wii -L.
|
||||
|
||||
MACHDEP := -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float
|
||||
CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(INCLUDE)
|
||||
LDFLAGS := $(MACHDEP)
|
||||
LDFLAGS := $(MACHDEP) -Wl,-Map,$(notdir $(ELF_TARGET)).map,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,strdup,-wrap,strndup,-wrap,malloc_usable_size -T gx/ld/rvl.ld
|
||||
LIBS := -lfat -lretro_wii -lwiiuse -logc -lbte
|
||||
|
||||
OBJ = console/griffin/griffin.o console/font.bmpobj console/rzlib/rzlib.o
|
||||
APP_BOOTER_DIR = wii/app_booter
|
||||
|
||||
OBJ = console/griffin/griffin.o console/font.binobj console/rzlib/rzlib.o $(APP_BOOTER_DIR)/app_booter.binobj
|
||||
|
||||
ifeq ($(HAVE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_LOGGER
|
||||
@ -39,7 +53,7 @@ CFLAGS += -DHAVE_FILE_LOGGER
|
||||
CFLAGS += -Iconsole/logger
|
||||
endif
|
||||
|
||||
CFLAGS += -std=gnu99 -DHAVE_DEFAULT_RETROPAD_INPUT -DRARCH_CONSOLE -DHAVE_CONFIGFILE=1 -DGEKKO -DHW_RVL -DHAVE_ZLIB -DHAVE_RARCH_MAIN_WRAP -DHAVE_GRIFFIN=1 -DPACKAGE_VERSION=\"0.9.6\" -Dmain=rarch_main -Wno-char-subscripts
|
||||
CFLAGS += -std=gnu99 -DHAVE_DEFAULT_RETROPAD_INPUT -DHAVE_RGUI -DHAVE_THREAD -DRARCH_CONSOLE -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RARCH_EXEC -DHAVE_CONFIGFILE=1 -DGEKKO -DHAVE_ZLIB -DHAVE_RARCH_MAIN_WRAP -DHAVE_GRIFFIN=1 -DHAVE_SCREENSHOTS -DPACKAGE_VERSION=\"0.9.7\" -Dmain=rarch_main -Wno-char-subscripts
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -O0 -g
|
||||
@ -50,7 +64,7 @@ endif
|
||||
all: $(DOL_TARGET)
|
||||
|
||||
%.dol: %.elf
|
||||
$(DEVKITPPC)/bin/elf2dol $< $@
|
||||
$(ELF2DOL) $< $@
|
||||
|
||||
$(ELF_TARGET): $(OBJ)
|
||||
$(CXX) -o $@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(LIBS)
|
||||
@ -61,13 +75,20 @@ $(ELF_TARGET): $(OBJ)
|
||||
%.bmpobj: %.bmp
|
||||
$(LD) -r -b binary -o $@ $<
|
||||
|
||||
%.binobj: %.bin
|
||||
$(LD) -r -b binary -o $@ $<
|
||||
|
||||
$(APP_BOOTER_DIR)/app_booter.bin:
|
||||
$(MAKE) -C $(APP_BOOTER_DIR)
|
||||
|
||||
pkg: all
|
||||
cp -r $(DOL_TARGET) wii/pkg/boot.dol
|
||||
cp -r $(DOL_TARGET) wii/pkg/CORE.dol
|
||||
|
||||
clean:
|
||||
rm -f $(DOL_TARGET)
|
||||
rm -f $(ELF_TARGET)
|
||||
rm -f $(OBJ)
|
||||
$(MAKE) -C $(APP_BOOTER_DIR) clean
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
|
91
Makefile.wii.salamander
Normal file
91
Makefile.wii.salamander
Normal file
@ -0,0 +1,91 @@
|
||||
###
|
||||
##
|
||||
# Makefile for RetroArch Wii.
|
||||
##
|
||||
|
||||
DEBUG = 0
|
||||
HAVE_LOGGER = 0
|
||||
HAVE_FILE_LOGGER = 0
|
||||
|
||||
# system platform
|
||||
system_platform = unix
|
||||
ifeq ($(shell uname -a),)
|
||||
EXE_EXT = .exe
|
||||
system_platform = win
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
system_platform = osx
|
||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||
system_platform = win
|
||||
endif
|
||||
|
||||
PC_DEVELOPMENT_IP_ADDRESS = "192.168.1.7"
|
||||
PC_DEVELOPMENT_UDP_PORT = 3490
|
||||
|
||||
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
|
||||
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
|
||||
LD = $(DEVKITPPC)/bin/powerpc-eabi-ld$(EXE_EXT)
|
||||
ELF2DOL = $(DEVKITPPC)/bin/elf2dol$(EXE_EXT)
|
||||
|
||||
DOL_TARGET := retroarch-salamander_wii.dol
|
||||
ELF_TARGET := retroarch-salamander_wii.elf
|
||||
|
||||
INCLUDE := -I. -I$(DEVKITPRO)/libogc/include
|
||||
LIBDIRS := -L$(DEVKITPRO)/libogc/lib/wii -L.
|
||||
|
||||
MACHDEP := -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float
|
||||
CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(INCLUDE)
|
||||
LDFLAGS := $(MACHDEP) -Wl,-Map,$(notdir $(ELF_TARGET)).map
|
||||
LIBS := -lfat -lwiiuse -logc -lbte
|
||||
|
||||
APP_BOOTER_DIR = wii/app_booter
|
||||
|
||||
OBJ = gx/salamander/main.o console/rarch_console_exec.o console/rarch_console_libretro_mgmt.o file_path.o compat/compat.o conf/config_file.o $(APP_BOOTER_DIR)/app_booter.binobj
|
||||
|
||||
ifeq ($(HAVE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_LOGGER
|
||||
CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
||||
CFLAGS += -Iconsole/logger
|
||||
OBJ += console/logger/logger.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_FILE_LOGGER
|
||||
CFLAGS += -Iconsole/logger
|
||||
endif
|
||||
|
||||
CFLAGS += -std=gnu99 -DHAVE_DEFAULT_RETROPAD_INPUT -DIS_SALAMANDER -DRARCH_CONSOLE -DHAVE_RARCH_EXEC -DHAVE_CONFIGFILE=1 -DGEKKO -DPACKAGE_VERSION=\"0.9.7\" -Wno-char-subscripts
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -O0 -g
|
||||
else
|
||||
CFLAGS += -O3
|
||||
endif
|
||||
|
||||
all: $(DOL_TARGET)
|
||||
|
||||
%.dol: %.elf
|
||||
$(ELF2DOL) $< $@
|
||||
|
||||
$(ELF_TARGET): $(OBJ)
|
||||
$(CXX) -o $@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(LIBS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
%.binobj: %.bin
|
||||
$(LD) -r -b binary -o $@ $<
|
||||
|
||||
$(APP_BOOTER_DIR)/app_booter.bin:
|
||||
$(MAKE) -C $(APP_BOOTER_DIR)
|
||||
|
||||
pkg: all
|
||||
cp -r $(DOL_TARGET) wii/pkg/boot.dol
|
||||
|
||||
clean:
|
||||
rm -f $(DOL_TARGET)
|
||||
rm -f $(ELF_TARGET)
|
||||
rm -f $(OBJ)
|
||||
$(MAKE) -C $(APP_BOOTER_DIR) clean
|
||||
|
||||
.PHONY: clean
|
||||
|
25
Makefile.win
25
Makefile.win
@ -35,6 +35,7 @@ HAVE_SDL = 1
|
||||
HAVE_OPENGL = 1
|
||||
HAVE_DYLIB = 1
|
||||
HAVE_NETPLAY = 1
|
||||
HAVE_STDIN_CMD = 1
|
||||
HAVE_THREADS = 1
|
||||
DYNAMIC = 1
|
||||
|
||||
@ -52,7 +53,7 @@ endif
|
||||
libretro ?= -lretro
|
||||
|
||||
LIBS = -lm
|
||||
DEFINES = -I. -DHAVE_CONFIGFILE -DHAVE_SDL -DHAVE_SCREENSHOTS -DHAVE_BSV_MOVIE -DPACKAGE_VERSION=\"0.9.6\"
|
||||
DEFINES = -I. -DHAVE_CONFIGFILE -DHAVE_SDL -DHAVE_SCREENSHOTS -DHAVE_BSV_MOVIE -DPACKAGE_VERSION=\"0.9.7\"
|
||||
LDFLAGS = -L. -static-libgcc
|
||||
|
||||
ifeq ($(TDM_GCC),)
|
||||
@ -60,9 +61,13 @@ ifeq ($(TDM_GCC),)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SDL), 1)
|
||||
OBJ += gfx/sdl_gfx.o gfx/gl.o gfx/fonts/freetype.o gfx/context/sdl_ctx.o input/sdl_input.o audio/sdl_audio.o fifo_buffer.o
|
||||
OBJ += gfx/sdl_gfx.o gfx/gl.o gfx/math/matrix.o gfx/fonts/freetype.o gfx/context/sdl_ctx.o input/sdl_input.o audio/sdl_audio.o fifo_buffer.o
|
||||
OBJ += gfx/scaler/scaler.o gfx/scaler/pixconv.o gfx/scaler/scaler_int.o gfx/scaler/filter.o
|
||||
LIBS += -lSDL
|
||||
DEFINES += -ISDL -DHAVE_SDL
|
||||
ifeq ($(SCALER_NO_SIMD), 1)
|
||||
DEFINES += -DSCALER_NO_SIMD
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_THREADS), 1)
|
||||
@ -114,9 +119,14 @@ ifeq ($(HAVE_DYLIB), 1)
|
||||
DEFINES += -DHAVE_DYLIB
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_STDIN_CMD), 1)
|
||||
DEFINES += -DHAVE_COMMAND -DHAVE_STDIN_CMD
|
||||
OBJ += command.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_NETPLAY), 1)
|
||||
DEFINES += -DHAVE_NETPLAY -DHAVE_NETWORK_CMD
|
||||
OBJ += netplay.o command.o
|
||||
OBJ += netplay.o
|
||||
LIBS += -lws2_32
|
||||
endif
|
||||
|
||||
@ -153,14 +163,13 @@ ifeq ($(HAVE_DINPUT), 1)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FFMPEG), 1)
|
||||
LIBS += -lavformat -lavcodec -lavutil -lswscale -lws2_32 -lz
|
||||
LIBS += -lavformat -lavcodec -lavutil -lws2_32 -lz
|
||||
DEFINES += -DHAVE_FFMPEG -Iffmpeg
|
||||
DEFINES += -DHAVE_FFMPEG_ALLOC_CONTEXT3
|
||||
DEFINES += -DHAVE_FFMPEG_AVCODEC_OPEN2
|
||||
DEFINES += -DHAVE_FFMPEG_AVIO_OPEN
|
||||
DEFINES += -DHAVE_FFMPEG_AVFORMAT_WRITE_HEADER
|
||||
DEFINES += -DHAVE_FFMPEG_AVFORMAT_NEW_STREAM
|
||||
DEFINES += -DHAVE_X264RGB
|
||||
OBJ += record/ffemu.o
|
||||
endif
|
||||
|
||||
@ -212,8 +221,10 @@ clean:
|
||||
rm -f audio/xaudio-c/*.o
|
||||
rm -f compat/*.o
|
||||
rm -f conf/*.o
|
||||
rm -f gfx/scaler/*.o
|
||||
rm -f gfx/*.o
|
||||
rm -f gfx/context/*.o
|
||||
rm -f gfx/math/*.o
|
||||
rm -f gfx/fonts/*.o
|
||||
rm -f gfx/py_state/*.o
|
||||
rm -f record/*.o
|
||||
@ -223,10 +234,10 @@ clean:
|
||||
rm -f tools/*.o
|
||||
|
||||
dist_x86: all
|
||||
zip -r retroarch-win32-0.9.6.zip $(TARGET) $(JTARGET) retroarch.cfg SDL.dll
|
||||
zip -r retroarch-win32-0.9.7.zip $(TARGET) $(JTARGET) retroarch.cfg SDL.dll
|
||||
|
||||
dist_x86_64: all
|
||||
zip -r retroarch-win64-0.9.6.zip $(TARGET) $(JTARGET) retroarch.cfg SDL.dll
|
||||
zip -r retroarch-win64-0.9.7.zip $(TARGET) $(JTARGET) retroarch.cfg SDL.dll
|
||||
|
||||
libs_x86:
|
||||
wget https://github.com/downloads/Themaister/RetroArch/RetroArch-win32-libs.zip --no-check-certificate
|
||||
|
@ -18,10 +18,10 @@ PPU_TARGET_ADJUSTED := retroarch-libxenon.elf32
|
||||
LDDIRS = -L. -L$(DEVKITXENON)/usr/lib -L$(DEVKITXENON)/xenon/lib/32
|
||||
INCDIRS = -I. -I$(DEVKITXENON)/usr/include
|
||||
|
||||
OBJ = fifo_buffer.o retroarch.o driver.o file.o file_path.o settings.o message.o rewind.o movie.o gfx/gfx_common.o patch.o compat/compat.o screenshot.o audio/hermite.o dynamic.o audio/utils.o conf/config_file.o 360/frontend-xenon/main.o 360/xenon360_audio.o 360/xenon360_input.o 360/xenon360_video.o
|
||||
OBJ = fifo_buffer.o retroarch.o driver.o file.o file_path.o settings.o message.o rewind.o movie.o gfx/gfx_common.o patch.o compat/compat.o screenshot.o audio/hermite.o dynamic.o audio/utils.o conf/config_file.o 360/frontend-xenon/main.o 360/xenon360_audio.o 360/xenon360_input.o 360/xenon360_video.o thread/xenon_sdl_threads.o
|
||||
|
||||
LIBS = -lretro_xenon360 -lxenon -lm -lc
|
||||
DEFINES = -std=gnu99 -DHAVE_CONFIGFILE=1 -DPACKAGE_VERSION=\"0.9.6\" -DRARCH_CONSOLE -DHAVE_GETOPT_LONG=1 -Dmain=rarch_main
|
||||
DEFINES = -std=gnu99 -DHAVE_CONFIGFILE=1 -DPACKAGE_VERSION=\"0.9.7\" -DRARCH_CONSOLE -DHAVE_GETOPT_LONG=1 -Dmain=rarch_main
|
||||
DEFINES += -maltivec -mhard-float -m32 -mpowerpc64 -mcpu=cell -mtune=cell -fno-pic -g -Wall -DXENON $(INCDIRS)
|
||||
DEFINES += -u read -u _start -u exc_base
|
||||
|
||||
|
@ -4,5 +4,6 @@
|
||||
<classpathentry kind="src" path="gen"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="output" path="bin/classes"/>
|
||||
</classpath>
|
||||
|
@ -5,6 +5,12 @@
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
|
||||
<arguments>
|
||||
@ -25,9 +31,19 @@
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
90
android/bifrost.c
Normal file
90
android/bifrost.c
Normal file
@ -0,0 +1,90 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2012 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* 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.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* RetroArch Bifrost:
|
||||
* A burning rainbow bridge that reaches between Java (the world)
|
||||
* and C/C++, the realm of the gods */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <jni.h>
|
||||
#include "../boolean.h"
|
||||
|
||||
#include "com_retroarch_rruntime.h"
|
||||
|
||||
#include "../console/rarch_console_main_wrap.h"
|
||||
#include "../console/rarch_console_rom_ext.h"
|
||||
#include "../console/rarch_console_settings.h"
|
||||
#include "../general.h"
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_load_1game
|
||||
(JNIEnv *env, jclass class, jstring j_path, jint j_extract_zip_mode)
|
||||
{
|
||||
jboolean is_copy = false;
|
||||
const char * game_path = (*env)->GetStringUTFChars(env, j_path, &is_copy);
|
||||
|
||||
rarch_console_load_game_wrap(game_path, 0, 0);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, j_path, game_path);
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL Java_com_retroarch_rruntime_run_1frame
|
||||
(JNIEnv *env, jclass class)
|
||||
{
|
||||
return rarch_main_iterate();
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_startup
|
||||
(JNIEnv *env, jclass class, jstring j_config_path)
|
||||
{
|
||||
bool retval = false;
|
||||
jboolean is_copy = false;
|
||||
const char * config_path = (*env)->GetStringUTFChars(env, j_config_path, &is_copy);
|
||||
|
||||
retval = rarch_startup(config_path);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, j_config_path, config_path);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_deinit
|
||||
(JNIEnv *env, jclass class)
|
||||
{
|
||||
rarch_main_deinit();
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_load_1state
|
||||
(JNIEnv *env, jclass class)
|
||||
{
|
||||
rarch_load_state();
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_save_1state
|
||||
(JNIEnv *env, jclass class)
|
||||
{
|
||||
rarch_save_state();
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_settings_1change
|
||||
(JNIEnv *env, jclass class, jint j_setting)
|
||||
{
|
||||
unsigned setting = j_setting;
|
||||
rarch_settings_change(setting);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_settings_1set_1defaults
|
||||
(JNIEnv *env, jclass class)
|
||||
{
|
||||
rarch_settings_set_default();
|
||||
}
|
77
android/com_retroarch_rruntime.h
Normal file
77
android/com_retroarch_rruntime.h
Normal file
@ -0,0 +1,77 @@
|
||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* Header for class com_retroarch_rruntime */
|
||||
|
||||
#ifndef _Included_com_retroarch_rruntime
|
||||
#define _Included_com_retroarch_rruntime
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*
|
||||
* Class: com_retroarch_rruntime
|
||||
* Method: load_game
|
||||
* Signature: (Ljava/lang/String;I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_load_1game
|
||||
(JNIEnv *, jclass, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: com_retroarch_rruntime
|
||||
* Method: run_frame
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_com_retroarch_rruntime_run_1frame
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: com_retroarch_rruntime
|
||||
* Method: startup
|
||||
* Signature: (Ljava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_startup
|
||||
(JNIEnv *, jclass, jstring);
|
||||
|
||||
/*
|
||||
* Class: com_retroarch_rruntime
|
||||
* Method: deinit
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_deinit
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: com_retroarch_rruntime
|
||||
* Method: load_state
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_load_1state
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: com_retroarch_rruntime
|
||||
* Method: save_state
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_save_1state
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: com_retroarch_rruntime
|
||||
* Method: settings_change
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_settings_1change
|
||||
(JNIEnv *, jclass, jint);
|
||||
|
||||
/*
|
||||
* Class: com_retroarch_rruntime
|
||||
* Method: settings_set_defaults
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_settings_1set_1defaults
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
@ -1,12 +1,14 @@
|
||||
RARCH_VERSION = "0.9.6"
|
||||
RARCH_VERSION = "0.9.7"
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
|
||||
LOCAL_MODULE := retroarch
|
||||
LOCAL_SRC_FILES = ../../console/griffin/griffin.c ../../console/rzlib/rzlib.c
|
||||
LOCAL_SRC_FILES = ../../console/griffin/griffin.c ../../console/rzlib/rzlib.c ../bifrost.c
|
||||
|
||||
LOCAL_CFLAGS = -DANDROID -DHAVE_DYNAMIC -DHAVE_ZLIB -DINLINE=inline -DRARCH_CONSOLE -DLSB_FIRST -D__LIBRETRO__ -DHAVE_CONFIGFILE=1 -DHAVE_GRIFFIN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -std=gnu99
|
||||
LOCAL_CFLAGS = -DANDROID -DHAVE_DYNAMIC -DHAVE_DYLIB -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_GLSL -DHAVE_VID_CONTEXT -DHAVE_ZLIB -DHAVE_RARCH_MAIN_WRAP -DINLINE=inline -DRARCH_CONSOLE -DLSB_FIRST -D__LIBRETRO__ -DHAVE_CONFIGFILE=1 -DHAVE_GRIFFIN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -std=gnu99
|
||||
|
||||
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -lGLESv2 -llog
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
@ -1,3 +1,19 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2012 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* 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.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.retroarch;
|
||||
|
||||
import android.media.AudioFormat;
|
||||
|
@ -1,3 +1,19 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2012 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* 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.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.retroarch;
|
||||
|
||||
import com.retroarch.R;
|
||||
@ -79,4 +95,4 @@ class rgl_context extends GLSurfaceView
|
||||
setEGLContextClientVersion(2);
|
||||
setRenderer(new rgl());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,19 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2012 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* 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.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.retroarch;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
@ -68,28 +84,28 @@ public class rgl implements GLSurfaceView.Renderer
|
||||
|
||||
public void onSurfaceCreated(GL10 unused, EGLConfig config)
|
||||
{
|
||||
//background color
|
||||
GLES20.glClearColor(0.5f, 0.5f, 0.5f, 1.0f);
|
||||
|
||||
triangles_init();
|
||||
shader_init();
|
||||
//background color
|
||||
GLES20.glClearColor(0.5f, 0.5f, 0.5f, 1.0f);
|
||||
|
||||
triangles_init();
|
||||
shader_init();
|
||||
}
|
||||
|
||||
public void onDrawFrame(GL10 unused)
|
||||
{
|
||||
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
|
||||
|
||||
GLES20.glUseProgram(cprg);
|
||||
|
||||
// Triangle
|
||||
GLES20.glVertexAttribPointer(v_position_handle, 3, GLES20.GL_FLOAT, false, 12, triangle_vbo);
|
||||
GLES20.glEnableVertexAttribArray(v_position_handle);
|
||||
|
||||
GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, 3);
|
||||
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
|
||||
|
||||
GLES20.glUseProgram(cprg);
|
||||
|
||||
// Triangle
|
||||
GLES20.glVertexAttribPointer(v_position_handle, 3, GLES20.GL_FLOAT, false, 12, triangle_vbo);
|
||||
GLES20.glEnableVertexAttribArray(v_position_handle);
|
||||
|
||||
GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, 3);
|
||||
}
|
||||
|
||||
public void onSurfaceChanged(GL10 unused, int width, int height)
|
||||
{
|
||||
GLES20.glViewport(0, 0, width, height);
|
||||
GLES20.glViewport(0, 0, width, height);
|
||||
}
|
||||
}
|
||||
|
46
android/src/com/retroarch/rruntime.java
Normal file
46
android/src/com/retroarch/rruntime.java
Normal file
@ -0,0 +1,46 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2012 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* 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.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.retroarch;
|
||||
|
||||
public class rruntime
|
||||
{
|
||||
static
|
||||
{
|
||||
System.loadLibrary("retroarch");
|
||||
}
|
||||
|
||||
private rruntime()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static native void load_game(final String j_path, final int j_extract_zip_mode);
|
||||
|
||||
public static native boolean run_frame();
|
||||
|
||||
public static native void startup(String j_config_path);
|
||||
|
||||
public static native void deinit();
|
||||
|
||||
public static native void load_state();
|
||||
|
||||
public static native void save_state();
|
||||
|
||||
public static native void settings_change(final int j_setting);
|
||||
|
||||
public static native void settings_set_defaults();
|
||||
}
|
37
audio/alsa.c
37
audio/alsa.c
@ -124,8 +124,9 @@ static ssize_t alsa_write(void *data, const void *buf_, size_t size_)
|
||||
alsa_t *alsa = (alsa_t*)data;
|
||||
const uint8_t *buf = (const uint8_t*)buf_;
|
||||
|
||||
bool eagain_retry = true;
|
||||
snd_pcm_sframes_t written = 0;
|
||||
snd_pcm_sframes_t size = snd_pcm_bytes_to_frames(alsa->pcm, size_);
|
||||
snd_pcm_sframes_t size = snd_pcm_bytes_to_frames(alsa->pcm, size_);
|
||||
|
||||
while (size)
|
||||
{
|
||||
@ -135,7 +136,11 @@ static ssize_t alsa_write(void *data, const void *buf_, size_t size_)
|
||||
if (rc == -EPIPE || rc == -ESTRPIPE || rc == -EINTR)
|
||||
{
|
||||
if (snd_pcm_recover(alsa->pcm, rc, 1) < 0)
|
||||
{
|
||||
RARCH_ERR("[ALSA]: (#1) Failed to recover from error (%s)\n",
|
||||
snd_strerror(rc));
|
||||
return -1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -145,18 +150,40 @@ static ssize_t alsa_write(void *data, const void *buf_, size_t size_)
|
||||
if (frames == -EPIPE || frames == -EINTR || frames == -ESTRPIPE)
|
||||
{
|
||||
if (snd_pcm_recover(alsa->pcm, frames, 1) < 0)
|
||||
{
|
||||
RARCH_ERR("[ALSA]: (#2) Failed to recover from error (%s)\n",
|
||||
snd_strerror(frames));
|
||||
return -1;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
else if (frames == -EAGAIN && alsa->nonblock)
|
||||
break;
|
||||
else if (frames == -EAGAIN && !alsa->nonblock) // Definitely not supposed to happen.
|
||||
{
|
||||
RARCH_WARN("[ALSA]: poll() was signaled, but EAGAIN returned from write.\n"
|
||||
"Your ALSA driver might be subtly broken.\n");
|
||||
|
||||
if (eagain_retry)
|
||||
{
|
||||
eagain_retry = false;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
return written;
|
||||
}
|
||||
else if (frames == -EAGAIN) // Expected if we're running nonblock.
|
||||
{
|
||||
return written;
|
||||
}
|
||||
else if (frames < 0)
|
||||
{
|
||||
RARCH_ERR("[ALSA]: Unknown error occured (%s).\n", snd_strerror(frames));
|
||||
return -1;
|
||||
}
|
||||
|
||||
written += frames;
|
||||
buf += (frames << 1) * (alsa->has_float ? sizeof(float) : sizeof(int16_t));
|
||||
size -= frames;
|
||||
buf += (frames << 1) * (alsa->has_float ? sizeof(float) : sizeof(int16_t));
|
||||
size -= frames;
|
||||
}
|
||||
|
||||
return written;
|
||||
|
@ -354,11 +354,14 @@ static void *dsound_init(const char *device, unsigned rate, unsigned latency)
|
||||
IDirectSoundBuffer_SetVolume(ds->dsb, DSBVOLUME_MAX);
|
||||
|
||||
#ifdef _XBOX
|
||||
dsmb.dwMixBinCount = 8;
|
||||
dsmb.lpMixBinVolumePairs = dsmbvp;
|
||||
|
||||
IDirectSoundBuffer_SetHeadroom(ds->dsb, DSBHEADROOM_MIN);
|
||||
IDirectSoundBuffer_SetMixBins(ds->dsb, &dsmb);
|
||||
if(g_console.sound_volume_level == 1)
|
||||
{
|
||||
dsmb.dwMixBinCount = 8;
|
||||
dsmb.lpMixBinVolumePairs = dsmbvp;
|
||||
|
||||
IDirectSoundBuffer_SetHeadroom(ds->dsb, DSBHEADROOM_MIN);
|
||||
IDirectSoundBuffer_SetMixBins(ds->dsb, &dsmb);
|
||||
}
|
||||
#endif
|
||||
|
||||
IDirectSoundBuffer_SetCurrentPosition(ds->dsb, 0);
|
||||
|
@ -86,7 +86,7 @@ static void *audio_ext_init(const char *device, unsigned rate, unsigned latency)
|
||||
|
||||
if (ext->driver->api_version != RARCH_AUDIO_API_VERSION)
|
||||
{
|
||||
RARCH_ERR("API mismatch in external audio plugin. SSNES: %d, Plugin: %d ...\n", RARCH_AUDIO_API_VERSION, ext->driver->api_version);
|
||||
RARCH_ERR("API mismatch in external audio plugin. RetroArch: %d, Plugin: %d ...\n", RARCH_AUDIO_API_VERSION, ext->driver->api_version);
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ static void *ja_init(const char *device, unsigned rate, unsigned latency)
|
||||
size_t bufsize = 0;
|
||||
int parsed = 0;
|
||||
|
||||
jd->client = jack_client_open("SSNES", JackNullOption, NULL);
|
||||
jd->client = jack_client_open("RetroArch", JackNullOption, NULL);
|
||||
if (jd->client == NULL)
|
||||
goto error;
|
||||
|
||||
|
@ -117,7 +117,7 @@ static void *pulse_init(const char *device, unsigned rate, unsigned latency)
|
||||
if (!pa->mainloop)
|
||||
goto error;
|
||||
|
||||
pa->context = pa_context_new(pa_threaded_mainloop_get_api(pa->mainloop), "SSNES");
|
||||
pa->context = pa_context_new(pa_threaded_mainloop_get_api(pa->mainloop), "RetroArch");
|
||||
if (!pa->context)
|
||||
goto error;
|
||||
|
||||
|
@ -37,7 +37,7 @@ static void *ra_init(const char *device, unsigned rate, unsigned latency)
|
||||
return NULL;
|
||||
|
||||
roar_vs_t *vss;
|
||||
if ((vss = roar_vs_new_simple(device, "SSNES", rate, 2, ROAR_CODEC_PCM_S, 16, ROAR_DIR_PLAY, &err)) == NULL)
|
||||
if ((vss = roar_vs_new_simple(device, "RetroArch", rate, 2, ROAR_CODEC_PCM_S, 16, ROAR_DIR_PLAY, &err)) == NULL)
|
||||
{
|
||||
RARCH_ERR("RoarAudio: \"%s\"\n", roar_vs_strerr(err));
|
||||
free(roar);
|
||||
|
@ -3,7 +3,7 @@
|
||||
authors: OV2, Themaister
|
||||
*/
|
||||
|
||||
// Kinda stripped down. Only contains the bare essentials used in SSNES.
|
||||
// Kinda stripped down. Only contains the bare essentials used in RetroArch.
|
||||
|
||||
#ifndef XAUDIO2_MINGW_H
|
||||
#define XAUDIO2_MINGW_H
|
||||
|
4
cheats.c
4
cheats.c
@ -234,7 +234,7 @@ static void cheat_manager_save_config(cheat_manager_t *handle, const char *path,
|
||||
#endif
|
||||
}
|
||||
|
||||
cheat_manager_t* cheat_manager_new(const char *path)
|
||||
cheat_manager_t *cheat_manager_new(const char *path)
|
||||
{
|
||||
LIBXML_TEST_VERSION;
|
||||
|
||||
@ -295,7 +295,7 @@ cheat_manager_t* cheat_manager_new(const char *path)
|
||||
if (!sha256)
|
||||
continue;
|
||||
|
||||
if (strcmp((const char*)sha256, g_extern.sha256) == 0)
|
||||
if (*g_extern.sha256 && strcmp((const char*)sha256, g_extern.sha256) == 0)
|
||||
{
|
||||
xmlFree(sha256);
|
||||
break;
|
||||
|
68
command.c
68
command.c
@ -27,6 +27,11 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#define DEFAULT_NETWORK_CMD_PORT 55355
|
||||
#define STDIN_BUF_SIZE 4096
|
||||
|
||||
@ -114,7 +119,9 @@ rarch_cmd_t *rarch_cmd_new(bool stdin_enable, bool network_enable, uint16_t port
|
||||
(void)stdin_enable;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETWORK_CMD
|
||||
freeaddrinfo(res);
|
||||
#endif
|
||||
return handle;
|
||||
|
||||
error:
|
||||
@ -128,8 +135,10 @@ error:
|
||||
|
||||
void rarch_cmd_free(rarch_cmd_t *handle)
|
||||
{
|
||||
#ifdef HAVE_NETWORK_CMD
|
||||
if (handle->net_fd >= 0)
|
||||
close(handle->net_fd);
|
||||
#endif
|
||||
|
||||
free(handle);
|
||||
}
|
||||
@ -238,7 +247,6 @@ static void network_cmd_pre_frame(rarch_cmd_t *handle)
|
||||
|
||||
#ifdef _WIN32
|
||||
// Oh you, Win32 ... <_<
|
||||
// TODO: Untested! Might not compile nor work.
|
||||
static size_t read_stdin(char *buf, size_t size)
|
||||
{
|
||||
HANDLE hnd = GetStdHandle(STD_INPUT_HANDLE);
|
||||
@ -248,25 +256,45 @@ static size_t read_stdin(char *buf, size_t size)
|
||||
// Check first if we're a pipe
|
||||
// (not console).
|
||||
DWORD avail = 0;
|
||||
BOOL ret = PeekNamedPipe(hnd, NULL, 0, NULL, &avail, NULL);
|
||||
bool echo = false;
|
||||
|
||||
if (!ret) // If not a pipe, check if we're running in a console.
|
||||
// If not a pipe, check if we're running in a console.
|
||||
if (!PeekNamedPipe(hnd, NULL, 0, NULL, &avail, NULL))
|
||||
{
|
||||
DWORD mode = 0;
|
||||
if (!GetConsoleMode(hnd, &mode))
|
||||
return 0;
|
||||
|
||||
INPUT_RECORD rec = {0};
|
||||
if ((mode & (ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT))
|
||||
&& !SetConsoleMode(hnd, mode & ~(ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT)))
|
||||
return 0;
|
||||
|
||||
// Win32, Y U NO SANE NONBLOCK READ!?
|
||||
DWORD has_read = 0;
|
||||
INPUT_RECORD recs[256];
|
||||
if (!PeekConsoleInput(hnd, recs, sizeof(recs) / sizeof(recs[0]), &has_read))
|
||||
return 0;
|
||||
|
||||
do
|
||||
bool has_key = false;
|
||||
for (DWORD i = 0; i < has_read; i++)
|
||||
{
|
||||
has_read = 0;
|
||||
PeekConsoleInput(hnd, &rec, 1, &has_read);
|
||||
} while (has_read && rec.EventType != KEY_EVENT);
|
||||
// Very crude, but should get the job done ...
|
||||
if (recs[i].EventType == KEY_EVENT &&
|
||||
recs[i].Event.KeyEvent.bKeyDown &&
|
||||
(isgraph(recs[i].Event.KeyEvent.wVirtualKeyCode) || recs[i].Event.KeyEvent.wVirtualKeyCode == VK_RETURN))
|
||||
{
|
||||
has_key = true;
|
||||
echo = true;
|
||||
avail = size;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (rec.EventType == KEY_EVENT)
|
||||
avail = size;
|
||||
if (!has_key)
|
||||
{
|
||||
FlushConsoleInputBuffer(hnd);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!avail)
|
||||
@ -276,10 +304,24 @@ static size_t read_stdin(char *buf, size_t size)
|
||||
avail = size;
|
||||
|
||||
DWORD has_read = 0;
|
||||
ret = ReadFile(hnd, buf, avail, &has_read, NULL);
|
||||
if (!ret)
|
||||
if (!ReadFile(hnd, buf, avail, &has_read, NULL))
|
||||
return 0;
|
||||
|
||||
for (DWORD i = 0; i < has_read; i++)
|
||||
if (buf[i] == '\r')
|
||||
buf[i] = '\n';
|
||||
|
||||
// Console won't echo for us while in non-line mode, so do it manually ...
|
||||
if (echo)
|
||||
{
|
||||
HANDLE hnd_out = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
if (hnd_out != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DWORD has_written;
|
||||
WriteConsole(hnd_out, buf, has_read, &has_written, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
return has_read;
|
||||
}
|
||||
#else
|
||||
@ -307,7 +349,7 @@ static void stdin_cmd_pre_frame(rarch_cmd_t *handle)
|
||||
if (!handle->stdin_enable)
|
||||
return;
|
||||
|
||||
size_t ret = read_stdin(handle->stdin_buf, STDIN_BUF_SIZE - handle->stdin_buf_ptr - 1);
|
||||
size_t ret = read_stdin(handle->stdin_buf + handle->stdin_buf_ptr, STDIN_BUF_SIZE - handle->stdin_buf_ptr - 1);
|
||||
if (ret == 0)
|
||||
return;
|
||||
|
||||
|
@ -30,8 +30,6 @@
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#elif defined(_XBOX)
|
||||
#define NOD3D
|
||||
#define NONET
|
||||
#include <xtl.h>
|
||||
#endif
|
||||
|
||||
@ -314,6 +312,23 @@ static bool parse_line(config_file_t *conf, struct entry_list *list, char *line)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool config_append_file(config_file_t *conf, const char *path)
|
||||
{
|
||||
config_file_t *new_conf = config_file_new(path);
|
||||
if (!new_conf)
|
||||
return false;
|
||||
|
||||
if (new_conf->tail)
|
||||
{
|
||||
new_conf->tail->next = conf->entries;
|
||||
conf->entries = new_conf->entries; // Pilfer.
|
||||
new_conf->entries = NULL;
|
||||
}
|
||||
|
||||
config_file_free(new_conf);
|
||||
return true;
|
||||
}
|
||||
|
||||
static config_file_t *config_file_new_internal(const char *path, unsigned depth)
|
||||
{
|
||||
struct config_file *conf = (struct config_file*)calloc(1, sizeof(*conf));
|
||||
@ -331,13 +346,7 @@ static config_file_t *config_file_new_internal(const char *path, unsigned depth)
|
||||
}
|
||||
|
||||
conf->include_depth = depth;
|
||||
|
||||
#ifdef RARCH_CONSOLE
|
||||
// This will create the file if it doesn't exist, and start reading at beginning.
|
||||
FILE *file = fopen(path, "a+");
|
||||
#else
|
||||
FILE *file = fopen(path, "r");
|
||||
#endif
|
||||
|
||||
if (!file)
|
||||
{
|
||||
@ -573,16 +582,48 @@ bool config_get_array(config_file_t *conf, const char *key, char *buf, size_t si
|
||||
{
|
||||
struct entry_list *list = conf->entries;
|
||||
|
||||
while (list)
|
||||
{
|
||||
if (strcmp(key, list->key) == 0)
|
||||
return strlcpy(buf, list->value, size) < size;
|
||||
list = list->next;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool config_get_path(config_file_t *conf, const char *key, char *buf, size_t size)
|
||||
{
|
||||
#if defined(_WIN32) || defined(RARCH_CONSOLE)
|
||||
return config_get_array(conf, key, buf, size);
|
||||
#else
|
||||
struct entry_list *list = conf->entries;
|
||||
|
||||
while (list)
|
||||
{
|
||||
if (strcmp(key, list->key) == 0)
|
||||
{
|
||||
strlcpy(buf, list->value, size);
|
||||
return true;
|
||||
const char *value = list->value;
|
||||
if (*value == '~')
|
||||
{
|
||||
const char *home = getenv("HOME");
|
||||
if (home)
|
||||
{
|
||||
size_t src_size = strlcpy(buf, home, size);
|
||||
if (src_size >= size)
|
||||
return false;
|
||||
|
||||
buf += src_size;
|
||||
size -= src_size;
|
||||
value++;
|
||||
}
|
||||
}
|
||||
|
||||
return strlcpy(buf, value, size) < size;
|
||||
}
|
||||
list = list->next;
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool config_get_bool(config_file_t *conf, const char *key, bool *in)
|
||||
|
@ -40,6 +40,10 @@ config_file_t *config_file_new(const char *path);
|
||||
// Frees config file.
|
||||
void config_file_free(config_file_t *conf);
|
||||
|
||||
// Loads a new config, and appends its data to conf.
|
||||
// The key-value pairs of the new config file takes priority over the old.
|
||||
bool config_append_file(config_file_t *conf, const char *path);
|
||||
|
||||
// All extract functions return true when value is valid and exists.
|
||||
// Returns false otherwise.
|
||||
|
||||
@ -63,6 +67,8 @@ bool config_get_char(config_file_t *conf, const char *entry, char *in);
|
||||
bool config_get_string(config_file_t *conf, const char *entry, char **in);
|
||||
// Extracts a string to a preallocated buffer. Avoid memory allocation.
|
||||
bool config_get_array(config_file_t *conf, const char *entry, char *in, size_t size);
|
||||
// Extracts a string to a preallocated buffer. Avoid memory allocation. Recognized magic like ~/. Similar to config_get_array() otherwise.
|
||||
bool config_get_path(config_file_t *conf, const char *entry, char *in, size_t size);
|
||||
// Extracts a boolean from config. Valid boolean true are "true" and "1". Valid false are "false" and "0". Other values will be treated as an error.
|
||||
bool config_get_bool(config_file_t *conf, const char *entry, bool *in);
|
||||
|
||||
|
@ -47,16 +47,21 @@
|
||||
#define CONFIG_GET_STRING_BASE(conf, base, var, key) \
|
||||
config_get_array(conf, key, base.var, sizeof(base.var))
|
||||
|
||||
#define CONFIG_GET_PATH_BASE(conf, base, var, key) \
|
||||
config_get_path(conf, key, base.var, sizeof(base.var))
|
||||
|
||||
#define CONFIG_GET_BOOL(var, key) CONFIG_GET_BOOL_BASE(conf, g_settings, var, key)
|
||||
#define CONFIG_GET_INT(var, key) CONFIG_GET_INT_BASE(conf, g_settings, var, key)
|
||||
#define CONFIG_GET_UINT64(var, key) CONFIG_GET_UINT64_BASE(conf, g_settings, var, key)
|
||||
#define CONFIG_GET_FLOAT(var, key) CONFIG_GET_FLOAT_BASE(conf, g_settings, var, key)
|
||||
#define CONFIG_GET_STRING(var, key) CONFIG_GET_STRING_BASE(conf, g_settings, var, key)
|
||||
#define CONFIG_GET_PATH(var, key) CONFIG_GET_PATH_BASE(conf, g_settings, var, key)
|
||||
|
||||
#define CONFIG_GET_BOOL_EXTERN(var, key) CONFIG_GET_BOOL_BASE(conf, g_extern, var, key)
|
||||
#define CONFIG_GET_INT_EXTERN(var, key) CONFIG_GET_INT_BASE(conf, g_extern, var, key)
|
||||
#define CONFIG_GET_FLOAT_EXTERN(var, key) CONFIG_GET_FLOAT_BASE(conf, g_extern, var, key)
|
||||
#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)
|
||||
|
16
config.def.h
16
config.def.h
@ -200,9 +200,15 @@ static const bool hires_record = false;
|
||||
// Enables lossless RGB H.264 recording if possible (if not, FFV1 is used).
|
||||
static const bool h264_record = true;
|
||||
|
||||
// Record post-filtered (CPU filter) video rather than raw SNES output.
|
||||
// Record post-filtered (CPU filter) video rather than raw game output.
|
||||
static const bool post_filter_record = false;
|
||||
|
||||
// Screenshots post-shaded GPU output if available.
|
||||
static const bool gpu_screenshot = true;
|
||||
|
||||
// Record post-shaded GPU output instead of raw game footage if available.
|
||||
static const bool gpu_record = false;
|
||||
|
||||
// OSD-messages
|
||||
static const bool font_enable = true;
|
||||
|
||||
@ -247,10 +253,18 @@ static const int out_latency = 64;
|
||||
static const bool audio_sync = true;
|
||||
|
||||
// Experimental rate control
|
||||
#ifdef GEKKO
|
||||
static const bool rate_control = true;
|
||||
#else
|
||||
static const bool rate_control = false;
|
||||
#endif
|
||||
|
||||
// Rate control delta. Defines how much rate_control is allowed to adjust input rate.
|
||||
#ifdef GEKKO
|
||||
static const float rate_control_delta = 0.006;
|
||||
#else
|
||||
static const float rate_control_delta = 0.005;
|
||||
#endif
|
||||
|
||||
//////////////
|
||||
// Misc
|
||||
|
@ -134,12 +134,6 @@ static const bool _ffmpeg_supp = true;
|
||||
static const bool _ffmpeg_supp = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_X264RGB
|
||||
static const bool _x264rgb_supp = true;
|
||||
#else
|
||||
static const bool _x264rgb_supp = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIGFILE
|
||||
static const bool _configfile_supp = true;
|
||||
#else
|
||||
|
2
configure
vendored
2
configure
vendored
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
PACKAGE_NAME=retroarch
|
||||
PACKAGE_VERSION=0.9.6
|
||||
PACKAGE_VERSION=0.9.7
|
||||
|
||||
. qb/qb.params.sh
|
||||
|
||||
|
@ -16,18 +16,22 @@
|
||||
|
||||
#include "file_browser.h"
|
||||
|
||||
static bool filebrowser_parse_directory(filebrowser_t * filebrowser, unsigned stack_size,
|
||||
const char * path, const char * extensions)
|
||||
static bool filebrowser_parse_directory(filebrowser_t *filebrowser, unsigned stack_size,
|
||||
const char *path, const char * extensions)
|
||||
{
|
||||
struct string_list *list = dir_list_new(path, extensions, true);
|
||||
|
||||
if(list != NULL)
|
||||
{
|
||||
strlcpy(filebrowser->dir[stack_size], path,
|
||||
sizeof(filebrowser->dir[stack_size]));
|
||||
strlcpy(filebrowser->directory_path, path, sizeof(filebrowser->directory_path));
|
||||
|
||||
if(filebrowser->current_dir.list != NULL)
|
||||
dir_list_free(filebrowser->current_dir.list);
|
||||
|
||||
filebrowser->current_dir.list = list;
|
||||
filebrowser->current_dir.ptr = 0;
|
||||
filebrowser->directory_stack_size = stack_size;
|
||||
strlcpy(filebrowser->extensions, extensions, sizeof(filebrowser->extensions));
|
||||
|
||||
dir_list_sort(filebrowser->current_dir.list, true);
|
||||
|
||||
@ -37,18 +41,10 @@ const char * path, const char * extensions)
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool filebrowser_new(filebrowser_t * filebrowser, const char * start_dir,
|
||||
const char * extensions)
|
||||
static bool filebrowser_new(filebrowser_t *filebrowser, const char *start_dir,
|
||||
const char *extensions)
|
||||
{
|
||||
bool ret = true;
|
||||
|
||||
ret = filebrowser_parse_directory(filebrowser, 0, start_dir, extensions);
|
||||
|
||||
if(ret)
|
||||
{
|
||||
filebrowser->directory_stack_size = 0;
|
||||
strlcpy(filebrowser->extensions, extensions, sizeof(filebrowser->extensions));
|
||||
}
|
||||
bool ret = filebrowser_parse_directory(filebrowser, 0, start_dir, extensions);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -78,9 +74,7 @@ bool with_extension)
|
||||
{
|
||||
bool ret = true;
|
||||
char extensions[256];
|
||||
unsigned push_dir;
|
||||
|
||||
push_dir = filebrowser->directory_stack_size + 1;
|
||||
unsigned push_dir = filebrowser->directory_stack_size + 1;
|
||||
|
||||
if(with_extension)
|
||||
snprintf(extensions, sizeof(extensions), filebrowser->extensions);
|
||||
@ -89,37 +83,42 @@ bool with_extension)
|
||||
|
||||
ret = filebrowser_parse_directory(filebrowser, push_dir, path, extensions);
|
||||
|
||||
if(ret)
|
||||
filebrowser->directory_stack_size = push_dir;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool filebrowser_pop_directory (filebrowser_t * filebrowser)
|
||||
{
|
||||
bool ret = true;
|
||||
unsigned pop_dir;
|
||||
char previous_dir[PATH_MAX], directory_path_tmp[PATH_MAX];
|
||||
unsigned pop_dir = filebrowser->directory_stack_size;
|
||||
|
||||
if (filebrowser->directory_stack_size > 0)
|
||||
pop_dir = filebrowser->directory_stack_size - 1;
|
||||
else
|
||||
pop_dir = filebrowser->directory_stack_size;
|
||||
pop_dir -= 1;
|
||||
|
||||
ret = filebrowser_parse_directory(filebrowser, pop_dir, filebrowser->dir[pop_dir],
|
||||
fill_pathname_basedir(previous_dir, filebrowser->directory_path, sizeof(previous_dir));
|
||||
strlcpy(directory_path_tmp, filebrowser->directory_path, sizeof(directory_path_tmp));
|
||||
|
||||
//test first if previous directory can be accessed
|
||||
ret = filebrowser_parse_directory(filebrowser, pop_dir, previous_dir,
|
||||
filebrowser->extensions);
|
||||
|
||||
if(ret)
|
||||
filebrowser->directory_stack_size = pop_dir;
|
||||
if(!ret)
|
||||
{
|
||||
//revert to previous directory
|
||||
strlcpy(filebrowser->directory_path, directory_path_tmp, sizeof(filebrowser->directory_path));
|
||||
ret = filebrowser_parse_directory(filebrowser, pop_dir, filebrowser->directory_path,
|
||||
filebrowser->extensions);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
const char * filebrowser_get_current_dir (filebrowser_t *filebrowser)
|
||||
const char *filebrowser_get_current_dir (filebrowser_t *filebrowser)
|
||||
{
|
||||
return filebrowser->dir[filebrowser->directory_stack_size];
|
||||
return filebrowser->directory_path;
|
||||
}
|
||||
|
||||
const char * filebrowser_get_current_path (filebrowser_t *filebrowser)
|
||||
const char *filebrowser_get_current_path (filebrowser_t *filebrowser)
|
||||
{
|
||||
return filebrowser->current_dir.list->elems[filebrowser->current_dir.ptr].data;
|
||||
}
|
||||
@ -155,7 +154,7 @@ static void filebrowser_set_current_decrement (filebrowser_t *filebrowser, bool
|
||||
|
||||
bool filebrowser_iterate(filebrowser_t *filebrowser, filebrowser_action_t action)
|
||||
{
|
||||
static bool ret = true;
|
||||
bool ret = true;
|
||||
unsigned entries_to_scroll = 19;
|
||||
|
||||
switch(action)
|
||||
|
@ -17,19 +17,17 @@
|
||||
#ifndef FILEBROWSER_H_
|
||||
#define FILEBROWSER_H_
|
||||
|
||||
#define MAX_DIR_STACK 25
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include "../../general.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t directory_stack_size;
|
||||
char dir[MAX_DIR_STACK][512];
|
||||
unsigned char directory_stack_size;
|
||||
char directory_path[PATH_MAX];
|
||||
struct {
|
||||
struct string_list *list;
|
||||
size_t ptr;
|
||||
struct string_list *list;
|
||||
size_t ptr;
|
||||
} current_dir;
|
||||
char root_dir[PATH_MAX];
|
||||
char extensions[PATH_MAX];
|
||||
|
BIN
console/font.bin
Normal file
BIN
console/font.bin
Normal file
Binary file not shown.
@ -13,23 +13,17 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_CTX_H
|
||||
#define _SDL_CTX_H
|
||||
#ifndef _CONSOLE_FONT_H
|
||||
#define _CONSOLE_FONT_H
|
||||
|
||||
#include "SDL.h"
|
||||
#include "SDL_version.h"
|
||||
#define FONT_WIDTH 5
|
||||
#define FONT_HEIGHT 10
|
||||
#define FONT_WIDTH_STRIDE (FONT_WIDTH + 1)
|
||||
#define FONT_HEIGHT_STRIDE (FONT_HEIGHT + 1)
|
||||
|
||||
#if SDL_VERSION_ATLEAST(1, 3, 0)
|
||||
#define SDL_MODERN 1
|
||||
#else
|
||||
#define SDL_MODERN 0
|
||||
#endif
|
||||
#define FONT_OFFSET(x) ((x) * ((FONT_HEIGHT * FONT_WIDTH + 7) / 8))
|
||||
|
||||
// Not legal to cast (void*) to fn-pointer. Need workaround to be compliant.
|
||||
#define SDL_SYM_WRAP(sym, symbol) { \
|
||||
rarch_assert(sizeof(void*) == sizeof(void (*)(void))); \
|
||||
void *sym__ = SDL_GL_GetProcAddress(symbol); \
|
||||
memcpy(&(sym), &sym__, sizeof(void*)); \
|
||||
}
|
||||
//extern uint8_t _binary_console_font_bmp_start[];
|
||||
extern uint8_t _binary_console_font_bin_start[];
|
||||
|
||||
#endif
|
@ -32,6 +32,11 @@ CONSOLE EXTENSIONS
|
||||
#include "../rarch_console_main_wrap.c"
|
||||
#endif
|
||||
|
||||
#ifdef HW_DOL
|
||||
#include "../../ngc/ssaram.c"
|
||||
#include "../../ngc/sidestep.c"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_RARCH_EXEC
|
||||
#include "../rarch_console_exec.c"
|
||||
#endif
|
||||
@ -82,10 +87,14 @@ VIDEO CONTEXT
|
||||
|
||||
#ifdef HAVE_VID_CONTEXT
|
||||
|
||||
#if defined(__CELLOS_LV2__)
|
||||
#if defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
|
||||
#include "../../gfx/context/ps3_ctx.c"
|
||||
#elif defined(_XBOX)
|
||||
#include "../../gfx/context/xdk_ctx.c"
|
||||
#elif defined(HAVE_EGL)
|
||||
#include "../../gfx/context/egl_ctx.c"
|
||||
#else
|
||||
#include "../../gfx/context/null_ctx.c"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@ -112,6 +121,8 @@ VIDEO IMAGE
|
||||
|
||||
#if defined(__CELLOS_LV2__)
|
||||
#include "../../ps3/image.c"
|
||||
#elif defined(_XBOX1)
|
||||
#include "../../xbox1/image.c"
|
||||
#endif
|
||||
|
||||
/*============================================================
|
||||
@ -119,9 +130,18 @@ VIDEO DRIVER
|
||||
============================================================ */
|
||||
|
||||
#if defined(HAVE_OPENGL)
|
||||
#include "../../gfx/math/matrix.c"
|
||||
#include "../../gfx/gl.c"
|
||||
#elif defined(GEKKO)
|
||||
#include "../../wii/gx_video.c"
|
||||
#ifdef HW_RVL
|
||||
#include "../../wii/vi_encoder.c"
|
||||
#include "../../wii/mem2_manager.c"
|
||||
#endif
|
||||
#include "../../gx/gx_video.c"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DYLIB
|
||||
#include "../../gfx/ext_gfx.c"
|
||||
#endif
|
||||
|
||||
#include "../../gfx/gfx_common.c"
|
||||
@ -141,12 +161,16 @@ VIDEO DRIVER
|
||||
FONTS
|
||||
============================================================ */
|
||||
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_D3D8) || defined(HAVE_D3D9)
|
||||
#if defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
|
||||
#include "../../gfx/fonts/ps3_libdbgfont.c"
|
||||
#elif defined(_XBOX1)
|
||||
#include "../../gfx/fonts/xdk1_xfonts.c"
|
||||
#elif defined(_XBOX360)
|
||||
#include "../../gfx/fonts/xdk360_fonts.cpp"
|
||||
#else
|
||||
#include "../../gfx/fonts/null_fonts.c"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*============================================================
|
||||
@ -155,7 +179,7 @@ INPUT
|
||||
#if defined(__CELLOS_LV2__)
|
||||
#include "../../ps3/ps3_input.c"
|
||||
#elif defined(GEKKO)
|
||||
#include "../../wii/gx_input.c"
|
||||
#include "../../gx/gx_input.c"
|
||||
#elif defined(_XBOX)
|
||||
#include "../../xdk/xdk_xinput_input.c"
|
||||
#endif
|
||||
@ -207,13 +231,17 @@ AUDIO
|
||||
#elif defined(_XBOX360)
|
||||
#include "../../360/xdk360_audio.cpp"
|
||||
#elif defined(GEKKO)
|
||||
#include "../../wii/gx_audio.c"
|
||||
#include "../../gx/gx_audio.c"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DSOUND
|
||||
#include "../../audio/dsound.c"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DYLIB
|
||||
#include "../../audio/ext_audio.c"
|
||||
#endif
|
||||
|
||||
#include "../../audio/null.c"
|
||||
|
||||
/*============================================================
|
||||
@ -256,7 +284,9 @@ MAIN
|
||||
#if defined(_XBOX)
|
||||
#include "../../xdk/frontend/main.c"
|
||||
#elif defined(GEKKO)
|
||||
#include "../../wii/frontend/main.c"
|
||||
#include "../../gx/frontend/main.c"
|
||||
#elif defined(__PSL1GHT__)
|
||||
#include "../../ps3/frontend/main.c"
|
||||
#endif
|
||||
|
||||
/*============================================================
|
||||
@ -278,16 +308,33 @@ NETPLAY
|
||||
#include "../../netplay.c"
|
||||
#endif
|
||||
|
||||
/*============================================================
|
||||
SCREENSHOTS
|
||||
============================================================ */
|
||||
#ifdef HAVE_SCREENSHOTS
|
||||
#include "../../screenshot.c"
|
||||
#endif
|
||||
|
||||
/*============================================================
|
||||
MENU
|
||||
============================================================ */
|
||||
#ifdef HAVE_RMENU
|
||||
#if defined(__CELLOS_LV2__)
|
||||
#include "../rmenu/context/rmenu_ctx_ps3.c"
|
||||
#elif defined(_XBOX1)
|
||||
#include "../rmenu/context/rmenu_ctx_xdk.c"
|
||||
#endif
|
||||
#include "../rmenu/rmenu_stack.c"
|
||||
#include "../rmenu/rmenu.c"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_RGUI
|
||||
#include "../rgui/rgui.c"
|
||||
#include "../rgui/list.c"
|
||||
#endif
|
||||
|
||||
#if defined(_XBOX360)
|
||||
#include "../../360/frontend-xdk/menu.cpp"
|
||||
#elif defined(_XBOX1)
|
||||
#include "../../xbox1/frontend/menu.cpp"
|
||||
#include "../../xbox1/frontend/RetroLaunch/IoSupport.cpp"
|
||||
#include "../../xbox1/frontend/RetroLaunch/Surface.cpp"
|
||||
#elif defined(GEKKO)
|
||||
#include "../../wii/frontend/rgui.c"
|
||||
#include "../../wii/frontend/list.c"
|
||||
#endif
|
||||
|
@ -39,9 +39,10 @@
|
||||
#define video_free_func() gl_free(driver.video_data)
|
||||
#define video_set_rotation_func(rotation) gl_set_rotation(driver.video_data, rotation)
|
||||
#define video_set_aspect_ratio_func(aspectratio_idx) gfx_ctx_set_aspect_ratio(driver.video_data, aspectratio_idx)
|
||||
#define video_stop_func() gl_stop()
|
||||
#define video_start_func() gl_start()
|
||||
|
||||
#define gfx_ctx_window_has_focus() (true)
|
||||
#define gfx_ctx_swap_buffers() (psglSwap())
|
||||
|
||||
#define input_init_func() ps3_input_initialize()
|
||||
#define input_poll_func() ps3_input_poll(driver.input_data)
|
||||
@ -67,9 +68,10 @@
|
||||
#define video_free_func() xdk_d3d_free(driver.video_data)
|
||||
#define video_set_rotation_func(rotation) xdk_d3d_set_rotation(driver.video_data, rotation)
|
||||
#define video_set_aspect_ratio_func(aspectratio_idx) gfx_ctx_set_aspect_ratio(driver.video_data, aspectratio_idx)
|
||||
#define video_stop_func() xdk_d3d_stop()
|
||||
#define video_start_func() xdk_d3d_start()
|
||||
|
||||
#define gfx_ctx_window_has_focus() (true)
|
||||
#define gfx_ctx_swap_buffers() (d3d->d3d_render_device->Present(NULL, NULL, NULL, NULL))
|
||||
|
||||
#define input_init_func() xinput_input_init()
|
||||
#define input_poll_func() xinput_input_poll(driver.input_data)
|
||||
@ -84,23 +86,27 @@
|
||||
|
||||
#elif defined(GEKKO)
|
||||
|
||||
#define video_init_func(video_info, input, input_data) wii_init(video_info, input, input_data)
|
||||
#define video_init_func(video_info, input, input_data) gx_init(video_info, input, input_data)
|
||||
#define video_frame_func(data, width, height, pitch, msg) \
|
||||
wii_frame(driver.video_data, data, width, height, pitch, msg)
|
||||
#define video_set_nonblock_state_func(state) wii_set_nonblock_state(driver.video_data, state)
|
||||
#define video_alive_func() wii_alive(driver.video_data)
|
||||
#define video_focus_func() wii_focus(driver.video_data)
|
||||
gx_frame(driver.video_data, data, width, height, pitch, msg)
|
||||
#define video_set_nonblock_state_func(state) gx_set_nonblock_state(driver.video_data, state)
|
||||
#define video_alive_func() gx_alive(driver.video_data)
|
||||
#define video_focus_func() gx_focus(driver.video_data)
|
||||
#define video_xml_shader_func(path) driver.video->xml_shader(driver.video_data, path)
|
||||
#define video_free_func() wii_free(driver.video_data)
|
||||
#define video_set_rotation_func(orientation) wii_set_rotation(driver.video_data, orientation)
|
||||
#define video_set_aspect_ratio_func(aspectratio_idx) wii_set_aspect_ratio(driver.video_data, aspectratio_idx)
|
||||
#define video_free_func() gx_free(driver.video_data)
|
||||
#define video_set_rotation_func(orientation) gx_set_rotation(driver.video_data, orientation)
|
||||
#define video_set_aspect_ratio_func(aspectratio_idx) gx_set_aspect_ratio(driver.video_data, aspectratio_idx)
|
||||
#define video_stop_func() gx_stop()
|
||||
#define video_start_func() gx_start()
|
||||
#define video_viewport_size_func(width, height) ((void)0)
|
||||
#define video_read_viewport_func(buffer) (false)
|
||||
|
||||
#define input_init_func() wii_input_initialize()
|
||||
#define input_poll_func() wii_input_poll(driver.input_data)
|
||||
#define input_init_func() gx_input_initialize()
|
||||
#define input_poll_func() gx_input_poll(driver.input_data)
|
||||
#define input_input_state_func(retro_keybinds, port, device, index, id) \
|
||||
wii_input_state(driver.input_data, retro_keybinds, port, device, index, id)
|
||||
#define input_key_pressed_func(key) wii_key_pressed(driver.input_data, key)
|
||||
#define input_free_func() wii_free_input(driver.input_data)
|
||||
gx_input_state(driver.input_data, retro_keybinds, port, device, index, id)
|
||||
#define input_key_pressed_func(key) gx_key_pressed(driver.input_data, key)
|
||||
#define input_free_func() gx_free_input(driver.input_data)
|
||||
#define gfx_ctx_window_has_focus() (true)
|
||||
|
||||
#else
|
||||
@ -119,6 +125,8 @@
|
||||
#define video_free_func() null_gfx_free(driver.video_data)
|
||||
#define video_set_rotation_func(orientation) (true)
|
||||
#define video_set_aspect_ratio_func(aspectratio_idx) (true)
|
||||
#define video_stop_func() null_gfx_stop()
|
||||
#define video_start_func() null_gfx_start()
|
||||
|
||||
#define input_init_func() null_input_init()
|
||||
#define input_poll_func() null_input_poll(driver.input_data)
|
||||
|
@ -61,7 +61,6 @@
|
||||
|
||||
#define close(x) socketclose(x)
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
Naming convention. Functions for use in API are called rsd_*(), *
|
||||
@ -241,7 +240,7 @@ static int rsnd_connect_server( rsound_t *rd )
|
||||
|
||||
/* Cleanup for errors. */
|
||||
error:
|
||||
RSD_ERR("Connecting to server failed. \"%s\"", rd->host);
|
||||
RSD_ERR("[RSound] Connecting to server failed. \"%s\"", rd->host);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -255,7 +254,7 @@ static int rsnd_send_header_info(rsound_t *rd)
|
||||
char *header = calloc(1, HEADER_SIZE);
|
||||
if (header == NULL)
|
||||
{
|
||||
RSD_ERR("Could not allocate memory.");
|
||||
RSD_ERR("[RSound] Could not allocate memory.");
|
||||
return -1;
|
||||
}
|
||||
uint16_t temp16;
|
||||
@ -311,7 +310,6 @@ static int rsnd_send_header_info(rsound_t *rd)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* Since the values in the wave header we are interested in, are little endian (>_<), we need
|
||||
to determine whether we're running it or not, so we can byte swap accordingly.
|
||||
Could determine this compile time, but it was simpler to do it this way. */
|
||||
@ -406,7 +404,7 @@ static int rsnd_get_backend_info ( rsound_t *rd )
|
||||
|
||||
if ( rsnd_recv_chunk(rd->conn.socket, rsnd_header, RSND_HEADER_SIZE, 1) != RSND_HEADER_SIZE )
|
||||
{
|
||||
RSD_ERR("Couldn't receive chunk.");
|
||||
RSD_ERR("[RSound] Couldn't receive chunk.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -434,7 +432,7 @@ static int rsnd_get_backend_info ( rsound_t *rd )
|
||||
rd->fifo_buffer = fifo_new (rd->buffer_size);
|
||||
if ( rd->fifo_buffer == NULL )
|
||||
{
|
||||
RSD_ERR("Failed to create fifobuf");
|
||||
RSD_ERR("[RSound] Failed to create FIFO buffer.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -463,7 +461,7 @@ static int rsnd_get_backend_info ( rsound_t *rd )
|
||||
if ( rsnd_recv_chunk(rd->conn.socket, rsnd_header, RSND_HEADER_SIZE, 0) == RSND_HEADER_SIZE )
|
||||
rd->conn_type |= RSD_CONN_PROTO;
|
||||
else
|
||||
{ RSD_DEBUG("Failed to get new proto"); }
|
||||
{ RSD_DEBUG("[RSound] Failed to get new proto.\n"); }
|
||||
|
||||
// We no longer want to read from this socket.
|
||||
#ifdef _WIN32
|
||||
@ -487,7 +485,7 @@ static int rsnd_create_connection(rsound_t *rd)
|
||||
rc = rsnd_connect_server(rd);
|
||||
if (rc < 0)
|
||||
{
|
||||
RSD_ERR("connect server failed!");
|
||||
RSD_ERR("[RSound] connect server failed.\n");
|
||||
rsd_stop(rd);
|
||||
return -1;
|
||||
}
|
||||
@ -500,14 +498,14 @@ static int rsnd_create_connection(rsound_t *rd)
|
||||
|
||||
if ( rsnd_poll(&fd, 1, 2000) < 0 )
|
||||
{
|
||||
RSD_ERR("rsnd_poll failed!");
|
||||
RSD_ERR("[RSound] rsnd_poll failed.\n");
|
||||
rsd_stop(rd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( !(fd.revents & POLLOUT) )
|
||||
{
|
||||
RSD_ERR("Poll didn't return what we wanted!");
|
||||
RSD_ERR("[RSound] Poll didn't return what we wanted.\n");
|
||||
rsd_stop(rd);
|
||||
return -1;
|
||||
}
|
||||
@ -523,7 +521,7 @@ static int rsnd_create_connection(rsound_t *rd)
|
||||
rc = rsnd_send_header_info(rd);
|
||||
if (rc < 0)
|
||||
{
|
||||
RSD_ERR("Send header failed!");
|
||||
RSD_ERR("[RSound] Send header failed.\n");
|
||||
rsd_stop(rd);
|
||||
return -1;
|
||||
}
|
||||
@ -531,7 +529,7 @@ static int rsnd_create_connection(rsound_t *rd)
|
||||
rc = rsnd_get_backend_info(rd);
|
||||
if (rc < 0)
|
||||
{
|
||||
RSD_ERR("Get backend info failed!");
|
||||
RSD_ERR("[RSound] Get backend info failed.\n");
|
||||
rsd_stop(rd);
|
||||
return -1;
|
||||
}
|
||||
@ -539,7 +537,7 @@ static int rsnd_create_connection(rsound_t *rd)
|
||||
rc = rsnd_start_thread(rd);
|
||||
if (rc < 0)
|
||||
{
|
||||
RSD_ERR("Starting thread failed!");
|
||||
RSD_ERR("[RSound] Starting thread failed.\n");
|
||||
rsd_stop(rd);
|
||||
return -1;
|
||||
}
|
||||
@ -589,7 +587,7 @@ static ssize_t rsnd_send_chunk(int socket, const void* buf, size_t size, int blo
|
||||
rc = send(socket, (const char*)buf + wrote, send_size, 0);
|
||||
if ( rc < 0 )
|
||||
{
|
||||
RSD_ERR("Error sending chunk, %s\n", strerror(errno));
|
||||
RSD_ERR("[RSound] Error sending chunk, %s.\n", strerror(errno));
|
||||
return rc;
|
||||
}
|
||||
wrote += rc;
|
||||
@ -625,13 +623,13 @@ static ssize_t rsnd_recv_chunk(int socket, void *buf, size_t size, int blocking)
|
||||
{
|
||||
if ( rsnd_poll(&fd, 1, sleep_time) < 0 )
|
||||
{
|
||||
RSD_ERR("Poll failed");
|
||||
RSD_ERR("[RSound] Poll failed.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( fd.revents & POLLHUP )
|
||||
{
|
||||
RSD_ERR("Server hung up");
|
||||
RSD_ERR("[RSound] Server hung up.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -641,7 +639,7 @@ static ssize_t rsnd_recv_chunk(int socket, void *buf, size_t size, int blocking)
|
||||
rc = recv(socket, (char*)buf + has_read, read_size, 0);
|
||||
if ( rc <= 0 )
|
||||
{
|
||||
RSD_ERR("Error receiving chunk, %s\n", strerror(errno));
|
||||
RSD_ERR("[RSound] Error receiving chunk, %s.\n", strerror(errno));
|
||||
return rc;
|
||||
}
|
||||
has_read += rc;
|
||||
@ -650,7 +648,7 @@ static ssize_t rsnd_recv_chunk(int socket, void *buf, size_t size, int blocking)
|
||||
{
|
||||
if ( blocking )
|
||||
{
|
||||
RSD_ERR("Block FAIL!");
|
||||
RSD_ERR("[RSound] Block fail.\n");
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
@ -735,19 +733,19 @@ static size_t rsnd_fill_buffer(rsound_t *rd, const char *buf, size_t size)
|
||||
pthread_mutex_lock(&rd->thread.cond_mutex);
|
||||
pthread_cond_signal(&rd->thread.cond);
|
||||
|
||||
RSD_DEBUG("rsnd_fill_buffer: Going to sleep.");
|
||||
RSD_DEBUG("[RSound] rsnd_fill_buffer: Going to sleep.\n");
|
||||
pthread_cond_wait(&rd->thread.cond, &rd->thread.cond_mutex);
|
||||
RSD_DEBUG("rsnd_fill_buffer: Woke up.");
|
||||
RSD_DEBUG("[RSound] rsnd_fill_buffer: Woke up.\n");
|
||||
pthread_mutex_unlock(&rd->thread.cond_mutex);
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&rd->thread.mutex);
|
||||
fifo_write(rd->fifo_buffer, buf, size);
|
||||
pthread_mutex_unlock(&rd->thread.mutex);
|
||||
//RSD_DEBUG("fill_buffer: Wrote to buffer.");
|
||||
//RSD_DEBUG("[RSound] fill_buffer: Wrote to buffer.\n");
|
||||
|
||||
/* Send signal to thread that buffer has been updated */
|
||||
//RSD_DEBUG("fill_buffer: Waking up thread.");
|
||||
//RSD_DEBUG("[RSound] fill_buffer: Waking up thread.\n");
|
||||
pthread_cond_signal(&rd->thread.cond);
|
||||
|
||||
return size;
|
||||
@ -763,7 +761,7 @@ static int rsnd_start_thread(rsound_t *rd)
|
||||
if ( rc < 0 )
|
||||
{
|
||||
rd->thread_active = 0;
|
||||
RSD_ERR("Failed to create thread.");
|
||||
RSD_ERR("[RSound] Failed to create thread.");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
@ -778,7 +776,7 @@ static int rsnd_stop_thread(rsound_t *rd)
|
||||
if ( rd->thread_active )
|
||||
{
|
||||
|
||||
RSD_DEBUG("Shutting down thread.");
|
||||
RSD_DEBUG("[RSound] Shutting down thread.\n");
|
||||
|
||||
pthread_mutex_lock(&rd->thread.cond_mutex);
|
||||
rd->thread_active = 0;
|
||||
@ -786,15 +784,15 @@ static int rsnd_stop_thread(rsound_t *rd)
|
||||
pthread_mutex_unlock(&rd->thread.cond_mutex);
|
||||
|
||||
if ( pthread_join(rd->thread.threadId, NULL) < 0 )
|
||||
RSD_WARN("*** Warning, did not terminate thread. ***");
|
||||
RSD_WARN("[RSound] *** Warning, did not terminate thread. ***\n");
|
||||
else
|
||||
RSD_DEBUG("Thread joined successfully.");
|
||||
RSD_DEBUG("[RSound] Thread joined successfully.\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
RSD_DEBUG("Thread is already shut down.");
|
||||
RSD_DEBUG("Thread is already shut down.\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -811,7 +809,7 @@ static size_t rsnd_get_delay(rsound_t *rd)
|
||||
|
||||
pthread_mutex_lock(&rd->thread.mutex);
|
||||
ptr += rd->delay_offset;
|
||||
RSD_DEBUG("Offset: %d", rd->delay_offset);
|
||||
RSD_DEBUG("Offset: %d.\n", rd->delay_offset);
|
||||
pthread_mutex_unlock(&rd->thread.mutex);
|
||||
|
||||
if ( ptr < 0 )
|
||||
@ -1005,7 +1003,7 @@ static int rsnd_update_server_info(rsound_t *rd)
|
||||
delta += fifo_read_avail(rd->fifo_buffer);
|
||||
pthread_mutex_unlock(&rd->thread.mutex);
|
||||
|
||||
RSD_DEBUG("Delay: %d, Delta: %d", delay, delta);
|
||||
RSD_DEBUG("[RSound] Delay: %d, Delta: %d.\n", delay, delta);
|
||||
|
||||
// We only update the pointer if the data we got is quite recent.
|
||||
if ( rd->total_written - client_ptr < 4 * rd->backend_info.chunk_size && rd->total_written > client_ptr )
|
||||
@ -1020,7 +1018,7 @@ static int rsnd_update_server_info(rsound_t *rd)
|
||||
pthread_mutex_lock(&rd->thread.mutex);
|
||||
rd->delay_offset += offset_delta;
|
||||
pthread_mutex_unlock(&rd->thread.mutex);
|
||||
RSD_DEBUG("Changed offset-delta: %d", offset_delta);
|
||||
RSD_DEBUG("[RSound] Changed offset-delta: %d.\n", offset_delta);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1116,13 +1114,13 @@ static void* rsnd_thread ( void * thread_data )
|
||||
|
||||
if ( rd->thread_active )
|
||||
{
|
||||
RSD_DEBUG("Thread going to sleep.");
|
||||
RSD_DEBUG("[RSound] Thread going to sleep.\n");
|
||||
pthread_cond_wait(&rd->thread.cond, &rd->thread.cond_mutex);
|
||||
RSD_DEBUG("Thread woke up.");
|
||||
RSD_DEBUG("[RSound] Thread woke up.\n");
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&rd->thread.cond_mutex);
|
||||
RSD_DEBUG("Thread unlocked cond_mutex.");
|
||||
RSD_DEBUG("[RSound] Thread unlocked cond_mutex.\n");
|
||||
}
|
||||
/* Abort request, chap. */
|
||||
else
|
||||
@ -1170,7 +1168,7 @@ static void* rsnd_cb_thread(void *thread_data)
|
||||
{
|
||||
if ((int)rsd_delay_ms(rd) < rd->max_latency / 2)
|
||||
{
|
||||
RSD_DEBUG("Callback thread: Requested %d bytes, got %d\n", (int)will_read, (int)ret);
|
||||
RSD_DEBUG("[RSound] Callback thread: Requested %d bytes, got %d.\n", (int)will_read, (int)ret);
|
||||
memset(buffer + has_read, 0, will_read - ret);
|
||||
has_read += will_read - ret;
|
||||
}
|
||||
@ -1306,25 +1304,25 @@ int rsd_start(rsound_t *rsound)
|
||||
int rsd_exec(rsound_t *rsound)
|
||||
{
|
||||
assert(rsound != NULL);
|
||||
RSD_DEBUG("rsd_exec()");
|
||||
RSD_DEBUG("[RSound] rsd_exec().\n");
|
||||
|
||||
// Makes sure we have a working connection
|
||||
if ( rsound->conn.socket < 0 )
|
||||
{
|
||||
RSD_DEBUG("Calling rsd_start()");
|
||||
RSD_DEBUG("[RSound] Calling rsd_start().\n");
|
||||
if ( rsd_start(rsound) < 0 )
|
||||
{
|
||||
RSD_ERR("rsd_start() failed!");
|
||||
RSD_ERR("[RSound] rsd_start() failed.\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
RSD_DEBUG("Closing ctl");
|
||||
RSD_DEBUG("[RSound] Closing ctl.\n");
|
||||
if ( rsnd_close_ctl(rsound) < 0 )
|
||||
return -1;
|
||||
|
||||
int fd = rsound->conn.socket;
|
||||
RSD_DEBUG("Socket: %d", fd);
|
||||
RSD_DEBUG("[RSound] Socket: %d.\n", fd);
|
||||
|
||||
rsnd_stop_thread(rsound);
|
||||
|
||||
@ -1339,13 +1337,13 @@ int rsd_exec(rsound_t *rsound)
|
||||
fifo_read(rsound->fifo_buffer, buffer, sizeof(buffer));
|
||||
if ( rsnd_send_chunk(fd, buffer, sizeof(buffer), 1) != (ssize_t)sizeof(buffer) )
|
||||
{
|
||||
RSD_DEBUG("Failed flushing buffer!");
|
||||
RSD_DEBUG("[RSound] Failed flushing buffer.\n");
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
RSD_DEBUG("Returning from rsd_exec()");
|
||||
RSD_DEBUG("[RSound] Returning from rsd_exec().\n");
|
||||
rsd_free(rsound);
|
||||
return fd;
|
||||
}
|
||||
@ -1445,7 +1443,7 @@ void rsd_delay_wait(rsound_t *rd)
|
||||
if ( rd->max_latency < latency_ms )
|
||||
{
|
||||
int64_t sleep_ms = latency_ms - rd->max_latency;
|
||||
RSD_DEBUG("Delay wait: %d ms\n", (int)sleep_ms);
|
||||
RSD_DEBUG("[RSound] Delay wait: %d ms.\n", (int)sleep_ms);
|
||||
rsnd_sleep((int)sleep_ms);
|
||||
}
|
||||
}
|
||||
|
@ -15,16 +15,19 @@
|
||||
*/
|
||||
|
||||
#ifdef __CELLOS_LV2__
|
||||
#include "../../ps3/sdk_defines.h"
|
||||
#ifndef __PSL1GHT__
|
||||
#include <netex/net.h>
|
||||
#include <cell/sysmodule.h>
|
||||
#include <netex/libnetctl.h>
|
||||
#include <sys/timer.h>
|
||||
#endif
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#ifdef HW_RVL
|
||||
#ifdef GEKKO
|
||||
#include <network.h>
|
||||
#endif
|
||||
|
||||
@ -125,7 +128,7 @@ static int if_down(int sid)
|
||||
(void)sid;
|
||||
#ifdef __CELLOS_LV2__
|
||||
cellNetCtlTerm();
|
||||
#elif defined(GEKKO)
|
||||
#elif defined(GEKKO) && !defined(HW_DOL)
|
||||
net_deinit();
|
||||
#endif
|
||||
return (0);
|
||||
|
81
console/logger/psl1ght_logger.c
Normal file
81
console/logger/psl1ght_logger.c
Normal file
@ -0,0 +1,81 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2012 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* 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.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <net/net.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
#if !defined(PC_DEVELOPMENT_IP_ADDRESS)
|
||||
#error "An IP address for the PC logging server was not set in the Makefile, cannot continue."
|
||||
#endif
|
||||
|
||||
#if !defined(PC_DEVELOPMENT_UDP_PORT)
|
||||
#error "An UDP port for the PC logging server was not set in the Makefile, cannot continue."
|
||||
#endif
|
||||
|
||||
int s;
|
||||
struct sockaddr_in server;
|
||||
|
||||
#define INITSTRING "Logging Started\n"
|
||||
#define BYESTRING "Logging Stopped\n"
|
||||
|
||||
void logger_init (void)
|
||||
{
|
||||
s = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
memset(&server, 0, sizeof(server));
|
||||
server.sin_len = sizeof(server);
|
||||
server.sin_family = AF_INET;
|
||||
inet_pton(AF_INET, PC_DEVELOPMENT_IP_ADDRESS, &server.sin_addr);
|
||||
server.sin_port = htons(PC_DEVELOPMENT_UDP_PORT);
|
||||
|
||||
sendto(s, INITSTRING, strlen(INITSTRING), 0, (struct sockaddr*)&server, sizeof(server));
|
||||
}
|
||||
|
||||
void logger_shutdown (void)
|
||||
{
|
||||
sendto(s, BYESTRING, strlen(BYESTRING), 0, (struct sockaddr*)&server, sizeof(server));
|
||||
close(s);
|
||||
}
|
||||
|
||||
void logger_send(const char *format,...)
|
||||
{
|
||||
if(s == -1)
|
||||
return;
|
||||
|
||||
char logBuffer[1024];
|
||||
int max = sizeof(logBuffer);
|
||||
va_list va;
|
||||
va_start(va, format);
|
||||
|
||||
int wrote = vsnprintf(logBuffer, max, format, va);
|
||||
|
||||
if(wrote > max)
|
||||
wrote = max;
|
||||
|
||||
va_end(va);
|
||||
sendto(s, logBuffer, wrote, 0, (struct sockaddr *)&server, sizeof(server));
|
||||
}
|
@ -46,12 +46,13 @@ enum {
|
||||
MENU_ITEM_SCREENSHOT_MODE,
|
||||
MENU_ITEM_RESET,
|
||||
MENU_ITEM_RETURN_TO_GAME,
|
||||
#ifdef __CELLOS_LV2__
|
||||
MENU_ITEM_RETURN_TO_MENU,
|
||||
MENU_ITEM_CHANGE_LIBRETRO,
|
||||
#ifdef HAVE_MULTIMAN
|
||||
MENU_ITEM_RETURN_TO_MULTIMAN,
|
||||
#endif
|
||||
MENU_ITEM_RETURN_TO_DASHBOARD
|
||||
MENU_ITEM_QUIT_RARCH,
|
||||
MENU_ITEM_LAST
|
||||
};
|
||||
|
||||
enum
|
||||
@ -70,9 +71,14 @@ enum
|
||||
#ifdef HAVE_HEADSET
|
||||
SOUND_MODE_HEADSET,
|
||||
#endif
|
||||
SOUND_MODE_LAST
|
||||
};
|
||||
|
||||
#ifdef _WIN32
|
||||
#define MAXIMUM_PATH 260
|
||||
#else
|
||||
#define MAXIMUM_PATH 512
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@ -89,6 +95,7 @@ typedef struct
|
||||
char filebrowser_startup_dir[MAXIMUM_PATH];
|
||||
char filesystem_root_dir[MAXIMUM_PATH];
|
||||
char input_presets_dir[MAXIMUM_PATH];
|
||||
char screenshots_dir[MAXIMUM_PATH];
|
||||
#ifdef HAVE_MULTIMAN
|
||||
char multiman_self_file[MAXIMUM_PATH];
|
||||
#endif
|
||||
@ -99,12 +106,11 @@ typedef struct
|
||||
char shader_file[MAXIMUM_PATH];
|
||||
char shader_dir[MAXIMUM_PATH];
|
||||
#endif
|
||||
char salamander_file[MAXIMUM_PATH];
|
||||
char sram_dir[MAXIMUM_PATH];
|
||||
char system_dir[MAXIMUM_PATH];
|
||||
} default_paths_t;
|
||||
|
||||
extern default_paths_t default_paths;
|
||||
|
||||
#define MENU_ITEM_LAST MENU_ITEM_RETURN_TO_DASHBOARD+1
|
||||
|
||||
#endif
|
||||
|
@ -20,34 +20,36 @@
|
||||
#include "../conf/config_file_macros.h"
|
||||
|
||||
#include "rarch_console_config.h"
|
||||
#include "rarch_console_libretro_mgmt.h"
|
||||
|
||||
void rarch_config_load(const char * conf_name, const char * libretro_dir_path, const char * exe_ext, bool find_libretro_path)
|
||||
void rarch_config_load(const char * conf_name, const char * libretro_dir_path, const char * exe_ext, bool upgrade_core_succeeded)
|
||||
{
|
||||
char libretro_path_tmp[PATH_MAX];
|
||||
|
||||
//if a core has been upgraded, settings need to saved at the end
|
||||
if(upgrade_core_succeeded)
|
||||
snprintf(libretro_path_tmp, sizeof(libretro_path_tmp), g_settings.libretro);
|
||||
|
||||
|
||||
config_file_t * conf = config_file_new(conf_name);
|
||||
|
||||
if(!conf)
|
||||
{
|
||||
#ifdef RARCH_CONSOLE
|
||||
FILE * f;
|
||||
RARCH_ERR("Config file \"%s\" doesn't exist. Creating...\n", conf_name);
|
||||
f = fopen(conf_name, "w");
|
||||
fclose(f);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
// g_settings
|
||||
|
||||
#ifdef HAVE_LIBRETRO_MANAGEMENT
|
||||
if(find_libretro_path)
|
||||
{
|
||||
CONFIG_GET_STRING(libretro, "libretro_path");
|
||||
|
||||
if(strcmp(g_settings.libretro, "") == 0)
|
||||
{
|
||||
char first_file[PATH_MAX];
|
||||
rarch_manage_libretro_set_first_file(first_file, sizeof(first_file), libretro_dir_path, exe_ext);
|
||||
if(first_file != NULL)
|
||||
strlcpy(g_settings.libretro, first_file, sizeof(g_settings.libretro));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
CONFIG_GET_STRING(libretro, "libretro_path");
|
||||
CONFIG_GET_STRING(system_directory, "system_directory");
|
||||
#ifdef HAVE_XML
|
||||
CONFIG_GET_STRING(cheat_database, "cheat_database");
|
||||
#endif
|
||||
CONFIG_GET_BOOL(rewind_enable, "rewind_enable");
|
||||
CONFIG_GET_STRING(video.cg_shader_path, "video_cg_shader");
|
||||
#ifdef HAVE_FBO
|
||||
@ -56,21 +58,21 @@ void rarch_config_load(const char * conf_name, const char * libretro_dir_path, c
|
||||
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
|
||||
#ifdef _XBOX360
|
||||
CONFIG_GET_BOOL_CONSOLE(gamma_correction_enable, "gamma_correction_enable");
|
||||
CONFIG_GET_INT_CONSOLE(color_format, "color_format");
|
||||
#endif
|
||||
CONFIG_GET_BOOL(video.smooth, "video_smooth");
|
||||
CONFIG_GET_BOOL(video.vsync, "video_vsync");
|
||||
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");
|
||||
CONFIG_GET_FLOAT(audio.rate_control_delta, "audio_rate_control_delta");
|
||||
|
||||
for (unsigned i = 0; i < 7; i++)
|
||||
{
|
||||
char cfg[64];
|
||||
snprintf(cfg, sizeof(cfg), "input_dpad_emulation_p%u", i + 1);
|
||||
CONFIG_GET_INT(input.dpad_emulation[i], cfg);
|
||||
snprintf(cfg, sizeof(cfg), "input_device_p%u", i + 1);
|
||||
CONFIG_GET_INT(input.device[i], cfg);
|
||||
}
|
||||
|
||||
// g_console
|
||||
@ -97,6 +99,15 @@ void rarch_config_load(const char * conf_name, const char * libretro_dir_path, c
|
||||
#ifdef HAVE_ZLIB
|
||||
CONFIG_GET_INT_CONSOLE(zip_extract_mode, "zip_extract_mode");
|
||||
#endif
|
||||
#ifdef _XBOX360
|
||||
CONFIG_GET_INT_CONSOLE(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_CONSOLE(menu_font_size, "menu_font_size");
|
||||
CONFIG_GET_FLOAT_CONSOLE(overscan_amount, "overscan_amount");
|
||||
@ -104,6 +115,13 @@ void rarch_config_load(const char * conf_name, const char * libretro_dir_path, c
|
||||
// g_extern
|
||||
CONFIG_GET_INT_EXTERN(state_slot, "state_slot");
|
||||
CONFIG_GET_INT_EXTERN(audio_data.mute, "audio_mute");
|
||||
|
||||
if(upgrade_core_succeeded)
|
||||
{
|
||||
//save config file with new libretro path
|
||||
snprintf(g_settings.libretro, sizeof(g_settings.libretro), libretro_path_tmp);
|
||||
rarch_config_save(conf_name);
|
||||
}
|
||||
}
|
||||
|
||||
void rarch_config_save(const char * conf_name)
|
||||
@ -111,7 +129,10 @@ void rarch_config_save(const char * conf_name)
|
||||
config_file_t * conf = config_file_new(conf_name);
|
||||
|
||||
if(!conf)
|
||||
{
|
||||
RARCH_ERR("Failed to write config file to \"%s\". Check permissions.\n", conf_name);
|
||||
return;
|
||||
}
|
||||
|
||||
// g_settings
|
||||
config_set_string(conf, "libretro_path", g_settings.libretro);
|
||||
@ -131,12 +152,16 @@ void rarch_config_save(const char * conf_name)
|
||||
config_set_bool(conf, "video_smooth", g_settings.video.smooth);
|
||||
config_set_bool(conf, "video_vsync", g_settings.video.vsync);
|
||||
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);
|
||||
|
||||
for (unsigned i = 0; i < 7; i++)
|
||||
{
|
||||
char cfg[64];
|
||||
snprintf(cfg, sizeof(cfg), "input_dpad_emulation_p%u", i + 1);
|
||||
config_set_int(conf, cfg, g_settings.input.dpad_emulation[i]);
|
||||
snprintf(cfg, sizeof(cfg), "input_device_p%u", i + 1);
|
||||
config_set_int(conf, cfg, g_settings.input.device[i]);
|
||||
}
|
||||
|
||||
#ifdef RARCH_CONSOLE
|
||||
@ -146,9 +171,14 @@ void rarch_config_save(const char * conf_name)
|
||||
#endif
|
||||
config_set_bool(conf, "overscan_enable", g_console.overscan_enable);
|
||||
config_set_bool(conf, "screenshots_enable", g_console.screenshots_enable);
|
||||
#ifdef _XBOX
|
||||
config_set_bool(conf, "gamma_correction_enable", g_console.gamma_correction_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);
|
||||
#ifdef _XBOX1
|
||||
config_set_int(conf, "flicker_filter", g_console.flicker_filter);
|
||||
config_set_int(conf, "sound_volume_level", g_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);
|
||||
|
@ -24,7 +24,7 @@ enum
|
||||
INPUT_PRESET_FILE
|
||||
};
|
||||
|
||||
void rarch_config_load(const char * conf_name, const char * libretro_dir_path, const char * exe_ext, bool find_libretro_path);
|
||||
void rarch_config_load(const char * conf_name, const char * libretro_dir_path, const char * exe_ext, bool upgrade_core_succeeded);
|
||||
void rarch_config_save(const char * conf_name);
|
||||
|
||||
#endif
|
||||
|
@ -25,11 +25,51 @@
|
||||
#include <np/drm.h>
|
||||
#elif defined(_XBOX)
|
||||
#include <xtl.h>
|
||||
#elif defined(HW_RVL)
|
||||
#include <string.h>
|
||||
#include <fat.h>
|
||||
#include <gctypes.h>
|
||||
#include <ogc/cache.h>
|
||||
#include <ogc/lwp_threads.h>
|
||||
#include <ogc/system.h>
|
||||
#include <ogc/usbstorage.h>
|
||||
#include <sdcard/wiisd_io.h>
|
||||
|
||||
#define EXECUTE_ADDR ((uint8_t *) 0x91800000)
|
||||
#define BOOTER_ADDR ((uint8_t *) 0x93000000)
|
||||
#define ARGS_ADDR ((uint8_t *) 0x93200000)
|
||||
|
||||
extern uint8_t _binary_wii_app_booter_app_booter_bin_start[];
|
||||
extern uint8_t _binary_wii_app_booter_app_booter_bin_end[];
|
||||
#define booter_start _binary_wii_app_booter_app_booter_bin_start
|
||||
#define booter_end _binary_wii_app_booter_app_booter_bin_end
|
||||
|
||||
#elif defined(HW_DOL)
|
||||
#include "../ngc/sidestep.h"
|
||||
#endif
|
||||
|
||||
#include "rarch_console_exec.h"
|
||||
#include "../retroarch_logger.h"
|
||||
|
||||
#ifdef HW_RVL
|
||||
// NOTE: this does not update the path to point to the new loading .dol file.
|
||||
// we only need it for keeping the current directory anyway.
|
||||
void dol_copy_argv_path(void)
|
||||
{
|
||||
struct __argv *argv = (struct __argv *) ARGS_ADDR;
|
||||
memset(ARGS_ADDR, 0, sizeof(struct __argv));
|
||||
char *cmdline = (char *) ARGS_ADDR + sizeof(struct __argv);
|
||||
argv->argvMagic = ARGV_MAGIC;
|
||||
argv->commandLine = cmdline;
|
||||
size_t len = strlen(__system_argv->argv[0]);
|
||||
memcpy(cmdline, __system_argv->argv[0], ++len);
|
||||
cmdline[len++] = 0;
|
||||
cmdline[len++] = 0;
|
||||
argv->length = len;
|
||||
DCFlushRange(ARGS_ADDR, sizeof(struct __argv) + argv->length);
|
||||
}
|
||||
#endif
|
||||
|
||||
void rarch_console_exec(const char *path)
|
||||
{
|
||||
RARCH_LOG("Attempt to load executable: [%s].\n", path);
|
||||
@ -63,6 +103,39 @@ void rarch_console_exec(const char *path)
|
||||
sys_net_finalize_network();
|
||||
cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_NP);
|
||||
cellSysmoduleUnloadModule(CELL_SYSMODULE_NET);
|
||||
#elif defined(HW_RVL)
|
||||
FILE * fp = fopen(path, "rb");
|
||||
if (fp == NULL)
|
||||
{
|
||||
RARCH_ERR("Could not execute DOL file.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
fseek(fp, 0, SEEK_END);
|
||||
size_t size = ftell(fp);
|
||||
fseek(fp, 0, SEEK_SET);
|
||||
fread(EXECUTE_ADDR, 1, size, fp);
|
||||
fclose(fp);
|
||||
DCFlushRange(EXECUTE_ADDR, size);
|
||||
|
||||
dol_copy_argv_path();
|
||||
|
||||
fatUnmount("carda:");
|
||||
fatUnmount("cardb:");
|
||||
fatUnmount("sd:");
|
||||
fatUnmount("usb:");
|
||||
__io_wiisd.shutdown();
|
||||
__io_usbstorage.shutdown();
|
||||
|
||||
size_t booter_size = booter_end - booter_start;
|
||||
memcpy(BOOTER_ADDR, booter_start, booter_size);
|
||||
DCFlushRange(BOOTER_ADDR, booter_size);
|
||||
|
||||
RARCH_LOG("jumping to %08x\n", (unsigned) BOOTER_ADDR);
|
||||
SYS_ResetSystem(SYS_SHUTDOWN,0,0);
|
||||
__lwp_thread_stopmultitasking((void (*)(void)) BOOTER_ADDR);
|
||||
#elif defined(HW_DOL)
|
||||
DOLtoARAM(path);
|
||||
#else
|
||||
RARCH_WARN("External loading of executables is not supported for this platform.\n");
|
||||
#endif
|
||||
|
@ -30,7 +30,7 @@ struct platform_bind
|
||||
|
||||
uint64_t rarch_default_keybind_lut[RARCH_FIRST_META_KEY];
|
||||
|
||||
char rarch_default_libretro_keybind_name_lut[RARCH_FIRST_META_KEY][256] = {
|
||||
char rarch_default_libretro_keybind_name_lut[RARCH_FIRST_META_KEY][32] = {
|
||||
"RetroPad Button B", /* RETRO_DEVICE_ID_JOYPAD_B */
|
||||
"RetroPad Button Y", /* RETRO_DEVICE_ID_JOYPAD_Y */
|
||||
"RetroPad Button Select", /* RETRO_DEVICE_ID_JOYPAD_SELECT */
|
||||
@ -49,6 +49,12 @@ char rarch_default_libretro_keybind_name_lut[RARCH_FIRST_META_KEY][256] = {
|
||||
"RetroPad Button R3", /* RETRO_DEVICE_ID_JOYPAD_R3 */
|
||||
};
|
||||
|
||||
char rarch_dpad_emulation_name_lut[KEYBIND_DEFAULT][32] = {
|
||||
"None", /* DPAD_EMULATION_NONE */
|
||||
"Left Stick", /* DPAD_EMULATION_LSTICK */
|
||||
"Right Stick", /* DPAD_EMULATION_RSTICK */
|
||||
};
|
||||
|
||||
extern const struct platform_bind platform_keys[];
|
||||
extern const unsigned int platform_keys_size;
|
||||
|
||||
|
@ -31,7 +31,8 @@ enum
|
||||
{
|
||||
DPAD_EMULATION_NONE = 0,
|
||||
DPAD_EMULATION_LSTICK,
|
||||
DPAD_EMULATION_RSTICK
|
||||
DPAD_EMULATION_RSTICK,
|
||||
DPAD_EMULATION_LAST
|
||||
};
|
||||
|
||||
enum
|
||||
@ -47,7 +48,8 @@ enum
|
||||
};
|
||||
|
||||
extern uint64_t rarch_default_keybind_lut[RARCH_FIRST_META_KEY];
|
||||
extern char rarch_default_libretro_keybind_name_lut[RARCH_FIRST_META_KEY][256];
|
||||
extern char rarch_default_libretro_keybind_name_lut[RARCH_FIRST_META_KEY][32];
|
||||
extern char rarch_dpad_emulation_name_lut[KEYBIND_DEFAULT][32];
|
||||
|
||||
const char *rarch_input_find_platform_key_label(uint64_t joykey);
|
||||
|
||||
|
@ -17,16 +17,13 @@
|
||||
#include <stdio.h>
|
||||
#include "../boolean.h"
|
||||
#include "../file.h"
|
||||
#include "rarch_console.h"
|
||||
|
||||
// if a CORE executable exists (full_path), this means we have just installed
|
||||
// a new libretro port and therefore we need to change it to a more
|
||||
// sane name.
|
||||
#include "rarch_console_libretro_mgmt.h"
|
||||
|
||||
#ifndef IS_SALAMANDER
|
||||
|
||||
// Transforms a library id to a name suitable as a pathname.
|
||||
|
||||
static void rarch_console_name_from_id(char *name, size_t size)
|
||||
void rarch_console_name_from_id(char *name, size_t size)
|
||||
{
|
||||
if (size == 0)
|
||||
return;
|
||||
@ -57,84 +54,57 @@ static void rarch_console_name_from_id(char *name, size_t size)
|
||||
}
|
||||
}
|
||||
|
||||
static bool rarch_manage_libretro_install(char *libretro_core_installed, size_t sizeof_libretro_core, const char *full_path, const char *path, const char *exe_ext)
|
||||
{
|
||||
int ret;
|
||||
char tmp_path2[1024], tmp_pathnewfile[1024];
|
||||
|
||||
rarch_console_name_from_id(tmp_path2, sizeof(tmp_path2));
|
||||
strlcat(tmp_path2, exe_ext, sizeof(tmp_path2));
|
||||
snprintf(tmp_pathnewfile, sizeof(tmp_pathnewfile), "%s%s", path, tmp_path2);
|
||||
|
||||
if (path_file_exists(tmp_pathnewfile))
|
||||
{
|
||||
// if libretro core already exists, this means we are
|
||||
// upgrading the libretro core - so delete pre-existing
|
||||
// file first.
|
||||
|
||||
RARCH_LOG("Upgrading emulator core...\n");
|
||||
ret = remove(tmp_pathnewfile);
|
||||
|
||||
if (ret == 0)
|
||||
RARCH_LOG("Succeeded in removing pre-existing libretro core: [%s].\n", tmp_pathnewfile);
|
||||
else
|
||||
RARCH_ERR("Failed to remove pre-existing libretro core: [%s].\n", tmp_pathnewfile);
|
||||
}
|
||||
|
||||
//now attempt the renaming.
|
||||
ret = rename(full_path, tmp_pathnewfile);
|
||||
|
||||
if (ret == 0)
|
||||
{
|
||||
RARCH_LOG("libretro core [%s] renamed to: [%s].\n", full_path, tmp_pathnewfile);
|
||||
strlcpy(libretro_core_installed, tmp_pathnewfile, sizeof_libretro_core);
|
||||
ret = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
RARCH_ERR("Failed to rename CORE executable.\n");
|
||||
RARCH_WARN("CORE executable was not found, or some other errors occurred. Will attempt to load libretro core path from config file.\n");
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool rarch_configure_libretro_core(const char *full_path, const char *tmp_path,
|
||||
bool rarch_configure_libretro_core(const char *core_exe_path, const char *tmp_path,
|
||||
const char *libretro_path, const char *config_path, const char *extension)
|
||||
{
|
||||
bool libretro_core_was_installed = false;
|
||||
bool find_libretro_file = false;
|
||||
char libretro_core_installed[1024];
|
||||
bool upgrade_core_succeeded = false;
|
||||
|
||||
g_extern.verbose = true;
|
||||
|
||||
//install and rename libretro core first if 'CORE' executable exists
|
||||
if (path_file_exists(full_path))
|
||||
libretro_core_was_installed = rarch_manage_libretro_install(
|
||||
libretro_core_installed, sizeof(libretro_core_installed), full_path, tmp_path, extension);
|
||||
if (path_file_exists(core_exe_path))
|
||||
{
|
||||
bool ret = false;
|
||||
char tmp_path2[PATH_MAX], tmp_pathnewfile[PATH_MAX];
|
||||
|
||||
rarch_console_name_from_id(tmp_path2, sizeof(tmp_path2));
|
||||
strlcat(tmp_path2, extension, sizeof(tmp_path2));
|
||||
snprintf(tmp_pathnewfile, sizeof(tmp_pathnewfile), "%s%s", tmp_path, tmp_path2);
|
||||
|
||||
if (path_file_exists(tmp_pathnewfile))
|
||||
{
|
||||
// if libretro core already exists, this means we are
|
||||
// upgrading the libretro core - so delete pre-existing
|
||||
// file first.
|
||||
|
||||
RARCH_LOG("Upgrading emulator core...\n");
|
||||
ret = remove(tmp_pathnewfile);
|
||||
|
||||
if (ret == 0)
|
||||
RARCH_LOG("Succeeded in removing pre-existing libretro core: [%s].\n", tmp_pathnewfile);
|
||||
else
|
||||
RARCH_ERR("Failed to remove pre-existing libretro core: [%s].\n", tmp_pathnewfile);
|
||||
}
|
||||
|
||||
//now attempt the renaming.
|
||||
ret = rename(core_exe_path, tmp_pathnewfile);
|
||||
|
||||
if (ret == 0)
|
||||
{
|
||||
RARCH_LOG("libretro core [%s] renamed to: [%s].\n", core_exe_path, tmp_pathnewfile);
|
||||
snprintf(g_settings.libretro, sizeof(g_settings.libretro), tmp_pathnewfile);
|
||||
upgrade_core_succeeded = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
RARCH_ERR("Failed to rename CORE executable.\n");
|
||||
RARCH_WARN("CORE executable was not found, or some other error occurred. Will attempt to load libretro core path from config file.\n");
|
||||
}
|
||||
}
|
||||
|
||||
g_extern.verbose = false;
|
||||
|
||||
//if we have just installed a libretro core, set libretro path in settings to newly installed libretro core
|
||||
|
||||
if(libretro_core_was_installed)
|
||||
strlcpy(g_settings.libretro, libretro_core_installed, sizeof(g_settings.libretro));
|
||||
else
|
||||
find_libretro_file = true;
|
||||
|
||||
return find_libretro_file;
|
||||
}
|
||||
|
||||
bool rarch_configure_libretro(const input_driver_t *input, const char *path_prefix, const char * extension)
|
||||
{
|
||||
char full_path[1024];
|
||||
snprintf(full_path, sizeof(full_path), "%sCORE%s", path_prefix, extension);
|
||||
|
||||
bool find_libretro_file = rarch_configure_libretro_core(full_path, path_prefix, path_prefix,
|
||||
default_paths.config_file, extension);
|
||||
|
||||
return find_libretro_file;
|
||||
return upgrade_core_succeeded;
|
||||
}
|
||||
|
||||
bool rarch_manage_libretro_extension_supported(const char *filename)
|
||||
@ -153,14 +123,10 @@ bool rarch_manage_libretro_extension_supported(const char *filename)
|
||||
return ext_supported;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
void rarch_manage_libretro_set_first_file(char *first_file, size_t size_of_first_file, const char *libretro_path, const char * exe_ext)
|
||||
{
|
||||
//We need to set libretro to the first entry in the cores
|
||||
//directory so that it will be saved to the config file
|
||||
|
||||
struct string_list *dir_list = dir_list_new(libretro_path, exe_ext, false);
|
||||
|
||||
const char * first_exe;
|
||||
@ -176,28 +142,24 @@ void rarch_manage_libretro_set_first_file(char *first_file, size_t size_of_first
|
||||
|
||||
if(first_exe)
|
||||
{
|
||||
#ifdef _XBOX
|
||||
char fname_tmp[PATH_MAX];
|
||||
fill_pathname_base(fname_tmp, first_exe, sizeof(fname_tmp));
|
||||
|
||||
if(strcmp(fname_tmp, "RetroArch-Salamander.xex") == 0)
|
||||
if(strncmp(fname_tmp, default_paths.salamander_file, sizeof(fname_tmp)) == 0)
|
||||
{
|
||||
RARCH_WARN("First entry is RetroArch Salamander itself, increment entry by one and check if it exists.\n");
|
||||
first_exe = dir_list->elems[1].data;
|
||||
fill_pathname_base(fname_tmp, first_exe, sizeof(fname_tmp));
|
||||
first_exe = dir_list->elems[1].data;
|
||||
fill_pathname_base(fname_tmp, first_exe, sizeof(fname_tmp));
|
||||
|
||||
if(!first_exe)
|
||||
{
|
||||
if(!first_exe)
|
||||
{
|
||||
RARCH_ERR("Unlikely error happened - no second entry - no choice but to set it to RetroArch Salamander\n");
|
||||
first_exe = dir_list->elems[0].data;
|
||||
fill_pathname_base(fname_tmp, first_exe, sizeof(fname_tmp));
|
||||
}
|
||||
first_exe = dir_list->elems[0].data;
|
||||
fill_pathname_base(fname_tmp, first_exe, sizeof(fname_tmp));
|
||||
}
|
||||
}
|
||||
|
||||
strlcpy(first_file, fname_tmp, size_of_first_file);
|
||||
#else
|
||||
strlcpy(first_file, first_exe, size_of_first_file);
|
||||
#endif
|
||||
RARCH_LOG("Set first entry in libretro core dir to libretro path: [%s].\n", first_file);
|
||||
}
|
||||
|
||||
|
@ -23,15 +23,30 @@ enum
|
||||
{
|
||||
EXTERN_LAUNCHER_SALAMANDER,
|
||||
#ifdef HAVE_MULTIMAN
|
||||
EXTERN_LAUNCHER_MULTIMAN
|
||||
EXTERN_LAUNCHER_MULTIMAN,
|
||||
#endif
|
||||
#ifdef GEKKO
|
||||
EXTERN_LAUNCHER_CHANNEL,
|
||||
#endif
|
||||
};
|
||||
|
||||
void rarch_console_name_from_id(char *name, size_t size);
|
||||
|
||||
//We need to set libretro to the first entry in the cores
|
||||
//directory so that it will be saved to the config file
|
||||
void rarch_manage_libretro_set_first_file(char *first_file, size_t size_of_first_file, const char *libretro_path, const char * exe_ext);
|
||||
|
||||
#ifndef IS_SALAMANDER
|
||||
bool rarch_configure_libretro(const input_driver_t *input, const char *path_prefix, const char * extension);
|
||||
|
||||
// if a CORE executable exists (full_path), this means we have just installed
|
||||
// a new libretro port and therefore we need to change it to a more
|
||||
// sane name.
|
||||
bool rarch_configure_libretro_core(const char *full_path, const char *tmp_path,
|
||||
const char *libretro_path, const char *config_path, const char *extension);
|
||||
|
||||
// Transforms a library id to a name suitable as a pathname.
|
||||
bool rarch_manage_libretro_extension_supported(const char *filename);
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -49,6 +49,14 @@ static int rarch_main_init_wrap(const struct rarch_main_wrap *args)
|
||||
argv[argc++] = strdup(args->config_path);
|
||||
}
|
||||
|
||||
#ifdef HAVE_DYLIB
|
||||
if (args->libretro_path)
|
||||
{
|
||||
argv[argc++] = strdup("-L");
|
||||
argv[argc++] = strdup(args->libretro_path);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (args->verbose)
|
||||
argv[argc++] = strdup("-v");
|
||||
|
||||
@ -87,6 +95,9 @@ bool rarch_startup (const char * 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_console.rom_path;
|
||||
#ifdef HAVE_DYLIB
|
||||
args.libretro_path = g_settings.libretro;
|
||||
#endif
|
||||
|
||||
int init_ret = rarch_main_init_wrap(&args);
|
||||
(void)init_ret;
|
||||
|
@ -23,6 +23,9 @@ struct rarch_main_wrap
|
||||
const char *sram_path;
|
||||
const char *state_path;
|
||||
const char *config_path;
|
||||
#ifdef HAVE_DYLIB
|
||||
const char *libretro_path;
|
||||
#endif
|
||||
bool verbose;
|
||||
};
|
||||
|
||||
|
@ -41,51 +41,43 @@ static void rarch_console_load_game(const char *path)
|
||||
void rarch_console_load_game_wrap(const char *path, unsigned extract_zip_mode, unsigned delay)
|
||||
{
|
||||
const char *game_to_load;
|
||||
#ifdef HAVE_ZLIB
|
||||
char first_file[PATH_MAX];
|
||||
#endif
|
||||
char first_file_inzip[PATH_MAX];
|
||||
char rom_path_temp[PATH_MAX];
|
||||
char dir_path_temp[PATH_MAX];
|
||||
struct retro_system_info info;
|
||||
bool block_zip_extract = false;
|
||||
bool extract_zip_cond = false;
|
||||
bool extract_zip_and_load_game_cond = false;
|
||||
bool load_game = !extract_zip_cond;
|
||||
|
||||
#ifdef ANDROID
|
||||
pretro_get_system_info(&info);
|
||||
#else
|
||||
retro_get_system_info(&info);
|
||||
#endif
|
||||
block_zip_extract = info.block_extract;
|
||||
|
||||
snprintf(rom_path_temp, sizeof(rom_path_temp), path);
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
bool extract_zip_cond = (strstr(rom_path_temp, ".zip") || strstr(rom_path_temp, ".ZIP"))
|
||||
extract_zip_cond = (strstr(rom_path_temp, ".zip") || strstr(rom_path_temp, ".ZIP"))
|
||||
&& !block_zip_extract;
|
||||
#else
|
||||
bool extract_zip_cond = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
if(extract_zip_cond)
|
||||
{
|
||||
fill_pathname_basedir(dir_path_temp, rom_path_temp, sizeof(dir_path_temp));
|
||||
rarch_extract_zipfile(rom_path_temp, dir_path_temp, first_file, sizeof(first_file), extract_zip_mode);
|
||||
rarch_extract_zipfile(rom_path_temp, dir_path_temp, first_file_inzip, sizeof(first_file_inzip), extract_zip_mode);
|
||||
|
||||
#ifndef GEKKO
|
||||
if(g_console.info_msg_enable)
|
||||
#endif
|
||||
rarch_settings_msg(S_MSG_EXTRACTED_ZIPFILE, S_DELAY_180);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
bool extract_zip_and_load_game_cond = (extract_zip_cond &&
|
||||
extract_zip_and_load_game_cond = (extract_zip_cond &&
|
||||
g_console.zip_extract_mode == ZIP_EXTRACT_TO_CURRENT_DIR_AND_LOAD_FIRST_FILE);
|
||||
bool load_game = (extract_zip_and_load_game_cond) || (!extract_zip_cond);
|
||||
#else
|
||||
bool extract_zip_and_load_game_cond = false;
|
||||
bool load_game = !extract_zip_cond;
|
||||
#endif
|
||||
load_game = (extract_zip_and_load_game_cond) || (!extract_zip_cond);
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
if(extract_zip_and_load_game_cond)
|
||||
game_to_load = first_file;
|
||||
game_to_load = first_file_inzip;
|
||||
else
|
||||
#endif
|
||||
game_to_load = path;
|
||||
@ -94,9 +86,7 @@ void rarch_console_load_game_wrap(const char *path, unsigned extract_zip_mode, u
|
||||
{
|
||||
rarch_console_load_game(game_to_load);
|
||||
|
||||
#ifndef GEKKO
|
||||
if(g_console.info_msg_enable)
|
||||
#endif
|
||||
rarch_settings_msg(S_MSG_LOADING_ROM, delay);
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,13 @@
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <direct.h>
|
||||
#else
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#include "../boolean.h"
|
||||
|
||||
#ifdef HAVE_LIBRETRO_MANAGEMENT
|
||||
@ -29,6 +36,7 @@
|
||||
static int rarch_extract_currentfile_in_zip(unzFile uf, const char *current_dir, char *slash, char *write_filename, size_t write_filename_size, unsigned extract_zip_mode)
|
||||
{
|
||||
char filename_inzip[PATH_MAX];
|
||||
bool is_dir = false;
|
||||
FILE *file_out = NULL;
|
||||
|
||||
unz_file_info file_info;
|
||||
@ -63,19 +71,33 @@ static int rarch_extract_currentfile_in_zip(unzFile uf, const char *current_dir,
|
||||
#endif
|
||||
}
|
||||
|
||||
if(filename_inzip[strlen(filename_inzip) - 1] == '/')
|
||||
is_dir = true;
|
||||
|
||||
ret = unzOpenCurrentFile(uf);
|
||||
if (ret != UNZ_OK)
|
||||
RARCH_ERR("Error %d while trying to open ZIP file.\n", ret);
|
||||
else
|
||||
{
|
||||
/* success */
|
||||
file_out = fopen(write_filename, "wb");
|
||||
if(is_dir)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
_mkdir(write_filename);
|
||||
#else
|
||||
mkdir(write_filename, S_IRWXU | S_IRWXG | S_IRWXO | S_IFDIR);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
file_out = fopen(write_filename, "wb");
|
||||
|
||||
if (!file_out)
|
||||
RARCH_ERR("Error opening %s.\n", write_filename);
|
||||
if (!file_out)
|
||||
RARCH_ERR("Error opening %s.\n", write_filename);
|
||||
}
|
||||
}
|
||||
|
||||
if (file_out)
|
||||
if (is_dir || file_out)
|
||||
{
|
||||
RARCH_LOG("Extracting: %s..\n", write_filename);
|
||||
|
||||
@ -88,7 +110,7 @@ static int rarch_extract_currentfile_in_zip(unzFile uf, const char *current_dir,
|
||||
break;
|
||||
}
|
||||
|
||||
if (ret > 0)
|
||||
if (ret > 0 && !is_dir)
|
||||
{
|
||||
if (fwrite(buf, ret, 1, file_out) != 1)
|
||||
{
|
||||
@ -99,7 +121,7 @@ static int rarch_extract_currentfile_in_zip(unzFile uf, const char *current_dir,
|
||||
}
|
||||
}while (ret > 0);
|
||||
|
||||
if (file_out)
|
||||
if (!is_dir && file_out)
|
||||
fclose(file_out);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
enum
|
||||
{
|
||||
ZIP_EXTRACT_TO_CURRENT_DIR,
|
||||
ZIP_EXTRACT_TO_CURRENT_DIR = 0,
|
||||
ZIP_EXTRACT_TO_CURRENT_DIR_AND_LOAD_FIRST_FILE,
|
||||
ZIP_EXTRACT_TO_CACHE_DIR
|
||||
};
|
||||
|
@ -92,7 +92,7 @@ void rarch_settings_change(unsigned setting)
|
||||
g_console.ingame_menu_enable = false;
|
||||
g_console.mode_switch = MODE_EXIT;
|
||||
break;
|
||||
case S_RETURN_TO_DASHBOARD:
|
||||
case S_QUIT_RARCH:
|
||||
g_console.menu_enable = false;
|
||||
g_console.initialize_rarch_enable = false;
|
||||
g_console.mode_switch = MODE_EXIT;
|
||||
@ -106,6 +106,7 @@ void rarch_settings_change(unsigned setting)
|
||||
case S_RETURN_TO_LAUNCHER:
|
||||
g_console.return_to_launcher = true;
|
||||
g_console.menu_enable = false;
|
||||
g_console.initialize_rarch_enable = false;
|
||||
g_console.mode_switch = MODE_EXIT;
|
||||
break;
|
||||
case S_RETURN_TO_MENU:
|
||||
@ -148,7 +149,8 @@ void rarch_settings_change(unsigned setting)
|
||||
g_settings.video.fbo_scale_y += 1.0f;
|
||||
break;
|
||||
case S_THROTTLE:
|
||||
g_console.throttle_enable = !g_console.throttle_enable;
|
||||
if(!g_extern.system.force_nonblock)
|
||||
g_console.throttle_enable = !g_console.throttle_enable;
|
||||
break;
|
||||
case S_TRIPLE_BUFFERING:
|
||||
g_console.triple_buffering_enable = !g_console.triple_buffering_enable;
|
||||
@ -189,7 +191,8 @@ void rarch_settings_default(unsigned setting)
|
||||
g_console.screen_orientation = ORIENTATION_NORMAL;
|
||||
break;
|
||||
case S_DEF_THROTTLE:
|
||||
g_console.throttle_enable = true;
|
||||
if(!g_extern.system.force_nonblock)
|
||||
g_console.throttle_enable = true;
|
||||
break;
|
||||
case S_DEF_TRIPLE_BUFFERING:
|
||||
g_console.triple_buffering_enable = true;
|
||||
@ -257,13 +260,13 @@ void rarch_settings_msg(unsigned setting, unsigned delay)
|
||||
snprintf(str, sizeof(str), "INFO - Resize the screen by moving around the two analog sticks.\nPress [RetroPad X] to reset to default values, and [RetroPad A] to go back.\nTo select the resized screen mode, set Aspect Ratio to: 'Custom'.");
|
||||
break;
|
||||
case S_MSG_RESTART_RARCH:
|
||||
snprintf(str, sizeof(str), "INFO - You need to restart RetroArch for this change to take effect.");
|
||||
snprintf(str, sizeof(str), "INFO - You need to restart RetroArch.");
|
||||
break;
|
||||
case S_MSG_SELECT_LIBRETRO_CORE:
|
||||
snprintf(str, sizeof(str), "INFO - Select a Libretro core from the menu by pressing [RetroPad B].");
|
||||
snprintf(str, sizeof(str), "INFO - Select a Libretro core from the menu.");
|
||||
break;
|
||||
case S_MSG_SELECT_SHADER:
|
||||
snprintf(str, sizeof(str), "INFO - Select a shader from the menu by pressing [RetroPad A].");
|
||||
snprintf(str, sizeof(str), "INFO - Select a shader from the menu.");
|
||||
break;
|
||||
case S_MSG_SHADER_LOADING_SUCCEEDED:
|
||||
snprintf(str, sizeof(str), "INFO - Shader successfully loaded.");
|
||||
@ -309,14 +312,40 @@ void rarch_settings_create_menu_item_label(char * str, unsigned setting, size_t
|
||||
case S_LBL_SAVE_STATE_SLOT:
|
||||
snprintf(str, size, "Save State #%d", g_extern.state_slot);
|
||||
break;
|
||||
case S_LBL_ZIP_EXTRACT:
|
||||
{
|
||||
char msg[128];
|
||||
switch(g_console.zip_extract_mode)
|
||||
{
|
||||
case ZIP_EXTRACT_TO_CURRENT_DIR:
|
||||
snprintf(msg, sizeof(msg), "Current dir");
|
||||
break;
|
||||
case ZIP_EXTRACT_TO_CURRENT_DIR_AND_LOAD_FIRST_FILE:
|
||||
snprintf(msg, sizeof(msg), "Current dir and load first file");
|
||||
break;
|
||||
case ZIP_EXTRACT_TO_CACHE_DIR:
|
||||
snprintf(msg, sizeof(msg), "Cache dir");
|
||||
break;
|
||||
}
|
||||
snprintf(str, size, "ZIP Extract: %s", msg);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void rarch_settings_set_default (const input_driver_t *input)
|
||||
#if defined(_XBOX360)
|
||||
#define DEFAULT_GAMMA 1
|
||||
#else
|
||||
#define DEFAULT_GAMMA 0
|
||||
#endif
|
||||
|
||||
void rarch_settings_set_default(void)
|
||||
{
|
||||
// g_settings
|
||||
g_settings.rewind_enable = false;
|
||||
#ifdef HAVE_XML
|
||||
strlcpy(g_settings.cheat_database, default_paths.port_dir, sizeof(g_settings.cheat_database));
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
|
||||
strlcpy(g_settings.video.cg_shader_path, default_paths.shader_file, sizeof(g_settings.video.cg_shader_path));
|
||||
@ -329,9 +358,15 @@ void rarch_settings_set_default (const input_driver_t *input)
|
||||
g_settings.video.fbo_scale_y = 2.0f;
|
||||
#endif
|
||||
|
||||
#ifdef GEKKO
|
||||
g_settings.audio.rate_control_delta = 0.006;
|
||||
g_settings.audio.rate_control = true;
|
||||
#endif
|
||||
|
||||
g_settings.video.render_to_texture = true;
|
||||
g_settings.video.smooth = true;
|
||||
g_settings.video.vsync = true;
|
||||
g_settings.video.refresh_rate = 59.92;
|
||||
|
||||
strlcpy(g_settings.system_directory, default_paths.system_dir, sizeof(g_settings.system_directory));
|
||||
|
||||
@ -339,8 +374,6 @@ void rarch_settings_set_default (const input_driver_t *input)
|
||||
g_settings.video.msg_pos_y = 0.90f;
|
||||
g_settings.video.aspect_ratio = -1.0f;
|
||||
|
||||
rarch_input_set_controls_default(input);
|
||||
|
||||
// g_console
|
||||
g_console.block_config_read = true;
|
||||
g_console.frame_advance_enable = false;
|
||||
@ -377,8 +410,13 @@ void rarch_settings_set_default (const input_driver_t *input)
|
||||
g_console.info_msg_enable = true;
|
||||
#ifdef _XBOX360
|
||||
g_console.color_format = 0;
|
||||
g_console.gamma_correction_enable = 1;
|
||||
#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_console.zip_extract_mode = 0;
|
||||
#endif
|
||||
|
@ -42,7 +42,7 @@ enum
|
||||
S_QUIT,
|
||||
S_RESOLUTION_PREVIOUS,
|
||||
S_RESOLUTION_NEXT,
|
||||
S_RETURN_TO_DASHBOARD,
|
||||
S_QUIT_RARCH,
|
||||
S_RETURN_TO_GAME,
|
||||
S_RETURN_TO_LAUNCHER,
|
||||
S_RETURN_TO_MENU,
|
||||
@ -101,12 +101,13 @@ enum
|
||||
S_LBL_SCALE_FACTOR,
|
||||
S_LBL_LOAD_STATE_SLOT,
|
||||
S_LBL_SAVE_STATE_SLOT,
|
||||
S_LBL_ZIP_EXTRACT,
|
||||
};
|
||||
|
||||
void rarch_settings_change(unsigned setting);
|
||||
void rarch_settings_default(unsigned setting);
|
||||
void rarch_settings_msg(unsigned setting, unsigned delay);
|
||||
void rarch_settings_set_default (const input_driver_t *input);
|
||||
void rarch_settings_set_default(void);
|
||||
|
||||
void rarch_settings_create_menu_item_label(char * str, unsigned setting, size_t size);
|
||||
void rarch_settings_create_menu_item_label_w(wchar_t *strwbuf, unsigned setting, size_t size);
|
||||
|
@ -26,30 +26,31 @@
|
||||
#endif
|
||||
|
||||
struct aspect_ratio_elem aspectratio_lut[ASPECT_RATIO_END] = {
|
||||
{ "1:1", 1.0f },
|
||||
{ "2:1", 2.0f },
|
||||
{ "3:2", 1.5f },
|
||||
{ "3:4", 0.75f },
|
||||
{ "4:1", 4.0f },
|
||||
{ "4:3", 1.3333f },
|
||||
{ "4:4", 1.0f },
|
||||
{ "5:4", 1.25f },
|
||||
{ "6:5", 1.2f },
|
||||
{ "7:9", 0.7777f },
|
||||
{ "8:3", 2.6666f },
|
||||
{ "8:7", 1.1428f },
|
||||
{ "16:9", 1.7778f },
|
||||
{ "16:10", 1.6f },
|
||||
{ "16:15", 3.2f },
|
||||
{ "19:12", 1.5833f },
|
||||
{ "19:14", 1.3571f },
|
||||
{ "30:17", 1.7647f },
|
||||
{ "32:9", 3.5555f },
|
||||
{ "Auto", 1.0f },
|
||||
{ "Custom", 0.0f }
|
||||
{ "1:1", 1.0f },
|
||||
{ "2:1", 2.0f },
|
||||
{ "3:2", 1.5f },
|
||||
{ "3:4", 0.75f },
|
||||
{ "4:1", 4.0f },
|
||||
{ "4:3", 1.3333f },
|
||||
{ "4:4", 1.0f },
|
||||
{ "5:4", 1.25f },
|
||||
{ "6:5", 1.2f },
|
||||
{ "7:9", 0.7777f },
|
||||
{ "8:3", 2.6666f },
|
||||
{ "8:7", 1.1428f },
|
||||
{ "16:9", 1.7778f },
|
||||
{ "16:10", 1.6f },
|
||||
{ "16:15", 3.2f },
|
||||
{ "19:12", 1.5833f },
|
||||
{ "19:14", 1.3571f },
|
||||
{ "30:17", 1.7647f },
|
||||
{ "32:9", 3.5555f },
|
||||
{ "Auto", 1.0f },
|
||||
{ "Core Provided", 1.0f },
|
||||
{ "Custom", 0.0f }
|
||||
};
|
||||
|
||||
char rotation_lut[ASPECT_RATIO_END][PATH_MAX] =
|
||||
char rotation_lut[ASPECT_RATIO_END][32] =
|
||||
{
|
||||
"Normal",
|
||||
"Vertical",
|
||||
@ -76,7 +77,19 @@ void rarch_set_auto_viewport(unsigned width, unsigned height)
|
||||
aspect_y = height / highest;
|
||||
|
||||
snprintf(aspectratio_lut[ASPECT_RATIO_AUTO].name, sizeof(aspectratio_lut[ASPECT_RATIO_AUTO].name), "%d:%d (Auto)", aspect_x, aspect_y);
|
||||
aspectratio_lut[ASPECT_RATIO_AUTO].value = (int)aspect_x / (int)aspect_y;
|
||||
aspectratio_lut[ASPECT_RATIO_AUTO].value = (float) aspect_x / aspect_y;
|
||||
}
|
||||
|
||||
void rarch_set_core_viewport()
|
||||
{
|
||||
if (!g_console.emulator_initialized)
|
||||
return;
|
||||
|
||||
// fallback to 1:1 pixel ratio if none provided
|
||||
if (g_extern.system.av_info.geometry.aspect_ratio == 0.0)
|
||||
aspectratio_lut[ASPECT_RATIO_CORE].value = (float) g_extern.system.av_info.geometry.base_width / g_extern.system.av_info.geometry.base_height;
|
||||
else
|
||||
aspectratio_lut[ASPECT_RATIO_CORE].value = g_extern.system.av_info.geometry.aspect_ratio;
|
||||
}
|
||||
|
||||
#if defined(HAVE_HLSL) || defined(HAVE_CG) || defined(HAVE_GLSL)
|
||||
|
@ -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_EXPIRED(handle) (!(IS_TIMER_NOT_EXPIRED(handle)))
|
||||
#define SET_TIMER_EXPIRATION(handle, value) (g_console.timer_expiration_frame_count = handle->frame_count + value)
|
||||
#define IS_TIMER_NOT_EXPIRED(handle) ((handle)->frame_count < g_console.timer_expiration_frame_count)
|
||||
#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 MIN_SCALING_FACTOR (1.0f)
|
||||
|
||||
@ -58,6 +58,7 @@ enum aspect_ratio
|
||||
ASPECT_RATIO_30_17,
|
||||
ASPECT_RATIO_32_9,
|
||||
ASPECT_RATIO_AUTO,
|
||||
ASPECT_RATIO_CORE,
|
||||
ASPECT_RATIO_CUSTOM,
|
||||
|
||||
ASPECT_RATIO_END,
|
||||
@ -76,7 +77,7 @@ enum rotation
|
||||
|
||||
#define LAST_ORIENTATION (ORIENTATION_END-1)
|
||||
|
||||
extern char rotation_lut[ASPECT_RATIO_END][PATH_MAX];
|
||||
extern char rotation_lut[ASPECT_RATIO_END][32];
|
||||
|
||||
/* ABGR color format defines */
|
||||
|
||||
@ -101,6 +102,7 @@ struct aspect_ratio_elem
|
||||
extern struct aspect_ratio_elem aspectratio_lut[ASPECT_RATIO_END];
|
||||
|
||||
extern void rarch_set_auto_viewport(unsigned width, unsigned height);
|
||||
extern void rarch_set_core_viewport();
|
||||
extern void rarch_load_shader(unsigned slot, const char *path);
|
||||
|
||||
#endif
|
||||
|
@ -352,7 +352,7 @@ inline static CGresource _RGLGetBaseResource( CGresource resource )
|
||||
case CG_UNDEFINED:
|
||||
return CG_UNDEFINED;
|
||||
default:
|
||||
printf("RGL WARN: resource 0x%d is unknown here.\n", resource );
|
||||
//RARCH_WARN("Resource 0x%d is unknown here.\n", resource );
|
||||
return CG_UNDEFINED;
|
||||
}
|
||||
}
|
||||
@ -419,20 +419,6 @@ static inline const CgParameterResource *_RGLGetParameterResource( const _CGprog
|
||||
return ( CgParameterResource * )( program->parameterResources + entry->typeIndex );
|
||||
}
|
||||
|
||||
static inline CGtype _RGLGetParameterCGtype( const _CGprogram *program, const CgParameterEntry *entry )
|
||||
{
|
||||
if ( entry->flags & CGP_RTCREATED )
|
||||
return ( CGtype )entry->typeIndex;
|
||||
else
|
||||
{
|
||||
const CgParameterResource *parameterResource = _RGLGetParameterResource( program, entry );
|
||||
if ( parameterResource )
|
||||
return ( CGtype )parameterResource->type;
|
||||
}
|
||||
|
||||
return CG_UNKNOWN_TYPE;
|
||||
}
|
||||
|
||||
static inline const CgParameterArray *_RGLGetParameterArray( const _CGprogram *program, const CgParameterEntry *entry )
|
||||
{
|
||||
return ( CgParameterArray* )( program->parameterResources + entry->typeIndex );
|
||||
@ -453,6 +439,8 @@ inline int _RGLGetProgramProfileIndex( CGprofile profile )
|
||||
return -1;
|
||||
}
|
||||
|
||||
CGGL_API void cgGLSetMatrixParameterfc( CGparameter param, const float *matrix );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -104,9 +104,62 @@ static bool bIsVertexProgram = true;
|
||||
|
||||
static int getStride(CgBaseType *type);
|
||||
static int getSizeofSubArray(_CGNVCONTAINERS &containers, int dimensionIndex, int dimensionCount, int endianness);
|
||||
static unsigned int stringTableFind( std::vector<char> &stringTable, const char* str);
|
||||
static unsigned int stringTableAdd( std::vector<char> &stringTable, const char* str );
|
||||
static unsigned int stringTableAddUnique( std::vector<char> &stringTable, const char* str );
|
||||
|
||||
static unsigned int stringTableFind( std::vector<char> &stringTable, const char* str )
|
||||
{
|
||||
const char* data = &stringTable[0];
|
||||
size_t size = stringTable.size();
|
||||
const char *end = data + size;
|
||||
|
||||
size_t length = strlen(str);
|
||||
|
||||
if (length+1 > size)
|
||||
return 0;
|
||||
|
||||
data += length;
|
||||
|
||||
const char *p = (char*)memchr(data,'\0',end-data);
|
||||
while (p && (end-data)>0)
|
||||
{
|
||||
if (!memcmp(p - length, str, length))
|
||||
return (unsigned int)(p - length - &stringTable[0]);
|
||||
|
||||
data = p+1;
|
||||
p = (char*)memchr(data,'\0',end-data);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned int stringTableAdd( std::vector<char> &stringTable, const char* str )
|
||||
{
|
||||
unsigned int ret = (unsigned int)stringTable.size();
|
||||
|
||||
if ( ret == 0 )
|
||||
{
|
||||
stringTable.push_back('\0');
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
size_t stringLength = strlen(str) + 1;
|
||||
stringTable.resize(ret + stringLength);
|
||||
memcpy(&stringTable[0] + ret,str,stringLength);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static unsigned int stringTableAddUnique( std::vector<char> &stringTable, const char* str )
|
||||
{
|
||||
if ( stringTable.size() == 0 )
|
||||
stringTable.push_back('\0');
|
||||
|
||||
unsigned int ret = stringTableFind(stringTable, str);
|
||||
|
||||
if (ret == 0 && str[0] != '\0')
|
||||
ret = stringTableAdd(stringTable, str);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<class Type> static size_t array_size(std::vector<Type> &array);
|
||||
template<class Type> static void array_push(char* ¶meterOffset, std::vector<Type> &array);
|
||||
inline static unsigned int swap16(const unsigned int v);
|
||||
|
@ -14,61 +14,6 @@
|
||||
#define CNV2END(val) convert_endianness((val), elfEndianness)
|
||||
#define ENDSWAP(val) convert_endianness((val), (host_endianness() == 1) ? 2 : 1)
|
||||
|
||||
static unsigned int stringTableAdd( std::vector<char> &stringTable, const char* str )
|
||||
{
|
||||
unsigned int ret = (unsigned int)stringTable.size();
|
||||
|
||||
if ( ret == 0 )
|
||||
{
|
||||
stringTable.push_back('\0');
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
size_t stringLength = strlen(str) + 1;
|
||||
stringTable.resize(ret + stringLength);
|
||||
memcpy(&stringTable[0] + ret,str,stringLength);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static unsigned int stringTableFind( std::vector<char> &stringTable, const char* str )
|
||||
{
|
||||
const char* data = &stringTable[0];
|
||||
size_t size = stringTable.size();
|
||||
const char *end = data + size;
|
||||
|
||||
size_t length = strlen(str);
|
||||
|
||||
if (length+1 > size)
|
||||
return 0;
|
||||
|
||||
data += length;
|
||||
|
||||
const char *p = (char*)memchr(data,'\0',end-data);
|
||||
while (p && (end-data)>0)
|
||||
{
|
||||
if (!memcmp(p - length, str, length))
|
||||
return (unsigned int)(p - length - &stringTable[0]);
|
||||
|
||||
data = p+1;
|
||||
p = (char*)memchr(data,'\0',end-data);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned int stringTableAddUnique( std::vector<char> &stringTable, const char* str )
|
||||
{
|
||||
if ( stringTable.size() == 0 )
|
||||
stringTable.push_back('\0');
|
||||
|
||||
unsigned int ret = stringTableFind(stringTable, str);
|
||||
|
||||
if (ret == 0 && str[0] != '\0')
|
||||
ret = stringTableAdd(stringTable, str);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int convertNvToElfFromFile(const char *sourceFile, int endianness, int constTableOffset, void **binaryShader, int *size, std::vector<char> &stringTable, std::vector<float> &defaultValues);
|
||||
int convertNvToElfFromMemory(const void *sourceData, size_t size, int endianness, int constTableOffset, void **binaryShader, int *binarySize, std::vector<char> &stringTable, std::vector<float> &defaultValues);
|
||||
|
||||
|
@ -35,15 +35,6 @@ using namespace cell::Gcm;
|
||||
|
||||
extern void _RGLFifoGlSetRenderTarget( RGLRenderTargetEx const * const args );
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int id;
|
||||
GLuint offset;
|
||||
GLuint size;
|
||||
GLuint pitch;
|
||||
GLuint bank;
|
||||
} jsTiledRegion;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
jsTiledRegion region[MAX_TILED_REGIONS];
|
||||
@ -60,6 +51,9 @@ static const uint32_t WaitLabelIndex = 111;
|
||||
extern GLuint nvFenceCounter;
|
||||
RGLState _RGLState;
|
||||
|
||||
extern GmmAllocator *pGmmLocalAllocator;
|
||||
extern GmmAllocator *pGmmMainAllocator;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int width;
|
||||
@ -121,11 +115,10 @@ static const int sysutilModeCount = sizeof( sysutilModes ) / sizeof( sysutilMode
|
||||
|
||||
static inline void _RGLPrintIt( unsigned int v )
|
||||
{
|
||||
printf( "%02x %02x %02x %02x : ", ( v >> 24 )&0xff, ( v >> 16 )&0xff, ( v >> 8 )&0xff, v&0xff );
|
||||
RARCH_LOG( "%02x %02x %02x %02x : \n", ( v >> 24 )&0xff, ( v >> 16 )&0xff, ( v >> 8 )&0xff, v&0xff );
|
||||
|
||||
for ( unsigned int mask = ( 0x1 << 31 ), i = 1; mask != 0; mask >>= 1, i++ )
|
||||
printf("%d%s", ( v & mask ) ? 1 : 0, ( i % 8 == 0 ) ? " " : "");
|
||||
printf( "\n" );
|
||||
RARCH_LOG("%d%s\n", ( v & mask ) ? 1 : 0, ( i % 8 == 0 ) ? " " : "");
|
||||
}
|
||||
|
||||
static inline void _RGLPrintFifoFromPut(unsigned int numWords)
|
||||
@ -254,42 +247,25 @@ static GLboolean _RGLInitFromRM( RGLResource *rmResource )
|
||||
|
||||
ref = RGL_CLAMPF_01(ref);
|
||||
|
||||
cellGcmSetAlphaFuncInline( &_RGLState.fifo, CELL_GCM_ALWAYS, RGL_QUICK_FLOAT2UINT( ref * 255.0f ));
|
||||
cellGcmSetAlphaFunc( &_RGLState.fifo, CELL_GCM_ALWAYS, RGL_QUICK_FLOAT2UINT( ref * 255.0f ));
|
||||
cellGcmSetBlendColor( &_RGLState.fifo, hwColor, hwColor);
|
||||
cellGcmSetBlendEquation( &_RGLState.fifo, CELL_GCM_FUNC_ADD, CELL_GCM_FUNC_ADD );
|
||||
cellGcmSetBlendFunc( &_RGLState.fifo, CELL_GCM_ONE, CELL_GCM_ZERO, CELL_GCM_ONE, CELL_GCM_ZERO );
|
||||
cellGcmSetClearColor( &_RGLState.fifo, hwColor);
|
||||
cellGcmSetScissor( &_RGLState.fifo, 0, 0, 4095, 4095);
|
||||
cellGcmSetVertexAttribOutputMask( &_RGLState.fifo, s->vertexProgramAttribMask & s->fragmentProgramAttribMask);
|
||||
|
||||
cellGcmSetBlendColorInline( &_RGLState.fifo, hwColor, hwColor);
|
||||
cellGcmSetBlendEquationInline( &_RGLState.fifo, CELL_GCM_FUNC_ADD, CELL_GCM_FUNC_ADD );
|
||||
cellGcmSetBlendFuncInline( &_RGLState.fifo, CELL_GCM_ONE, CELL_GCM_ZERO, CELL_GCM_ONE, CELL_GCM_ZERO );
|
||||
cellGcmSetClearColorInline( &_RGLState.fifo, hwColor);
|
||||
cellGcmSetAlphaTestEnableInline( &_RGLState.fifo, CELL_GCM_FALSE);
|
||||
cellGcmSetBlendEnableInline( &_RGLState.fifo, CELL_GCM_FALSE);
|
||||
cellGcmSetAlphaTestEnableInline( &_RGLState.fifo, CELL_GCM_FALSE);
|
||||
cellGcmSetBlendEnableMrtInline( &_RGLState.fifo, CELL_GCM_FALSE, CELL_GCM_FALSE, CELL_GCM_FALSE);
|
||||
cellGcmSetLogicOpEnableInline( &_RGLState.fifo, CELL_GCM_FALSE);
|
||||
cellGcmSetCullFaceEnableInline( &_RGLState.fifo, CELL_GCM_FALSE);
|
||||
cellGcmSetCullFaceEnableInline( &_RGLState.fifo, CELL_GCM_FALSE);
|
||||
cellGcmSetDepthBoundsTestEnableInline( &_RGLState.fifo, CELL_GCM_FALSE);
|
||||
cellGcmSetDepthTestEnableInline( &_RGLState.fifo, CELL_GCM_FALSE);
|
||||
cellGcmSetPolygonOffsetFillEnableInline( &_RGLState.fifo, CELL_GCM_FALSE);
|
||||
cellGcmSetPolygonOffsetLineEnableInline( &_RGLState.fifo, CELL_GCM_FALSE);
|
||||
cellGcmSetRestartIndexEnableInline( &_RGLState.fifo, CELL_GCM_FALSE);
|
||||
cellGcmSetFragmentProgramGammaEnableInline( &_RGLState.fifo, CELL_GCM_FALSE);
|
||||
cellGcmSetScissorInline( &_RGLState.fifo, 0, 0, 4095, 4095);
|
||||
cellGcmSetStencilTestEnableInline( &_RGLState.fifo, CELL_GCM_FALSE);
|
||||
cellGcmSetTwoSidedStencilTestEnableInline( &_RGLState.fifo, CELL_GCM_FALSE);
|
||||
cellGcmSetTwoSideLightEnableInline( &_RGLState.fifo, CELL_GCM_FALSE);
|
||||
cellGcmSetVertexAttribOutputMaskInline( &_RGLState.fifo, s->vertexProgramAttribMask & s->fragmentProgramAttribMask);
|
||||
cellGcmSetPointSpriteControl( &_RGLState.fifo, CELL_GCM_FALSE, 1, 0);
|
||||
cellGcmSetFrequencyDividerOperation( &_RGLState.fifo, 0);
|
||||
|
||||
cellGcmSetPointSpriteControlInline( &_RGLState.fifo, CELL_GCM_FALSE, 1, 0);
|
||||
cellGcmSetFrequencyDividerOperationInline( &_RGLState.fifo, 0);
|
||||
|
||||
cellGcmSetRestartIndexInline( &_RGLState.fifo, 0);
|
||||
cellGcmSetShadeModeInline( &_RGLState.fifo, CELL_GCM_SMOOTH);
|
||||
cellGcmSetRestartIndex( &_RGLState.fifo, 0);
|
||||
cellGcmSetShadeMode( &_RGLState.fifo, CELL_GCM_SMOOTH);
|
||||
|
||||
for (i = 0; i < CELL_GCM_MAX_TEXIMAGE_COUNT; i++)
|
||||
{
|
||||
cellGcmSetTextureAddressInline( &_RGLState.fifo, i, CELL_GCM_TEXTURE_WRAP, CELL_GCM_TEXTURE_WRAP, CELL_GCM_TEXTURE_CLAMP_TO_EDGE, CELL_GCM_TEXTURE_UNSIGNED_REMAP_NORMAL, CELL_GCM_TEXTURE_ZFUNC_NEVER, 0 );
|
||||
cellGcmSetTextureFilterInline( &_RGLState.fifo, i, 0, CELL_GCM_TEXTURE_NEAREST_LINEAR, CELL_GCM_TEXTURE_LINEAR, CELL_GCM_TEXTURE_CONVOLUTION_QUINCUNX );
|
||||
cellGcmSetTextureControlInline( &_RGLState.fifo, i, CELL_GCM_TRUE, 0, 12 << 8, CELL_GCM_TEXTURE_MAX_ANISO_1 );
|
||||
cellGcmSetTextureAddress( &_RGLState.fifo, i, CELL_GCM_TEXTURE_WRAP, CELL_GCM_TEXTURE_WRAP, CELL_GCM_TEXTURE_CLAMP_TO_EDGE, CELL_GCM_TEXTURE_UNSIGNED_REMAP_NORMAL, CELL_GCM_TEXTURE_ZFUNC_NEVER, 0 );
|
||||
cellGcmSetTextureFilter( &_RGLState.fifo, i, 0, CELL_GCM_TEXTURE_NEAREST_LINEAR, CELL_GCM_TEXTURE_LINEAR, CELL_GCM_TEXTURE_CONVOLUTION_QUINCUNX );
|
||||
cellGcmSetTextureControl( &_RGLState.fifo, i, CELL_GCM_TRUE, 0, 12 << 8, CELL_GCM_TEXTURE_MAX_ANISO_1 );
|
||||
}
|
||||
|
||||
_RGLFifoGlViewport( 0, 0, CELL_GCM_MAX_RT_DIMENSION, CELL_GCM_MAX_RT_DIMENSION, 0.0f, 1.0f );
|
||||
@ -970,7 +946,7 @@ static int _RGLPlatformCreateDevice( PSGLdevice* device )
|
||||
_RGLSetDisplayMode(vm, gcmDevice->color[0].bpp*8, gcmDevice->color[0].pitch);
|
||||
|
||||
cellGcmSetFlipMode(gcmDevice->vsync ? CELL_GCM_DISPLAY_VSYNC : CELL_GCM_DISPLAY_HSYNC);
|
||||
cellGcmSetInvalidateVertexCacheInline( &_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache( &_RGLState.fifo);
|
||||
_RGLFifoFinish( &_RGLState.fifo );
|
||||
|
||||
for (int i = 0; i < params->bufferingMode; ++i)
|
||||
@ -1072,22 +1048,6 @@ PSGLdevice* psglCreateDeviceExtended(const PSGLdeviceParameters *parameters )
|
||||
return device;
|
||||
}
|
||||
|
||||
GLfloat psglGetDeviceAspectRatio(const PSGLdevice * device)
|
||||
{
|
||||
CellVideoOutState videoState;
|
||||
cellVideoOutGetState(CELL_VIDEO_OUT_PRIMARY, 0, &videoState);
|
||||
|
||||
switch (videoState.displayMode.aspect)
|
||||
{
|
||||
case CELL_VIDEO_OUT_ASPECT_4_3:
|
||||
return 4.0f/3.0f;
|
||||
case CELL_VIDEO_OUT_ASPECT_16_9:
|
||||
return 16.0f/9.0f;
|
||||
}
|
||||
|
||||
return 16.0f/9.0f;
|
||||
}
|
||||
|
||||
void psglGetDeviceDimensions(const PSGLdevice * device, GLuint *width, GLuint *height)
|
||||
{
|
||||
*width = device->deviceParameters.width;
|
||||
@ -1104,7 +1064,7 @@ void psglDestroyDevice(PSGLdevice *device)
|
||||
RGLDevice *gcmDevice = ( RGLDevice * )device->platformDevice;
|
||||
PSGLdeviceParameters* params = &device->deviceParameters;
|
||||
|
||||
cellGcmSetInvalidateVertexCacheInline( &_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache( &_RGLState.fifo);
|
||||
_RGLFifoFinish( &_RGLState.fifo );
|
||||
|
||||
if ( rescIsEnabled( params ) )
|
||||
@ -1144,7 +1104,7 @@ static void *_RGLPlatformRasterInit (void)
|
||||
{
|
||||
RGLDriver *driver = (RGLDriver*)malloc(sizeof(RGLDriver));
|
||||
|
||||
cellGcmSetInvalidateVertexCacheInline( &_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache( &_RGLState.fifo);
|
||||
_RGLFifoFinish( &_RGLState.fifo );
|
||||
memset( driver, 0, sizeof( RGLDriver ) );
|
||||
driver->rt.yInverted = CELL_GCM_TRUE;
|
||||
@ -1177,7 +1137,54 @@ PSGLdevice *psglGetCurrentDevice(void)
|
||||
return _CurrentDevice;
|
||||
}
|
||||
|
||||
extern void gmmUpdateFreeList (const uint8_t location);
|
||||
static void gmmRemovePendingFree(GmmAllocator *pAllocator, GmmBlock *pBlock)
|
||||
{
|
||||
if (pBlock == pAllocator->pPendingFreeHead)
|
||||
pAllocator->pPendingFreeHead = pBlock->pNextFree;
|
||||
|
||||
if (pBlock == pAllocator->pPendingFreeTail)
|
||||
pAllocator->pPendingFreeTail = pBlock->pPrevFree;
|
||||
|
||||
if (pBlock->pNextFree)
|
||||
pBlock->pNextFree->pPrevFree = pBlock->pPrevFree;
|
||||
|
||||
if (pBlock->pPrevFree)
|
||||
pBlock->pPrevFree->pNextFree = pBlock->pNextFree;
|
||||
}
|
||||
|
||||
extern void gmmAddFree(GmmAllocator *pAllocator, GmmBlock *pBlock);
|
||||
|
||||
static void gmmUpdateFreeLists (void)
|
||||
{
|
||||
for(int i = 0; i < 2; i++)
|
||||
{
|
||||
uint8_t location = i == 0 ? CELL_GCM_LOCATION_LOCAL : CELL_GCM_LOCATION_MAIN;
|
||||
GmmAllocator *pAllocator;
|
||||
const uint32_t fence = _RGLState.semaphores->userSemaphores[SEMA_FENCE].val;
|
||||
GmmBlock *pBlock = NULL;
|
||||
GmmBlock *pTemp = NULL;
|
||||
|
||||
pAllocator = (location == CELL_GCM_LOCATION_LOCAL) ?
|
||||
pGmmLocalAllocator :
|
||||
pGmmMainAllocator;
|
||||
|
||||
pBlock = pAllocator->pPendingFreeHead;
|
||||
|
||||
while (pBlock)
|
||||
{
|
||||
pTemp = pBlock->pNextFree;
|
||||
|
||||
if ( !(( fence - pBlock->fence ) & 0x80000000 ) )
|
||||
{
|
||||
gmmRemovePendingFree(pAllocator, pBlock);
|
||||
gmmAddFree(pAllocator, pBlock);
|
||||
}
|
||||
|
||||
pBlock = pTemp;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
GLAPI void psglSwap(void)
|
||||
{
|
||||
@ -1185,8 +1192,7 @@ GLAPI void psglSwap(void)
|
||||
PSGLdevice *device = _CurrentDevice;
|
||||
RGLFifo *fifo = &_RGLState.fifo;
|
||||
|
||||
gmmUpdateFreeList(CELL_GCM_LOCATION_LOCAL);
|
||||
gmmUpdateFreeList(CELL_GCM_LOCATION_MAIN);
|
||||
gmmUpdateFreeLists();
|
||||
|
||||
RGLDevice *gcmDevice = ( RGLDevice * )device->platformDevice;
|
||||
|
||||
@ -1234,27 +1240,17 @@ GLAPI void psglSwap(void)
|
||||
cellGcmSetWaitFlip();
|
||||
}
|
||||
|
||||
cellGcmSetPolySmoothEnableInline( &_RGLState.fifo, CELL_GCM_FALSE);
|
||||
cellGcmSetLineStippleEnableInline( &_RGLState.fifo, CELL_GCM_FALSE );
|
||||
cellGcmSetPolygonStippleEnableInline( &_RGLState.fifo, CELL_GCM_FALSE);
|
||||
cellGcmSetDepthBoundsTestEnable( &_RGLState.fifo, CELL_GCM_FALSE);
|
||||
|
||||
LContext->needValidate = PSGL_VALIDATE_ALL;
|
||||
|
||||
for(int unit = 0; unit < MAX_TEXTURE_UNITS; unit++)
|
||||
LContext->TextureCoordsUnits[unit].TextureMatrixStack.dirty = GL_TRUE;
|
||||
|
||||
LContext->ModelViewMatrixStack.dirty = GL_TRUE;
|
||||
LContext->ProjectionMatrixStack.dirty = GL_TRUE;
|
||||
LContext->attribs->DirtyMask = (1 << MAX_VERTEX_ATTRIBS) - 1;
|
||||
|
||||
cellGcmSetInvalidateVertexCacheInline( &_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache( &_RGLState.fifo);
|
||||
|
||||
_RGLFifoFlush(fifo);
|
||||
|
||||
while(sys_semaphore_wait(FlipSem, 1000) != CELL_OK);
|
||||
|
||||
cellGcmSetInvalidateVertexCacheInline(&_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache(&_RGLState.fifo);
|
||||
_RGLFifoFlush(fifo);
|
||||
|
||||
if (device->deviceParameters.bufferingMode == PSGL_BUFFERING_MODE_DOUBLE)
|
||||
@ -1326,11 +1322,3 @@ GLboolean _RGLTryResizeTileRegion(GLuint address, GLuint size, void* data)
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
void _RGLGetTileRegionInfo(void* data, GLuint *address, GLuint *size)
|
||||
{
|
||||
jsTiledRegion* region = ( jsTiledRegion* )data;
|
||||
|
||||
*address = region->offset;
|
||||
*size = region->size;
|
||||
}
|
||||
|
@ -310,10 +310,6 @@ GLAPI void APIENTRY glFlush( void );
|
||||
GLAPI void APIENTRY glGenTextures( GLsizei n, GLuint *textures );
|
||||
GLAPI GLenum APIENTRY glGetError( void );
|
||||
GLAPI const GLubyte * APIENTRY glGetString( GLenum name );
|
||||
GLAPI void APIENTRY glLoadIdentity( void );
|
||||
GLAPI void APIENTRY glMatrixMode( GLenum mode );
|
||||
GLAPI void APIENTRY glOrthof( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar );
|
||||
GLAPI void APIENTRY glRotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z );
|
||||
GLAPI void APIENTRY glPixelStorei( GLenum pname, GLint param );
|
||||
GLAPI void APIENTRY glTexCoordPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer );
|
||||
GLAPI void APIENTRY glTexImage2D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels );
|
||||
|
@ -58,12 +58,6 @@ typedef struct
|
||||
|
||||
ELF_section_t *findSection(const ELF_t *elf, const char *name);
|
||||
int lookupSymbol(const ELF_t *elf, const char *name);
|
||||
const Elf32_Sym *getSymbolByIndex(const ELF_t *elf, int idx);
|
||||
|
||||
const char *findSectionInPlace(const char* memory,unsigned int size,const char *name,size_t *sectionSize);
|
||||
const char *findSymbolSectionInPlace(const char *memory, unsigned int size, size_t *symbolSize, size_t *symbolCount, const char **symbolstrtab);
|
||||
int lookupSymbolValueInPlace(const char *symbolSection, size_t symbolSize, size_t symbolCount, const char *symbolstrtab, const char *name);
|
||||
const char *getSymbolByIndexInPlace(const char *symbolSection, size_t symbolSize, size_t symbolCount, const char *symbolstrtab, int index);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -22,6 +22,8 @@ typedef struct _CGcontext *CGcontext;
|
||||
#define SUBPIXEL_ADJUST (0.5/(1<<12))
|
||||
|
||||
#define gmmIdIsMain(id) (((GmmBaseBlock *)id)->isMain)
|
||||
#define gmmAddressToOffset(address, isMain) ((isMain) ? (address)-pGmmMainAllocator->memoryBase : (address)-pGmmLocalAllocator->memoryBase)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
@ -182,15 +184,17 @@ typedef struct
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GLfloat * MatrixStackf;
|
||||
int MatrixStackPtr;
|
||||
GLboolean dirty;
|
||||
} jsMatrixStack;
|
||||
int X, Y, XSize, YSize;
|
||||
} jsViewPort;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int X, Y, XSize, YSize;
|
||||
} jsViewPort;
|
||||
int id;
|
||||
GLuint offset;
|
||||
GLuint size;
|
||||
GLuint pitch;
|
||||
GLuint bank;
|
||||
} jsTiledRegion;
|
||||
|
||||
enum
|
||||
{
|
||||
@ -261,16 +265,12 @@ typedef struct
|
||||
}
|
||||
jsTexture;
|
||||
|
||||
#define _RGL_MAX_TEXTURE_COORDS 8
|
||||
#define _RGL_MAX_TEXTURE_IMAGE_UNITS 16
|
||||
#define _RGL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 4
|
||||
#define MAX_TEXTURE_COORDS 8
|
||||
#define MAX_TEXTURE_IMAGE_UNITS 16
|
||||
#define MAX_VERTEX_TEXTURE_IMAGE_UNITS 4
|
||||
|
||||
#define MAX_TEXTURE_UNITS 4
|
||||
|
||||
#define _RGL_MAX_MODELVIEW_STACK_DEPTH 16
|
||||
#define _RGL_MAX_PROJECTION_STACK_DEPTH 2
|
||||
#define MAX_TEXTURE_STACK_DEPTH 2
|
||||
|
||||
#define MAX_VERTEX_ATTRIBS 16
|
||||
|
||||
typedef struct
|
||||
@ -283,12 +283,6 @@ typedef struct
|
||||
jsTexture* currentTexture;
|
||||
} jsTextureImageUnit;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GLuint revalidate;
|
||||
jsMatrixStack TextureMatrixStack;
|
||||
} jsTextureCoordsUnit;
|
||||
|
||||
enum
|
||||
{
|
||||
FRAMEBUFFER_ATTACHMENT_NONE,
|
||||
@ -464,8 +458,6 @@ struct jsBufferObject
|
||||
void *platformBufferObject[];
|
||||
};
|
||||
|
||||
#define ELEMENTS_IN_MATRIX 16
|
||||
|
||||
typedef struct jsNameSpace
|
||||
{
|
||||
void** data;
|
||||
@ -488,13 +480,6 @@ jsTexNameSpace;
|
||||
struct PSGLcontext
|
||||
{
|
||||
GLenum error;
|
||||
int MatrixMode;
|
||||
jsMatrixStack ModelViewMatrixStack;
|
||||
jsMatrixStack ProjectionMatrixStack;
|
||||
GLfloat LocalToScreenMatrixf[ELEMENTS_IN_MATRIX];
|
||||
GLfloat InverseModelViewMatrixf[ELEMENTS_IN_MATRIX];
|
||||
GLboolean InverseModelViewValid;
|
||||
GLfloat ScalingFactor;
|
||||
jsViewPort ViewPort;
|
||||
jsAttributeState defaultAttribs0;
|
||||
jsAttributeState *attribs;
|
||||
@ -502,7 +487,6 @@ struct PSGLcontext
|
||||
GLuint attribSetName;
|
||||
GLboolean attribSetDirty;
|
||||
jsColorRGBAf ClearColor;
|
||||
jsColorRGBAf AccumClearColor;
|
||||
GLboolean ShaderSRGBRemap;
|
||||
GLboolean Blending;
|
||||
GLboolean BlendingMrt[3];
|
||||
@ -516,11 +500,9 @@ struct PSGLcontext
|
||||
jsTexNameSpace textureNameSpace;
|
||||
GLuint ActiveTexture;
|
||||
GLuint CS_ActiveTexture;
|
||||
jsTextureImageUnit TextureImageUnits[_RGL_MAX_TEXTURE_IMAGE_UNITS];
|
||||
jsTextureImageUnit TextureImageUnits[MAX_TEXTURE_IMAGE_UNITS];
|
||||
jsTextureImageUnit* CurrentImageUnit;
|
||||
jsTextureCoordsUnit TextureCoordsUnits[_RGL_MAX_TEXTURE_COORDS];
|
||||
jsTextureCoordsUnit* CurrentCoordsUnit;
|
||||
jsTexture *VertexTextureImages[_RGL_MAX_VERTEX_TEXTURE_IMAGE_UNITS];
|
||||
jsTexture *VertexTextureImages[MAX_VERTEX_TEXTURE_IMAGE_UNITS];
|
||||
GLsizei packAlignment;
|
||||
GLsizei unpackAlignment;
|
||||
jsTexNameSpace bufferObjectNameSpace;
|
||||
@ -550,11 +532,6 @@ struct PSGLcontext
|
||||
#define RGL_LIKELY(COND) (COND)
|
||||
#define RGL_UNLIKELY(COND) (COND)
|
||||
|
||||
static inline float _RGLClampf( const float value )
|
||||
{
|
||||
return MAX( MIN( value, 1.f ), 0.f );
|
||||
}
|
||||
|
||||
static inline unsigned int endianSwapWord( unsigned int v )
|
||||
{
|
||||
return ( v&0xff ) << 24 | ( v&0xff00 ) << 8 |
|
||||
@ -577,13 +554,6 @@ static inline unsigned long _RGLPad(unsigned long x, unsigned long pad)
|
||||
return ( x + pad - 1 ) / pad*pad;
|
||||
}
|
||||
|
||||
static inline char* _RGLPadPtr(const char* p, unsigned int pad)
|
||||
{
|
||||
intptr_t x = (intptr_t)p;
|
||||
x = ( x + pad - 1 ) / pad * pad;
|
||||
return ( char* )x;
|
||||
}
|
||||
|
||||
typedef struct MemoryBlockManager_t_
|
||||
{
|
||||
char *memory;
|
||||
@ -597,8 +567,6 @@ typedef struct MemoryBlockManager_t_
|
||||
|
||||
typedef unsigned long jsName;
|
||||
|
||||
void _RGLInitNameSpace( struct jsNameSpace * name );
|
||||
void _RGLFreeNameSpace( struct jsNameSpace * name );
|
||||
jsName _RGLCreateName( struct jsNameSpace * ns, void* object );
|
||||
unsigned int _RGLIsName( struct jsNameSpace* ns, jsName name );
|
||||
void _RGLEraseName( struct jsNameSpace* ns, jsName name );
|
||||
@ -712,6 +680,9 @@ typedef struct GmmAllocator
|
||||
uint32_t totalSize;
|
||||
} GmmAllocator;
|
||||
|
||||
extern GmmAllocator *pGmmLocalAllocator;
|
||||
extern GmmAllocator *pGmmMainAllocator;
|
||||
|
||||
uint32_t gmmInit(
|
||||
const void *localMemoryBase,
|
||||
const void *localStartAddress,
|
||||
@ -745,14 +716,23 @@ void gmmSetTileAttrib(const uint32_t id, const uint32_t tag, void *pData);
|
||||
COMMAND_BUFFER = (typeof(COMMAND_BUFFER))gcmContext.current; \
|
||||
}
|
||||
|
||||
#define _RGLTransferDataVidToVid(dstId, dstIdOffset, dstPitch, dstX, dstY, srcId, srcIdOffset, srcPitch, srcX, srcY, width, height, bytesPerPixel) \
|
||||
{ \
|
||||
GmmBaseBlock *pBaseBlock_dst = (GmmBaseBlock *)dstId; \
|
||||
GmmBaseBlock *pBaseBlock_src = (GmmBaseBlock *)srcId; \
|
||||
GLuint dstOffset_tmp = gmmAddressToOffset(pBaseBlock_dst->address, pBaseBlock_dst->isMain) + dstIdOffset; \
|
||||
GLuint srcOffset_tmp = gmmAddressToOffset(pBaseBlock_src->address, pBaseBlock_src->isMain) + srcIdOffset; \
|
||||
cellGcmSetTransferImageInline( &_RGLState.fifo, CELL_GCM_TRANSFER_LOCAL_TO_LOCAL, dstOffset_tmp, (dstPitch), (dstX), (dstY), (srcOffset_tmp), (srcPitch), (srcX), (srcY), (width), (height), (bytesPerPixel) ); \
|
||||
}
|
||||
typedef struct
|
||||
{
|
||||
unsigned dst_id;
|
||||
unsigned dst_id_offset;
|
||||
unsigned dst_pitch;
|
||||
unsigned dst_x;
|
||||
unsigned dst_y;
|
||||
unsigned src_id;
|
||||
unsigned src_id_offset;
|
||||
unsigned src_pitch;
|
||||
unsigned src_x;
|
||||
unsigned src_y;
|
||||
unsigned width;
|
||||
unsigned height;
|
||||
unsigned bpp;
|
||||
void *fifo_ptr;
|
||||
} transfer_params_t;
|
||||
|
||||
#define HOST_BUFFER_ALIGNMENT 128
|
||||
|
||||
@ -798,7 +778,7 @@ struct RGLResource
|
||||
char * dmaPushBuffer;
|
||||
GLuint dmaPushBufferSize;
|
||||
void* dmaControl;
|
||||
RGLSemaphoreMemory *semaphores;
|
||||
RGLSemaphoreMemory *semaphores;
|
||||
};
|
||||
|
||||
typedef volatile struct
|
||||
@ -835,6 +815,17 @@ struct RGLFifo: public CellGcmContextData
|
||||
int spuid;
|
||||
};
|
||||
|
||||
static inline void TransferDataVidToVid(transfer_params_t *params)
|
||||
{
|
||||
GmmBaseBlock *pBaseBlock_dst = (GmmBaseBlock *)params->dst_id;
|
||||
GmmBaseBlock *pBaseBlock_src = (GmmBaseBlock *)params->src_id;
|
||||
|
||||
GLuint dstOffset_tmp = gmmAddressToOffset(pBaseBlock_dst->address, pBaseBlock_dst->isMain) + params->dst_id_offset;
|
||||
GLuint srcOffset_tmp = gmmAddressToOffset(pBaseBlock_src->address, pBaseBlock_src->isMain) + params->src_id_offset;
|
||||
|
||||
cellGcmSetTransferImage( (RGLFifo*)params->fifo_ptr, CELL_GCM_TRANSFER_LOCAL_TO_LOCAL, dstOffset_tmp, params->dst_pitch, params->dst_x, params->dst_y, srcOffset_tmp, params->src_pitch, params->src_x, params->src_y, params->width, params->height, params->bpp);
|
||||
}
|
||||
|
||||
typedef struct RGLRenderTarget RGLRenderTarget;
|
||||
typedef struct RGLCachedState RGLCachedState;
|
||||
typedef struct RGLBlendState RGLBlendState;
|
||||
@ -903,7 +894,6 @@ void _RGLSetNativeCgVertexProgram( const void *header );
|
||||
void _RGLSetNativeCgFragmentProgram( const void *header );
|
||||
|
||||
GLboolean _RGLTryResizeTileRegion( GLuint address, GLuint size, void* data );
|
||||
void _RGLGetTileRegionInfo( void* data, GLuint *address, GLuint *size );
|
||||
|
||||
static inline GLuint _RGLPlatformGetBitsPerPixel( GLenum internalFormat )
|
||||
{
|
||||
@ -927,7 +917,7 @@ static inline GLuint _RGLPlatformGetBitsPerPixel( GLenum internalFormat )
|
||||
}
|
||||
|
||||
|
||||
void static inline _RGLFifoGlViewport( GLint x, GLint y, GLsizei width, GLsizei height, GLclampf zNear = 0.0f, GLclampf zFar = 1.0f )
|
||||
static inline void _RGLFifoGlViewport( GLint x, GLint y, GLsizei width, GLsizei height, GLclampf zNear = 0.0f, GLclampf zFar = 1.0f )
|
||||
{
|
||||
RGLViewportState *vp = &_RGLState.state.viewport;
|
||||
RGLRenderTarget *rt = &_RGLState.renderTarget;
|
||||
@ -1040,7 +1030,6 @@ extern void psglExit();
|
||||
|
||||
PSGLdevice *psglCreateDeviceAuto( GLenum colorFormat, GLenum depthFormat, GLenum multisamplingMode );
|
||||
PSGLdevice *psglCreateDeviceExtended( const PSGLdeviceParameters *parameters );
|
||||
GLfloat psglGetDeviceAspectRatio(const PSGLdevice *device );
|
||||
void psglGetDeviceDimensions(const PSGLdevice *device, GLuint *width, GLuint *height );
|
||||
void psglDestroyDevice( PSGLdevice* device );
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
|
||||
struct rgui_file
|
||||
{
|
||||
@ -111,7 +112,7 @@ static int list_comp(const void *a_, const void *b_)
|
||||
if (a->type != b->type)
|
||||
return a->type == RGUI_FILE_DIRECTORY ? -1 : 1;
|
||||
|
||||
return strcmp(a->path, b->path);
|
||||
return strcasecmp(a->path, b->path);
|
||||
}
|
||||
|
||||
void rgui_list_sort(rgui_list_t *list)
|
@ -15,29 +15,69 @@
|
||||
|
||||
#include "rgui.h"
|
||||
#include "list.h"
|
||||
#include "../rarch_console_video.h"
|
||||
#include "../font.h"
|
||||
#include "../../screenshot.h"
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
|
||||
#define FONT_WIDTH 5
|
||||
#define FONT_HEIGHT 10
|
||||
#define FONT_WIDTH_STRIDE (FONT_WIDTH + 1)
|
||||
#define FONT_HEIGHT_STRIDE (FONT_HEIGHT + 1)
|
||||
|
||||
#define TERM_START_X 15
|
||||
#define TERM_START_Y 27
|
||||
#define TERM_WIDTH (((RGUI_WIDTH - TERM_START_X - 15) / (FONT_WIDTH_STRIDE)))
|
||||
#define TERM_HEIGHT (((RGUI_HEIGHT - TERM_START_Y - 15) / (FONT_HEIGHT_STRIDE)))
|
||||
#define TERM_HEIGHT (((RGUI_HEIGHT - TERM_START_Y - 15) / (FONT_HEIGHT_STRIDE)) - 1)
|
||||
|
||||
extern char app_dir[PATH_MAX];
|
||||
#ifdef HAVE_HDD_CACHE_PARTITION
|
||||
#define LAST_ZIP_EXTRACT ZIP_EXTRACT_TO_CACHE_DIR
|
||||
#else
|
||||
#define LAST_ZIP_EXTRACT ZIP_EXTRACT_TO_CURRENT_DIR_AND_LOAD_FIRST_FILE
|
||||
#endif
|
||||
|
||||
#ifdef GEKKO
|
||||
enum
|
||||
{
|
||||
GX_RESOLUTIONS_384_224 = 0,
|
||||
GX_RESOLUTIONS_512_224,
|
||||
GX_RESOLUTIONS_640_224,
|
||||
GX_RESOLUTIONS_512_239,
|
||||
GX_RESOLUTIONS_512_240,
|
||||
GX_RESOLUTIONS_640_240,
|
||||
GX_RESOLUTIONS_640_288,
|
||||
GX_RESOLUTIONS_384_448,
|
||||
GX_RESOLUTIONS_512_448,
|
||||
GX_RESOLUTIONS_640_448,
|
||||
GX_RESOLUTIONS_512_478,
|
||||
GX_RESOLUTIONS_DEFAULT,
|
||||
GX_RESOLUTIONS_LAST,
|
||||
};
|
||||
|
||||
unsigned rgui_gx_resolutions[GX_RESOLUTIONS_LAST][2] = {
|
||||
{ 384, 224 },
|
||||
{ 512, 224 },
|
||||
{ 640, 224 },
|
||||
{ 512, 239 },
|
||||
{ 512, 240 },
|
||||
{ 640, 240 },
|
||||
{ 640, 288 },
|
||||
{ 384, 448 },
|
||||
{ 512, 448 },
|
||||
{ 640, 448 },
|
||||
{ 512, 478 },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
unsigned rgui_current_gx_resolution = GX_RESOLUTIONS_DEFAULT;
|
||||
#endif
|
||||
|
||||
unsigned RGUI_WIDTH = 320;
|
||||
unsigned RGUI_HEIGHT = 240;
|
||||
|
||||
struct rgui_handle
|
||||
{
|
||||
uint16_t *frame_buf;
|
||||
size_t frame_buf_pitch;
|
||||
const uint8_t *font_buf;
|
||||
|
||||
rgui_folder_enum_cb_t folder_cb;
|
||||
void *userdata;
|
||||
@ -46,14 +86,15 @@ struct rgui_handle
|
||||
rgui_list_t *folder_buf;
|
||||
int directory_ptr;
|
||||
bool need_refresh;
|
||||
bool msg_force;
|
||||
|
||||
char path_buf[PATH_MAX];
|
||||
|
||||
uint16_t font_white[256][FONT_HEIGHT][FONT_WIDTH];
|
||||
uint16_t font_green[256][FONT_HEIGHT][FONT_WIDTH];
|
||||
uint8_t *font;
|
||||
bool alloc_font;
|
||||
};
|
||||
|
||||
static const char *rgui_device_lables[] = {
|
||||
static const char *rgui_device_labels[] = {
|
||||
"GameCube Controller",
|
||||
"Wiimote",
|
||||
"Wiimote + Nunchuk",
|
||||
@ -84,14 +125,12 @@ static inline bool rgui_is_controller_menu(rgui_file_type_t menu_type)
|
||||
return (menu_type >= RGUI_SETTINGS_CONTROLLER_1 && menu_type <= RGUI_SETTINGS_CONTROLLER_4);
|
||||
}
|
||||
|
||||
static inline bool rgui_is_filebrowser_menu(rgui_file_type_t menu_type)
|
||||
static inline bool rgui_is_viewport_menu(rgui_file_type_t menu_type)
|
||||
{
|
||||
return (menu_type == RGUI_FILE_DIRECTORY || menu_type == RGUI_FILE_DEVICE || menu_type == RGUI_SETTINGS_CORE);
|
||||
return (menu_type == RGUI_SETTINGS_CUSTOM_VIEWPORT || menu_type == RGUI_SETTINGS_CUSTOM_VIEWPORT_2);
|
||||
}
|
||||
|
||||
static void copy_glyph(uint16_t glyph_white[FONT_HEIGHT][FONT_WIDTH],
|
||||
uint16_t glyph_green[FONT_HEIGHT][FONT_WIDTH],
|
||||
const uint8_t *buf)
|
||||
static void copy_glyph(uint8_t *glyph, const uint8_t *buf)
|
||||
{
|
||||
for (int y = 0; y < FONT_HEIGHT; y++)
|
||||
{
|
||||
@ -102,34 +141,37 @@ static void copy_glyph(uint16_t glyph_white[FONT_HEIGHT][FONT_WIDTH],
|
||||
((uint32_t)buf[3 * (-y * 256 + x) + 1] << 8) |
|
||||
((uint32_t)buf[3 * (-y * 256 + x) + 2] << 16);
|
||||
|
||||
glyph_white[y][x] = col == 0xff ? 0 : 0x7fff;
|
||||
glyph_green[y][x] = col == 0xff ? 0 : (5 << 10) | (20 << 5) | (5 << 0);
|
||||
uint8_t rem = 1 << ((x + y * FONT_WIDTH) & 7);
|
||||
unsigned offset = (x + y * FONT_WIDTH) >> 3;
|
||||
|
||||
if (col != 0xff)
|
||||
glyph[offset] |= rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void init_font(rgui_handle_t *rgui, const char *path)
|
||||
static void init_font(rgui_handle_t *rgui, const uint8_t *font_bmp_buf)
|
||||
{
|
||||
rgui->font = (uint8_t *) calloc(1, FONT_OFFSET(256));
|
||||
rgui->alloc_font = true;
|
||||
for (unsigned i = 0; i < 256; i++)
|
||||
{
|
||||
unsigned y = i / 16;
|
||||
unsigned x = i % 16;
|
||||
copy_glyph(rgui->font_white[i],
|
||||
rgui->font_green[i],
|
||||
rgui->font_buf + 54 + 3 * (256 * (255 - 16 * y) + 16 * x));
|
||||
copy_glyph(&rgui->font[FONT_OFFSET(i)],
|
||||
font_bmp_buf + 54 + 3 * (256 * (255 - 16 * y) + 16 * x));
|
||||
}
|
||||
}
|
||||
|
||||
rgui_handle_t *rgui_init(const char *base_path,
|
||||
uint16_t *buf, size_t buf_pitch,
|
||||
const uint8_t *font_buf,
|
||||
uint16_t *framebuf, size_t framebuf_pitch,
|
||||
const uint8_t *font_bmp_buf, uint8_t *font_bin_buf,
|
||||
rgui_folder_enum_cb_t folder_cb, void *userdata)
|
||||
{
|
||||
rgui_handle_t *rgui = (rgui_handle_t*)calloc(1, sizeof(*rgui));
|
||||
|
||||
rgui->frame_buf = buf;
|
||||
rgui->frame_buf_pitch = buf_pitch;
|
||||
rgui->font_buf = font_buf;
|
||||
rgui->frame_buf = framebuf;
|
||||
rgui->frame_buf_pitch = framebuf_pitch;
|
||||
|
||||
rgui->folder_cb = folder_cb;
|
||||
rgui->userdata = userdata;
|
||||
@ -138,7 +180,15 @@ rgui_handle_t *rgui_init(const char *base_path,
|
||||
rgui->folder_buf = rgui_list_new();
|
||||
rgui_list_push(rgui->path_stack, base_path, RGUI_FILE_DIRECTORY, 0);
|
||||
|
||||
init_font(rgui, "font.bmp");
|
||||
if (font_bmp_buf)
|
||||
init_font(rgui, font_bmp_buf);
|
||||
else if (font_bin_buf)
|
||||
rgui->font = font_bin_buf;
|
||||
else
|
||||
{
|
||||
RARCH_ERR("no font bmp or bin, abort");
|
||||
rarch_settings_change(S_QUIT);
|
||||
}
|
||||
|
||||
return rgui;
|
||||
}
|
||||
@ -147,6 +197,8 @@ void rgui_free(rgui_handle_t *rgui)
|
||||
{
|
||||
rgui_list_free(rgui->path_stack);
|
||||
rgui_list_free(rgui->folder_buf);
|
||||
if (rgui->alloc_font)
|
||||
free(rgui->font);
|
||||
free(rgui);
|
||||
}
|
||||
|
||||
@ -154,18 +206,16 @@ static uint16_t gray_filler(unsigned x, unsigned y)
|
||||
{
|
||||
x >>= 1;
|
||||
y >>= 1;
|
||||
uint16_t col = ((x + y) & 1) + 1;
|
||||
col <<= 1;
|
||||
return (col << 0) | (col << 5) | (col << 10);
|
||||
unsigned col = ((x + y) & 1) + 1;
|
||||
return (6 << 12) | (col << 8) | (col << 4) | (col << 0);
|
||||
}
|
||||
|
||||
static uint16_t green_filler(unsigned x, unsigned y)
|
||||
{
|
||||
x >>= 1;
|
||||
y >>= 1;
|
||||
uint16_t col = ((x + y) & 1) + 1;
|
||||
col <<= 1;
|
||||
return (col << 0) | (col << 6) | (col << 10);
|
||||
unsigned col = ((x + y) & 1) + 1;
|
||||
return (6 << 12) | (col << 8) | (col << 5) | (col << 0);
|
||||
}
|
||||
|
||||
static void fill_rect(uint16_t *buf, unsigned pitch,
|
||||
@ -187,12 +237,13 @@ static void blit_line(rgui_handle_t *rgui,
|
||||
{
|
||||
for (unsigned i = 0; i < FONT_WIDTH; i++)
|
||||
{
|
||||
uint16_t col = green ?
|
||||
rgui->font_green[(unsigned char)*message][j][i] :
|
||||
rgui->font_white[(unsigned char)*message][j][i];
|
||||
uint8_t rem = 1 << ((i + j * FONT_WIDTH) & 7);
|
||||
unsigned offset = (i + j * FONT_WIDTH) >> 3;
|
||||
bool col = (rgui->font[FONT_OFFSET((unsigned char)*message) + offset] & rem);
|
||||
|
||||
if (col)
|
||||
rgui->frame_buf[(y + j) * (rgui->frame_buf_pitch >> 1) + (x + i)] = col;
|
||||
rgui->frame_buf[(y + j) * (rgui->frame_buf_pitch >> 1) + (x + i)] = green ?
|
||||
(3 << 0) | (10 << 4) | (3 << 8) | (7 << 12) : 0x7FFF;
|
||||
}
|
||||
}
|
||||
|
||||
@ -259,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)
|
||||
if (rgui->need_refresh && g_console.mode_switch == MODE_MENU && !rgui->msg_force)
|
||||
return;
|
||||
|
||||
size_t begin = rgui->directory_ptr >= TERM_HEIGHT / 2 ?
|
||||
@ -276,20 +327,21 @@ static void render_text(rgui_handle_t *rgui)
|
||||
const char *dir = 0;
|
||||
rgui_file_type_t menu_type = 0;
|
||||
rgui_list_back(rgui->path_stack, &dir, &menu_type, NULL);
|
||||
|
||||
if (menu_type == RGUI_SETTINGS_CORE)
|
||||
{
|
||||
snprintf(title, sizeof(title), "CORE SELECTION");
|
||||
}
|
||||
else if (rgui_is_controller_menu(menu_type) || menu_type == RGUI_SETTINGS)
|
||||
{
|
||||
else if (rgui_is_controller_menu(menu_type) || rgui_is_viewport_menu(menu_type) || menu_type == RGUI_SETTINGS)
|
||||
snprintf(title, sizeof(title), "SETTINGS: %s", dir);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(title, sizeof(title), "FILE BROWSER: %s", dir);
|
||||
}
|
||||
|
||||
blit_line(rgui, TERM_START_X + 15, 15, title, true);
|
||||
|
||||
struct retro_system_info info;
|
||||
retro_get_system_info(&info);
|
||||
snprintf(title, sizeof(title), "CORE: %s %s", info.library_name, info.library_version);
|
||||
blit_line(rgui, TERM_START_X + 15, (TERM_HEIGHT * FONT_HEIGHT_STRIDE) + TERM_START_Y + 2, title, true);
|
||||
|
||||
unsigned x = TERM_START_X;
|
||||
unsigned y = TERM_START_Y;
|
||||
|
||||
@ -316,15 +368,63 @@ static void render_text(rgui_handle_t *rgui)
|
||||
snprintf(type_str, sizeof(type_str), "(DEV)");
|
||||
w = 5;
|
||||
break;
|
||||
case RGUI_SETTINGS_SAVESTATE_SAVE:
|
||||
case RGUI_SETTINGS_SAVESTATE_LOAD:
|
||||
snprintf(type_str, sizeof(type_str), "%d", g_extern.state_slot);
|
||||
break;
|
||||
case RGUI_SETTINGS_VIDEO_FILTER:
|
||||
snprintf(type_str, sizeof(type_str), g_settings.video.smooth ? "Bilinear filtering" : "Point filtering");
|
||||
break;
|
||||
#ifdef HW_RVL
|
||||
case RGUI_SETTINGS_VIDEO_SOFT_FILTER:
|
||||
snprintf(type_str, sizeof(type_str), g_console.soft_display_filter_enable ? "ON" : "OFF");
|
||||
break;
|
||||
#endif
|
||||
#ifdef GEKKO
|
||||
case RGUI_SETTINGS_VIDEO_RESOLUTION:
|
||||
snprintf(type_str, sizeof(type_str), "%s", gx_get_video_mode());
|
||||
break;
|
||||
#endif
|
||||
case RGUI_SETTINGS_VIDEO_GAMMA:
|
||||
snprintf(type_str, sizeof(type_str), "%d", g_console.gamma_correction);
|
||||
break;
|
||||
case RGUI_SETTINGS_VIDEO_ASPECT_RATIO:
|
||||
snprintf(type_str, sizeof(type_str), "%s", aspectratio_lut[g_console.aspect_ratio_index].name);
|
||||
break;
|
||||
case RGUI_SETTINGS_VIDEO_OVERSCAN:
|
||||
snprintf(type_str, sizeof(type_str), "%.2f", g_console.overscan_amount);
|
||||
break;
|
||||
case RGUI_SETTINGS_VIDEO_ROTATION:
|
||||
{
|
||||
char rotate_msg[64];
|
||||
rarch_settings_create_menu_item_label(rotate_msg, S_LBL_ROTATION, sizeof(rotate_msg));
|
||||
snprintf(type_str, sizeof(type_str), rotate_msg);
|
||||
}
|
||||
break;
|
||||
case RGUI_SETTINGS_AUDIO_MUTE:
|
||||
snprintf(type_str, sizeof(type_str), g_extern.audio_data.mute ? "ON" : "OFF");
|
||||
break;
|
||||
case RGUI_SETTINGS_AUDIO_CONTROL_RATE:
|
||||
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)
|
||||
{
|
||||
case ZIP_EXTRACT_TO_CURRENT_DIR:
|
||||
snprintf(type_str, sizeof(type_str), "Current");
|
||||
break;
|
||||
case ZIP_EXTRACT_TO_CURRENT_DIR_AND_LOAD_FIRST_FILE:
|
||||
snprintf(type_str, sizeof(type_str), "Current + Load");
|
||||
break;
|
||||
case ZIP_EXTRACT_TO_CACHE_DIR:
|
||||
snprintf(type_str, sizeof(type_str), "Cache");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case RGUI_SETTINGS_DEBUG_TEXT:
|
||||
snprintf(type_str, sizeof(type_str), g_console.fps_info_msg_enable ? "ON" : "OFF");
|
||||
break;
|
||||
case RGUI_SETTINGS_CUSTOM_VIEWPORT:
|
||||
case RGUI_SETTINGS_CORE:
|
||||
case RGUI_SETTINGS_CONTROLLER_1:
|
||||
case RGUI_SETTINGS_CONTROLLER_2:
|
||||
@ -333,7 +433,10 @@ static void render_text(rgui_handle_t *rgui)
|
||||
snprintf(type_str, sizeof(type_str), "...");
|
||||
break;
|
||||
case RGUI_SETTINGS_BIND_DEVICE:
|
||||
snprintf(type_str, sizeof(type_str), "%s", rgui_device_lables[g_settings.input.device[port]]);
|
||||
snprintf(type_str, sizeof(type_str), "%s", rgui_device_labels[g_settings.input.device[port]]);
|
||||
break;
|
||||
case RGUI_SETTINGS_BIND_DPAD_EMULATION:
|
||||
snprintf(type_str, sizeof(type_str), "%s", rarch_dpad_emulation_name_lut[g_settings.input.dpad_emulation[port]]);
|
||||
break;
|
||||
case RGUI_SETTINGS_BIND_UP:
|
||||
case RGUI_SETTINGS_BIND_DOWN:
|
||||
@ -358,30 +461,202 @@ static void render_text(rgui_handle_t *rgui)
|
||||
w = 0;
|
||||
break;
|
||||
}
|
||||
snprintf(message, sizeof(message), "%c %-*s %-*s\n",
|
||||
|
||||
const char *entry_title;
|
||||
char tmp[TERM_WIDTH];
|
||||
size_t path_len = strlen(path);
|
||||
// trim long filenames
|
||||
if ((type == RGUI_FILE_PLAIN || type == RGUI_FILE_DIRECTORY) && path_len > TERM_WIDTH - (w + 1 + 2))
|
||||
{
|
||||
snprintf(tmp, sizeof(tmp), "%.*s...%s", TERM_WIDTH - (w + 1 + 2) - 8, path, &path[path_len - 5]);
|
||||
entry_title = tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
entry_title = path;
|
||||
}
|
||||
|
||||
snprintf(message, sizeof(message), "%c %-*.*s %-*s\n",
|
||||
i == rgui->directory_ptr ? '>' : ' ',
|
||||
TERM_WIDTH - (w + 1 + 2),
|
||||
path,
|
||||
TERM_WIDTH - (w + 1 + 2), TERM_WIDTH - (w + 1 + 2),
|
||||
entry_title,
|
||||
w,
|
||||
type_str);
|
||||
|
||||
blit_line(rgui, x, y, message, i == rgui->directory_ptr);
|
||||
}
|
||||
|
||||
render_messagebox(rgui, msg_queue_pull(g_extern.msg_queue));
|
||||
const char *message_queue;
|
||||
#ifdef GEKKO
|
||||
gx_video_t *gx = (gx_video_t*)driver.video_data;
|
||||
if (rgui->msg_force)
|
||||
{
|
||||
message_queue = msg_queue_pull(g_extern.msg_queue);
|
||||
rgui->msg_force = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
message_queue = gx->msg;
|
||||
}
|
||||
#else
|
||||
message_queue = msg_queue_pull(g_extern.msg_queue);
|
||||
#endif
|
||||
render_messagebox(rgui, message_queue);
|
||||
}
|
||||
|
||||
#ifdef GEKKO
|
||||
#define MAX_GAMMA_SETTING 2
|
||||
#else
|
||||
#define MAX_GAMMA_SETTING 1
|
||||
#endif
|
||||
|
||||
static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t action, rgui_file_type_t menu_type)
|
||||
{
|
||||
unsigned port = menu_type - RGUI_SETTINGS_CONTROLLER_1;
|
||||
|
||||
switch (setting)
|
||||
{
|
||||
case RGUI_SETTINGS_SAVESTATE_SAVE:
|
||||
case RGUI_SETTINGS_SAVESTATE_LOAD:
|
||||
if (action == RGUI_ACTION_OK)
|
||||
{
|
||||
if (setting == RGUI_SETTINGS_SAVESTATE_SAVE)
|
||||
rarch_save_state();
|
||||
else
|
||||
rarch_load_state();
|
||||
rarch_settings_change(S_RETURN_TO_GAME);
|
||||
}
|
||||
else if (action == RGUI_ACTION_START)
|
||||
rarch_settings_default(S_DEF_SAVE_STATE);
|
||||
else if (action == RGUI_ACTION_LEFT)
|
||||
rarch_settings_change(S_SAVESTATE_DECREMENT);
|
||||
else if (action == RGUI_ACTION_RIGHT)
|
||||
rarch_settings_change(S_SAVESTATE_INCREMENT);
|
||||
break;
|
||||
case RGUI_SETTINGS_SCREENSHOT:
|
||||
if (action == RGUI_ACTION_OK)
|
||||
{
|
||||
const uint16_t *data = (const uint16_t*)g_extern.frame_cache.data;
|
||||
unsigned width = g_extern.frame_cache.width;
|
||||
unsigned height = g_extern.frame_cache.height;
|
||||
int pitch = g_extern.frame_cache.pitch;
|
||||
|
||||
// Negative pitch is needed as screenshot takes bottom-up,
|
||||
// but we use top-down.
|
||||
bool r = screenshot_dump(default_paths.port_dir,
|
||||
data + (height - 1) * (pitch >> 1),
|
||||
width, height, -pitch, false);
|
||||
|
||||
msg_queue_push(g_extern.msg_queue, r ? "Screenshot saved" : "Screenshot failed to save", 1, S_DELAY_90);
|
||||
}
|
||||
break;
|
||||
case RGUI_SETTINGS_RESTART_GAME:
|
||||
if (action == RGUI_ACTION_OK)
|
||||
{
|
||||
rarch_settings_change(S_RETURN_TO_GAME);
|
||||
rarch_game_reset();
|
||||
}
|
||||
break;
|
||||
case RGUI_SETTINGS_VIDEO_FILTER:
|
||||
if (action == RGUI_ACTION_START)
|
||||
rarch_settings_default(S_DEF_HW_TEXTURE_FILTER);
|
||||
else
|
||||
rarch_settings_change(S_HW_TEXTURE_FILTER);
|
||||
break;
|
||||
#ifdef HW_RVL
|
||||
case RGUI_SETTINGS_VIDEO_SOFT_FILTER:
|
||||
{
|
||||
g_console.soft_display_filter_enable = !g_console.soft_display_filter_enable;
|
||||
driver.video->apply_state_changes();
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#ifdef GEKKO
|
||||
case RGUI_SETTINGS_VIDEO_RESOLUTION:
|
||||
if (action == RGUI_ACTION_LEFT)
|
||||
{
|
||||
if(rgui_current_gx_resolution > 0)
|
||||
{
|
||||
rgui_current_gx_resolution--;
|
||||
gx_set_video_mode(rgui_gx_resolutions[rgui_current_gx_resolution][0], rgui_gx_resolutions[rgui_current_gx_resolution][1]);
|
||||
}
|
||||
}
|
||||
else if (action == RGUI_ACTION_RIGHT)
|
||||
{
|
||||
if(rgui_current_gx_resolution < GX_RESOLUTIONS_LAST - 1)
|
||||
{
|
||||
rgui_current_gx_resolution++;
|
||||
gx_set_video_mode(rgui_gx_resolutions[rgui_current_gx_resolution][0], rgui_gx_resolutions[rgui_current_gx_resolution][1]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case RGUI_SETTINGS_VIDEO_GAMMA:
|
||||
if (action == RGUI_ACTION_START)
|
||||
{
|
||||
g_console.gamma_correction = 0;
|
||||
driver.video->apply_state_changes();
|
||||
}
|
||||
else if (action == RGUI_ACTION_LEFT)
|
||||
{
|
||||
if(g_console.gamma_correction > 0)
|
||||
{
|
||||
g_console.gamma_correction--;
|
||||
driver.video->apply_state_changes();
|
||||
}
|
||||
}
|
||||
else if (action == RGUI_ACTION_RIGHT)
|
||||
{
|
||||
if(g_console.gamma_correction < MAX_GAMMA_SETTING)
|
||||
{
|
||||
g_console.gamma_correction++;
|
||||
driver.video->apply_state_changes();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case RGUI_SETTINGS_VIDEO_ASPECT_RATIO:
|
||||
if (action == RGUI_ACTION_START)
|
||||
rarch_settings_default(S_DEF_ASPECT_RATIO);
|
||||
else if (action == RGUI_ACTION_LEFT)
|
||||
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);
|
||||
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);
|
||||
}
|
||||
else if (action == RGUI_ACTION_LEFT)
|
||||
{
|
||||
rarch_settings_change(S_ROTATION_DECREMENT);
|
||||
video_set_rotation_func(g_console.screen_orientation);
|
||||
}
|
||||
else if (action == RGUI_ACTION_RIGHT)
|
||||
{
|
||||
rarch_settings_change(S_ROTATION_INCREMENT);
|
||||
video_set_rotation_func(g_console.screen_orientation);
|
||||
}
|
||||
break;
|
||||
case RGUI_SETTINGS_VIDEO_OVERSCAN:
|
||||
if (action == RGUI_ACTION_START)
|
||||
{
|
||||
rarch_settings_default(S_DEF_OVERSCAN);
|
||||
driver.video->apply_state_changes();
|
||||
}
|
||||
else if (action == RGUI_ACTION_LEFT)
|
||||
{
|
||||
rarch_settings_change(S_OVERSCAN_DECREMENT);
|
||||
driver.video->apply_state_changes();
|
||||
}
|
||||
else if (action == RGUI_ACTION_RIGHT)
|
||||
{
|
||||
rarch_settings_change(S_OVERSCAN_INCREMENT);
|
||||
driver.video->apply_state_changes();
|
||||
}
|
||||
break;
|
||||
case RGUI_SETTINGS_AUDIO_MUTE:
|
||||
if (action == RGUI_ACTION_START)
|
||||
rarch_settings_default(S_DEF_AUDIO_MUTE);
|
||||
@ -396,24 +671,33 @@ static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t
|
||||
else if (action == RGUI_ACTION_RIGHT)
|
||||
rarch_settings_change(S_AUDIO_CONTROL_RATE_INCREMENT);
|
||||
break;
|
||||
|
||||
/*case RGUI_SETTINGS_CORE:
|
||||
{
|
||||
// !!JUST FOR TESTING!!
|
||||
char boot_dol[PATH_MAX];
|
||||
char temp_dol[PATH_MAX];
|
||||
char temp2_dol[PATH_MAX];
|
||||
|
||||
snprintf(boot_dol, sizeof(boot_dol), "%s%s", app_dir, "boot.dol");
|
||||
snprintf(temp_dol, sizeof(temp_dol), "%s%s", app_dir, "temp.dol");
|
||||
snprintf(temp2_dol, sizeof(temp2_dol), "%s%s", app_dir, "temp2.dol");
|
||||
|
||||
rename(boot_dol, temp2_dol);
|
||||
rename(temp_dol, boot_dol);
|
||||
rename(temp2_dol, temp_dol);
|
||||
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++;
|
||||
break;
|
||||
case RGUI_SETTINGS_DEBUG_TEXT:
|
||||
if (action == RGUI_ACTION_START || action == RGUI_ACTION_LEFT)
|
||||
g_console.fps_info_msg_enable = false;
|
||||
else if (action == RGUI_ACTION_RIGHT)
|
||||
g_console.fps_info_msg_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);
|
||||
#endif
|
||||
rarch_settings_change(S_RETURN_TO_LAUNCHER);
|
||||
}
|
||||
break;
|
||||
case RGUI_SETTINGS_QUIT_EMULATOR:
|
||||
if (action == RGUI_ACTION_OK)
|
||||
rarch_settings_change(S_QUIT);
|
||||
break;
|
||||
}*/
|
||||
|
||||
// controllers
|
||||
case RGUI_SETTINGS_BIND_DEVICE:
|
||||
g_settings.input.device[port] += RARCH_DEVICE_LAST;
|
||||
@ -424,9 +708,20 @@ static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t
|
||||
else if (action == RGUI_ACTION_RIGHT)
|
||||
g_settings.input.device[port]++;
|
||||
g_settings.input.device[port] %= RARCH_DEVICE_LAST;
|
||||
input_wii.set_default_keybind_lut(g_settings.input.device[port], port);
|
||||
input_gx.set_default_keybind_lut(g_settings.input.device[port], port);
|
||||
rarch_input_set_default_keybinds(port);
|
||||
input_wii.set_analog_dpad_mapping(g_settings.input.device[port], g_settings.input.dpad_emulation[port], port);
|
||||
input_gx.set_analog_dpad_mapping(g_settings.input.device[port], g_settings.input.dpad_emulation[port], port);
|
||||
break;
|
||||
case RGUI_SETTINGS_BIND_DPAD_EMULATION:
|
||||
g_settings.input.dpad_emulation[port] += DPAD_EMULATION_LAST;
|
||||
if (action == RGUI_ACTION_START)
|
||||
g_settings.input.dpad_emulation[port] = DPAD_EMULATION_LSTICK;
|
||||
else if (action == RGUI_ACTION_LEFT)
|
||||
g_settings.input.dpad_emulation[port]--;
|
||||
else if (action == RGUI_ACTION_RIGHT)
|
||||
g_settings.input.dpad_emulation[port]++;
|
||||
g_settings.input.dpad_emulation[port] %= DPAD_EMULATION_LAST;
|
||||
input_gx.set_analog_dpad_mapping(g_settings.input.device[port], g_settings.input.dpad_emulation[port], port);
|
||||
break;
|
||||
case RGUI_SETTINGS_BIND_UP:
|
||||
case RGUI_SETTINGS_BIND_DOWN:
|
||||
@ -469,14 +764,36 @@ static void rgui_settings_populate_entries(rgui_handle_t *rgui)
|
||||
{
|
||||
rgui_list_clear(rgui->folder_buf);
|
||||
|
||||
if (g_console.ingame_menu_enable)
|
||||
{
|
||||
RGUI_MENU_ITEM("Save State", RGUI_SETTINGS_SAVESTATE_SAVE);
|
||||
RGUI_MENU_ITEM("Load State", RGUI_SETTINGS_SAVESTATE_LOAD);
|
||||
RGUI_MENU_ITEM("Take Screenshot", RGUI_SETTINGS_SCREENSHOT);
|
||||
RGUI_MENU_ITEM("Restart Game", RGUI_SETTINGS_RESTART_GAME);
|
||||
}
|
||||
RGUI_MENU_ITEM("Hardware filtering", RGUI_SETTINGS_VIDEO_FILTER);
|
||||
#ifdef HW_RVL
|
||||
RGUI_MENU_ITEM("VI Trap filtering", RGUI_SETTINGS_VIDEO_SOFT_FILTER);
|
||||
#endif
|
||||
#ifdef GEKKO
|
||||
RGUI_MENU_ITEM("Screen Resolution", RGUI_SETTINGS_VIDEO_RESOLUTION);
|
||||
#endif
|
||||
RGUI_MENU_ITEM("Gamma", RGUI_SETTINGS_VIDEO_GAMMA);
|
||||
RGUI_MENU_ITEM("Aspect Ratio", RGUI_SETTINGS_VIDEO_ASPECT_RATIO);
|
||||
RGUI_MENU_ITEM("Custom Ratio", RGUI_SETTINGS_CUSTOM_VIEWPORT);
|
||||
RGUI_MENU_ITEM("Overscan", RGUI_SETTINGS_VIDEO_OVERSCAN);
|
||||
RGUI_MENU_ITEM("Rotation", RGUI_SETTINGS_VIDEO_ROTATION);
|
||||
RGUI_MENU_ITEM("Mute Audio", RGUI_SETTINGS_AUDIO_MUTE);
|
||||
RGUI_MENU_ITEM("Audio Control Rate", RGUI_SETTINGS_AUDIO_CONTROL_RATE);
|
||||
RGUI_MENU_ITEM("Zip Extract Directory", RGUI_SETTINGS_ZIP_EXTRACT);
|
||||
RGUI_MENU_ITEM("Core", RGUI_SETTINGS_CORE);
|
||||
RGUI_MENU_ITEM("Controller #1 Config", RGUI_SETTINGS_CONTROLLER_1);
|
||||
RGUI_MENU_ITEM("Controller #2 Config", RGUI_SETTINGS_CONTROLLER_2);
|
||||
RGUI_MENU_ITEM("Controller #3 Config", RGUI_SETTINGS_CONTROLLER_3);
|
||||
RGUI_MENU_ITEM("Controller #4 Config", RGUI_SETTINGS_CONTROLLER_4);
|
||||
RGUI_MENU_ITEM("Debug Text", RGUI_SETTINGS_DEBUG_TEXT);
|
||||
RGUI_MENU_ITEM("Restart RetroArch", RGUI_SETTINGS_RESTART_EMULATOR);
|
||||
RGUI_MENU_ITEM("Exit RetroArch", RGUI_SETTINGS_QUIT_EMULATOR);
|
||||
}
|
||||
|
||||
static void rgui_settings_controller_populate_entries(rgui_handle_t *rgui)
|
||||
@ -484,6 +801,7 @@ static void rgui_settings_controller_populate_entries(rgui_handle_t *rgui)
|
||||
rgui_list_clear(rgui->folder_buf);
|
||||
|
||||
RGUI_MENU_ITEM("Device", RGUI_SETTINGS_BIND_DEVICE);
|
||||
RGUI_MENU_ITEM("DPad Emulation", RGUI_SETTINGS_BIND_DPAD_EMULATION);
|
||||
RGUI_MENU_ITEM("Up", RGUI_SETTINGS_BIND_UP);
|
||||
RGUI_MENU_ITEM("Down", RGUI_SETTINGS_BIND_DOWN);
|
||||
RGUI_MENU_ITEM("Left", RGUI_SETTINGS_BIND_LEFT);
|
||||
@ -502,16 +820,144 @@ static void rgui_settings_controller_populate_entries(rgui_handle_t *rgui)
|
||||
RGUI_MENU_ITEM("R3", RGUI_SETTINGS_BIND_R3);
|
||||
}
|
||||
|
||||
static const char *rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
||||
|
||||
void rgui_viewport_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
||||
{
|
||||
#ifdef GEKKO
|
||||
gx_video_t *gx = (gx_video_t*)driver.video_data;
|
||||
#endif
|
||||
rgui_file_type_t menu_type = 0;
|
||||
rgui_list_back(rgui->path_stack, NULL, &menu_type, NULL);
|
||||
|
||||
switch (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;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_console.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;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_console.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;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_console.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;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_console.viewports.custom_vp.width += 1;
|
||||
}
|
||||
driver.video->apply_state_changes();
|
||||
break;
|
||||
|
||||
case RGUI_ACTION_CANCEL:
|
||||
if (menu_type == RGUI_SETTINGS_CUSTOM_VIEWPORT_2)
|
||||
{
|
||||
rgui_list_pop(rgui->path_stack);
|
||||
rgui_list_push(rgui->path_stack, "", RGUI_SETTINGS_CUSTOM_VIEWPORT, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
rgui_list_pop(rgui->path_stack);
|
||||
}
|
||||
break;
|
||||
|
||||
case RGUI_ACTION_OK:
|
||||
if (menu_type == RGUI_SETTINGS_CUSTOM_VIEWPORT)
|
||||
{
|
||||
rgui_list_pop(rgui->path_stack);
|
||||
rgui_list_push(rgui->path_stack, "", RGUI_SETTINGS_CUSTOM_VIEWPORT_2, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
rgui_list_pop(rgui->path_stack);
|
||||
}
|
||||
break;
|
||||
|
||||
case RGUI_ACTION_START:
|
||||
#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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
#endif
|
||||
driver.video->apply_state_changes();
|
||||
break;
|
||||
|
||||
case RGUI_ACTION_SETTINGS:
|
||||
rgui_list_pop(rgui->path_stack);
|
||||
break;
|
||||
|
||||
case RGUI_ACTION_MESSAGE:
|
||||
rgui->msg_force = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
rgui_list_back(rgui->path_stack, NULL, &menu_type, NULL);
|
||||
|
||||
render_text(rgui);
|
||||
|
||||
if (menu_type == RGUI_SETTINGS_CUSTOM_VIEWPORT)
|
||||
render_messagebox(rgui, "Set Upper-Left Corner");
|
||||
else if (menu_type == RGUI_SETTINGS_CUSTOM_VIEWPORT_2)
|
||||
render_messagebox(rgui, "Set Bottom-Right Corner");
|
||||
}
|
||||
|
||||
void rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
||||
{
|
||||
rgui->frame_buf_pitch = RGUI_WIDTH * 2;
|
||||
rgui_file_type_t type = 0;
|
||||
const char *label = 0;
|
||||
rgui_list_at(rgui->folder_buf, rgui->directory_ptr, &label, &type, NULL);
|
||||
if (type == RGUI_SETTINGS_CORE)
|
||||
label = app_dir;
|
||||
label = default_paths.core_dir;
|
||||
const char *dir = 0;
|
||||
rgui_file_type_t menu_type = 0;
|
||||
size_t directory_ptr;
|
||||
size_t directory_ptr = 0;
|
||||
rgui_list_back(rgui->path_stack, &dir, &menu_type, &directory_ptr);
|
||||
|
||||
if (rgui->need_refresh)
|
||||
@ -535,12 +981,10 @@ static const char *rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t acti
|
||||
|
||||
case RGUI_ACTION_CANCEL:
|
||||
case RGUI_ACTION_SETTINGS:
|
||||
{
|
||||
rgui_list_pop(rgui->path_stack);
|
||||
rgui->directory_ptr = directory_ptr;
|
||||
rgui->need_refresh = true;
|
||||
break;
|
||||
}
|
||||
|
||||
case RGUI_ACTION_LEFT:
|
||||
case RGUI_ACTION_RIGHT:
|
||||
@ -552,6 +996,12 @@ static const char *rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t acti
|
||||
rgui->directory_ptr = 0;
|
||||
rgui->need_refresh = true;
|
||||
}
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
rgui_settings_toggle_setting(type, action, menu_type);
|
||||
@ -563,13 +1013,17 @@ static const char *rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t acti
|
||||
rgui->need_refresh = true;
|
||||
break;
|
||||
|
||||
case RGUI_ACTION_MESSAGE:
|
||||
rgui->msg_force = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
rgui_list_back(rgui->path_stack, &dir, &menu_type, &directory_ptr);
|
||||
|
||||
if (rgui->need_refresh && !rgui_is_filebrowser_menu(menu_type))
|
||||
if (rgui->need_refresh && !(menu_type == RGUI_FILE_DIRECTORY || menu_type == RGUI_FILE_DEVICE || menu_type == RGUI_SETTINGS_CORE))
|
||||
{
|
||||
rgui->need_refresh = false;
|
||||
if (rgui_is_controller_menu(menu_type))
|
||||
@ -580,23 +1034,21 @@ static const char *rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t acti
|
||||
|
||||
render_text(rgui);
|
||||
|
||||
return NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
const char *rgui_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
||||
void rgui_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
||||
{
|
||||
bool found = false;
|
||||
const char *dir = 0;
|
||||
rgui_file_type_t menu_type = 0;
|
||||
size_t directory_ptr;
|
||||
size_t directory_ptr = 0;
|
||||
rgui_list_back(rgui->path_stack, &dir, &menu_type, &directory_ptr);
|
||||
|
||||
if (menu_type == RGUI_SETTINGS || rgui_is_controller_menu(menu_type))
|
||||
{
|
||||
return rgui_settings_iterate(rgui, action);
|
||||
}
|
||||
|
||||
if (rgui->need_refresh)
|
||||
else if (rgui_is_viewport_menu(menu_type))
|
||||
return rgui_viewport_iterate(rgui, action);
|
||||
if (rgui->need_refresh && action != RGUI_ACTION_MESSAGE)
|
||||
action = RGUI_ACTION_NOOP;
|
||||
|
||||
switch (action)
|
||||
@ -641,7 +1093,7 @@ const char *rgui_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
||||
case RGUI_ACTION_OK:
|
||||
{
|
||||
if (rgui_list_size(rgui->folder_buf) == 0)
|
||||
return NULL;
|
||||
return;
|
||||
|
||||
const char *path = 0;
|
||||
rgui_file_type_t type = 0;
|
||||
@ -674,7 +1126,7 @@ const char *rgui_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
||||
{
|
||||
if (menu_type == RGUI_SETTINGS_CORE)
|
||||
{
|
||||
// CORE SWITCHING CODE GOES HERE
|
||||
strlcpy(g_settings.libretro, path, sizeof(g_settings.libretro));
|
||||
rgui->directory_ptr = directory_ptr;
|
||||
rgui->need_refresh = true;
|
||||
rgui_list_pop(rgui->path_stack);
|
||||
@ -684,7 +1136,8 @@ const char *rgui_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
||||
{
|
||||
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);
|
||||
found = true;
|
||||
rgui->need_refresh = true; // in case of zip extract
|
||||
rgui->msg_force = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -709,6 +1162,10 @@ const char *rgui_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
||||
}
|
||||
return rgui_settings_iterate(rgui, RGUI_ACTION_REFRESH);
|
||||
|
||||
case RGUI_ACTION_MESSAGE:
|
||||
rgui->msg_force = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -716,7 +1173,7 @@ const char *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 && rgui_is_filebrowser_menu(menu_type))
|
||||
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)
|
||||
{
|
||||
rgui->need_refresh = false;
|
||||
rgui_list_clear(rgui->folder_buf);
|
||||
@ -729,7 +1186,4 @@ const char *rgui_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
||||
}
|
||||
|
||||
render_text(rgui);
|
||||
|
||||
return found ? rgui->path_buf : NULL;
|
||||
}
|
||||
|
@ -33,16 +33,37 @@ typedef enum
|
||||
RGUI_SETTINGS,
|
||||
|
||||
// settings options are done here too
|
||||
RGUI_SETTINGS_SAVESTATE_SAVE,
|
||||
RGUI_SETTINGS_SAVESTATE_LOAD,
|
||||
RGUI_SETTINGS_SCREENSHOT,
|
||||
RGUI_SETTINGS_RESTART_GAME,
|
||||
RGUI_SETTINGS_VIDEO_FILTER,
|
||||
#ifdef HW_RVL
|
||||
RGUI_SETTINGS_VIDEO_SOFT_FILTER,
|
||||
#endif
|
||||
#ifdef GEKKO
|
||||
RGUI_SETTINGS_VIDEO_RESOLUTION,
|
||||
#endif
|
||||
RGUI_SETTINGS_VIDEO_GAMMA,
|
||||
RGUI_SETTINGS_VIDEO_ASPECT_RATIO,
|
||||
RGUI_SETTINGS_CUSTOM_VIEWPORT,
|
||||
RGUI_SETTINGS_CUSTOM_VIEWPORT_2,
|
||||
RGUI_SETTINGS_VIDEO_OVERSCAN,
|
||||
RGUI_SETTINGS_VIDEO_ROTATION,
|
||||
RGUI_SETTINGS_AUDIO_MUTE,
|
||||
RGUI_SETTINGS_AUDIO_CONTROL_RATE,
|
||||
RGUI_SETTINGS_ZIP_EXTRACT,
|
||||
RGUI_SETTINGS_CORE,
|
||||
RGUI_SETTINGS_CONTROLLER_1,
|
||||
RGUI_SETTINGS_CONTROLLER_2,
|
||||
RGUI_SETTINGS_CONTROLLER_3,
|
||||
RGUI_SETTINGS_CONTROLLER_4,
|
||||
RGUI_SETTINGS_DEBUG_TEXT,
|
||||
RGUI_SETTINGS_RESTART_EMULATOR,
|
||||
RGUI_SETTINGS_QUIT_EMULATOR,
|
||||
|
||||
RGUI_SETTINGS_BIND_DEVICE,
|
||||
RGUI_SETTINGS_BIND_DPAD_EMULATION,
|
||||
RGUI_SETTINGS_BIND_UP,
|
||||
RGUI_SETTINGS_BIND_DOWN,
|
||||
RGUI_SETTINGS_BIND_LEFT,
|
||||
@ -72,6 +93,7 @@ typedef enum
|
||||
RGUI_ACTION_REFRESH,
|
||||
RGUI_ACTION_SETTINGS,
|
||||
RGUI_ACTION_START,
|
||||
RGUI_ACTION_MESSAGE,
|
||||
RGUI_ACTION_NOOP
|
||||
} rgui_action_t;
|
||||
|
||||
@ -82,15 +104,15 @@ typedef void (*rgui_file_enum_cb_t)(void *ctx,
|
||||
typedef bool (*rgui_folder_enum_cb_t)(const char *directory,
|
||||
rgui_file_enum_cb_t file_cb, void *userdata, void *ctx);
|
||||
|
||||
#define RGUI_WIDTH 320
|
||||
#define RGUI_HEIGHT 240
|
||||
extern unsigned RGUI_WIDTH;
|
||||
extern unsigned RGUI_HEIGHT;
|
||||
|
||||
rgui_handle_t *rgui_init(const char *base_path,
|
||||
uint16_t *framebuf, size_t framebuf_pitch,
|
||||
const uint8_t *font_buf,
|
||||
const uint8_t *font_bmp_buf, uint8_t *font_bin_buf,
|
||||
rgui_folder_enum_cb_t folder_cb, void *userdata);
|
||||
|
||||
const char *rgui_iterate(rgui_handle_t *rgui, rgui_action_t action);
|
||||
void rgui_iterate(rgui_handle_t *rgui, rgui_action_t action);
|
||||
|
||||
void rgui_free(rgui_handle_t *rgui);
|
||||
|
190
console/rmenu/context/rmenu_ctx_ps3.c
Normal file
190
console/rmenu/context/rmenu_ctx_ps3.c
Normal file
@ -0,0 +1,190 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2012 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* 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.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if defined(__CELLOS_LV2__)
|
||||
#include <sdk_version.h>
|
||||
#include <sysutil/sysutil_screenshot.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYSUTILS
|
||||
#include <cell/sysmodule.h>
|
||||
#endif
|
||||
|
||||
#include "../rmenu.h"
|
||||
#include "../../../gfx/context/ps3_ctx.h"
|
||||
|
||||
#define HARDCODE_FONT_SIZE 0.91f
|
||||
#define POSITION_X 0.09f
|
||||
#define POSITION_X_CENTER 0.5f
|
||||
#define POSITION_Y_START 0.17f
|
||||
#define POSITION_Y_INCREMENT 0.035f
|
||||
#define POSITION_Y_BEGIN (POSITION_Y_START + POSITION_Y_INCREMENT)
|
||||
#define COMMENT_TWO_Y_POSITION 0.91f
|
||||
#define COMMENT_Y_POSITION 0.82f
|
||||
|
||||
#define MSG_QUEUE_X_POSITION g_settings.video.msg_pos_x
|
||||
#define MSG_QUEUE_Y_POSITION 0.76f
|
||||
#define MSG_QUEUE_FONT_SIZE 1.03f
|
||||
|
||||
#define MSG_PREV_NEXT_Y_POSITION 0.03f
|
||||
#define CURRENT_PATH_Y_POSITION 0.15f
|
||||
#define CURRENT_PATH_FONT_SIZE FONT_SIZE
|
||||
|
||||
#define FONT_SIZE (g_console.menu_font_size)
|
||||
|
||||
#define NUM_ENTRY_PER_PAGE 15
|
||||
|
||||
#define DRIVE_MAPPING_SIZE 4
|
||||
|
||||
const char drive_mappings[DRIVE_MAPPING_SIZE][32] = {
|
||||
"/app_home/",
|
||||
"/dev_hdd0/",
|
||||
"/dev_hdd1/",
|
||||
"/host_root/"
|
||||
};
|
||||
|
||||
unsigned char drive_mapping_idx = 1;
|
||||
|
||||
static void rmenu_ctx_ps3_clear(void)
|
||||
{
|
||||
gfx_ctx_clear();
|
||||
}
|
||||
|
||||
static void rmenu_ctx_ps3_blend(bool enable)
|
||||
{
|
||||
gfx_ctx_set_blend(enable);
|
||||
}
|
||||
|
||||
static void rmenu_ctx_ps3_init_textures(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void rmenu_ctx_ps3_free_textures(void)
|
||||
{
|
||||
gl_t *gl = driver.video_data;
|
||||
gl->menu_render = false;
|
||||
}
|
||||
|
||||
static void rmenu_ctx_ps3_render_selection_panel(rmenu_position_t *position)
|
||||
{
|
||||
(void)position;
|
||||
}
|
||||
|
||||
static void rmenu_ctx_ps3_render_bg(rmenu_position_t *position)
|
||||
{
|
||||
(void)position;
|
||||
}
|
||||
|
||||
static void rmenu_ctx_ps3_swap_buffers(void)
|
||||
{
|
||||
gfx_ctx_swap_buffers();
|
||||
#ifdef HAVE_SYSUTILS
|
||||
cellSysutilCheckCallback();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void rmenu_ctx_ps3_set_default_pos(rmenu_default_positions_t *position)
|
||||
{
|
||||
position->x_position = POSITION_X;
|
||||
position->x_position_center = POSITION_X_CENTER;
|
||||
position->y_position = POSITION_Y_BEGIN;
|
||||
position->comment_y_position = COMMENT_Y_POSITION;
|
||||
position->y_position_increment = POSITION_Y_INCREMENT;
|
||||
position->starting_y_position = POSITION_Y_START;
|
||||
position->comment_two_y_position = COMMENT_TWO_Y_POSITION;
|
||||
position->font_size = HARDCODE_FONT_SIZE;
|
||||
position->msg_queue_x_position = MSG_QUEUE_X_POSITION;
|
||||
position->msg_queue_y_position = MSG_QUEUE_Y_POSITION;
|
||||
position->msg_queue_font_size= MSG_QUEUE_FONT_SIZE;
|
||||
position->msg_prev_next_y_position = MSG_PREV_NEXT_Y_POSITION;
|
||||
position->current_path_font_size = CURRENT_PATH_FONT_SIZE;
|
||||
position->current_path_y_position = CURRENT_PATH_Y_POSITION;
|
||||
position->variable_font_size = FONT_SIZE;
|
||||
position->entries_per_page = NUM_ENTRY_PER_PAGE;
|
||||
position->core_msg_x_position = 0.3f;
|
||||
position->core_msg_y_position = 0.06f;
|
||||
position->core_msg_font_size = COMMENT_Y_POSITION;
|
||||
}
|
||||
|
||||
static void rmenu_ctx_ps3_render_msg(float xpos, float ypos, float scale, unsigned color, const char *msg, ...)
|
||||
{
|
||||
gl_t *gl = driver.video_data;
|
||||
|
||||
gl_render_msg_place(gl, xpos, ypos, scale, color, msg);
|
||||
}
|
||||
|
||||
static void rmenu_ctx_ps3_render_menu_enable(bool enable)
|
||||
{
|
||||
gl_t *gl = driver.video_data;
|
||||
gl->menu_render = enable;
|
||||
}
|
||||
|
||||
static void rmenu_ctx_ps3_screenshot_enable(bool enable)
|
||||
{
|
||||
#if(CELL_SDK_VERSION > 0x340000)
|
||||
if(enable)
|
||||
{
|
||||
cellSysmoduleLoadModule(CELL_SYSMODULE_SYSUTIL_SCREENSHOT);
|
||||
CellScreenShotSetParam screenshot_param = {0, 0, 0, 0};
|
||||
|
||||
screenshot_param.photo_title = "RetroArch PS3";
|
||||
screenshot_param.game_title = "RetroArch PS3";
|
||||
cellScreenShotSetParameter (&screenshot_param);
|
||||
cellScreenShotEnable();
|
||||
}
|
||||
else
|
||||
{
|
||||
cellScreenShotDisable();
|
||||
cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_SCREENSHOT);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void rmenu_ctx_ps3_screenshot_dump(void *data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static const char * rmenu_ctx_ps3_drive_mapping_previous(void)
|
||||
{
|
||||
if(drive_mapping_idx > 0)
|
||||
drive_mapping_idx--;
|
||||
return drive_mappings[drive_mapping_idx];
|
||||
}
|
||||
|
||||
static const char * rmenu_ctx_ps3_drive_mapping_next(void)
|
||||
{
|
||||
if((drive_mapping_idx + 1) < DRIVE_MAPPING_SIZE)
|
||||
drive_mapping_idx++;
|
||||
return drive_mappings[drive_mapping_idx];
|
||||
}
|
||||
|
||||
const rmenu_context_t rmenu_ctx_ps3 = {
|
||||
.clear = rmenu_ctx_ps3_clear,
|
||||
.blend = rmenu_ctx_ps3_blend,
|
||||
.free_textures = rmenu_ctx_ps3_free_textures,
|
||||
.init_textures = rmenu_ctx_ps3_init_textures,
|
||||
.render_selection_panel = rmenu_ctx_ps3_render_selection_panel,
|
||||
.render_bg = rmenu_ctx_ps3_render_bg,
|
||||
.render_menu_enable = rmenu_ctx_ps3_render_menu_enable,
|
||||
.render_msg = rmenu_ctx_ps3_render_msg,
|
||||
.screenshot_enable = rmenu_ctx_ps3_screenshot_enable,
|
||||
.screenshot_dump = rmenu_ctx_ps3_screenshot_dump,
|
||||
.swap_buffers = rmenu_ctx_ps3_swap_buffers,
|
||||
.set_default_pos = rmenu_ctx_ps3_set_default_pos,
|
||||
.drive_mapping_prev = rmenu_ctx_ps3_drive_mapping_previous,
|
||||
.drive_mapping_next = rmenu_ctx_ps3_drive_mapping_next,
|
||||
};
|
204
console/rmenu/context/rmenu_ctx_xdk.c
Normal file
204
console/rmenu/context/rmenu_ctx_xdk.c
Normal file
@ -0,0 +1,204 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2012 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* 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.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../rmenu.h"
|
||||
#include "../../screenshot.h"
|
||||
#include "../../gfx/context/xdk_ctx.h"
|
||||
|
||||
#define ROM_PANEL_WIDTH 510
|
||||
#define ROM_PANEL_HEIGHT 20
|
||||
|
||||
#define HARDCODE_FONT_SIZE 21
|
||||
|
||||
#define POSITION_X m_menuMainRomListPos_x
|
||||
#define POSITION_X_CENTER (m_menuMainRomListPos_x + 350)
|
||||
#define POSITION_Y_START m_menuMainRomListPos_y
|
||||
#define POSITION_Y_BEGIN (POSITION_Y_START + POSITION_Y_INCREMENT)
|
||||
#define POSITION_Y_INCREMENT 20
|
||||
#define COMMENT_Y_POSITION (ypos - ((POSITION_Y_INCREMENT/2) * 3))
|
||||
#define COMMENT_TWO_Y_POSITION (ypos - ((POSITION_Y_INCREMENT/2) * 1))
|
||||
|
||||
#define MSG_QUEUE_X_POSITION POSITION_X
|
||||
#define MSG_QUEUE_Y_POSITION (ypos - ((POSITION_Y_INCREMENT/2) * 7) + 5)
|
||||
#define MSG_QUEUE_FONT_SIZE HARDCODE_FONT_SIZE
|
||||
|
||||
#define MSG_PREV_NEXT_Y_POSITION 24
|
||||
|
||||
#define CURRENT_PATH_Y_POSITION (m_menuMainRomListPos_y - ((POSITION_Y_INCREMENT/2)))
|
||||
#define CURRENT_PATH_FONT_SIZE 21
|
||||
|
||||
#define FONT_SIZE 21
|
||||
|
||||
#define NUM_ENTRY_PER_PAGE 12
|
||||
|
||||
#define DRIVE_MAPPING_SIZE 5
|
||||
|
||||
const char drive_mappings[DRIVE_MAPPING_SIZE][32] = {
|
||||
"C:",
|
||||
"D:",
|
||||
"E:",
|
||||
"F:",
|
||||
"G:"
|
||||
};
|
||||
|
||||
unsigned char drive_mapping_idx = 2;
|
||||
|
||||
int xpos, ypos;
|
||||
texture_image m_menuMainRomSelectPanel;
|
||||
texture_image m_menuMainBG;
|
||||
|
||||
// Rom list coords
|
||||
int m_menuMainRomListPos_x;
|
||||
int m_menuMainRomListPos_y;
|
||||
|
||||
static void rmenu_ctx_xdk_clear(void)
|
||||
{
|
||||
gfx_ctx_clear();
|
||||
}
|
||||
|
||||
static void rmenu_ctx_xdk_blend(bool enable)
|
||||
{
|
||||
gfx_ctx_set_blend(enable);
|
||||
}
|
||||
|
||||
static void rmenu_ctx_xdk_free_textures(void)
|
||||
{
|
||||
texture_image_free(&m_menuMainBG);
|
||||
texture_image_free(&m_menuMainRomSelectPanel);
|
||||
}
|
||||
|
||||
static void rmenu_ctx_xdk_init_textures(void)
|
||||
{
|
||||
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
|
||||
|
||||
int width = d3d->d3dpp.BackBufferWidth;
|
||||
|
||||
// Load background image
|
||||
if(width == 640)
|
||||
{
|
||||
texture_image_load("D:\\Media\\main-menu_480p.png", &m_menuMainBG);
|
||||
m_menuMainRomListPos_x = 60;
|
||||
m_menuMainRomListPos_y = 80;
|
||||
}
|
||||
else if(width == 1280)
|
||||
{
|
||||
texture_image_load("D:\\Media\\main-menu_720p.png", &m_menuMainBG);
|
||||
m_menuMainRomListPos_x = 360;
|
||||
m_menuMainRomListPos_y = 130;
|
||||
}
|
||||
|
||||
// Load rom selector panel
|
||||
texture_image_load("D:\\Media\\menuMainRomSelectPanel.png", &m_menuMainRomSelectPanel);
|
||||
|
||||
//Display some text
|
||||
//Center the text (hardcoded)
|
||||
xpos = width == 640 ? 65 : 400;
|
||||
ypos = width == 640 ? 430 : 670;
|
||||
}
|
||||
|
||||
static void rmenu_ctx_xdk_render_selection_panel(rmenu_position_t *position)
|
||||
{
|
||||
m_menuMainRomSelectPanel.x = position->x;
|
||||
m_menuMainRomSelectPanel.y = position->y;
|
||||
m_menuMainRomSelectPanel.width = ROM_PANEL_WIDTH;
|
||||
m_menuMainRomSelectPanel.height = ROM_PANEL_HEIGHT;
|
||||
texture_image_render(&m_menuMainRomSelectPanel);
|
||||
}
|
||||
|
||||
static void rmenu_ctx_xdk_render_bg(rmenu_position_t *position)
|
||||
{
|
||||
m_menuMainBG.x = 0;
|
||||
m_menuMainBG.y = 0;
|
||||
texture_image_render(&m_menuMainBG);
|
||||
}
|
||||
|
||||
static void rmenu_ctx_xdk_swap_buffers(void)
|
||||
{
|
||||
gfx_ctx_swap_buffers();
|
||||
}
|
||||
|
||||
static void rmenu_ctx_xdk_set_default_pos(rmenu_default_positions_t *position)
|
||||
{
|
||||
position->x_position = POSITION_X;
|
||||
position->x_position_center = POSITION_X_CENTER;
|
||||
position->y_position = POSITION_Y_BEGIN;
|
||||
position->comment_y_position = COMMENT_Y_POSITION;
|
||||
position->y_position_increment = POSITION_Y_INCREMENT;
|
||||
position->starting_y_position = POSITION_Y_START;
|
||||
position->comment_two_y_position = COMMENT_TWO_Y_POSITION;
|
||||
position->font_size = HARDCODE_FONT_SIZE;
|
||||
position->msg_queue_x_position = MSG_QUEUE_X_POSITION;
|
||||
position->msg_queue_y_position = MSG_QUEUE_Y_POSITION;
|
||||
position->msg_queue_font_size= MSG_QUEUE_FONT_SIZE;
|
||||
position->msg_prev_next_y_position = MSG_PREV_NEXT_Y_POSITION;
|
||||
position->current_path_font_size = CURRENT_PATH_FONT_SIZE;
|
||||
position->current_path_y_position = CURRENT_PATH_Y_POSITION;
|
||||
position->variable_font_size = FONT_SIZE;
|
||||
position->entries_per_page = NUM_ENTRY_PER_PAGE;
|
||||
position->core_msg_x_position = position->x_position;
|
||||
position->core_msg_y_position = position->msg_prev_next_y_position + 0.01f;
|
||||
position->core_msg_font_size = position->font_size;
|
||||
}
|
||||
|
||||
static void rmenu_ctx_xdk_render_msg(float xpos, float ypos, float scale, unsigned color, const char *msg, ...)
|
||||
{
|
||||
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
|
||||
xfonts_render_msg_place(d3d, xpos, ypos, scale, msg);
|
||||
}
|
||||
|
||||
static void rmenu_ctx_xdk_render_menu_enable(bool enable)
|
||||
{
|
||||
}
|
||||
|
||||
static void rmenu_ctx_xdk_screenshot_enable(bool enable)
|
||||
{
|
||||
}
|
||||
|
||||
static void rmenu_ctx_xdk_screenshot_dump(void *data)
|
||||
{
|
||||
gfx_ctx_xdk_screenshot_dump(NULL);
|
||||
}
|
||||
|
||||
static const char * rmenu_ctx_xdk_drive_mapping_previous(void)
|
||||
{
|
||||
if(drive_mapping_idx > 0)
|
||||
drive_mapping_idx--;
|
||||
return drive_mappings[drive_mapping_idx];
|
||||
}
|
||||
|
||||
static const char * rmenu_ctx_xdk_drive_mapping_next(void)
|
||||
{
|
||||
if((drive_mapping_idx + 1) < DRIVE_MAPPING_SIZE)
|
||||
drive_mapping_idx++;
|
||||
return drive_mappings[drive_mapping_idx];
|
||||
}
|
||||
|
||||
const rmenu_context_t rmenu_ctx_xdk = {
|
||||
rmenu_ctx_xdk_clear,
|
||||
rmenu_ctx_xdk_blend,
|
||||
rmenu_ctx_xdk_free_textures,
|
||||
rmenu_ctx_xdk_init_textures,
|
||||
rmenu_ctx_xdk_render_selection_panel,
|
||||
rmenu_ctx_xdk_render_bg,
|
||||
rmenu_ctx_xdk_render_menu_enable,
|
||||
rmenu_ctx_xdk_render_msg,
|
||||
rmenu_ctx_xdk_screenshot_enable,
|
||||
rmenu_ctx_xdk_screenshot_dump,
|
||||
rmenu_ctx_xdk_swap_buffers,
|
||||
rmenu_ctx_xdk_set_default_pos,
|
||||
rmenu_ctx_xdk_drive_mapping_previous,
|
||||
rmenu_ctx_xdk_drive_mapping_next,
|
||||
};
|
BIN
console/rmenu/images/main-menu.xcf
Normal file
BIN
console/rmenu/images/main-menu.xcf
Normal file
Binary file not shown.
BIN
console/rmenu/images/main-menu_1080p.png
Normal file
BIN
console/rmenu/images/main-menu_1080p.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 43 KiB |
2392
console/rmenu/rmenu.c
Normal file
2392
console/rmenu/rmenu.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -14,50 +14,78 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef MENU_H_
|
||||
#define MENU_H_
|
||||
#ifndef _RMENU_H_
|
||||
#define _RMENU_H_
|
||||
|
||||
#if defined(__CELLOS_LV2__)
|
||||
#define DEVICE_CAST gl_t*
|
||||
#define input_ptr input_ps3
|
||||
#define DEVICE_PTR device_ptr
|
||||
#define FONT_SIZE (g_console.menu_font_size)
|
||||
#define render_msg_pre_func() gl_render_msg_pre(DEVICE_PTR)
|
||||
#define render_msg_place_func(xpos, ypos, scale, color, msg) gl_render_msg_place(xpos, ypos, scale, color, msg)
|
||||
#define render_msg_post_func() gl_render_msg_post(DEVICE_PTR)
|
||||
#define video_ptr video_gl
|
||||
|
||||
#elif defined(_XBOX1)
|
||||
#define DEVICE_CAST xdk_d3d_video_t*
|
||||
#define input_ptr input_xinput
|
||||
#define DEVICE_PTR device_ptr
|
||||
#define FONT_SIZE 0
|
||||
#define render_msg_pre_func() xfonts_render_msg_pre(DEVICE_PTR)
|
||||
#define render_msg_place_func(xpos, ypos, scale, color, msg) xfonts_render_msg_place(DEVICE_PTR, xpos, ypos, scale, msg)
|
||||
#define render_msg_post_func() xfonts_render_msg_post(DEVICE_PTR)
|
||||
#define video_ptr video_xdk_d3d
|
||||
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char enum_id; /* enum ID of item */
|
||||
char text[128]; /* item label */
|
||||
char setting_text[256]; /* setting label */
|
||||
float text_xpos; /* text X position (upper left corner) */
|
||||
float text_ypos; /* text Y position (upper left corner) */
|
||||
unsigned text_color; /* text color */
|
||||
char comment[256]; /* item comment */
|
||||
unsigned item_color; /* color of item */
|
||||
char text[64]; /* item label */
|
||||
char setting_text[64]; /* setting label */
|
||||
char comment[192]; /* item comment */
|
||||
unsigned char page; /* page */
|
||||
} item;
|
||||
|
||||
typedef struct
|
||||
typedef struct rmenu_position
|
||||
{
|
||||
char title[64];
|
||||
unsigned char enum_id;
|
||||
unsigned char selected;
|
||||
unsigned char page;
|
||||
unsigned char first_setting;
|
||||
unsigned char max_settings;
|
||||
unsigned char category_id;
|
||||
} menu;
|
||||
float x;
|
||||
float y;
|
||||
float width;
|
||||
float height;
|
||||
} rmenu_position_t;
|
||||
|
||||
typedef struct rmenu_default_positions
|
||||
{
|
||||
float x_position;
|
||||
float x_position_center;
|
||||
float y_position;
|
||||
float comment_y_position;
|
||||
float y_position_increment;
|
||||
float starting_y_position;
|
||||
float comment_two_y_position;
|
||||
float font_size;
|
||||
float msg_queue_x_position;
|
||||
float msg_queue_y_position;
|
||||
float msg_queue_font_size;
|
||||
float msg_prev_next_y_position;
|
||||
float current_path_font_size;
|
||||
float current_path_y_position;
|
||||
float variable_font_size;
|
||||
float core_msg_x_position;
|
||||
float core_msg_y_position;
|
||||
float core_msg_font_size;
|
||||
unsigned entries_per_page;
|
||||
} rmenu_default_positions_t;
|
||||
|
||||
typedef struct rmenu_context
|
||||
{
|
||||
void (*clear)(void);
|
||||
void (*blend)(bool enable);
|
||||
void (*free_textures)(void);
|
||||
void (*init_textures)(void);
|
||||
void (*render_selection_panel)(rmenu_position_t *position);
|
||||
void (*render_bg)(rmenu_position_t *position);
|
||||
void (*render_menu_enable)(bool enable);
|
||||
void (*render_msg)(float xpos, float ypos, float scale, unsigned color, const char *msg, ...);
|
||||
void (*screenshot_enable)(bool enable);
|
||||
void (*screenshot_dump)(void *data);
|
||||
void (*swap_buffers)(void);
|
||||
void (*set_default_pos)(rmenu_default_positions_t *position);
|
||||
const char * (*drive_mapping_prev)(void);
|
||||
const char * (*drive_mapping_next)(void);
|
||||
} rmenu_context_t;
|
||||
|
||||
enum
|
||||
{
|
||||
@ -82,7 +110,9 @@ enum
|
||||
LIBRETRO_CHOICE,
|
||||
PATH_SAVESTATES_DIR_CHOICE,
|
||||
PATH_DEFAULT_ROM_DIR_CHOICE,
|
||||
#ifdef HAVE_XML
|
||||
PATH_CHEATS_DIR_CHOICE,
|
||||
#endif
|
||||
PATH_SRAM_DIR_CHOICE,
|
||||
PATH_SYSTEM_DIR_CHOICE,
|
||||
INPUT_PRESET_CHOICE,
|
||||
@ -93,46 +123,68 @@ enum
|
||||
|
||||
enum
|
||||
{
|
||||
#ifdef __CELLOS_LV2__
|
||||
SETTING_CHANGE_RESOLUTION,
|
||||
#endif
|
||||
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
|
||||
SETTING_SHADER_PRESETS,
|
||||
SETTING_SHADER,
|
||||
SETTING_SHADER_2,
|
||||
#endif
|
||||
SETTING_FONT_SIZE,
|
||||
SETTING_KEEP_ASPECT_RATIO,
|
||||
SETTING_HW_TEXTURE_FILTER,
|
||||
#ifdef HAVE_FBO
|
||||
SETTING_HW_TEXTURE_FILTER_2,
|
||||
SETTING_SCALE_ENABLED,
|
||||
SETTING_SCALE_FACTOR,
|
||||
#endif
|
||||
#ifdef _XBOX1
|
||||
SETTING_FLICKER_FILTER,
|
||||
SETTING_SOFT_DISPLAY_FILTER,
|
||||
#endif
|
||||
SETTING_HW_OVERSCAN_AMOUNT,
|
||||
SETTING_THROTTLE_MODE,
|
||||
SETTING_TRIPLE_BUFFERING,
|
||||
SETTING_ENABLE_SCREENSHOTS,
|
||||
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
|
||||
SETTING_SAVE_SHADER_PRESET,
|
||||
SETTING_APPLY_SHADER_PRESET_ON_STARTUP,
|
||||
#endif
|
||||
SETTING_DEFAULT_VIDEO_ALL,
|
||||
SETTING_SOUND_MODE,
|
||||
#ifdef HAVE_RSOUND
|
||||
SETTING_RSOUND_SERVER_IP_ADDRESS,
|
||||
#endif
|
||||
SETTING_ENABLE_CUSTOM_BGM,
|
||||
SETTING_DEFAULT_AUDIO_ALL,
|
||||
SETTING_EMU_CURRENT_SAVE_STATE_SLOT,
|
||||
SETTING_EMU_SHOW_DEBUG_INFO_MSG,
|
||||
SETTING_EMU_SHOW_INFO_MSG,
|
||||
SETTING_ZIP_EXTRACT,
|
||||
SETTING_RARCH_DEFAULT_EMU,
|
||||
SETTING_QUIT_RARCH,
|
||||
SETTING_EMU_DEFAULT_ALL,
|
||||
SETTING_EMU_REWIND_ENABLED,
|
||||
SETTING_EMU_VIDEO_DEFAULT_ALL,
|
||||
#ifdef _XBOX1
|
||||
SETTING_EMU_AUDIO_SOUND_VOLUME_LEVEL,
|
||||
#endif
|
||||
SETTING_EMU_AUDIO_MUTE,
|
||||
SETTING_EMU_AUDIO_DEFAULT_ALL,
|
||||
SETTING_PATH_DEFAULT_ROM_DIRECTORY,
|
||||
SETTING_PATH_SAVESTATES_DIRECTORY,
|
||||
SETTING_PATH_SRAM_DIRECTORY,
|
||||
#ifdef HAVE_XML
|
||||
SETTING_PATH_CHEATS,
|
||||
#endif
|
||||
SETTING_PATH_SYSTEM,
|
||||
SETTING_ENABLE_SRAM_PATH,
|
||||
SETTING_ENABLE_STATE_PATH,
|
||||
SETTING_PATH_DEFAULT_ALL,
|
||||
SETTING_CONTROLS_SCHEME,
|
||||
SETTING_CONTROLS_NUMBER,
|
||||
SETTING_DPAD_EMULATION,
|
||||
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_B,
|
||||
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_Y,
|
||||
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_SELECT,
|
||||
@ -170,10 +222,8 @@ enum
|
||||
#define MAX_NO_OF_PATH_SETTINGS SETTING_PATH_DEFAULT_ALL+1
|
||||
#define MAX_NO_OF_CONTROLS_SETTINGS SETTING_CONTROLS_DEFAULT_ALL+1
|
||||
|
||||
#ifndef _XBOX
|
||||
void menu_init (void);
|
||||
void menu_loop (void);
|
||||
void menu_free (void);
|
||||
#endif
|
||||
|
||||
#endif /* MENU_H_ */
|
196
console/rmenu/rmenu_stack.c
Normal file
196
console/rmenu/rmenu_stack.c
Normal file
@ -0,0 +1,196 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2012 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* 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.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "rmenu_stack.h"
|
||||
|
||||
static unsigned char menu_stack_enum_array[10];
|
||||
static unsigned stack_idx = 0;
|
||||
static bool need_refresh = false;
|
||||
|
||||
static void menu_stack_pop(void)
|
||||
{
|
||||
if(stack_idx > 0)
|
||||
{
|
||||
stack_idx--;
|
||||
need_refresh = true;
|
||||
}
|
||||
}
|
||||
|
||||
static void menu_stack_force_refresh(void)
|
||||
{
|
||||
need_refresh = true;
|
||||
}
|
||||
|
||||
static void menu_stack_push(unsigned menu_id)
|
||||
{
|
||||
menu_stack_enum_array[++stack_idx] = menu_id;
|
||||
need_refresh = true;
|
||||
}
|
||||
|
||||
static void menu_stack_get_current_ptr(menu *current_menu)
|
||||
{
|
||||
if(!need_refresh)
|
||||
return;
|
||||
|
||||
unsigned menu_id = menu_stack_enum_array[stack_idx];
|
||||
|
||||
switch(menu_id)
|
||||
{
|
||||
case INGAME_MENU:
|
||||
strlcpy(current_menu->title, "Ingame Menu", sizeof(current_menu->title));
|
||||
current_menu->enum_id = menu_id;
|
||||
current_menu->selected = 0;
|
||||
current_menu->page = 0;
|
||||
current_menu->category_id = CATEGORY_INGAME_MENU;
|
||||
break;
|
||||
case INGAME_MENU_RESIZE:
|
||||
strlcpy(current_menu->title, "Resize Menu", sizeof(current_menu->title));
|
||||
current_menu->enum_id = INGAME_MENU_RESIZE;
|
||||
current_menu->selected = 0;
|
||||
current_menu->page = 0;
|
||||
current_menu->category_id = CATEGORY_INGAME_MENU;
|
||||
break;
|
||||
case INGAME_MENU_SCREENSHOT:
|
||||
strlcpy(current_menu->title, "Ingame Menu", sizeof(current_menu->title));
|
||||
current_menu->enum_id = menu_id;
|
||||
current_menu->selected = 0;
|
||||
current_menu->page = 0;
|
||||
current_menu->category_id = CATEGORY_INGAME_MENU;
|
||||
break;
|
||||
case FILE_BROWSER_MENU:
|
||||
strlcpy(current_menu->title, "Filebrowser", sizeof(current_menu->title));
|
||||
current_menu->enum_id = menu_id;
|
||||
current_menu->selected = 0;
|
||||
current_menu->page = 0;
|
||||
current_menu->category_id = CATEGORY_FILEBROWSER;
|
||||
break;
|
||||
case LIBRETRO_CHOICE:
|
||||
strlcpy(current_menu->title, "Libretro", sizeof(current_menu->title));
|
||||
current_menu->enum_id = menu_id;
|
||||
current_menu->selected = 0;
|
||||
current_menu->page = 0;
|
||||
current_menu->category_id = CATEGORY_FILEBROWSER;
|
||||
break;
|
||||
case PRESET_CHOICE:
|
||||
strlcpy(current_menu->title, "Shader", sizeof(current_menu->title));
|
||||
current_menu->enum_id = menu_id;
|
||||
current_menu->selected = 0;
|
||||
current_menu->page = 0;
|
||||
current_menu->category_id = CATEGORY_FILEBROWSER;
|
||||
break;
|
||||
case INPUT_PRESET_CHOICE:
|
||||
strlcpy(current_menu->title, "Input", sizeof(current_menu->title));
|
||||
current_menu->enum_id = menu_id;
|
||||
current_menu->selected = 0;
|
||||
current_menu->page = 0;
|
||||
current_menu->category_id = CATEGORY_FILEBROWSER;
|
||||
break;
|
||||
case SHADER_CHOICE:
|
||||
strlcpy(current_menu->title, "Shaders", sizeof(current_menu->title));
|
||||
current_menu->enum_id = menu_id;
|
||||
current_menu->selected = 0;
|
||||
current_menu->page = 0;
|
||||
current_menu->category_id = CATEGORY_FILEBROWSER;
|
||||
break;
|
||||
case BORDER_CHOICE:
|
||||
strlcpy(current_menu->title, "Borders", sizeof(current_menu->title));
|
||||
current_menu->enum_id = menu_id;
|
||||
current_menu->selected = 0;
|
||||
current_menu->page = 0;
|
||||
current_menu->category_id = CATEGORY_FILEBROWSER;
|
||||
break;
|
||||
case PATH_DEFAULT_ROM_DIR_CHOICE:
|
||||
case PATH_SAVESTATES_DIR_CHOICE:
|
||||
case PATH_SRAM_DIR_CHOICE:
|
||||
#ifdef HAVE_XML
|
||||
case PATH_CHEATS_DIR_CHOICE:
|
||||
#endif
|
||||
case PATH_SYSTEM_DIR_CHOICE:
|
||||
strlcpy(current_menu->title, "Path", sizeof(current_menu->title));
|
||||
current_menu->enum_id = menu_id;
|
||||
current_menu->selected = 0;
|
||||
current_menu->page = 0;
|
||||
current_menu->category_id = CATEGORY_FILEBROWSER;
|
||||
break;
|
||||
case GENERAL_VIDEO_MENU:
|
||||
strlcpy(current_menu->title, "Video", sizeof(current_menu->title));
|
||||
current_menu->enum_id = GENERAL_VIDEO_MENU;
|
||||
current_menu->selected = FIRST_VIDEO_SETTING;
|
||||
current_menu->page = 0;
|
||||
current_menu->first_setting = FIRST_VIDEO_SETTING;
|
||||
current_menu->max_settings = MAX_NO_OF_VIDEO_SETTINGS;
|
||||
current_menu->category_id = CATEGORY_SETTINGS;
|
||||
break;
|
||||
case GENERAL_AUDIO_MENU:
|
||||
strlcpy(current_menu->title, "Audio", sizeof(current_menu->title));
|
||||
current_menu->enum_id = GENERAL_AUDIO_MENU;
|
||||
current_menu->selected = FIRST_AUDIO_SETTING;
|
||||
current_menu->page = 0;
|
||||
current_menu->first_setting = FIRST_AUDIO_SETTING;
|
||||
current_menu->max_settings = MAX_NO_OF_AUDIO_SETTINGS;
|
||||
current_menu->category_id = CATEGORY_SETTINGS;
|
||||
break;
|
||||
case EMU_GENERAL_MENU:
|
||||
strlcpy(current_menu->title, "Retro", sizeof(current_menu->title));
|
||||
current_menu->enum_id = EMU_GENERAL_MENU;
|
||||
current_menu->selected = FIRST_EMU_SETTING;
|
||||
current_menu->page = 0;
|
||||
current_menu->first_setting = FIRST_EMU_SETTING;
|
||||
current_menu->max_settings = MAX_NO_OF_EMU_SETTINGS;
|
||||
current_menu->category_id = CATEGORY_SETTINGS;
|
||||
break;
|
||||
case EMU_VIDEO_MENU:
|
||||
strlcpy(current_menu->title, "Retro Video", sizeof(current_menu->title));
|
||||
current_menu->enum_id = EMU_VIDEO_MENU;
|
||||
current_menu->selected = FIRST_EMU_VIDEO_SETTING;
|
||||
current_menu->page = 0;
|
||||
current_menu->first_setting = FIRST_EMU_VIDEO_SETTING;
|
||||
current_menu->max_settings = MAX_NO_OF_EMU_VIDEO_SETTINGS;
|
||||
current_menu->category_id = CATEGORY_SETTINGS;
|
||||
break;
|
||||
case EMU_AUDIO_MENU:
|
||||
strlcpy(current_menu->title, "Retro Audio", sizeof(current_menu->title));
|
||||
current_menu->enum_id = EMU_AUDIO_MENU;
|
||||
current_menu->selected = FIRST_EMU_AUDIO_SETTING;
|
||||
current_menu->page = 0;
|
||||
current_menu->first_setting = FIRST_EMU_AUDIO_SETTING;
|
||||
current_menu->max_settings = MAX_NO_OF_EMU_AUDIO_SETTINGS;
|
||||
current_menu->category_id = CATEGORY_SETTINGS;
|
||||
break;
|
||||
case PATH_MENU:
|
||||
strlcpy(current_menu->title, "Path", sizeof(current_menu->title));
|
||||
current_menu->enum_id = PATH_MENU;
|
||||
current_menu->selected = FIRST_PATH_SETTING;
|
||||
current_menu->page = 0;
|
||||
current_menu->first_setting = FIRST_PATH_SETTING;
|
||||
current_menu->max_settings = MAX_NO_OF_PATH_SETTINGS;
|
||||
current_menu->category_id = CATEGORY_SETTINGS;
|
||||
break;
|
||||
case CONTROLS_MENU:
|
||||
strlcpy(current_menu->title, "Controls", sizeof(current_menu->title));
|
||||
current_menu->enum_id = CONTROLS_MENU;
|
||||
current_menu->selected = FIRST_CONTROLS_SETTING_PAGE_1;
|
||||
current_menu->page = 0;
|
||||
current_menu->first_setting = FIRST_CONTROLS_SETTING_PAGE_1;
|
||||
current_menu->max_settings = MAX_NO_OF_CONTROLS_SETTINGS;
|
||||
current_menu->category_id = CATEGORY_SETTINGS;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
need_refresh = false;
|
||||
}
|
31
console/rmenu/rmenu_stack.h
Normal file
31
console/rmenu/rmenu_stack.h
Normal file
@ -0,0 +1,31 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2012 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* 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.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _RMENU_STACK_H_
|
||||
#define _RMENU_STACK_H_
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char title[32];
|
||||
unsigned char enum_id;
|
||||
unsigned char selected;
|
||||
unsigned char page;
|
||||
unsigned char first_setting;
|
||||
unsigned char max_settings;
|
||||
unsigned char category_id;
|
||||
} menu;
|
||||
|
||||
#endif
|
@ -59,8 +59,6 @@ struct internal_state
|
||||
inflate_blocks_statef *blocks; /* current inflate_blocks state */
|
||||
};
|
||||
|
||||
static const unsigned int border[] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
|
||||
|
||||
|
||||
typedef enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
|
||||
START, /* x: set up for LEN */
|
||||
@ -88,18 +86,18 @@ static int huft_build (
|
||||
unsigned int * ); /* space for values */
|
||||
|
||||
/* Tables for deflate from PKZIP's appnote.txt. */
|
||||
static const unsigned int cplens[31] = { /* Copy lengths for literal codes 257..285 */
|
||||
const unsigned int cplens[31] = { /* Copy lengths for literal codes 257..285 */
|
||||
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
|
||||
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
|
||||
/* see note #13 above about 258 */
|
||||
static const unsigned int cplext[31] = { /* Extra bits for literal codes 257..285 */
|
||||
const unsigned int cplext[31] = { /* Extra bits for literal codes 257..285 */
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
|
||||
3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */
|
||||
static const unsigned int cpdist[30] = { /* Copy offsets for distance codes 0..29 */
|
||||
const unsigned int cpdist[30] = { /* Copy offsets for distance codes 0..29 */
|
||||
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
|
||||
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
|
||||
8193, 12289, 16385, 24577};
|
||||
static const unsigned int cpdext[30] = { /* Extra bits for distance codes */
|
||||
const unsigned int cpdext[30] = { /* Extra bits for distance codes */
|
||||
0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
|
||||
7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
|
||||
12, 12, 13, 13};
|
||||
@ -148,8 +146,7 @@ inflate_codes_statef *inflate_codes_new(unsigned int bl, unsigned int bd, inflat
|
||||
{
|
||||
inflate_codes_statef *c;
|
||||
|
||||
if ((c = (inflate_codes_statef *)
|
||||
ZALLOC(z,1,sizeof(struct inflate_codes_state))) != 0)
|
||||
if ((c = (inflate_codes_statef *)ZALLOC(z,1,sizeof(struct inflate_codes_state))) != 0)
|
||||
{
|
||||
c->mode = START;
|
||||
c->lbits = (Byte)bl;
|
||||
@ -736,9 +733,10 @@ int inflate_trees_dynamic(unsigned int nl, unsigned int nd, unsigned int *c, uns
|
||||
return Z_OK;
|
||||
}
|
||||
|
||||
static unsigned int fixed_bl = 9;
|
||||
static unsigned int fixed_bd = 5;
|
||||
static inflate_huft fixed_tl[] = {
|
||||
#define FIXED_BL 9
|
||||
#define FIXED_BD 5
|
||||
|
||||
inflate_huft fixed_tl[] = {
|
||||
{{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
|
||||
{{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192},
|
||||
{{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160},
|
||||
@ -869,7 +867,7 @@ static inflate_huft fixed_tl[] = {
|
||||
{{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255}
|
||||
};
|
||||
|
||||
static inflate_huft fixed_td[] = {
|
||||
inflate_huft fixed_td[] = {
|
||||
{{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097},
|
||||
{{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385},
|
||||
{{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193},
|
||||
@ -882,11 +880,12 @@ static inflate_huft fixed_td[] = {
|
||||
|
||||
int inflate_trees_fixed(unsigned int * bl, unsigned int *bd, inflate_huft ** tl, inflate_huft ** td, z_streamp z)
|
||||
{
|
||||
*bl = fixed_bl;
|
||||
*bd = fixed_bd;
|
||||
*tl = fixed_tl;
|
||||
*td = fixed_td;
|
||||
return Z_OK;
|
||||
*bl = FIXED_BL;
|
||||
*bd = FIXED_BD;
|
||||
*tl = fixed_tl;
|
||||
*td = fixed_td;
|
||||
|
||||
return Z_OK;
|
||||
}
|
||||
|
||||
/* infblock.c -- interpret and process block types to last block
|
||||
@ -940,10 +939,11 @@ int inflate_blocks(inflate_blocks_statef *s, z_streamp z, int r)
|
||||
unsigned int t; /* temporary storage */
|
||||
unsigned long b; /* bit buffer */
|
||||
unsigned int k; /* bits in bit buffer */
|
||||
Bytef *p; /* input data pointer */
|
||||
Bytef *p; /* input data pointer */
|
||||
unsigned int n; /* bytes available there */
|
||||
Bytef *q; /* output window write pointer */
|
||||
Bytef *q; /* output window write pointer */
|
||||
unsigned int m; /* bytes to end of window or read pointer */
|
||||
const unsigned int border[] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
|
||||
|
||||
/* copy input/output information to locals (UPDATE macro restores) */
|
||||
LOAD
|
||||
@ -1284,7 +1284,7 @@ void zcfree (voidpf opaque, voidpf ptr)
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
static const unsigned long crc_table[256] = {
|
||||
const unsigned long crc_table[256] = {
|
||||
0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
|
||||
0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
|
||||
0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
|
||||
@ -1466,7 +1466,7 @@ int inflateInit2_(z_streamp z, int w, const char * version, int stream_size)
|
||||
}
|
||||
|
||||
|
||||
int inflateInit_(z_streamp z, const char * version, int stream_size)
|
||||
int inflateInit_(z_streamp z, const char * version, int stream_size)
|
||||
{
|
||||
return inflateInit2_(z, DEF_WBITS, version, stream_size);
|
||||
}
|
||||
@ -1616,7 +1616,7 @@ int inflate(z_streamp z, int f)
|
||||
# define Z_PRINTF_BUFSIZE 4096
|
||||
#endif
|
||||
|
||||
static int gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
|
||||
int gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
|
||||
|
||||
/* gzip flag byte */
|
||||
#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */
|
||||
|
@ -73,6 +73,12 @@ Unix-like systems will look in $XDG_CONFIG_HOME/retroarch/retroarch.cfg first. T
|
||||
.IP
|
||||
Windows will look in retroarch.cfg in same folder where retroarch.exe resides.
|
||||
|
||||
.TP
|
||||
\fB--appendconfig PATH\fR
|
||||
Appends a different set of config files to the config file loaded in -c (or default).
|
||||
Multiple config files are delimited by ','.
|
||||
Every config file will be appended in order where the key-value pairs of the next config file takes priority over the old ones.
|
||||
|
||||
.TP
|
||||
\fB--gameboy PATH, -g PATH\fR
|
||||
Path to a Nintendo Game Boy ROM. If this flag is set, the Super Game Boy subsystem will be activated. The Super Game Boy BIOS needs to be loaded as the normal rom.
|
||||
@ -99,27 +105,31 @@ When using Sufami, save ram paths will be inferred from the Sufami BIOS path, no
|
||||
|
||||
.TP
|
||||
\fB--mouse PORT, -m PORT\fR
|
||||
Connects a Super Nintendo Mouse into port number PORT of the emulated SNES. Possible values for PORT are 1 and 2.
|
||||
Connects a mouse into port number PORT. Possible values for PORT are 1 to 8.
|
||||
|
||||
.TP
|
||||
\fB--nodevice PORT, -N PORT\fR
|
||||
Disconnects an input device from port number PORT of the emulated SNES. Possible values for PORT are 1 and 2. This may be needed for some odd games to run properly.
|
||||
Disconnects an input device from port number PORT. Possible values for PORT are 1 to 8. This may be needed for some odd games to run properly.
|
||||
|
||||
.TP
|
||||
\fB--scope, -p\fR
|
||||
Connects a Super Scope into port 2 of the SNES. It is controlled with your mouse.
|
||||
Connects a Super Scope into port 2 of an emulated SNES. It is controlled with your mouse.
|
||||
|
||||
.TP
|
||||
\fB--justifier, -j\fR
|
||||
Connects a Konami Justifier into port 2 of the SNES. It is controller with your mouse.
|
||||
Connects a Konami Justifier into port 2 of an emulated SNES. It is controlled with your mouse.
|
||||
|
||||
.TP
|
||||
\fB--justifiers, -J\fR
|
||||
Connects two Konami Justifier into port 2 of the SNES. Currently, only player 1 is controlled with the mouse.
|
||||
Connects two Konami Justifier into port 2 of an emulated SNES. Currently, only player 1 is controlled with the mouse.
|
||||
|
||||
.TP
|
||||
\fB--multitap, -4\fR
|
||||
Connects a four-way multitap into port 2 of the SNES. This allows for up to 5 players.
|
||||
Connects a four-way multitap into an emulated SNES. This allows for up to 5 players.
|
||||
|
||||
.TP
|
||||
\fB--dualanalog PORT, -A PORT\fR
|
||||
Connects a DualAnalog controller into port PORT. Possible values are 1 to 8.
|
||||
|
||||
.TP
|
||||
\fB--record PATH, -r PATH\fR
|
||||
|
68
driver.c
68
driver.c
@ -73,7 +73,7 @@ static const audio_driver_t *audio_drivers[] = {
|
||||
&audio_xdk360,
|
||||
#endif
|
||||
#ifdef GEKKO
|
||||
&audio_wii,
|
||||
&audio_gx,
|
||||
#endif
|
||||
&audio_null,
|
||||
};
|
||||
@ -98,7 +98,7 @@ static const video_driver_t *video_drivers[] = {
|
||||
&video_ext,
|
||||
#endif
|
||||
#ifdef GEKKO
|
||||
&video_wii,
|
||||
&video_gx,
|
||||
#endif
|
||||
#ifdef HAVE_RPI
|
||||
&video_rpi,
|
||||
@ -123,9 +123,9 @@ static const input_driver_t *input_drivers[] = {
|
||||
&input_xinput,
|
||||
#endif
|
||||
#ifdef GEKKO
|
||||
&input_wii,
|
||||
&input_gx,
|
||||
#endif
|
||||
#ifdef IS_LINUX
|
||||
#if defined(__linux__) && !defined(ANDROID)
|
||||
&input_linuxraw,
|
||||
#endif
|
||||
&input_null,
|
||||
@ -192,8 +192,42 @@ void init_drivers_pre(void)
|
||||
find_input_driver();
|
||||
}
|
||||
|
||||
static void adjust_system_rates(void)
|
||||
{
|
||||
g_extern.system.force_nonblock = false;
|
||||
const struct retro_system_timing *info = &g_extern.system.av_info.timing;
|
||||
|
||||
float timing_skew = fabs(1.0f - info->fps / g_settings.video.refresh_rate);
|
||||
if (timing_skew > 0.05f) // We don't want to adjust pitch too much. If we have extreme cases, just don't readjust at all.
|
||||
{
|
||||
RARCH_LOG("Timings deviate too much. Will not adjust. (Display = %.2f Hz, Game = %.2f Hz)\n",
|
||||
g_settings.video.refresh_rate,
|
||||
(float)info->fps);
|
||||
|
||||
// We won't be able to do VSync reliably as game FPS > monitor FPS.
|
||||
if (info->fps > g_settings.video.refresh_rate)
|
||||
{
|
||||
g_extern.system.force_nonblock = true;
|
||||
RARCH_LOG("Game FPS > Monitor FPS. Cannot rely on VSync.\n");
|
||||
}
|
||||
|
||||
g_settings.audio.in_rate = info->sample_rate;
|
||||
}
|
||||
else
|
||||
g_settings.audio.in_rate = info->sample_rate *
|
||||
(g_settings.video.refresh_rate / info->fps);
|
||||
|
||||
RARCH_LOG("Set audio input rate to: %.2f Hz.\n", g_settings.audio.in_rate);
|
||||
|
||||
#ifdef RARCH_CONSOLE
|
||||
video_set_nonblock_state_func(!g_settings.video.vsync || g_extern.system.force_nonblock);
|
||||
#endif
|
||||
}
|
||||
|
||||
void init_drivers(void)
|
||||
{
|
||||
adjust_system_rates();
|
||||
|
||||
init_video_input();
|
||||
init_audio();
|
||||
}
|
||||
@ -242,7 +276,7 @@ static void init_dsp_plugin(void)
|
||||
|
||||
if (g_extern.audio_data.dsp_plugin->api_version != RARCH_DSP_API_VERSION)
|
||||
{
|
||||
RARCH_ERR("DSP plugin API mismatch. SSNES: %d, Plugin: %d\n", RARCH_DSP_API_VERSION, g_extern.audio_data.dsp_plugin->api_version);
|
||||
RARCH_ERR("DSP plugin API mismatch. RetroArch: %d, Plugin: %d\n", RARCH_DSP_API_VERSION, g_extern.audio_data.dsp_plugin->api_version);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@ -278,26 +312,6 @@ static void deinit_dsp_plugin(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void adjust_audio_input_rate(void)
|
||||
{
|
||||
const struct retro_system_timing *info = &g_extern.system.av_info.timing;
|
||||
|
||||
float timing_skew = fabs(1.0f - info->fps / g_settings.video.refresh_rate);
|
||||
if (timing_skew > 0.05f) // We don't want to adjust pitch too much. If we have extreme cases, just don't readjust at all.
|
||||
{
|
||||
RARCH_LOG("Timings deviate too much. Will not adjust. (Display = %.2f Hz, Game = %.2f Hz)\n",
|
||||
g_settings.video.refresh_rate,
|
||||
(float)info->fps);
|
||||
|
||||
g_settings.video.refresh_rate = info->fps;
|
||||
}
|
||||
|
||||
g_settings.audio.in_rate = info->sample_rate *
|
||||
(g_settings.video.refresh_rate / info->fps);
|
||||
|
||||
RARCH_LOG("Set audio input rate to: %.2f Hz.\n", g_settings.audio.in_rate);
|
||||
}
|
||||
|
||||
void init_audio(void)
|
||||
{
|
||||
// Accomodate rewind since at some point we might have two full buffers.
|
||||
@ -321,8 +335,6 @@ void init_audio(void)
|
||||
return;
|
||||
}
|
||||
|
||||
adjust_audio_input_rate();
|
||||
|
||||
driver.audio_data = audio_init_func(*g_settings.audio.device ? g_settings.audio.device : NULL,
|
||||
g_settings.audio.out_rate, g_settings.audio.latency);
|
||||
|
||||
@ -586,7 +598,7 @@ void init_video_input(void)
|
||||
video.width = width;
|
||||
video.height = height;
|
||||
video.fullscreen = g_settings.video.fullscreen;
|
||||
video.vsync = g_settings.video.vsync;
|
||||
video.vsync = g_settings.video.vsync && !g_extern.system.force_nonblock;
|
||||
video.force_aspect = g_settings.video.force_aspect;
|
||||
video.smooth = g_settings.video.smooth;
|
||||
video.input_scale = scale;
|
||||
|
7
driver.h
7
driver.h
@ -186,6 +186,7 @@ typedef struct video_driver
|
||||
void (*start)(void);
|
||||
void (*stop)(void);
|
||||
void (*restart)(void);
|
||||
void (*apply_state_changes)(void);
|
||||
#endif
|
||||
|
||||
void (*set_rotation)(void *data, unsigned rotation);
|
||||
@ -237,10 +238,10 @@ extern const audio_driver_t audio_coreaudio;
|
||||
extern const audio_driver_t audio_xenon360;
|
||||
extern const audio_driver_t audio_xdk360;
|
||||
extern const audio_driver_t audio_ps3;
|
||||
extern const audio_driver_t audio_wii;
|
||||
extern const audio_driver_t audio_gx;
|
||||
extern const audio_driver_t audio_null;
|
||||
extern const video_driver_t video_gl;
|
||||
extern const video_driver_t video_wii;
|
||||
extern const video_driver_t video_gx;
|
||||
extern const video_driver_t video_xenon360;
|
||||
extern const video_driver_t video_xvideo;
|
||||
extern const video_driver_t video_xdk_d3d;
|
||||
@ -252,7 +253,7 @@ extern const input_driver_t input_sdl;
|
||||
extern const input_driver_t input_x;
|
||||
extern const input_driver_t input_ps3;
|
||||
extern const input_driver_t input_xenon360;
|
||||
extern const input_driver_t input_wii;
|
||||
extern const input_driver_t input_gx;
|
||||
extern const input_driver_t input_xinput;
|
||||
extern const input_driver_t input_linuxraw;
|
||||
extern const input_driver_t input_null;
|
||||
|
43
dynamic.c
43
dynamic.c
@ -352,6 +352,49 @@ static bool environment_cb(unsigned cmd, void *data)
|
||||
break;
|
||||
}
|
||||
|
||||
case RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS:
|
||||
{
|
||||
memset(g_extern.system.input_desc_btn, 0, sizeof(g_extern.system.input_desc_btn));
|
||||
|
||||
const struct retro_input_descriptor *desc = (const struct retro_input_descriptor*)data;
|
||||
for (; desc->description; desc++)
|
||||
{
|
||||
if (desc->port >= MAX_PLAYERS)
|
||||
continue;
|
||||
|
||||
if (desc->device != RETRO_DEVICE_JOYPAD) // Ignore all others for now.
|
||||
continue;
|
||||
|
||||
if (desc->id >= RARCH_FIRST_ANALOG_BIND)
|
||||
continue;
|
||||
|
||||
g_extern.system.input_desc_btn[desc->port][desc->id] = desc->description;
|
||||
}
|
||||
|
||||
static const char *libretro_btn_desc[] = {
|
||||
"B (bottom)", "Y (left)", "Select", "Start",
|
||||
"D-Pad Up", "D-Pad Down", "D-Pad Left", "D-Pad Right",
|
||||
"A (right)", "X (up)",
|
||||
"L", "R", "L2", "R2", "L3", "R3",
|
||||
};
|
||||
|
||||
RARCH_LOG("Environ SET_INPUT_DESCRIPTORS:\n");
|
||||
for (unsigned p = 0; p < MAX_PLAYERS; p++)
|
||||
{
|
||||
for (unsigned id = 0; id < RARCH_FIRST_ANALOG_BIND; id++)
|
||||
{
|
||||
const char *desc = g_extern.system.input_desc_btn[p][id];
|
||||
if (desc)
|
||||
{
|
||||
RARCH_LOG("\tRetroPad, Player %u, Button \"%s\" => \"%s\"\n",
|
||||
p + 1, libretro_btn_desc[id], desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
RARCH_LOG("Environ UNSUPPORTED (#%u).\n", cmd);
|
||||
return false;
|
||||
|
6
file.c
6
file.c
@ -349,7 +349,7 @@ static void dump_to_file_desperate(const void *data, size_t size, int type)
|
||||
goto error;
|
||||
|
||||
char path[PATH_MAX];
|
||||
snprintf(path, sizeof(path), "%s/SSNES-recovery-", base);
|
||||
snprintf(path, sizeof(path), "%s/RetroArch-recovery-", base);
|
||||
char timebuf[PATH_MAX];
|
||||
|
||||
time_t time_;
|
||||
@ -359,14 +359,14 @@ static void dump_to_file_desperate(const void *data, size_t size, int type)
|
||||
strlcat(path, ramtype2str(type), sizeof(path));
|
||||
|
||||
if (dump_to_file(path, data, size))
|
||||
RARCH_WARN("Succeeded in saving RAM data to \"%s\". Phew ... :D\n", path);
|
||||
RARCH_WARN("Succeeded in saving RAM data to \"%s\".\n", path);
|
||||
else
|
||||
goto error;
|
||||
|
||||
return;
|
||||
|
||||
error:
|
||||
RARCH_WARN("Failed ... Tough luck ... :(\n");
|
||||
RARCH_WARN("Failed ... Cannot recover save file.\n");
|
||||
}
|
||||
|
||||
bool save_state(const char *path)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user