(PS3) Preliminary PS3 conversion to libretro

This commit is contained in:
Twinaphex 2012-04-10 00:22:02 +02:00
parent a949c0ed37
commit 6c05eac2f5
10 changed files with 147 additions and 1336 deletions

View File

@ -66,7 +66,7 @@ else
endif
PPU_LDLIBS = -ldbgfont $(GL_LIBS) -lsnes -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
PPU_LDLIBS = -ldbgfont $(GL_LIBS) -lretro -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 += -DSSNES_CONSOLE -DHAVE_OPENGL -DHAVE_CG -DHAVE_FBO -DHAVE_RSOUND -DHAVE_ZLIB -D__CELLOS_LV2__ -DHAVE_CONFIGFILE=1 -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_GRIFFIN=1 -DPACKAGE_VERSION=\"$(SSNES_VERSION)\" -Dmain=ssnes_main -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)

View File

@ -21,7 +21,7 @@
#include <ctype.h>
#include "../boolean.h"
#include "../compat/strl.h"
#include "../libsnes.hpp"
#include "../libretro.h"
#include "../general.h"
#include "../compat/strl.h"
#include "main_wrap.h"
@ -260,19 +260,19 @@ struct platform_bind
uint64_t ssnes_default_keybind_lut[SSNES_FIRST_META_KEY];
char ssnes_default_libsnes_keybind_name_lut[SSNES_FIRST_META_KEY][256] = {
"B Button", /* SNES_DEVICE_ID_JOYPAD_B */
"Y Button", /* SNES_DEVICE_ID_JOYPAD_Y */
"Select button", /* SNES_DEVICE_ID_JOYPAD_SELECT */
"Start button", /* SNES_DEVICE_ID_JOYPAD_START */
"D-Pad Up", /* SNES_DEVICE_ID_JOYPAD_UP */
"D-Pad Down", /* SNES_DEVICE_ID_JOYPAD_DOWN */
"D-Pad Left", /* SNES_DEVICE_ID_JOYPAD_LEFT */
"D-Pad Right", /* SNES_DEVICE_ID_JOYPAD_RIGHT */
"A Button", /* SNES_DEVICE_ID_JOYPAD_A */
"X Button", /* SNES_DEVICE_ID_JOYPAD_X */
"L Button", /* SNES_DEVICE_ID_JOYPAD_L */
"R Button", /* SNES_DEVICE_ID_JOYPAD_R */
char ssnes_default_libretro_keybind_name_lut[SSNES_FIRST_META_KEY][256] = {
"B Button", /* RETRO_DEVICE_ID_JOYPAD_B */
"Y Button", /* RETRO_DEVICE_ID_JOYPAD_Y */
"Select button", /* RETRO_DEVICE_ID_JOYPAD_SELECT */
"Start button", /* RETRO_DEVICE_ID_JOYPAD_START */
"D-Pad Up", /* RETRO_DEVICE_ID_JOYPAD_UP */
"D-Pad Down", /* RETRO_DEVICE_ID_JOYPAD_DOWN */
"D-Pad Left", /* RETRO_DEVICE_ID_JOYPAD_LEFT */
"D-Pad Right", /* RETRO_DEVICE_ID_JOYPAD_RIGHT */
"A Button", /* RETRO_DEVICE_ID_JOYPAD_A */
"X Button", /* RETRO_DEVICE_ID_JOYPAD_X */
"L Button", /* RETRO_DEVICE_ID_JOYPAD_L */
"R Button", /* RETRO_DEVICE_ID_JOYPAD_R */
};
#if defined(__CELLOS_LV2__)
@ -472,19 +472,19 @@ void ssnes_input_set_default_keybind_names_for_emulator(void)
// Genesis Plus GX/Next
if (strstr(id, "Genesis Plus GX"))
{
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_B],
"B button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_B]));
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_A],
"C button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_A]));
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_X],
"Y button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_X]));
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_Y],
"A button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_Y]));
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_L],
"X button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_L]));
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_R],
"Z button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_R]));
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_SELECT],
"Mode button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_SELECT]));
strlcpy(ssnes_default_libretro_keybind_name_lut[RETRO_DEVICE_ID_JOYPAD_B],
"B button", sizeof(ssnes_default_libretro_keybind_name_lut[RETRO_DEVICE_ID_JOYPAD_B]));
strlcpy(ssnes_default_libretro_keybind_name_lut[RETRO_DEVICE_ID_JOYPAD_A],
"C button", sizeof(ssnes_default_libretro_keybind_name_lut[RETRO_DEVICE_ID_JOYPAD_A]));
strlcpy(ssnes_default_libretro_keybind_name_lut[RETRO_DEVICE_ID_JOYPAD_X],
"Y button", sizeof(ssnes_default_libretro_keybind_name_lut[RETRO_DEVICE_ID_JOYPAD_X]));
strlcpy(ssnes_default_libretro_keybind_name_lut[RETRO_DEVICE_ID_JOYPAD_Y],
"A button", sizeof(ssnes_default_libretro_keybind_name_lut[RETRO_DEVICE_ID_JOYPAD_Y]));
strlcpy(ssnes_default_libretro_keybind_name_lut[RETRO_DEVICE_ID_JOYPAD_L],
"X button", sizeof(ssnes_default_libretro_keybind_name_lut[RETRO_DEVICE_ID_JOYPAD_L]));
strlcpy(ssnes_default_libretro_keybind_name_lut[RETRO_DEVICE_ID_JOYPAD_R],
"Z button", sizeof(ssnes_default_libretro_keybind_name_lut[RETRO_DEVICE_ID_JOYPAD_R]));
strlcpy(ssnes_default_libretro_keybind_name_lut[RETRO_DEVICE_ID_JOYPAD_SELECT],
"Mode button", sizeof(ssnes_default_libretro_keybind_name_lut[RETRO_DEVICE_ID_JOYPAD_SELECT]));
}
}

View File

@ -44,6 +44,7 @@
VIDEO
============================================================ */
#if defined(__CELLOS_LV2__)
#include "../../gfx/shader_cg.c"
#include "../../ps3/ps3_video_psgl.c"
#include "../../ps3/image.c"
#elif defined(_XBOX)
@ -63,7 +64,7 @@
/*============================================================
SNES STATE
============================================================ */
#include "../../gfx/snes_state.c"
#include "../../gfx/state_tracker.c"
/*============================================================
DRIVERS

View File

@ -101,18 +101,18 @@ static void set_default_settings(void)
g_settings.video.msg_pos_y = 0.90f;
g_settings.video.aspect_ratio = -1.0f;
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_B] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_CROSS];
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_Y] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_SQUARE];
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_SELECT] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_SELECT];
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_START] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_START];
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_UP] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_UP];
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_DOWN] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_DOWN];
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_LEFT] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_LEFT];
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_RIGHT] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_RIGHT];
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_A] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_CIRCLE];
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_X] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_TRIANGLE];
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_L] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_L1];
ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_R] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_R1];
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_B] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_CROSS];
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_Y] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_SQUARE];
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_SELECT] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_SELECT];
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_START] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_START];
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_UP] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_UP];
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_DOWN] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_DOWN];
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_LEFT] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_LEFT];
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_RIGHT] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_RIGHT];
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_A] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_CIRCLE];
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_X] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_TRIANGLE];
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_L1];
ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R] = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_R1];
for(uint32_t x = 0; x < MAX_PLAYERS; x++)
{

View File

@ -556,7 +556,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] =
0.83f,
},
{
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_B,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_B,
"B Button",
"",
0.0f,
@ -569,7 +569,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] =
0.83f,
},
{
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_Y,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_Y,
"Y Button",
"",
0.0f,
@ -582,7 +582,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] =
0.83f,
},
{
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_SELECT,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_SELECT,
"Select button",
"",
0.0f,
@ -595,7 +595,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] =
0.83f,
},
{
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_START,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_START,
"Start button",
"",
0.0f,
@ -608,7 +608,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] =
0.83f,
},
{
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_UP,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_UP,
"D-Pad Up",
"",
0.0f,
@ -621,7 +621,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] =
0.83f,
},
{
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_DOWN,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_DOWN,
"D-Pad Down",
"",
0.0f,
@ -634,7 +634,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] =
0.83f,
},
{
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_LEFT,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_LEFT,
"D-Pad Left",
"",
0.0f,
@ -647,7 +647,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] =
0.83f,
},
{
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_RIGHT,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_RIGHT,
"D-Pad Right",
"",
0.0f,
@ -660,7 +660,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] =
0.83f,
},
{
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_A,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_A,
"A Button",
"",
0.0f,
@ -673,7 +673,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] =
0.83f,
},
{
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_X,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_X,
"X Button",
"",
0.0f,
@ -686,7 +686,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] =
0.83f,
},
{
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_L,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_L,
"L Button",
"",
0.0f,
@ -699,7 +699,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] =
0.83f,
},
{
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_R,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_R,
"R Button",
"",
0.0f,

View File

@ -721,18 +721,18 @@ static void set_setting_label(menu * menu_obj, uint64_t currentsetting)
snprintf(menu_obj->items[currentsetting].comment, sizeof(menu_obj->items[currentsetting].comment), "Controller %d is currently selected.", currently_selected_controller_menu+1);
snprintf(menu_obj->items[currentsetting].setting_text, sizeof(menu_obj->items[currentsetting].setting_text), "%d", currently_selected_controller_menu+1);
break;
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_B:
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_Y:
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_SELECT:
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_START:
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_UP:
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_DOWN:
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_LEFT:
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_RIGHT:
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_A:
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_X:
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_L:
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_R:
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_B:
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_Y:
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_SELECT:
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_START:
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_UP:
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_DOWN:
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_LEFT:
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_RIGHT:
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_A:
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_X:
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_L:
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_R:
{
if(g_settings.input.binds[currently_selected_controller_menu][currentsetting-(FIRST_CONTROL_BIND)].joykey == ssnes_default_keybind_lut[currentsetting-FIRST_CONTROL_BIND])
menu_obj->items[currentsetting].text_color = GREEN;
@ -1754,41 +1754,41 @@ static void producesettingentry(menu * menu_obj, uint64_t switchvalue)
if(CTRL_START(state))
currently_selected_controller_menu = 0;
break;
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_UP:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_UP, SNES_DEVICE_ID_JOYPAD_UP);
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_UP:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_UP, RETRO_DEVICE_ID_JOYPAD_UP);
break;
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_DOWN:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_DOWN, SNES_DEVICE_ID_JOYPAD_DOWN);
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_DOWN:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_DOWN, RETRO_DEVICE_ID_JOYPAD_DOWN);
break;
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_LEFT:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_LEFT, SNES_DEVICE_ID_JOYPAD_LEFT);
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_LEFT:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_LEFT, RETRO_DEVICE_ID_JOYPAD_LEFT);
break;
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_RIGHT:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_RIGHT, SNES_DEVICE_ID_JOYPAD_RIGHT);
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_RIGHT:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_RIGHT, RETRO_DEVICE_ID_JOYPAD_RIGHT);
break;
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_A:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_CIRCLE, SNES_DEVICE_ID_JOYPAD_A);
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_A:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_CIRCLE, RETRO_DEVICE_ID_JOYPAD_A);
break;
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_B:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_CROSS, SNES_DEVICE_ID_JOYPAD_B);
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_B:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_CROSS, RETRO_DEVICE_ID_JOYPAD_B);
break;
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_X:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_TRIANGLE, SNES_DEVICE_ID_JOYPAD_X);
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_X:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_TRIANGLE, RETRO_DEVICE_ID_JOYPAD_X);
break;
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_Y:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_SQUARE, SNES_DEVICE_ID_JOYPAD_Y);
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_Y:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_SQUARE, RETRO_DEVICE_ID_JOYPAD_Y);
break;
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_SELECT:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_SELECT, SNES_DEVICE_ID_JOYPAD_SELECT);
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_SELECT:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_SELECT, RETRO_DEVICE_ID_JOYPAD_SELECT);
break;
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_START:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_START, SNES_DEVICE_ID_JOYPAD_START);
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_START:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_START, RETRO_DEVICE_ID_JOYPAD_START);
break;
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_L:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_L1, SNES_DEVICE_ID_JOYPAD_L);
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_L:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_L1, RETRO_DEVICE_ID_JOYPAD_L);
break;
case SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_R:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_R1, SNES_DEVICE_ID_JOYPAD_R);
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_R:
set_keybind_digital(state, PS3_DEVICE_ID_JOYPAD_R1, RETRO_DEVICE_ID_JOYPAD_R);
break;
case SETTING_CONTROLS_SAVE_CUSTOM_CONTROLS:
if(CTRL_LEFT(state) || CTRL_LSTICK_LEFT(state) || CTRL_RIGHT(state) || CTRL_LSTICK_RIGHT(state) || CTRL_CROSS(state) || CTRL_START(state))
@ -1799,41 +1799,41 @@ static void producesettingentry(menu * menu_obj, uint64_t switchvalue)
case SETTING_CONTROLS_DEFAULT_ALL:
if(CTRL_LEFT(state) || CTRL_LSTICK_LEFT(state) || CTRL_RIGHT(state) || CTRL_LSTICK_RIGHT(state) || CTRL_CROSS(state) || CTRL_START(state))
{
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_UP].id = SNES_DEVICE_ID_JOYPAD_UP;
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_UP].joykey = ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_UP];
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_UP].id = RETRO_DEVICE_ID_JOYPAD_UP;
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_UP].joykey = ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_UP];
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_DOWN].id = SNES_DEVICE_ID_JOYPAD_DOWN;
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_DOWN].joykey = ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_DOWN];
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_DOWN].id = RETRO_DEVICE_ID_JOYPAD_DOWN;
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_DOWN];
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_LEFT].id = SNES_DEVICE_ID_JOYPAD_LEFT;
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_LEFT].joykey = ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_LEFT];
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_LEFT].id = RETRO_DEVICE_ID_JOYPAD_LEFT;
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_LEFT];
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_RIGHT].id = SNES_DEVICE_ID_JOYPAD_RIGHT;
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_RIGHT].joykey = ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_RIGHT];
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_RIGHT].id = RETRO_DEVICE_ID_JOYPAD_RIGHT;
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_RIGHT];
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_A].id = SNES_DEVICE_ID_JOYPAD_A;
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_A].joykey = ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_A];
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_A].id = RETRO_DEVICE_ID_JOYPAD_A;
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_A].joykey = ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_A];
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_B].id = SNES_DEVICE_ID_JOYPAD_B;
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_B].joykey = ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_B];
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_B].id = RETRO_DEVICE_ID_JOYPAD_B;
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_B].joykey = ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_B];
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_X].id = SNES_DEVICE_ID_JOYPAD_X;
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_X].joykey = ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_X];
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_X].id = RETRO_DEVICE_ID_JOYPAD_X;
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_X].joykey = ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_X];
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_Y].id = SNES_DEVICE_ID_JOYPAD_Y;
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_Y].joykey = ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_Y];
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_Y].id = RETRO_DEVICE_ID_JOYPAD_Y;
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_Y].joykey = ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_Y];
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_L].id = SNES_DEVICE_ID_JOYPAD_L;
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_L].joykey = ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_L];
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_L].id = RETRO_DEVICE_ID_JOYPAD_L;
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_L].joykey = ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L];
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_R].id = SNES_DEVICE_ID_JOYPAD_R;
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_R].joykey = ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_R];
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_R].id = RETRO_DEVICE_ID_JOYPAD_R;
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_R].joykey = ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R];
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_START].id = SNES_DEVICE_ID_JOYPAD_START;
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_START].joykey = ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_START];
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_START].id = RETRO_DEVICE_ID_JOYPAD_START;
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_START].joykey = ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_START];
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_SELECT].id = SNES_DEVICE_ID_JOYPAD_SELECT;
g_settings.input.binds[currently_selected_controller_menu][SNES_DEVICE_ID_JOYPAD_SELECT].joykey = ssnes_default_keybind_lut[SNES_DEVICE_ID_JOYPAD_SELECT];
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_SELECT].id = RETRO_DEVICE_ID_JOYPAD_SELECT;
g_settings.input.binds[currently_selected_controller_menu][RETRO_DEVICE_ID_JOYPAD_SELECT].joykey = ssnes_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_SELECT];
menu_reinit_settings();
}
break;

View File

@ -119,18 +119,18 @@ enum
SETTING_PATH_DEFAULT_ALL,
SETTING_CONTROLS_SCHEME,
SETTING_CONTROLS_NUMBER,
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_B,
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_Y,
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_SELECT,
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_START,
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_UP,
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_DOWN,
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_LEFT,
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_RIGHT,
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_A,
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_X,
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_L,
SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_R,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_B,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_Y,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_SELECT,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_START,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_UP,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_DOWN,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_LEFT,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_RIGHT,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_A,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_X,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_L,
SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_R,
SETTING_CONTROLS_SAVE_CUSTOM_CONTROLS,
SETTING_CONTROLS_DEFAULT_ALL
};
@ -142,7 +142,7 @@ enum
#define FIRST_EMU_AUDIO_SETTING SETTING_EMU_VIDEO_DEFAULT_ALL+1
#define FIRST_PATH_SETTING SETTING_EMU_AUDIO_DEFAULT_ALL+1
#define FIRST_CONTROLS_SETTING_PAGE_1 SETTING_PATH_DEFAULT_ALL+1
#define FIRST_CONTROL_BIND SETTING_CONTROLS_SNES_DEVICE_ID_JOYPAD_B
#define FIRST_CONTROL_BIND SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_B
#define MAX_NO_OF_VIDEO_SETTINGS SETTING_DEFAULT_VIDEO_ALL+1
#define MAX_NO_OF_AUDIO_SETTINGS SETTING_DEFAULT_AUDIO_ALL+1

View File

@ -27,7 +27,7 @@
#include "ps3_video_psgl.h"
#include "../driver.h"
#include "../console/console_ext_input.h"
#include "../libsnes.hpp"
#include "../libretro.h"
#include "../general.h"
#include "shared.h"
@ -109,17 +109,17 @@ static int16_t ps3_input_state(void *data, const struct snes_keybind **binds,
player = 0;
pads_connected = cell_pad_input_pads_connected();
if (device != SNES_DEVICE_JOYPAD)
if (device != RETRO_DEVICE_JOYPAD)
return 0;
if (port == SNES_PORT_2)
if (port == 1)
{
if(pads_connected < 2)
return 0;
player = 1;
if(device == SNES_DEVICE_MULTITAP)
if(device == RETRO_DEVICE_MULTITAP)
player += index;
}
@ -280,22 +280,22 @@ void ps3_input_map_dpad_to_stick(uint32_t map_dpad_enum, uint32_t controller_id)
switch(map_dpad_enum)
{
case DPAD_EMULATION_NONE:
g_settings.input.binds[controller_id][SNES_DEVICE_ID_JOYPAD_UP].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_UP];
g_settings.input.binds[controller_id][SNES_DEVICE_ID_JOYPAD_DOWN].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_DOWN];
g_settings.input.binds[controller_id][SNES_DEVICE_ID_JOYPAD_LEFT].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_LEFT];
g_settings.input.binds[controller_id][SNES_DEVICE_ID_JOYPAD_RIGHT].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_RIGHT];
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_UP];
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_DOWN];
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_LEFT];
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_JOYPAD_RIGHT];
break;
case DPAD_EMULATION_LSTICK:
g_settings.input.binds[controller_id][SNES_DEVICE_ID_JOYPAD_UP].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_LSTICK_UP_DPAD];
g_settings.input.binds[controller_id][SNES_DEVICE_ID_JOYPAD_DOWN].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_LSTICK_DOWN_DPAD];
g_settings.input.binds[controller_id][SNES_DEVICE_ID_JOYPAD_LEFT].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_LSTICK_LEFT_DPAD];
g_settings.input.binds[controller_id][SNES_DEVICE_ID_JOYPAD_RIGHT].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_LSTICK_RIGHT_DPAD];
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_LSTICK_UP_DPAD];
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_LSTICK_DOWN_DPAD];
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_LSTICK_LEFT_DPAD];
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_LSTICK_RIGHT_DPAD];
break;
case DPAD_EMULATION_RSTICK:
g_settings.input.binds[controller_id][SNES_DEVICE_ID_JOYPAD_UP].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_RSTICK_UP_DPAD];
g_settings.input.binds[controller_id][SNES_DEVICE_ID_JOYPAD_DOWN].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_RSTICK_DOWN_DPAD];
g_settings.input.binds[controller_id][SNES_DEVICE_ID_JOYPAD_LEFT].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_RSTICK_LEFT_DPAD];
g_settings.input.binds[controller_id][SNES_DEVICE_ID_JOYPAD_RIGHT].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_RSTICK_RIGHT_DPAD];
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_RSTICK_UP_DPAD];
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_RSTICK_DOWN_DPAD];
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_RSTICK_LEFT_DPAD];
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = ssnes_platform_keybind_lut[PS3_DEVICE_ID_RSTICK_RIGHT_DPAD];
break;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -83,25 +83,6 @@ typedef struct gl
void *empty_buf;
} gl_t;
struct gl_cg_cgp_info
{
const char *shader[2];
bool filter_linear[2];
bool render_to_texture;
float fbo_scale;
const char *lut_texture_path;
const char *lut_texture_id;
bool lut_texture_absolute;
};
struct gl_cg_lut_info
{
char id[64];
GLuint tex;
};
bool ps3_setup_texture(void);
const char * ps3_get_resolution_label(uint32_t resolution);
int ps3_check_resolution(uint32_t resolution_id);