Fixed some core options:

- psx.input.port1.multitap was renamed for some reason to psx.input.pport1.multitap
    - psx.input.port2.multitap was renamed for some reason to psx.input.pport2.multitap

    Dualshock analogs were "broken", mednafen has psx.input.analog_mode_ct, if true then you toggle analogs by pressing start+select+l1+l2+r1+r2 for roughly two seconds. In the libretro port it was set to 1 always.
    I've made this a core option:
    setting_psx_analog_toggle, this enables/disables the MODE button, defaults to disabled.

    I think a sane default is for it to be disabled and analogs to work out of the box so I have added that too.
    If setting_psx_analog_toggle is enabled then it replicates mednafen's and the psx's  behavior, MODE button works and by default it's off, so analogs are off.
This commit is contained in:
AndresSM 2014-04-22 23:37:06 -05:00
parent 4d55eb140e
commit b43fe8e26b
4 changed files with 32 additions and 8 deletions

20
libretro.cpp Normal file → Executable file
View File

@ -584,9 +584,18 @@ static void check_variables(void)
hookup_ports(true);
}
var.key = "psx_enable_multitap_port1";
var.key = "psx_enable_analog_toggle";
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var))
{
if (strcmp(var.value, "enabled") == 0)
setting_psx_analog_toggle = 1;
else if (strcmp(var.value, "disabled") == 0)
setting_psx_analog_toggle = 0;
}
var.key = "psx_enable_multitap_port1";
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var))
{
if (strcmp(var.value, "enabled") == 0)
@ -753,7 +762,8 @@ static void hookup_ports(bool force)
case RETRO_DEVICE_ANALOG:
{
log_cb(RETRO_LOG_INFO, "[%s]: Selected analog controller type %s.\n", mednafen_core_str, psx_analog_type);
currgame->SetInput(j, psx_analog_type, &buf.u8[j]);
currgame->SetInput(j, psx_analog_type, &buf.u8[j]);
break;
}
default:
@ -1467,9 +1477,11 @@ void retro_set_environment(retro_environment_t cb)
#elif defined(WANT_PSX_EMU)
static const struct retro_variable vars[] = {
{ "psx_dithering", "Dithering; enabled|disabled" },
{ "psx_enable_dual_analog_type", "Analog controller mode; disabled|dualshock|dualanalog|flightstick" },
{ "psx_enable_dual_analog_type", "Analog controller mode; disabled|dualshock|dualanalog|flightstick" },
{ "psx_enable_analog_toggle", "Dualshock analog button; disabled|enabled" },
{ "psx_enable_multitap_port1", "Port 1: Multitap enable; disabled|enabled" },
{ "psx_enable_multitap_port2", "Port 2: Multitap enable; disabled|enabled" },
{ NULL, NULL },
};

12
mednafen/psx-09333/input/dualshock.cpp Normal file → Executable file
View File

@ -151,6 +151,16 @@ void InputDevice_DualShock::ResetTS(void)
void InputDevice_DualShock::SetAMCT(bool enabled)
{
amct_enabled = enabled;
if(amct_enabled)
{
analog_mode = false;
fprintf(stderr, "Analog button enabled, analog mode false\n");
}
else
{
analog_mode = true;
fprintf(stderr, "Analog button disabled, analog mode true\n");
}
}
//
@ -224,7 +234,6 @@ void InputDevice_DualShock::Power(void)
transmit_pos = 0;
transmit_count = 0;
analog_mode = false;
analog_mode_locked = false;
mad_munchkins = false;
@ -285,6 +294,7 @@ void InputDevice_DualShock::UpdateInput(const void *data)
//
CheckManualAnaModeChange();
//MDFN_DispMessage(_("%s: Analog mode is %s(%s)."), gp_name.c_str(), analog_mode ? _("on") : _("off"), analog_mode_locked ? _("locked") : _("unlocked"));
if(am_prev_info != analog_mode || aml_prev_info != analog_mode_locked)
{
MDFN_DispMessage(_("%s: Analog mode is %s(%s)."), gp_name.c_str(), analog_mode ? _("on") : _("off"), analog_mode_locked ? _("locked") : _("unlocked"));

7
mednafen/settings.cpp Normal file → Executable file
View File

@ -31,6 +31,7 @@ uint32_t setting_pce_keepaspect = 1;
#elif defined(WANT_PSX_EMU)
uint32_t setting_psx_multitap_port_1 = 0;
uint32_t setting_psx_multitap_port_2 = 0;
uint32_t setting_psx_analog_toggle = 0;
uint32_t setting_psx_fastboot = 1;
#elif defined(WANT_NGP_EMU)
uint32_t setting_ngp_language = 0;
@ -225,14 +226,14 @@ bool MDFN_GetSettingB(const char *name)
return 1;
if (!strcmp("psx.input.port8.memcard", name))
return 1;
if (!strcmp("psx.input.port1.multitap", name)) /* make configurable */
if (!strcmp("psx.input.pport1.multitap", name)) /* make configurable */
return setting_psx_multitap_port_1;
if (!strcmp("psx.input.port2.multitap", name)) /* make configurable */
if (!strcmp("psx.input.pport2.multitap", name)) /* make configurable */
return setting_psx_multitap_port_2;
if (!strcmp("psx.region_autodetect", name)) /* make configurable */
return 1;
if (!strcmp("psx.input.analog_mode_ct", name)) /* make configurable */
return 1;
return setting_psx_analog_toggle;
if (!strcmp("psx.fastboot", name))
return setting_psx_fastboot;
#elif defined(WANT_NGP_EMU)

1
mednafen/settings.h Normal file → Executable file
View File

@ -13,6 +13,7 @@ extern uint32_t setting_pce_keepaspect;
#elif defined(WANT_PSX_EMU)
extern uint32_t setting_psx_multitap_port_1;
extern uint32_t setting_psx_multitap_port_2;
extern uint32_t setting_psx_analog_toggle;
extern uint32_t setting_psx_fastboot;
#elif defined(WANT_NGP_EMU)
extern uint32_t setting_ngp_language;