mirror of
https://github.com/dborth/snes9xgx.git
synced 2024-11-27 21:14:21 +01:00
add sfc ext support, fix broken cc analog stick
This commit is contained in:
parent
b6273051f8
commit
8ce34860a3
@ -283,7 +283,9 @@ bool IsValidROM(int method)
|
||||
|
||||
if(p != NULL)
|
||||
{
|
||||
if (stricmp(p, ".smc") == 0 || stricmp(p, ".fig") == 0)
|
||||
if (stricmp(p, ".smc") == 0 ||
|
||||
stricmp(p, ".fig") == 0 ||
|
||||
stricmp(p, ".sfc") == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -299,13 +299,33 @@ void decodepad (int pad)
|
||||
{
|
||||
/*** we don't want division by zero ***/
|
||||
if (wm_ax > 0 && wm_ay == 0)
|
||||
{
|
||||
if(exp_type == WPAD_EXP_CLASSIC)
|
||||
wp |= WPAD_CLASSIC_BUTTON_RIGHT;
|
||||
else
|
||||
wp |= WPAD_BUTTON_RIGHT;
|
||||
}
|
||||
if (wm_ax < 0 && wm_ay == 0)
|
||||
{
|
||||
if(exp_type == WPAD_EXP_CLASSIC)
|
||||
wp |= WPAD_CLASSIC_BUTTON_LEFT;
|
||||
else
|
||||
wp |= WPAD_BUTTON_LEFT;
|
||||
}
|
||||
if (wm_ax == 0 && wm_ay > 0)
|
||||
{
|
||||
if(exp_type == WPAD_EXP_CLASSIC)
|
||||
wp |= WPAD_CLASSIC_BUTTON_UP;
|
||||
else
|
||||
wp |= WPAD_BUTTON_UP;
|
||||
}
|
||||
if (wm_ax == 0 && wm_ay < 0)
|
||||
{
|
||||
if(exp_type == WPAD_EXP_CLASSIC)
|
||||
wp |= WPAD_CLASSIC_BUTTON_DOWN;
|
||||
else
|
||||
wp |= WPAD_BUTTON_DOWN;
|
||||
}
|
||||
|
||||
if (wm_ax != 0 && wm_ay != 0)
|
||||
{
|
||||
@ -314,22 +334,42 @@ void decodepad (int pad)
|
||||
if (t >= -2.41421356237 && t < 2.41421356237)
|
||||
{
|
||||
if (wm_ax >= 0)
|
||||
{
|
||||
if(exp_type == WPAD_EXP_CLASSIC)
|
||||
wp |= WPAD_CLASSIC_BUTTON_RIGHT;
|
||||
else
|
||||
wp |= WPAD_BUTTON_RIGHT;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(exp_type == WPAD_EXP_CLASSIC)
|
||||
wp |= WPAD_CLASSIC_BUTTON_LEFT;
|
||||
else
|
||||
wp |= WPAD_BUTTON_LEFT;
|
||||
}
|
||||
}
|
||||
|
||||
/*** Recalc up / down ***/
|
||||
t = (float) wm_ax / wm_ay;
|
||||
if (t >= -2.41421356237 && t < 2.41421356237)
|
||||
{
|
||||
if (wm_ay >= 0)
|
||||
{
|
||||
if(exp_type == WPAD_EXP_CLASSIC)
|
||||
wp |= WPAD_CLASSIC_BUTTON_UP;
|
||||
else
|
||||
wp |= WPAD_BUTTON_UP;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(exp_type == WPAD_EXP_CLASSIC)
|
||||
wp |= WPAD_CLASSIC_BUTTON_DOWN;
|
||||
else
|
||||
wp |= WPAD_BUTTON_DOWN;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*** Fix offset to pad ***/
|
||||
|
Loading…
Reference in New Issue
Block a user