Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for RetroUSB Genesis RetroPort #484

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions gx/gui/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#ifdef HW_RVL
#include <ogc/usbmouse.h>
#include "wiidrc.h"
#include "retrousb.h"
#endif

#include <ogc/lwp_threads.h>
Expand Down Expand Up @@ -124,6 +125,7 @@
#include "ctrl_nunchuk_png.h"
#include "ctrl_wiimote_png.h"
#include "ctrl_wiiu_png.h"
#include "ctrl_retrousb_png.h"
#endif

/* Generic images */
Expand Down Expand Up @@ -2471,14 +2473,15 @@ static void ctrlmenu(void)

/* Player Configuration device items */
#ifdef HW_RVL
gui_item items_device[6] =
gui_item items_device[7] =
{
{NULL,ctrl_option_off_png ,"Input\nDevice","Select Input Controller",534,244,24,24},
{NULL,ctrl_gamecube_png ,"Input\nDevice","Select Input Controller",530,246,36,24},
{NULL,ctrl_wiimote_png ,"Input\nDevice","Select Input Controller",526,250,40,12},
{NULL,ctrl_nunchuk_png ,"Input\nDevice","Select Input Controller",532,242,32,32},
{NULL,ctrl_classic_png ,"Input\nDevice","Select Input Controller",526,242,40,32},
{NULL,ctrl_wiiu_png ,"Input\nDevice","Select Input Controller",526,246,40,24},
{NULL,ctrl_retrousb_png ,"Input\nDevice","Select Input Controller",526,246,40,24},
};
#else
gui_item items_device[2] =
Expand Down Expand Up @@ -2518,6 +2521,7 @@ static void ctrlmenu(void)
{
items_device[5].texture = gxTextureOpenPNG(items_device[5].data,0);
}
items_device[6].texture = gxTextureOpenPNG(items_device[6].data, 0);
#endif

/* restore current menu elements */
Expand Down Expand Up @@ -3060,11 +3064,21 @@ static void ctrlmenu(void)
/* support for only one gamepad */
if (!WiiDRC_Inited() || !WiiDRC_Connected() || (config.input[player].port >= 1))
{
/* no input controller left */
config.input[player].device = -1;
config.input[player].port = player%4;
/* test RetroUSB */
config.input[player].device = 5;
config.input[player].port = 0;
}
}

if (config.input[player].device == 5)
{
if (!RetroUSB_OK() || config.input[player].port >= 1)
{
/* no input controller left */
config.input[player].device = -1;
config.input[player].port = player % 4;
}
}
#endif

/* update menu items */
Expand Down Expand Up @@ -3230,6 +3244,7 @@ static void ctrlmenu(void)
{
gxTextureClose(&items_device[5].texture);
}
gxTextureClose(&items_device[6].texture);
#endif
}

Expand Down
Loading