sdl: fix formatting in code
This commit is contained in:
parent
3d1484c7e7
commit
5eeafe4ae3
|
@ -1315,7 +1315,7 @@ FCEUD_UpdateInput ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
FCEUD_SetInput (bool fourscore, bool microphone, ESI port0, ESI port1,
|
FCEUD_SetInput (bool fourscore, bool microphone, ESI port0, ESI port1,
|
||||||
ESIFC fcexp)
|
ESIFC fcexp)
|
||||||
{
|
{
|
||||||
|
@ -1342,8 +1342,7 @@ FCEUD_SetInput (bool fourscore, bool microphone, ESI port0, ESI port1,
|
||||||
/**
|
/**
|
||||||
* Initialize the input device interface between the emulation and the driver.
|
* Initialize the input device interface between the emulation and the driver.
|
||||||
*/
|
*/
|
||||||
void
|
void InitInputInterface ()
|
||||||
InitInputInterface ()
|
|
||||||
{
|
{
|
||||||
void *InputDPtr;
|
void *InputDPtr;
|
||||||
|
|
||||||
|
@ -1447,8 +1446,7 @@ static ButtConfig fkbmap[0x48] = {
|
||||||
/**
|
/**
|
||||||
* Update the status of the Family KeyBoard.
|
* Update the status of the Family KeyBoard.
|
||||||
*/
|
*/
|
||||||
static void
|
static void updatefkb ()
|
||||||
UpdateFKB ()
|
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
|
|
||||||
|
@ -1456,7 +1454,7 @@ UpdateFKB ()
|
||||||
{
|
{
|
||||||
fkbkeys[x] = 0;
|
fkbkeys[x] = 0;
|
||||||
|
|
||||||
if (DTestButton (&fkbmap[x]))
|
if (dtestbutton (&fkbmap[x]))
|
||||||
{
|
{
|
||||||
fkbkeys[x] = 1;
|
fkbkeys[x] = 1;
|
||||||
}
|
}
|
||||||
|
@ -1470,7 +1468,7 @@ static ButtConfig HyperShotButtons[4] = {
|
||||||
/**
|
/**
|
||||||
* Update the status of the HyperShot input device.
|
* Update the status of the HyperShot input device.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
UpdateHyperShot ()
|
UpdateHyperShot ()
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
|
@ -1494,7 +1492,7 @@ static ButtConfig MahjongButtons[21] = {
|
||||||
/**
|
/**
|
||||||
* Update the status of for the Mahjong input device.
|
* Update the status of for the Mahjong input device.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
UpdateMahjong ()
|
UpdateMahjong ()
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
|
@ -1516,7 +1514,7 @@ static ButtConfig QuizKingButtons[6] = {
|
||||||
/**
|
/**
|
||||||
* Update the status of the QuizKing input device.
|
* Update the status of the QuizKing input device.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
UpdateQuizKing ()
|
UpdateQuizKing ()
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
|
@ -1539,7 +1537,7 @@ static ButtConfig TopRiderButtons[8] = {
|
||||||
/**
|
/**
|
||||||
* Update the status of the TopRider input device.
|
* Update the status of the TopRider input device.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
UpdateTopRider ()
|
UpdateTopRider ()
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
|
@ -1563,8 +1561,7 @@ static ButtConfig FTrainerButtons[12] = {
|
||||||
/**
|
/**
|
||||||
* Update the status of the FTrainer input device.
|
* Update the status of the FTrainer input device.
|
||||||
*/
|
*/
|
||||||
static void
|
static void UpdateFTrainer ()
|
||||||
UpdateFTrainer ()
|
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
FTrainerData = 0;
|
FTrainerData = 0;
|
||||||
|
@ -1584,8 +1581,7 @@ UpdateFTrainer ()
|
||||||
* @param bc the NES gamepad's button config
|
* @param bc the NES gamepad's button config
|
||||||
* @param which the index of the button
|
* @param which the index of the button
|
||||||
*/
|
*/
|
||||||
const char *
|
const char * ButtonName (const ButtConfig * bc, int which)
|
||||||
ButtonName (const ButtConfig * bc, int which)
|
|
||||||
{
|
{
|
||||||
static char name[256];
|
static char name[256];
|
||||||
|
|
||||||
|
@ -1647,8 +1643,7 @@ ButtonName (const ButtConfig * bc, int which)
|
||||||
* Waits for a button input and returns the information as to which
|
* Waits for a button input and returns the information as to which
|
||||||
* button was pressed. Used in button configuration.
|
* button was pressed. Used in button configuration.
|
||||||
*/
|
*/
|
||||||
int
|
int DWaitButton (const uint8 * text, ButtConfig * bc, int wb)
|
||||||
DWaitButton (const uint8 * text, ButtConfig * bc, int wb)
|
|
||||||
{
|
{
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
static int32 LastAx[64][64];
|
static int32 LastAx[64][64];
|
||||||
|
@ -1744,7 +1739,7 @@ DWaitButton (const uint8 * text, ButtConfig * bc, int wb)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1754,26 +1749,25 @@ DWaitButton (const uint8 * text, ButtConfig * bc, int wb)
|
||||||
* used as input for the specified button, thus allowing up to four
|
* used as input for the specified button, thus allowing up to four
|
||||||
* possible settings for each input button.
|
* possible settings for each input button.
|
||||||
*/
|
*/
|
||||||
void
|
void configbutton (char *text, buttconfig * bc)
|
||||||
ConfigButton (char *text, ButtConfig * bc)
|
|
||||||
{
|
{
|
||||||
uint8 buf[256];
|
uint8 buf[256];
|
||||||
int wc;
|
int wc;
|
||||||
|
|
||||||
for (wc = 0; wc < MAXBUTTCONFIG; wc++)
|
for (wc = 0; wc < maxbuttconfig; wc++)
|
||||||
{
|
{
|
||||||
sprintf ((char *) buf, "%s (%d)", text, wc + 1);
|
sprintf ((char *) buf, "%s (%d)", text, wc + 1);
|
||||||
DWaitButton (buf, bc, wc);
|
dwaitbutton (buf, bc, wc);
|
||||||
|
|
||||||
if (wc &&
|
if (wc &&
|
||||||
bc->ButtType[wc] == bc->ButtType[wc - 1] &&
|
bc->butttype[wc] == bc->butttype[wc - 1] &&
|
||||||
bc->DeviceNum[wc] == bc->DeviceNum[wc - 1] &&
|
bc->devicenum[wc] == bc->devicenum[wc - 1] &&
|
||||||
bc->ButtonNum[wc] == bc->ButtonNum[wc - 1])
|
bc->buttonnum[wc] == bc->buttonnum[wc - 1])
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bc->NumC = wc;
|
bc->numc = wc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1781,8 +1775,7 @@ ConfigButton (char *text, ButtConfig * bc)
|
||||||
*/
|
*/
|
||||||
extern Config *g_config;
|
extern Config *g_config;
|
||||||
|
|
||||||
void
|
void ConfigDevice (int which, int arg)
|
||||||
ConfigDevice (int which, int arg)
|
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
int x;
|
int x;
|
||||||
|
@ -1916,8 +1909,7 @@ ConfigDevice (int which, int arg)
|
||||||
/**
|
/**
|
||||||
* Update the button configuration for a device, specified by a text string.
|
* Update the button configuration for a device, specified by a text string.
|
||||||
*/
|
*/
|
||||||
void
|
void InputCfg (const std::string & text)
|
||||||
InputCfg (const std::string & text)
|
|
||||||
{
|
{
|
||||||
#ifdef _GTK
|
#ifdef _GTK
|
||||||
// enable noGui to prevent the gtk x11 hack from executing
|
// enable noGui to prevent the gtk x11 hack from executing
|
||||||
|
@ -1970,8 +1962,7 @@ InputCfg (const std::string & text)
|
||||||
* configuration management. Will probably want to change this in the
|
* configuration management. Will probably want to change this in the
|
||||||
* future - soules.
|
* future - soules.
|
||||||
*/
|
*/
|
||||||
void
|
void UpdateInput (Config * config)
|
||||||
UpdateInput (Config * config)
|
|
||||||
{
|
{
|
||||||
char buf[64];
|
char buf[64];
|
||||||
std::string device, prefix;
|
std::string device, prefix;
|
||||||
|
@ -2289,9 +2280,9 @@ const char *GamePadNames[GAMEPAD_NUM_BUTTONS] = { "A", "B", "Select", "Start",
|
||||||
"Up", "Down", "Left", "Right", "TurboA", "TurboB"
|
"Up", "Down", "Left", "Right", "TurboA", "TurboB"
|
||||||
};
|
};
|
||||||
const char *DefaultGamePadDevice[GAMEPAD_NUM_DEVICES] =
|
const char *DefaultGamePadDevice[GAMEPAD_NUM_DEVICES] =
|
||||||
{ "Keyboard", "None", "None", "None" };
|
{ "Keyboard", "None", "None", "None" };
|
||||||
const int DefaultGamePad[GAMEPAD_NUM_DEVICES][GAMEPAD_NUM_BUTTONS] =
|
const int DefaultGamePad[GAMEPAD_NUM_DEVICES][GAMEPAD_NUM_BUTTONS] =
|
||||||
{ {SDLK_F, SDLK_D, SDLK_S, SDLK_RETURN,
|
{ {SDLK_F, SDLK_D, SDLK_S, SDLK_RETURN,
|
||||||
SDLK_UP, SDLK_DOWN, SDLK_LEFT, SDLK_RIGHT, 0, 0},
|
SDLK_UP, SDLK_DOWN, SDLK_LEFT, SDLK_RIGHT, 0, 0},
|
||||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
||||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
||||||
|
@ -2300,11 +2291,11 @@ const int DefaultGamePad[GAMEPAD_NUM_DEVICES][GAMEPAD_NUM_BUTTONS] =
|
||||||
|
|
||||||
// PowerPad defaults
|
// PowerPad defaults
|
||||||
const char *PowerPadNames[POWERPAD_NUM_BUTTONS] =
|
const char *PowerPadNames[POWERPAD_NUM_BUTTONS] =
|
||||||
{ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B" };
|
{ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B" };
|
||||||
const char *DefaultPowerPadDevice[POWERPAD_NUM_DEVICES] =
|
const char *DefaultPowerPadDevice[POWERPAD_NUM_DEVICES] =
|
||||||
{ "Keyboard", "None" };
|
{ "Keyboard", "None" };
|
||||||
const int DefaultPowerPad[POWERPAD_NUM_DEVICES][POWERPAD_NUM_BUTTONS] =
|
const int DefaultPowerPad[POWERPAD_NUM_DEVICES][POWERPAD_NUM_BUTTONS] =
|
||||||
{ {SDLK_o, SDLK_p, SDLK_LEFTBRACKET, SDLK_RIGHTBRACKET,
|
{ {SDLK_o, SDLK_p, SDLK_LEFTBRACKET, SDLK_RIGHTBRACKET,
|
||||||
SDLK_k, SDLK_l, SDLK_SEMICOLON, SDLK_QUOTE,
|
SDLK_k, SDLK_l, SDLK_SEMICOLON, SDLK_QUOTE,
|
||||||
SDLK_m, SDLK_COMMA, SDLK_PERIOD, SDLK_SLASH},
|
SDLK_m, SDLK_COMMA, SDLK_PERIOD, SDLK_SLASH},
|
||||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||||
|
@ -2312,52 +2303,52 @@ const int DefaultPowerPad[POWERPAD_NUM_DEVICES][POWERPAD_NUM_BUTTONS] =
|
||||||
|
|
||||||
// QuizKing defaults
|
// QuizKing defaults
|
||||||
const char *QuizKingNames[QUIZKING_NUM_BUTTONS] =
|
const char *QuizKingNames[QUIZKING_NUM_BUTTONS] =
|
||||||
{ "0", "1", "2", "3", "4", "5" };
|
{ "0", "1", "2", "3", "4", "5" };
|
||||||
const char *DefaultQuizKingDevice = "Keyboard";
|
const char *DefaultQuizKingDevice = "Keyboard";
|
||||||
const int DefaultQuizKing[QUIZKING_NUM_BUTTONS] =
|
const int DefaultQuizKing[QUIZKING_NUM_BUTTONS] =
|
||||||
{ SDLK_q, SDLK_w, SDLK_e, SDLK_r, SDLK_t, SDLK_y };
|
{ SDLK_q, SDLK_w, SDLK_e, SDLK_r, SDLK_t, SDLK_y };
|
||||||
|
|
||||||
// HyperShot defaults
|
// HyperShot defaults
|
||||||
const char *HyperShotNames[HYPERSHOT_NUM_BUTTONS] = { "0", "1", "2", "3" };
|
const char *HyperShotNames[HYPERSHOT_NUM_BUTTONS] = { "0", "1", "2", "3" };
|
||||||
|
|
||||||
const char *DefaultHyperShotDevice = "Keyboard";
|
const char *DefaultHyperShotDevice = "Keyboard";
|
||||||
const int DefaultHyperShot[HYPERSHOT_NUM_BUTTONS] =
|
const int DefaultHyperShot[HYPERSHOT_NUM_BUTTONS] =
|
||||||
{ SDLK_q, SDLK_w, SDLK_e, SDLK_r };
|
{ SDLK_q, SDLK_w, SDLK_e, SDLK_r };
|
||||||
|
|
||||||
// Mahjong defaults
|
// Mahjong defaults
|
||||||
const char *MahjongNames[MAHJONG_NUM_BUTTONS] =
|
const char *MahjongNames[MAHJONG_NUM_BUTTONS] =
|
||||||
{ "00", "01", "02", "03", "04", "05", "06", "07",
|
{ "00", "01", "02", "03", "04", "05", "06", "07",
|
||||||
"08", "09", "10", "11", "12", "13", "14", "15",
|
"08", "09", "10", "11", "12", "13", "14", "15",
|
||||||
"16", "17", "18", "19", "20"
|
"16", "17", "18", "19", "20"
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *DefaultMahjongDevice = "Keyboard";
|
const char *DefaultMahjongDevice = "Keyboard";
|
||||||
const int DefaultMahjong[MAHJONG_NUM_BUTTONS] =
|
const int DefaultMahjong[MAHJONG_NUM_BUTTONS] =
|
||||||
{ SDLK_q, SDLK_w, SDLK_e, SDLK_r, SDLK_t, SDLK_a, SDLK_s, SDLK_d,
|
{ SDLK_q, SDLK_w, SDLK_e, SDLK_r, SDLK_t, SDLK_a, SDLK_s, SDLK_d,
|
||||||
SDLK_f, SDLK_g, SDLK_h, SDLK_j, SDLK_k, SDLK_l, SDLK_z, SDLK_x,
|
SDLK_f, SDLK_g, SDLK_h, SDLK_j, SDLK_k, SDLK_l, SDLK_z, SDLK_x,
|
||||||
SDLK_c, SDLK_v, SDLK_b, SDLK_n, SDLK_m
|
SDLK_c, SDLK_v, SDLK_b, SDLK_n, SDLK_m
|
||||||
};
|
};
|
||||||
|
|
||||||
// TopRider defaults
|
// TopRider defaults
|
||||||
const char *TopRiderNames[TOPRIDER_NUM_BUTTONS] =
|
const char *TopRiderNames[TOPRIDER_NUM_BUTTONS] =
|
||||||
{ "0", "1", "2", "3", "4", "5", "6", "7" };
|
{ "0", "1", "2", "3", "4", "5", "6", "7" };
|
||||||
const char *DefaultTopRiderDevice = "Keyboard";
|
const char *DefaultTopRiderDevice = "Keyboard";
|
||||||
const int DefaultTopRider[TOPRIDER_NUM_BUTTONS] =
|
const int DefaultTopRider[TOPRIDER_NUM_BUTTONS] =
|
||||||
{ SDLK_q, SDLK_w, SDLK_e, SDLK_r, SDLK_t, SDLK_y, SDLK_u, SDLK_i };
|
{ SDLK_q, SDLK_w, SDLK_e, SDLK_r, SDLK_t, SDLK_y, SDLK_u, SDLK_i };
|
||||||
|
|
||||||
// FTrainer defaults
|
// FTrainer defaults
|
||||||
const char *FTrainerNames[FTRAINER_NUM_BUTTONS] =
|
const char *FTrainerNames[FTRAINER_NUM_BUTTONS] =
|
||||||
{ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B" };
|
{ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B" };
|
||||||
const char *DefaultFTrainerDevice = "Keyboard";
|
const char *DefaultFTrainerDevice = "Keyboard";
|
||||||
const int DefaultFTrainer[FTRAINER_NUM_BUTTONS] =
|
const int DefaultFTrainer[FTRAINER_NUM_BUTTONS] =
|
||||||
{ SDLK_o, SDLK_p, SDLK_LEFTBRACKET, SDLK_RIGHTBRACKET,
|
{ SDLK_o, SDLK_p, SDLK_LEFTBRACKET, SDLK_RIGHTBRACKET,
|
||||||
SDLK_k, SDLK_l, SDLK_SEMICOLON, SDLK_QUOTE,
|
SDLK_k, SDLK_l, SDLK_SEMICOLON, SDLK_QUOTE,
|
||||||
SDLK_m, SDLK_COMMA, SDLK_PERIOD, SDLK_SLASH
|
SDLK_m, SDLK_COMMA, SDLK_PERIOD, SDLK_SLASH
|
||||||
};
|
};
|
||||||
|
|
||||||
// FamilyKeyBoard defaults
|
// FamilyKeyBoard defaults
|
||||||
const char *FamilyKeyBoardNames[FAMILYKEYBOARD_NUM_BUTTONS] =
|
const char *FamilyKeyBoardNames[FAMILYKEYBOARD_NUM_BUTTONS] =
|
||||||
{ "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8",
|
{ "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8",
|
||||||
"1", "2", "3", "4", "5", "6", "7", "8", "9", "0",
|
"1", "2", "3", "4", "5", "6", "7", "8", "9", "0",
|
||||||
"MINUS", "EQUAL", "BACKSLASH", "BACKSPACE",
|
"MINUS", "EQUAL", "BACKSLASH", "BACKSPACE",
|
||||||
"ESCAPE", "Q", "W", "E", "R", "T", "Y", "U", "I", "O",
|
"ESCAPE", "Q", "W", "E", "R", "T", "Y", "U", "I", "O",
|
||||||
|
@ -2372,7 +2363,7 @@ const char *FamilyKeyBoardNames[FAMILYKEYBOARD_NUM_BUTTONS] =
|
||||||
|
|
||||||
const char *DefaultFamilyKeyBoardDevice = "Keyboard";
|
const char *DefaultFamilyKeyBoardDevice = "Keyboard";
|
||||||
const int DefaultFamilyKeyBoard[FAMILYKEYBOARD_NUM_BUTTONS] =
|
const int DefaultFamilyKeyBoard[FAMILYKEYBOARD_NUM_BUTTONS] =
|
||||||
{ SDLK_F1, SDLK_F2, SDLK_F3, SDLK_F4, SDLK_F5, SDLK_F6, SDLK_F7, SDLK_F8,
|
{ SDLK_F1, SDLK_F2, SDLK_F3, SDLK_F4, SDLK_F5, SDLK_F6, SDLK_F7, SDLK_F8,
|
||||||
SDLK_1, SDLK_2, SDLK_3, SDLK_4, SDLK_5,
|
SDLK_1, SDLK_2, SDLK_3, SDLK_4, SDLK_5,
|
||||||
SDLK_6, SDLK_7, SDLK_8, SDLK_9, SDLK_0,
|
SDLK_6, SDLK_7, SDLK_8, SDLK_9, SDLK_0,
|
||||||
SDLK_MINUS, SDLK_EQUALS, SDLK_BACKSLASH, SDLK_BACKSPACE,
|
SDLK_MINUS, SDLK_EQUALS, SDLK_BACKSLASH, SDLK_BACKSPACE,
|
||||||
|
|
Loading…
Reference in New Issue