mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
(360) Some libretro ABI-related changes for 360 port
This commit is contained in:
parent
b2fcf5b281
commit
9d3d696b3e
78
360/main.c
78
360/main.c
@ -137,18 +137,18 @@ static void set_default_settings (void)
|
|||||||
g_settings.video.smooth = true;
|
g_settings.video.smooth = true;
|
||||||
g_settings.video.aspect_ratio = -1.0f;
|
g_settings.video.aspect_ratio = -1.0f;
|
||||||
|
|
||||||
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_B] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_A];
|
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_B] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_A];
|
||||||
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_Y] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_X];
|
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_Y] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_X];
|
||||||
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_SELECT] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_BACK];
|
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_SELECT] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_BACK];
|
||||||
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_START] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_START];
|
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_START] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_START];
|
||||||
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_UP] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_UP];
|
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_UP] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_UP];
|
||||||
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_DOWN] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_DOWN];
|
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_DOWN] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_DOWN];
|
||||||
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_LEFT] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_LEFT];
|
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_LEFT] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_LEFT];
|
||||||
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_RIGHT] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_RIGHT];
|
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_RIGHT] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_RIGHT];
|
||||||
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_A] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_B];
|
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_A] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_B];
|
||||||
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_X] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_Y];
|
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_X] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_Y];
|
||||||
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_L] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_LB];
|
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_LB];
|
||||||
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_R] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_RB];
|
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R] = ssnes_platform_keybind_lut[XDK360_DEVICE_ID_JOYPAD_RB];
|
||||||
|
|
||||||
for(uint32_t x = 0; x < MAX_PLAYERS; x++)
|
for(uint32_t x = 0; x < MAX_PLAYERS; x++)
|
||||||
{
|
{
|
||||||
@ -252,7 +252,7 @@ static char **dir_list_new_360(const char *dir, const char *ext)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void init_settings (bool load_libsnes_path)
|
static void init_settings (bool load_libretro_path)
|
||||||
{
|
{
|
||||||
char fname_tmp[MAX_PATH_LENGTH];
|
char fname_tmp[MAX_PATH_LENGTH];
|
||||||
|
|
||||||
@ -266,13 +266,13 @@ static void init_settings (bool load_libsnes_path)
|
|||||||
|
|
||||||
config_file_t * conf = config_file_new(SYS_CONFIG_FILE);
|
config_file_t * conf = config_file_new(SYS_CONFIG_FILE);
|
||||||
|
|
||||||
if(load_libsnes_path)
|
if(load_libretro_path)
|
||||||
{
|
{
|
||||||
CONFIG_GET_STRING(libsnes, "libsnes_path");
|
CONFIG_GET_STRING(libretro, "libretro_path");
|
||||||
|
|
||||||
if(!strcmp(g_settings.libsnes, ""))
|
if(!strcmp(g_settings.libretro, ""))
|
||||||
{
|
{
|
||||||
//We need to set libsnes to the first entry in the cores
|
//We need to set libretro to the first entry in the cores
|
||||||
//directory so that it will be saved to the config file
|
//directory so that it will be saved to the config file
|
||||||
char ** dir_list = dir_list_new_360("game:\\", ".xex");
|
char ** dir_list = dir_list_new_360("game:\\", ".xex");
|
||||||
if (!dir_list)
|
if (!dir_list)
|
||||||
@ -301,12 +301,12 @@ static void init_settings (bool load_libsnes_path)
|
|||||||
fill_pathname_base(fname_tmp, first_xex, sizeof(fname_tmp));
|
fill_pathname_base(fname_tmp, first_xex, sizeof(fname_tmp));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SSNES_LOG("Set first .xex entry in dir: [%s] to libsnes path.\n", fname_tmp);
|
SSNES_LOG("Set first .xex entry in dir: [%s] to libretro path.\n", fname_tmp);
|
||||||
snprintf(g_settings.libsnes, sizeof(g_settings.libsnes), "game:\\%s", fname_tmp);
|
snprintf(g_settings.libretro, sizeof(g_settings.libretro), "game:\\%s", fname_tmp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SSNES_ERR("Failed to set first .xex entry to libsnes path.\n");
|
SSNES_ERR("Failed to set first .xex entry to libretro path.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
dir_list_free(dir_list);
|
dir_list_free(dir_list);
|
||||||
@ -347,7 +347,7 @@ static void save_settings (void)
|
|||||||
conf = config_file_new(NULL);
|
conf = config_file_new(NULL);
|
||||||
|
|
||||||
// g_settings
|
// g_settings
|
||||||
config_set_string(conf, "libsnes_path", g_settings.libsnes);
|
config_set_string(conf, "libretro_path", g_settings.libretro);
|
||||||
config_set_bool(conf, "rewind_enable", g_settings.rewind_enable);
|
config_set_bool(conf, "rewind_enable", g_settings.rewind_enable);
|
||||||
config_set_bool(conf, "video_smooth", g_settings.video.smooth);
|
config_set_bool(conf, "video_smooth", g_settings.video.smooth);
|
||||||
config_set_bool(conf, "video_vsync", g_settings.video.vsync);
|
config_set_bool(conf, "video_vsync", g_settings.video.vsync);
|
||||||
@ -449,19 +449,19 @@ static void get_environment_settings (void)
|
|||||||
strlcpy(SYS_CONFIG_FILE, "game:\\ssnes.cfg", sizeof(SYS_CONFIG_FILE));
|
strlcpy(SYS_CONFIG_FILE, "game:\\ssnes.cfg", sizeof(SYS_CONFIG_FILE));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool manage_libsnes_core(void)
|
static bool manage_libretro_core(void)
|
||||||
{
|
{
|
||||||
g_extern.verbose = true;
|
g_extern.verbose = true;
|
||||||
bool return_code;
|
bool return_code;
|
||||||
|
|
||||||
bool set_libsnes_path = false;
|
bool set_libretro_path = false;
|
||||||
char tmp_path[1024], tmp_path2[1024], tmp_pathnewfile[1024];
|
char tmp_path[1024], tmp_path2[1024], tmp_pathnewfile[1024];
|
||||||
snprintf(tmp_path, sizeof(tmp_path), "game:\\CORE.xex");
|
snprintf(tmp_path, sizeof(tmp_path), "game:\\CORE.xex");
|
||||||
SSNES_LOG("Assumed path of CORE.xex: [%s]\n", tmp_path);
|
SSNES_LOG("Assumed path of CORE.xex: [%s]\n", tmp_path);
|
||||||
if(path_file_exists(tmp_path))
|
if(path_file_exists(tmp_path))
|
||||||
{
|
{
|
||||||
//if CORE.xex exists, this indicates we have just installed
|
//if CORE.xex exists, this indicates we have just installed
|
||||||
//a new libsnes port and that we need to change it to a more
|
//a new libretro port and that we need to change it to a more
|
||||||
//sane name.
|
//sane name.
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
@ -473,17 +473,17 @@ static bool manage_libsnes_core(void)
|
|||||||
if(path_file_exists(tmp_pathnewfile))
|
if(path_file_exists(tmp_pathnewfile))
|
||||||
{
|
{
|
||||||
SSNES_LOG("Upgrading emulator core...\n");
|
SSNES_LOG("Upgrading emulator core...\n");
|
||||||
//if libsnes core already exists, then that means we are
|
//if libretro core already exists, then that means we are
|
||||||
//upgrading the libsnes core - so delete pre-existing
|
//upgrading the libretro core - so delete pre-existing
|
||||||
//file first
|
//file first
|
||||||
ret = DeleteFile(tmp_pathnewfile);
|
ret = DeleteFile(tmp_pathnewfile);
|
||||||
if(ret != 0)
|
if(ret != 0)
|
||||||
{
|
{
|
||||||
SSNES_LOG("Succeeded in removing pre-existing libsnes core: [%s].\n", tmp_pathnewfile);
|
SSNES_LOG("Succeeded in removing pre-existing libretro core: [%s].\n", tmp_pathnewfile);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SSNES_LOG("Failed to remove pre-existing libsnes core: [%s].\n", tmp_pathnewfile);
|
SSNES_LOG("Failed to remove pre-existing libretro core: [%s].\n", tmp_pathnewfile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -495,26 +495,26 @@ static bool manage_libsnes_core(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SSNES_LOG("Libsnes core [%s] renamed to: [%s].\n", tmp_path, tmp_pathnewfile);
|
SSNES_LOG("libretro core [%s] renamed to: [%s].\n", tmp_path, tmp_pathnewfile);
|
||||||
set_libsnes_path = true;
|
set_libretro_path = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SSNES_LOG("CORE.xex was not found, libsnes core path will be loaded from config file.\n");
|
SSNES_LOG("CORE.xex was not found, libretro core path will be loaded from config file.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(set_libsnes_path)
|
if(set_libretro_path)
|
||||||
{
|
{
|
||||||
//CORE.xex has been renamed, libsnes path will now be set to the recently
|
//CORE.xex has been renamed, libretro path will now be set to the recently
|
||||||
//renamed new libsnes core
|
//renamed new libretro core
|
||||||
strlcpy(g_settings.libsnes, tmp_pathnewfile, sizeof(g_settings.libsnes));
|
strlcpy(g_settings.libretro, tmp_pathnewfile, sizeof(g_settings.libretro));
|
||||||
return_code = 0;
|
return_code = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//There was no CORE.xex present, or the CORE.xex file was not renamed.
|
//There was no CORE.xex present, or the CORE.xex file was not renamed.
|
||||||
//The libsnes core path will still be loaded from the config file
|
//The libretro core path will still be loaded from the config file
|
||||||
return_code = 1;
|
return_code = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -530,11 +530,11 @@ int main(int argc, char *argv[])
|
|||||||
ssnes_main_clear_state();
|
ssnes_main_clear_state();
|
||||||
config_set_defaults();
|
config_set_defaults();
|
||||||
|
|
||||||
bool load_libsnes_path = manage_libsnes_core();
|
bool load_libretro_path = manage_libretro_core();
|
||||||
|
|
||||||
set_default_settings();
|
set_default_settings();
|
||||||
init_settings(load_libsnes_path);
|
init_settings(load_libretro_path);
|
||||||
init_libsnes_sym();
|
init_libretro_sym();
|
||||||
|
|
||||||
xdk360_video_init();
|
xdk360_video_init();
|
||||||
xdk360_input_init();
|
xdk360_input_init();
|
||||||
|
@ -276,6 +276,10 @@ HRESULT CSSNESQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
|
|||||||
|
|
||||||
HRESULT CSSNESMain::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
HRESULT CSSNESMain::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"XuiBtnRomBrowser", &m_filebrowser);
|
GetChildById(L"XuiBtnRomBrowser", &m_filebrowser);
|
||||||
GetChildById(L"XuiBtnSettings", &m_settings);
|
GetChildById(L"XuiBtnSettings", &m_settings);
|
||||||
GetChildById(L"XuiBtnQuickMenu", &m_quick_menu);
|
GetChildById(L"XuiBtnQuickMenu", &m_quick_menu);
|
||||||
@ -286,7 +290,7 @@ HRESULT CSSNESMain::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
|||||||
GetChildById(L"XuiBtnLibsnesCore", &m_change_libsnes_core);
|
GetChildById(L"XuiBtnLibsnesCore", &m_change_libsnes_core);
|
||||||
|
|
||||||
char core_text[256];
|
char core_text[256];
|
||||||
sprintf(core_text, "%s (v%s)", snes_library_id(), g_extern.system.version);
|
sprintf(core_text, "%s (v%s)", id, info.library_version);
|
||||||
char package_version[32];
|
char package_version[32];
|
||||||
sprintf(package_version, "SSNES %s", PACKAGE_VERSION);
|
sprintf(package_version, "SSNES %s", PACKAGE_VERSION);
|
||||||
unsigned long dwNum = MultiByteToWideChar(CP_ACP, 0, core_text, -1, NULL, 0);
|
unsigned long dwNum = MultiByteToWideChar(CP_ACP, 0, core_text, -1, NULL, 0);
|
||||||
|
@ -54,7 +54,7 @@ static void xdk360_input_poll(void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int16_t xdk360_input_state(void *data, const struct snes_keybind **binds,
|
static int16_t xdk360_input_state(void *data, const struct snes_keybind **binds,
|
||||||
bool port, unsigned device,
|
unsigned port, unsigned device,
|
||||||
unsigned index, unsigned id)
|
unsigned index, unsigned id)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user