add sfc ext support, fix broken cc analog stick

This commit is contained in:
dborth 2008-10-17 06:00:38 +00:00
parent b6273051f8
commit 8ce34860a3
2 changed files with 51 additions and 9 deletions

View File

@ -283,7 +283,9 @@ bool IsValidROM(int method)
if(p != NULL) 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; return true;
} }

View File

@ -299,13 +299,33 @@ void decodepad (int pad)
{ {
/*** we don't want division by zero ***/ /*** we don't want division by zero ***/
if (wm_ax > 0 && wm_ay == 0) if (wm_ax > 0 && wm_ay == 0)
wp |= WPAD_BUTTON_RIGHT; {
if(exp_type == WPAD_EXP_CLASSIC)
wp |= WPAD_CLASSIC_BUTTON_RIGHT;
else
wp |= WPAD_BUTTON_RIGHT;
}
if (wm_ax < 0 && wm_ay == 0) if (wm_ax < 0 && wm_ay == 0)
wp |= WPAD_BUTTON_LEFT; {
if(exp_type == WPAD_EXP_CLASSIC)
wp |= WPAD_CLASSIC_BUTTON_LEFT;
else
wp |= WPAD_BUTTON_LEFT;
}
if (wm_ax == 0 && wm_ay > 0) if (wm_ax == 0 && wm_ay > 0)
wp |= WPAD_BUTTON_UP; {
if(exp_type == WPAD_EXP_CLASSIC)
wp |= WPAD_CLASSIC_BUTTON_UP;
else
wp |= WPAD_BUTTON_UP;
}
if (wm_ax == 0 && wm_ay < 0) if (wm_ax == 0 && wm_ay < 0)
wp |= WPAD_BUTTON_DOWN; {
if(exp_type == WPAD_EXP_CLASSIC)
wp |= WPAD_CLASSIC_BUTTON_DOWN;
else
wp |= WPAD_BUTTON_DOWN;
}
if (wm_ax != 0 && wm_ay != 0) if (wm_ax != 0 && wm_ay != 0)
{ {
@ -314,9 +334,19 @@ void decodepad (int pad)
if (t >= -2.41421356237 && t < 2.41421356237) if (t >= -2.41421356237 && t < 2.41421356237)
{ {
if (wm_ax >= 0) if (wm_ax >= 0)
wp |= WPAD_BUTTON_RIGHT; {
if(exp_type == WPAD_EXP_CLASSIC)
wp |= WPAD_CLASSIC_BUTTON_RIGHT;
else
wp |= WPAD_BUTTON_RIGHT;
}
else else
wp |= WPAD_BUTTON_LEFT; {
if(exp_type == WPAD_EXP_CLASSIC)
wp |= WPAD_CLASSIC_BUTTON_LEFT;
else
wp |= WPAD_BUTTON_LEFT;
}
} }
/*** Recalc up / down ***/ /*** Recalc up / down ***/
@ -324,9 +354,19 @@ void decodepad (int pad)
if (t >= -2.41421356237 && t < 2.41421356237) if (t >= -2.41421356237 && t < 2.41421356237)
{ {
if (wm_ay >= 0) if (wm_ay >= 0)
wp |= WPAD_BUTTON_UP; {
if(exp_type == WPAD_EXP_CLASSIC)
wp |= WPAD_CLASSIC_BUTTON_UP;
else
wp |= WPAD_BUTTON_UP;
}
else else
wp |= WPAD_BUTTON_DOWN; {
if(exp_type == WPAD_EXP_CLASSIC)
wp |= WPAD_CLASSIC_BUTTON_DOWN;
else
wp |= WPAD_BUTTON_DOWN;
}
} }
} }
} }