working Wii U Pro Controller support

This commit is contained in:
Christopher Roy Bratusek 2016-08-15 16:56:56 +02:00
parent ab250fe53d
commit f76b0e89a8
20 changed files with 134 additions and 76 deletions

View File

@ -732,11 +732,13 @@ int MenuMain()
}
// wenn A gedrckt
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A) || PAD_ButtonsDown(0) & PAD_BUTTON_A)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A) || PAD_ButtonsDown(0) & PAD_BUTTON_A
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_A)
button = "A";
// wenn B gedrckt
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B)
button = "B";
// Settings
@ -817,7 +819,8 @@ int MenuMain()
#endif
// Power button
else if(power_Btn.GetState() == STATE_CLICKED || WPAD_ButtonsDown(0) & (WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME) || PAD_ButtonsDown(0) & PAD_BUTTON_START)
else if(power_Btn.GetState() == STATE_CLICKED || WPAD_ButtonsDown(0) & (WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME)
|| PAD_ButtonsDown(0) & PAD_BUTTON_START || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_HOME)
{
power_Btn.ResetState();
if(endPrompt() == MENU_EXIT)
@ -825,7 +828,8 @@ int MenuMain()
}
// Loader button
else if(loader_Btn.GetState() == STATE_CLICKED || WPAD_ButtonsDown(0) & (WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME) || PAD_ButtonsDown(0) & PAD_BUTTON_START)
else if(loader_Btn.GetState() == STATE_CLICKED || WPAD_ButtonsDown(0) & (WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME)
|| PAD_ButtonsDown(0) & PAD_BUTTON_START || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_HOME)
{
loader_Btn.ResetState();
if(loaderPrompt() == MENU_EXIT)
@ -842,26 +846,34 @@ int MenuMain()
// eine Seite weiter bzw zurck
else if((WPAD_ButtonsDown(0) & (WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT) && !Options.navigation) ||
(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) && Options.navigation) ||
(WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_RIGHT && !Options.navigation) ||
(WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_PLUS && Options.navigation) ||
PAD_ButtonsDown(0) & PAD_BUTTON_RIGHT || rightBtn.GetState() == STATE_CLICKED ||
(WPAD_ButtonsDown(0) & (WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT) && !Options.navigation) ||
(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) && Options.navigation) ||
(WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_LEFT && !Options.navigation) ||
(WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_MINUS && Options.navigation) ||
PAD_ButtonsDown(0) & PAD_BUTTON_LEFT || leftBtn.GetState() == STATE_CLICKED)
{
// Abbrechen Seite zurck
if((WPAD_ButtonsDown(0) & (WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT) && !Options.navigation) ||
(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) && Options.navigation) ||
(WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_RIGHT && !Options.navigation) ||
(WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_PLUS && Options.navigation) ||
PAD_ButtonsDown(0) & PAD_BUTTON_RIGHT || rightBtn.GetState() == STATE_CLICKED)
previous_page = false;
// Abbrechen Seite weiter
if((WPAD_ButtonsDown(0) & (WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT) && !Options.navigation) ||
(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) && Options.navigation) ||
(WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_LEFT && !Options.navigation) ||
(WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_MINUS && Options.navigation) ||
PAD_ButtonsDown(0) & PAD_BUTTON_LEFT || leftBtn.GetState() == STATE_CLICKED)
next_page = false;
int page = Settings.current_page;
bool change = false;
if(next_page || rightBtn.GetState() == STATE_CLICKED || (WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) && Options.navigation))
if(next_page || rightBtn.GetState() == STATE_CLICKED || (WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) && Options.navigation) || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_PLUS)
{
rightBtn.ResetState();
Settings.current_page++;
@ -877,7 +889,7 @@ int MenuMain()
change = true;
}
if(previous_page || leftBtn.GetState() == STATE_CLICKED || (WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) && Options.navigation))
if(previous_page || leftBtn.GetState() == STATE_CLICKED || (WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) && Options.navigation) || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_MINUS)
{
leftBtn.ResetState();
Settings.current_page--;
@ -955,6 +967,8 @@ int MenuMain()
// eine Kategorie weiter
else if((WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) && !Options.navigation) ||
(WPAD_ButtonsDown(0) & (WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT) && Options.navigation) ||
(WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_PLUS && !Options.navigation) ||
(WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_RIGHT && Options.navigation) ||
PAD_ButtonsDown(0) & PAD_TRIGGER_R || plusBtn.GetState() == STATE_CLICKED)
{
Next_Category();
@ -964,6 +978,8 @@ int MenuMain()
// eine Kategorie zurck
else if((WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) && !Options.navigation) ||
(WPAD_ButtonsDown(0) & (WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT) && Options.navigation) ||
(WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_MINUS && !Options.navigation) ||
(WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_LEFT && Options.navigation) ||
PAD_ButtonsDown(0) & PAD_TRIGGER_L || minusBtn.GetState() == STATE_CLICKED)
{
Previous_Category();
@ -1052,7 +1068,7 @@ int MenuMain()
if(AppsBtn[i]->GetState() == STATE_CLICKED && button == "B" && !grab)
{
AppsBtn[i]->ResetState();
if(Settings.current_category != 0 && strcasecmp(Settings.code,"NULL") == 0 && WPAD_ButtonsDown(0) & WPAD_BUTTON_B)
if(Settings.current_category != 0 && strcasecmp(Settings.code,"NULL") == 0 && (WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B))
{
pointer = new GuiImageData(Theme.player_grab);
grab = true;
@ -1191,7 +1207,7 @@ int MenuMain()
}
// wenn b losgelassen wurde
if(WPAD_ButtonsUp(0) & WPAD_BUTTON_B)
if(WPAD_ButtonsUp(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || WUPC_ButtonsUp(0) & WPAD_CLASSIC_BUTTON_B)
{
grab = false;
pointer = new GuiImageData(Theme.player_point);

View File

@ -150,7 +150,8 @@ int MenuSettingsFile()
ret = optionBrowser.GetChangedOption();
ret2 = optionBrowser.GetClickedOption();
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT) || PAD_ButtonsDown(0) & PAD_BUTTON_RIGHT)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT) || PAD_ButtonsDown(0) & PAD_BUTTON_RIGHT
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_RIGHT)
{
change = 0;
switch (ret)
@ -236,7 +237,8 @@ int MenuSettingsFile()
optionBrowser.TriggerUpdate();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT) || PAD_ButtonsDown(0) & PAD_BUTTON_LEFT)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT) || PAD_ButtonsDown(0) & PAD_BUTTON_LEFT
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_LEFT)
{
change = 0;
switch (ret)
@ -478,7 +480,8 @@ int MenuSettingsFile()
optionBrowser.TriggerUpdate();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B)
{
if(focus == 0)
{

View File

@ -162,7 +162,8 @@ int MenuSettingsFont()
optionBrowser.TriggerUpdate();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B)
{
if(focus == 0)
{

View File

@ -164,7 +164,8 @@ int MenuSettingsLanguage()
optionBrowser.TriggerUpdate();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B)
{
if(focus == 0)
{

View File

@ -100,7 +100,8 @@ int MenuSettingsNetwork()
ret = optionBrowser.GetChangedOption();
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT) || PAD_ButtonsDown(0) & PAD_BUTTON_RIGHT)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT) || PAD_ButtonsDown(0) & PAD_BUTTON_RIGHT
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_RIGHT)
{
change = 0;
switch (ret)
@ -132,7 +133,8 @@ int MenuSettingsNetwork()
HaltResumeGui();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT) || PAD_ButtonsDown(0) & PAD_BUTTON_LEFT)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT) || PAD_ButtonsDown(0) & PAD_BUTTON_LEFT
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_LEFT)
{
change = 0;
switch (ret)
@ -189,7 +191,8 @@ int MenuSettingsNetwork()
if(optionBrowser.GetClickedOption() != -1)
optionBrowser.TriggerUpdate();
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B)
{
if(focus == 0)
{

View File

@ -159,7 +159,8 @@ int MenuSettingsTheme()
optionBrowser.TriggerUpdate();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B)
{
if(focus == 0)
{

View File

@ -94,7 +94,8 @@ string AddApp(const char *AppName)
{
usleep(100);
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_R)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_R
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_PLUS)
{
kategorieInt++;
if ( kategorieInt >= (signed)AvailableCategory.categories.size() )
@ -105,7 +106,8 @@ string AddApp(const char *AppName)
HaltResumeGui();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_MINUS)
{
kategorieInt--;
if ( kategorieInt < 1 )

View File

@ -283,7 +283,8 @@ AppInfo(const char *title, string dir, u8* icon)
{
usleep(100);
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_UP)
{
int z = description.text_up();
@ -294,7 +295,8 @@ AppInfo(const char *title, string dir, u8* icon)
HaltResumeGui();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_DOWN)
{
int z = description.text_down(number);
@ -305,14 +307,16 @@ AppInfo(const char *title, string dir, u8* icon)
HaltResumeGui();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_R)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_R
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_PLUS)
{
sprintf(SelectIos, tr("Start with IOS %i (-/+)"), nextIos());
SelectIosTxt.SetText(SelectIos);
HaltResumeGui();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_MINUS)
{
sprintf(SelectIos, tr("Start with IOS %i (-/+)"), previousIos());
SelectIosTxt.SetText(SelectIos);

View File

@ -121,7 +121,8 @@ MetaEdit(string dir)
{
usleep(100);
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_UP)
{
startline = meta.text_up();
@ -131,7 +132,8 @@ MetaEdit(string dir)
HaltResumeGui();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_DOWN)
{
startline = meta.text_down(number);

View File

@ -88,7 +88,8 @@ string eraseCategory()
{
usleep(100);
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_R)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_R
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_PLUS)
{
kategorieInt++;
if ( kategorieInt >= (signed)AvailableCategory.categories.size() )
@ -99,7 +100,8 @@ string eraseCategory()
HaltResumeGui();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_MINUS)
{
kategorieInt--;
if ( kategorieInt < 1 )

View File

@ -219,7 +219,8 @@ string FontList()
{
usleep(100);
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_UP)
{
selection--;
if(selection < 0)
@ -237,7 +238,8 @@ string FontList()
HaltResumeGui();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_DOWN)
{
selection++;
if(selection == (signed)fonts.size())
@ -257,13 +259,15 @@ string FontList()
HaltResumeGui();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A) || PAD_ButtonsDown(0) & PAD_BUTTON_A)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A) || PAD_ButtonsDown(0) & PAD_BUTTON_A
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_A)
{
downloadfont = fonts[selection + textScrollPos];
stop = true;
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B)
{
downloadfont = "NULL";
stop = true;

View File

@ -220,7 +220,8 @@ string LanguageList()
{
usleep(100);
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_UP)
{
selection--;
if(selection < 0)
@ -238,7 +239,8 @@ string LanguageList()
HaltResumeGui();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_DOWN)
{
selection++;
if(selection == (signed)languages.size())
@ -258,13 +260,15 @@ string LanguageList()
HaltResumeGui();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A) || PAD_ButtonsDown(0) & PAD_BUTTON_A)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A) || PAD_ButtonsDown(0) & PAD_BUTTON_A
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_A)
{
downloadlanguage = languages[selection + textScrollPos];
stop = true;
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B)
{
downloadlanguage = "NULL";
stop = true;

View File

@ -111,19 +111,22 @@ void MoveCategory(int moveCategoryNr, string &Kategorie1, bool &vor, string &Kat
{
usleep(100);
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_R)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_R
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_PLUS)
{
vor = false;
zeile3_2Txt.SetText(tr("after"));
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_MINUS)
{
vor = true;
zeile3_2Txt.SetText(tr("before"));
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_UP)
{
CategoryInt--;
@ -134,7 +137,8 @@ void MoveCategory(int moveCategoryNr, string &Kategorie1, bool &vor, string &Kat
HaltResumeGui();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_DOWN)
{
CategoryInt++;
@ -160,4 +164,4 @@ void MoveCategory(int moveCategoryNr, string &Kategorie1, bool &vor, string &Kat
mainWindow->Remove(&promptWindow);
mainWindow->SetState(STATE_DEFAULT);
ResumeGui();
}
}

View File

@ -106,7 +106,8 @@ revtext(const char *msg)
{
usleep(100);
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_UP)
{
int z = revtext.text_up();
@ -117,7 +118,8 @@ revtext(const char *msg)
HaltResumeGui();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_DOWN)
{
int z = revtext.text_down(number);

View File

@ -238,7 +238,8 @@ string ThemeList()
{
usleep(100);
if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP)
if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP
|| WUPC_ButtonsHeld(0) & WPAD_CLASSIC_BUTTON_UP)
{
selection--;
if(selection < 0)
@ -258,7 +259,8 @@ string ThemeList()
usleep(100000);
}
if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN)
if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN
|| WUPC_ButtonsHeld(0) & WPAD_CLASSIC_BUTTON_DOWN)
{
selection++;
if(selection == (signed)themes.size())
@ -279,13 +281,15 @@ string ThemeList()
usleep(100000);
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A) || PAD_ButtonsDown(0) & PAD_BUTTON_A)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A) || PAD_ButtonsDown(0) & PAD_BUTTON_A
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_A)
{
downloadtheme = themes[selection + textScrollPos];
stop = true;
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B)
{
downloadtheme = "NULL";
stop = true;

View File

@ -281,7 +281,8 @@ string choiceRev(string revs)
{
usleep(100);
if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP)
if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP
|| WUPC_ButtonsHeld(0) & WPAD_CLASSIC_BUTTON_UP)
{
selection--;
@ -299,7 +300,8 @@ string choiceRev(string revs)
usleep(100000);
}
if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN)
if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN
|| WUPC_ButtonsHeld(0) & WPAD_CLASSIC_BUTTON_DOWN)
{
selection++;
@ -317,13 +319,15 @@ string choiceRev(string revs)
usleep(100000);
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A) || PAD_ButtonsDown(0) & PAD_BUTTON_A)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A) || PAD_ButtonsDown(0) & PAD_BUTTON_A
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_A)
{
rev = versions.line[selection + versions.textScrollPos];
stop = true;
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B)
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B)
stop = true;
}

View File

@ -41,6 +41,7 @@
#include <math.h>
#include <asndlib.h>
#include <wiiuse/wpad.h>
#include <wupc/wupc.h>
#include "pngu.h"
#include "FreeTypeGX.h"
#include "video.h"

View File

@ -202,13 +202,13 @@ void GuiButton::Update(GuiTrigger * t)
cc_btns_trig = trigger[i]->wpad->btns_d >> 16;
// lower 16 bits only (WiiU Pro controller)
wupc_btns = t->wupad->btns_d >> 16;
wupc_btns_trig = trigger[i]->wupad->btns_d >> 16;
wupc_btns = t->wupcdata.btns_d >> 16;
wupc_btns_trig = trigger[i]->wupcdata.btns_d >> 16;
if( ((t->wpad->btns_d > 0 && wm_btns == wm_btns_trig)
|| (t->wpad->exp.type == WPAD_EXP_CLASSIC && cc_btns == cc_btns_trig))
|| (t->pad.btns_d > 0 && t->pad.btns_d == trigger[i]->pad.btns_d)
|| (t->wupad->btns_d > 0 && wupc_btns == wupc_btns_trig))
|| (t->wupcdata.btns_d > 0 && wupc_btns == wupc_btns_trig))
{
if (t->chan == stateChan || stateChan == -1)
{
@ -254,14 +254,14 @@ void GuiButton::Update(GuiTrigger * t)
cc_btns_trig = trigger[i]->wpad->btns_h >> 16;
// lower 16 bits only (WiiU Pro controller)
wupc_btns = t->wupad->btns_d >> 16;
wupc_btns_h = t->wupad->btns_h >> 16;
wupc_btns_trig = trigger[i]->wupad->btns_h >> 16;
wupc_btns = t->wupcdata.btns_d >> 16;
wupc_btns_h = t->wupcdata.btns_h >> 16;
wupc_btns_trig = trigger[i]->wupcdata.btns_h >> 16;
if( (t->wpad->btns_d > 0 && wm_btns == wm_btns_trig)
|| (t->wpad->exp.type == WPAD_EXP_CLASSIC && cc_btns == cc_btns_trig)
|| (t->pad.btns_d > 0 && t->pad.btns_d == trigger[i]->pad.btns_d)
|| (t->wupad->btns_d > 0 && wupc_btns == wupc_btns_trig))
|| (t->wupcdata.btns_d > 0 && wupc_btns == wupc_btns_trig))
{
if (trigger[i]->type == TRIGGER_HELD && state == STATE_SELECTED &&
(t->chan == stateChan || stateChan == -1))
@ -271,7 +271,7 @@ void GuiButton::Update(GuiTrigger * t)
if( (t->wpad->btns_h > 0 && wm_btns_h == wm_btns_trig)
|| (t->wpad->exp.type == WPAD_EXP_CLASSIC && cc_btns_h == cc_btns_trig)
|| (t->pad.btns_h > 0 && t->pad.btns_h == trigger[i]->pad.btns_h)
|| (t->wupad->btns_h > 0 && wupc_btns_h == wupc_btns_trig)
|| (t->wupcdata.btns_h > 0 && wupc_btns_h == wupc_btns_trig)
)
{
if (trigger[i]->type == TRIGGER_HELD)

View File

@ -41,7 +41,7 @@ void GuiTrigger::SetSimpleTrigger(s32 ch, u32 wiibtns, u16 gcbtns)
{
type = TRIGGER_SIMPLE;
chan = ch;
wupad->btns_d = wiibtns;
wupcdata.btns_d = wiibtns;
wpaddata.btns_d = wiibtns;
pad.btns_d = gcbtns;
}
@ -55,7 +55,7 @@ void GuiTrigger::SetHeldTrigger(s32 ch, u32 wiibtns, u16 gcbtns)
{
type = TRIGGER_HELD;
chan = ch;
wupad->btns_h = wiibtns;
wupcdata.btns_h = wiibtns;
wpaddata.btns_h = wiibtns;
pad.btns_h = gcbtns;
}
@ -67,8 +67,8 @@ void GuiTrigger::SetButtonOnlyHeldTrigger(s32 ch, u32 wiibtns, u16 gcbtns)
{
type = TRIGGER_BUTTON_ONLY_HELD;
chan = ch;
wupad->btns_d = wiibtns;
wupad->btns_h = wiibtns;
wupcdata.btns_d = wiibtns;
wupcdata.btns_h = wiibtns;
wpaddata.btns_d = wiibtns;
wpaddata.btns_h = wiibtns;
pad.btns_d = gcbtns;
@ -83,7 +83,7 @@ void GuiTrigger::SetButtonOnlyTrigger(s32 ch, u32 wiibtns, u16 gcbtns)
{
type = TRIGGER_BUTTON_ONLY;
chan = ch;
wupad->btns_d = wiibtns;
wupcdata.btns_d = wiibtns;
wpaddata.btns_d = wiibtns;
pad.btns_d = gcbtns;
}
@ -97,7 +97,7 @@ void GuiTrigger::SetButtonOnlyInFocusTrigger(s32 ch, u32 wiibtns, u16 gcbtns)
{
type = TRIGGER_BUTTON_ONLY_IN_FOCUS;
chan = ch;
wupad->btns_d = wiibtns;
wupcdata.btns_d = wiibtns;
wpaddata.btns_d = wiibtns;
pad.btns_d = gcbtns;
}
@ -157,15 +157,15 @@ s8 GuiTrigger::WPAD_Stick(u8 right, int axis)
bool GuiTrigger::Left()
{
u32 wiibtn = WPAD_BUTTON_LEFT;
if(wpad->exp.type == WPAD_EXP_CLASSIC || (wupad->btns_d | wupad->btns_h) > 0)
if(wpad->exp.type == WPAD_EXP_CLASSIC || (wupcdata.btns_d | wupcdata.btns_h) > 0)
wiibtn |= WPAD_CLASSIC_BUTTON_LEFT;
if( ((wpad->btns_d | wpad->btns_h) & wiibtn)
|| ((wupad->btns_d | wupad->btns_h) & wiibtn)
|| ((wupcdata.btns_d | wupcdata.btns_h) & wiibtn)
|| ((pad.btns_d | pad.btns_h) & PAD_BUTTON_LEFT))
{
if( (wpad->btns_d & wiibtn)
|| (wupad->btns_d & wiibtn)
|| (wupcdata.btns_d & wiibtn)
|| (pad.btns_d & PAD_BUTTON_LEFT))
{
scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay.
@ -183,16 +183,16 @@ bool GuiTrigger::Left()
bool GuiTrigger::Right()
{
u32 wiibtn = WPAD_BUTTON_RIGHT;
if(wpad->exp.type == WPAD_EXP_CLASSIC || (wupad->btns_d | wupad->btns_h))
if(wpad->exp.type == WPAD_EXP_CLASSIC || (wupcdata.btns_d | wupcdata.btns_h))
wiibtn |= WPAD_CLASSIC_BUTTON_RIGHT;
if( ((wpad->btns_d | wpad->btns_h) & wiibtn)
|| ((pad.btns_d | pad.btns_h) & PAD_BUTTON_RIGHT)
|| ((wupad->btns_d | wupad->btns_h) & wiibtn))
|| ((wupcdata.btns_d | wupcdata.btns_h) & wiibtn))
{
if( (wpad->btns_d & wiibtn)
|| (pad.btns_d & PAD_BUTTON_RIGHT)
|| (wupad->btns_d & wiibtn))
|| (wupcdata.btns_d & wiibtn))
{
scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay.
return true;
@ -209,15 +209,15 @@ bool GuiTrigger::Right()
bool GuiTrigger::Up()
{
u32 wiibtn = WPAD_BUTTON_UP;
if(wpad->exp.type == WPAD_EXP_CLASSIC || (wupad->btns_d | wupad->btns_h))
if(wpad->exp.type == WPAD_EXP_CLASSIC || (wupcdata.btns_d | wupcdata.btns_h))
wiibtn |= WPAD_CLASSIC_BUTTON_UP;
if( ((wpad->btns_d | wpad->btns_h) & wiibtn)
|| ((pad.btns_d | pad.btns_h) & PAD_BUTTON_UP)
|| ((wupad->btns_d | wupad->btns_h) & wiibtn))
|| ((wupcdata.btns_d | wupcdata.btns_h) & wiibtn))
{
if( (wpad->btns_d & wiibtn)
|| (wupad->btns_d & wiibtn)
|| (wupcdata.btns_d & wiibtn)
|| (pad.btns_d & PAD_BUTTON_UP))
{
scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay.
@ -235,16 +235,16 @@ bool GuiTrigger::Up()
bool GuiTrigger::Down()
{
u32 wiibtn = WPAD_BUTTON_DOWN;
if(wpad->exp.type == WPAD_EXP_CLASSIC || (wupad->btns_d | wupad->btns_h))
if(wpad->exp.type == WPAD_EXP_CLASSIC || (wupcdata.btns_d | wupcdata.btns_h))
wiibtn |= WPAD_CLASSIC_BUTTON_DOWN;
if( ((wpad->btns_d | wpad->btns_h) & wiibtn)
|| ((pad.btns_d | pad.btns_h) & PAD_BUTTON_DOWN)
|| ((wupad->btns_d | wupad->btns_h) & wiibtn))
|| ((wupcdata.btns_d | wupcdata.btns_h) & wiibtn))
{
if( (wpad->btns_d & wiibtn)
|| (pad.btns_d & PAD_BUTTON_DOWN)
|| (wupad->btns_d & wiibtn))
|| (wupcdata.btns_d & wiibtn))
{
scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay.
return true;