mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-02 23:19:44 +01:00
Add support for the Wiimote controller
Thanks @Fussmatte for the button pictures. The Product IDs added here are those reported by libSDL when running on a Wii. Fixes: #1136
This commit is contained in:
parent
448c4a5514
commit
f3c87643e2
7 changed files with 40 additions and 8 deletions
|
@ -5,9 +5,9 @@
|
||||||
<height>10</height>
|
<height>10</height>
|
||||||
<white_teeth>1</white_teeth>
|
<white_teeth>1</white_teeth>
|
||||||
<chars>
|
<chars>
|
||||||
<range start="0xEB00" end="0xEB36"/>
|
<range start="0xEB00" end="0xEB3C"/>
|
||||||
</chars>
|
</chars>
|
||||||
<special>
|
<special>
|
||||||
<range start="0xEB00" end="0xEB36" color="1"/>
|
<range start="0xEB00" end="0xEB3C" color="1"/>
|
||||||
</special>
|
</special>
|
||||||
</font_metadata>
|
</font_metadata>
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.4 KiB |
|
@ -5,9 +5,9 @@
|
||||||
<height>12</height>
|
<height>12</height>
|
||||||
<white_teeth>1</white_teeth>
|
<white_teeth>1</white_teeth>
|
||||||
<chars>
|
<chars>
|
||||||
<range start="0xEB00" end="0xEB36"/>
|
<range start="0xEB00" end="0xEB3C"/>
|
||||||
</chars>
|
</chars>
|
||||||
<special>
|
<special>
|
||||||
<range start="0xEB00" end="0xEB36" color="1"/>
|
<range start="0xEB00" end="0xEB3C" color="1"/>
|
||||||
</special>
|
</special>
|
||||||
</font_metadata>
|
</font_metadata>
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.9 KiB |
|
@ -5,9 +5,9 @@
|
||||||
<height>8</height>
|
<height>8</height>
|
||||||
<white_teeth>1</white_teeth>
|
<white_teeth>1</white_teeth>
|
||||||
<chars>
|
<chars>
|
||||||
<range start="0xEB00" end="0xEB36"/>
|
<range start="0xEB00" end="0xEB3C"/>
|
||||||
</chars>
|
</chars>
|
||||||
<special>
|
<special>
|
||||||
<range start="0xEB00" end="0xEB36" color="1"/>
|
<range start="0xEB00" end="0xEB3C" color="1"/>
|
||||||
</special>
|
</special>
|
||||||
</font_metadata>
|
</font_metadata>
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.6 KiB |
|
@ -71,6 +71,13 @@ typedef enum
|
||||||
GLYPH_NINTENDO_GAMECUBE_R,
|
GLYPH_NINTENDO_GAMECUBE_R,
|
||||||
GLYPH_NINTENDO_GAMECUBE_Z,
|
GLYPH_NINTENDO_GAMECUBE_Z,
|
||||||
|
|
||||||
|
GLYPH_NINTENDO_WII_A,
|
||||||
|
GLYPH_NINTENDO_WII_B,
|
||||||
|
GLYPH_NINTENDO_WII_1,
|
||||||
|
GLYPH_NINTENDO_WII_2,
|
||||||
|
GLYPH_NINTENDO_WII_MINUS,
|
||||||
|
GLYPH_NINTENDO_WII_PLUS,
|
||||||
|
|
||||||
GLYPH_TOTAL
|
GLYPH_TOTAL
|
||||||
}
|
}
|
||||||
ButtonGlyphKey;
|
ButtonGlyphKey;
|
||||||
|
@ -89,6 +96,8 @@ typedef enum
|
||||||
|
|
||||||
/* Added after 2.4 */
|
/* Added after 2.4 */
|
||||||
LAYOUT_GAMECUBE,
|
LAYOUT_GAMECUBE,
|
||||||
|
LAYOUT_WIIMOTE_ON_WII,
|
||||||
|
LAYOUT_WIIMOTE_ON_PC,
|
||||||
|
|
||||||
LAYOUT_TOTAL
|
LAYOUT_TOTAL
|
||||||
}
|
}
|
||||||
|
@ -152,7 +161,21 @@ static const char* glyph_layout[LAYOUT_TOTAL][SDL_CONTROLLER_BUTTON_RIGHTSHOULDE
|
||||||
glyph[GLYPH_UNKNOWN], glyph[GLYPH_UNKNOWN], "START",
|
glyph[GLYPH_UNKNOWN], glyph[GLYPH_UNKNOWN], "START",
|
||||||
glyph[GLYPH_UNKNOWN], glyph[GLYPH_UNKNOWN],
|
glyph[GLYPH_UNKNOWN], glyph[GLYPH_UNKNOWN],
|
||||||
glyph[GLYPH_UNKNOWN], glyph[GLYPH_NINTENDO_GAMECUBE_Z]
|
glyph[GLYPH_UNKNOWN], glyph[GLYPH_NINTENDO_GAMECUBE_Z]
|
||||||
}
|
},
|
||||||
|
{ // WIIMOTE on WII
|
||||||
|
glyph[GLYPH_NINTENDO_WII_1], glyph[GLYPH_NINTENDO_WII_2],
|
||||||
|
glyph[GLYPH_NINTENDO_WII_A], glyph[GLYPH_NINTENDO_WII_B],
|
||||||
|
"HOME", glyph[GLYPH_NINTENDO_WII_MINUS], glyph[GLYPH_NINTENDO_WII_PLUS],
|
||||||
|
glyph[GLYPH_UNKNOWN], glyph[GLYPH_UNKNOWN],
|
||||||
|
glyph[GLYPH_UNKNOWN], glyph[GLYPH_UNKNOWN]
|
||||||
|
},
|
||||||
|
{ // WIIMOTE on PC
|
||||||
|
glyph[GLYPH_NINTENDO_WII_A], glyph[GLYPH_NINTENDO_WII_B],
|
||||||
|
glyph[GLYPH_NINTENDO_WII_1], glyph[GLYPH_NINTENDO_WII_2],
|
||||||
|
"HOME", glyph[GLYPH_NINTENDO_WII_MINUS], glyph[GLYPH_NINTENDO_WII_PLUS],
|
||||||
|
glyph[GLYPH_UNKNOWN], glyph[GLYPH_UNKNOWN],
|
||||||
|
glyph[GLYPH_UNKNOWN], glyph[GLYPH_UNKNOWN]
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool keyboard_is_active = true;
|
static bool keyboard_is_active = true;
|
||||||
|
@ -232,10 +255,19 @@ void BUTTONGLYPHS_update_layout(SDL_GameController *c)
|
||||||
{
|
{
|
||||||
layout = LAYOUT_NINTENDO_SWITCH_JOYCON_R;
|
layout = LAYOUT_NINTENDO_SWITCH_JOYCON_R;
|
||||||
}
|
}
|
||||||
else if (product == 0x0337)
|
else if (product == 0x0337 ||
|
||||||
|
product == 0x0100) // First GC controller on a Wii or Gamecube
|
||||||
{
|
{
|
||||||
layout = LAYOUT_GAMECUBE;
|
layout = LAYOUT_GAMECUBE;
|
||||||
}
|
}
|
||||||
|
else if (product == 0x0306)
|
||||||
|
{
|
||||||
|
layout = LAYOUT_WIIMOTE_ON_PC;
|
||||||
|
}
|
||||||
|
else if (product == 0x0501) // First wiimote on Wii
|
||||||
|
{
|
||||||
|
layout = LAYOUT_WIIMOTE_ON_WII;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
layout = LAYOUT_NINTENDO_SWITCH_PRO;
|
layout = LAYOUT_NINTENDO_SWITCH_PRO;
|
||||||
|
|
Loading…
Reference in a new issue