sdl: code cleanup

This commit is contained in:
punkrockguy318 2012-08-04 20:14:35 +00:00
parent e4e0ea6228
commit 989e3271c6
1 changed files with 41 additions and 39 deletions

View File

@ -319,6 +319,8 @@ std::string GetUserText (const char *title)
#ifdef _GTK #ifdef _GTK
/* prg318 - 10/13/11 - this is broken in recent build and causes segfaults/very weird behavior /* prg318 - 10/13/11 - this is broken in recent build and causes segfaults/very weird behavior
i'd rather remove it for now than it cause accidental segfaults i'd rather remove it for now than it cause accidental segfaults
TODO fix it
GtkWidget* d; GtkWidget* d;
GtkWidget* entry; GtkWidget* entry;
@ -1112,52 +1114,52 @@ ButtConfig GamePadConfig[4][10] = {
static void static void
UpdateGamepad (void) UpdateGamepad (void)
{ {
// don't update during movie playback // don't update during movie playback
if (FCEUMOV_Mode (MOVIEMODE_PLAY)) if (FCEUMOV_Mode (MOVIEMODE_PLAY))
{
return;
}
static int rapid = 0;
uint32 JS = 0;
int x;
int wg;
rapid ^= 1;
// go through each of the four game pads
for (wg = 0; wg < 4; wg++)
{
// the 4 directional buttons, start, select, a, b
for (x = 0; x < 8; x++)
{ {
if (DTestButton (&GamePadConfig[wg][x])) return;
{ }
JS |= (1 << x) << (wg << 3);
}
}
// rapid-fire a, rapid-fire b static int rapid = 0;
if (rapid) uint32 JS = 0;
{ int x;
for (x = 0; x < 2; x++) int wg;
{
if (DTestButton (&GamePadConfig[wg][8 + x])) rapid ^= 1;
// go through each of the four game pads
for (wg = 0; wg < 4; wg++)
{
// the 4 directional buttons, start, select, a, b
for (x = 0; x < 8; x++)
{ {
JS |= (1 << x) << (wg << 3); if (DTestButton (&GamePadConfig[wg][x]))
{
JS |= (1 << x) << (wg << 3);
}
}
// rapid-fire a, rapid-fire b
if (rapid)
{
for (x = 0; x < 2; x++)
{
if (DTestButton (&GamePadConfig[wg][8 + x]))
{
JS |= (1 << x) << (wg << 3);
}
}
} }
}
} }
}
// for(x=0;x<32;x+=8) /* Now, test to see if anything weird(up+down at same time) // for(x=0;x<32;x+=8) /* Now, test to see if anything weird(up+down at same time)
// is happening, and correct */ // is happening, and correct */
// { // {
// if((JS & (0xC0<<x) ) == (0xC0<<x) ) JS&=~(0xC0<<x); // if((JS & (0xC0<<x) ) == (0xC0<<x) ) JS&=~(0xC0<<x);
// if((JS & (0x30<<x) ) == (0x30<<x) ) JS&=~(0x30<<x); // if((JS & (0x30<<x) ) == (0x30<<x) ) JS&=~(0x30<<x);
// } // }
JSreturn = JS; JSreturn = JS;
} }
static ButtConfig powerpadsc[2][12] = { static ButtConfig powerpadsc[2][12] = {