Skip to content

Commit

Permalink
Add support for GameCube glyphs.
Browse files Browse the repository at this point in the history
It's kind of a bummer that L/R don't actually do anything... we should add ZL/ZR support at some point.

Also note that GameCube binds X to 'back' rather than B, this will be fixed by SDL_ActionSet for 2.5.
  • Loading branch information
flibitijibibo committed Jan 17, 2024
1 parent d299b42 commit b01f7bd
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 8 deletions.
4 changes: 2 additions & 2 deletions desktop_version/fonts/buttons_10x10.fontmeta
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<height>10</height>
<white_teeth>1</white_teeth>
<chars>
<range start="0xEB00" end="0xEB2F"/>
<range start="0xEB00" end="0xEB36"/>
</chars>
<special>
<range start="0xEB00" end="0xEB2F" color="1"/>
<range start="0xEB00" end="0xEB36" color="1"/>
</special>
</font_metadata>
Binary file modified desktop_version/fonts/buttons_10x10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions desktop_version/fonts/buttons_12x12.fontmeta
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<height>12</height>
<white_teeth>1</white_teeth>
<chars>
<range start="0xEB00" end="0xEB2F"/>
<range start="0xEB00" end="0xEB36"/>
</chars>
<special>
<range start="0xEB00" end="0xEB2F" color="1"/>
<range start="0xEB00" end="0xEB36" color="1"/>
</special>
</font_metadata>
Binary file modified desktop_version/fonts/buttons_12x12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions desktop_version/fonts/buttons_8x8.fontmeta
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<height>8</height>
<white_teeth>1</white_teeth>
<chars>
<range start="0xEB00" end="0xEB2F"/>
<range start="0xEB00" end="0xEB36"/>
</chars>
<special>
<range start="0xEB00" end="0xEB2F" color="1"/>
<range start="0xEB00" end="0xEB36" color="1"/>
</special>
</font_metadata>
Binary file modified desktop_version/fonts/buttons_8x8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 20 additions & 2 deletions desktop_version/src/ButtonGlyphs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ typedef enum
GLYPH_NINTENDO_GENERIC_STICK,
GLYPH_UNKNOWN,

/* Added after 2.4 */
GLYPH_NINTENDO_GAMECUBE_A,
GLYPH_NINTENDO_GAMECUBE_B,
GLYPH_NINTENDO_GAMECUBE_X,
GLYPH_NINTENDO_GAMECUBE_Y,
GLYPH_NINTENDO_GAMECUBE_L,
GLYPH_NINTENDO_GAMECUBE_R,
GLYPH_NINTENDO_GAMECUBE_Z,

GLYPH_TOTAL
}
ButtonGlyphKey;
Expand All @@ -78,6 +87,9 @@ typedef enum
LAYOUT_XBOX,
LAYOUT_GENERIC,

/* Added after 2.4 */
LAYOUT_GAMECUBE,

LAYOUT_TOTAL
}
ButtonGlyphLayout;
Expand Down Expand Up @@ -133,6 +145,13 @@ static const char* glyph_layout[LAYOUT_TOTAL][SDL_CONTROLLER_BUTTON_RIGHTSHOULDE
"SELECT", "GUIDE", "START",
glyph[GLYPH_NINTENDO_XBOX_LSTICK], glyph[GLYPH_NINTENDO_XBOX_RSTICK],
glyph[GLYPH_GENERIC_L], glyph[GLYPH_GENERIC_R]
},
{ // GAMECUBE
glyph[GLYPH_NINTENDO_GAMECUBE_A], glyph[GLYPH_NINTENDO_GAMECUBE_X],
glyph[GLYPH_NINTENDO_GAMECUBE_B], glyph[GLYPH_NINTENDO_GAMECUBE_Y],
glyph[GLYPH_UNKNOWN], glyph[GLYPH_UNKNOWN], "START",
glyph[GLYPH_UNKNOWN], glyph[GLYPH_UNKNOWN],
glyph[GLYPH_UNKNOWN], glyph[GLYPH_NINTENDO_GAMECUBE_Z]
}
};

Expand Down Expand Up @@ -215,8 +234,7 @@ void BUTTONGLYPHS_update_layout(SDL_GameController *c)
}
else if (product == 0x0337)
{
/* FIXME: GameCube glyphs? -flibit */
layout = LAYOUT_XBOX;
layout = LAYOUT_GAMECUBE;
}
else
{
Expand Down

0 comments on commit b01f7bd

Please sign in to comment.