From b9fdbfa8ada28956aaac96b63f67800bc71afd82 Mon Sep 17 00:00:00 2001 From: dborth Date: Tue, 13 Oct 2009 00:40:02 +0000 Subject: [PATCH] optimization - use a pointer for wpad data --- source/ngc/fceugx.cpp | 11 +------- source/ngc/gui/gui.h | 3 +- source/ngc/gui/gui_button.cpp | 38 +++++++++++++------------- source/ngc/gui/gui_filebrowser.cpp | 10 +++---- source/ngc/gui/gui_optionbrowser.cpp | 4 +-- source/ngc/gui/gui_savebrowser.cpp | 6 ++-- source/ngc/gui/gui_trigger.cpp | 41 ++++++++++++++-------------- source/ngc/gui/gui_window.cpp | 2 +- source/ngc/menu.cpp | 26 +++++++++--------- source/ngc/pad.cpp | 41 ++++++++++++++++++++++------ source/ngc/pad.h | 1 + 11 files changed, 100 insertions(+), 83 deletions(-) diff --git a/source/ngc/fceugx.cpp b/source/ngc/fceugx.cpp index 129272d..b198065 100644 --- a/source/ngc/fceugx.cpp +++ b/source/ngc/fceugx.cpp @@ -260,20 +260,11 @@ int main(int argc, char *argv[]) InitDeviceThread(); VIDEO_Init(); - PAD_Init(); - - #ifdef HW_RVL - WPAD_Init(); - #endif - + SetupPads(); InitGCVideo (); // Initialise video ResetVideo_Menu (); // change to menu video mode #ifdef HW_RVL - // read wiimote accelerometer and IR data - WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR); - WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight); - // Wii Power/Reset buttons WPAD_SetPowerButtonCallback((WPADShutdownCallback)ShutdownCB); SYS_SetPowerCallback(ShutdownCB); diff --git a/source/ngc/gui/gui.h b/source/ngc/gui/gui.h index c845dbe..79894ae 100644 --- a/source/ngc/gui/gui.h +++ b/source/ngc/gui/gui.h @@ -216,7 +216,8 @@ class GuiTrigger u8 type; //!< trigger type (TRIGGER_SIMPLE, TRIGGER_HELD, TRIGGER_BUTTON_ONLY, TRIGGER_BUTTON_ONLY_IN_FOCUS) s32 chan; //!< Trigger controller channel (0-3, -1 for all) - WPADData wpad; //!< Wii controller trigger data + WPADData * wpad; //!< Wii controller trigger + WPADData wpaddata; //!< Wii controller trigger data PADData pad; //!< GameCube controller trigger data }; diff --git a/source/ngc/gui/gui_button.cpp b/source/ngc/gui/gui_button.cpp index 0b5a9a7..93890ce 100644 --- a/source/ngc/gui/gui_button.cpp +++ b/source/ngc/gui/gui_button.cpp @@ -161,9 +161,9 @@ void GuiButton::Update(GuiTrigger * t) #ifdef HW_RVL // cursor - if(t->wpad.ir.valid && t->chan >= 0) + if(t->wpad->ir.valid && t->chan >= 0) { - if(this->IsInside(t->wpad.ir.x, t->wpad.ir.y)) + if(this->IsInside(t->wpad->ir.x, t->wpad->ir.y)) { if(state == STATE_DEFAULT) // we weren't on the button before! { @@ -209,24 +209,24 @@ void GuiButton::Update(GuiTrigger * t) if(trigger[i] && (trigger[i]->chan == -1 || trigger[i]->chan == t->chan)) { // higher 16 bits only (wiimote) - wm_btns = t->wpad.btns_d << 16; - wm_btns_trig = trigger[i]->wpad.btns_d << 16; + wm_btns = t->wpad->btns_d << 16; + wm_btns_trig = trigger[i]->wpad->btns_d << 16; // lower 16 bits only (classic controller) - cc_btns = t->wpad.btns_d >> 16; - cc_btns_trig = trigger[i]->wpad.btns_d >> 16; + cc_btns = t->wpad->btns_d >> 16; + cc_btns_trig = trigger[i]->wpad->btns_d >> 16; if( - (t->wpad.btns_d > 0 && + (t->wpad->btns_d > 0 && (wm_btns == wm_btns_trig || - (cc_btns == cc_btns_trig && t->wpad.exp.type == EXP_CLASSIC))) || + (cc_btns == cc_btns_trig && t->wpad->exp.type == EXP_CLASSIC))) || (t->pad.btns_d == trigger[i]->pad.btns_d && t->pad.btns_d > 0)) { if(t->chan == stateChan || stateChan == -1) { if(state == STATE_SELECTED) { - if(!t->wpad.ir.valid || this->IsInside(t->wpad.ir.x, t->wpad.ir.y)) + if(!t->wpad->ir.valid || this->IsInside(t->wpad->ir.x, t->wpad->ir.y)) { this->SetState(STATE_CLICKED, t->chan); @@ -259,19 +259,19 @@ void GuiButton::Update(GuiTrigger * t) if(trigger[i] && (trigger[i]->chan == -1 || trigger[i]->chan == t->chan)) { // higher 16 bits only (wiimote) - wm_btns = t->wpad.btns_d << 16; - wm_btns_h = t->wpad.btns_h << 16; - wm_btns_trig = trigger[i]->wpad.btns_h << 16; + wm_btns = t->wpad->btns_d << 16; + wm_btns_h = t->wpad->btns_h << 16; + wm_btns_trig = trigger[i]->wpad->btns_h << 16; // lower 16 bits only (classic controller) - cc_btns = t->wpad.btns_d >> 16; - cc_btns_h = t->wpad.btns_h >> 16; - cc_btns_trig = trigger[i]->wpad.btns_h >> 16; + cc_btns = t->wpad->btns_d >> 16; + cc_btns_h = t->wpad->btns_h >> 16; + cc_btns_trig = trigger[i]->wpad->btns_h >> 16; if( - (t->wpad.btns_d > 0 && + (t->wpad->btns_d > 0 && (wm_btns == wm_btns_trig || - (cc_btns == cc_btns_trig && t->wpad.exp.type == EXP_CLASSIC))) || + (cc_btns == cc_btns_trig && t->wpad->exp.type == EXP_CLASSIC))) || (t->pad.btns_d == trigger[i]->pad.btns_h && t->pad.btns_d > 0)) { if(trigger[i]->type == TRIGGER_HELD && state == STATE_SELECTED && @@ -280,9 +280,9 @@ void GuiButton::Update(GuiTrigger * t) } if( - (t->wpad.btns_h > 0 && + (t->wpad->btns_h > 0 && (wm_btns_h == wm_btns_trig || - (cc_btns_h == cc_btns_trig && t->wpad.exp.type == EXP_CLASSIC))) || + (cc_btns_h == cc_btns_trig && t->wpad->exp.type == EXP_CLASSIC))) || (t->pad.btns_h == trigger[i]->pad.btns_h && t->pad.btns_h > 0)) { if(trigger[i]->type == TRIGGER_HELD) diff --git a/source/ngc/gui/gui_filebrowser.cpp b/source/ngc/gui/gui_filebrowser.cpp index 3025ddc..f543b4f 100644 --- a/source/ngc/gui/gui_filebrowser.cpp +++ b/source/ngc/gui/gui_filebrowser.cpp @@ -239,12 +239,12 @@ void GuiFileBrowser::Update(GuiTrigger * t) // move the file listing to respond to wiimote cursor movement if(scrollbarBoxBtn->GetState() == STATE_HELD && scrollbarBoxBtn->GetStateChan() == t->chan && - t->wpad.ir.valid && + t->wpad->ir.valid && browser.numEntries > FILE_PAGESIZE ) { scrollbarBoxBtn->SetPosition(0,0); - positionWiimote = t->wpad.ir.y - 60 - scrollbarBoxBtn->GetTop(); + positionWiimote = t->wpad->ir.y - 60 - scrollbarBoxBtn->GetTop(); if(positionWiimote < scrollbarBoxBtn->GetMinY()) positionWiimote = scrollbarBoxBtn->GetMinY(); @@ -267,13 +267,13 @@ void GuiFileBrowser::Update(GuiTrigger * t) if(arrowDownBtn->GetState() == STATE_HELD && arrowDownBtn->GetStateChan() == t->chan) { - t->wpad.btns_h |= WPAD_BUTTON_DOWN; + t->wpad->btns_h |= WPAD_BUTTON_DOWN; if(!this->IsFocused()) ((GuiWindow *)this->GetParent())->ChangeFocus(this); } else if(arrowUpBtn->GetState() == STATE_HELD && arrowUpBtn->GetStateChan() == t->chan) { - t->wpad.btns_h |= WPAD_BUTTON_UP; + t->wpad->btns_h |= WPAD_BUTTON_UP; if(!this->IsFocused()) ((GuiWindow *)this->GetParent())->ChangeFocus(this); } @@ -395,7 +395,7 @@ void GuiFileBrowser::Update(GuiTrigger * t) int currChan = t->chan; - if(t->wpad.ir.valid && !fileList[i]->IsInside(t->wpad.ir.x, t->wpad.ir.y)) + if(t->wpad->ir.valid && !fileList[i]->IsInside(t->wpad->ir.x, t->wpad->ir.y)) t->chan = -1; fileList[i]->Update(t); diff --git a/source/ngc/gui/gui_optionbrowser.cpp b/source/ngc/gui/gui_optionbrowser.cpp index 2a7e042..cd1b820 100644 --- a/source/ngc/gui/gui_optionbrowser.cpp +++ b/source/ngc/gui/gui_optionbrowser.cpp @@ -245,7 +245,7 @@ void GuiOptionBrowser::Update(GuiTrigger * t) arrowDownBtn->Update(t); next = listOffset; - + if(listChanged) { listChanged = false; @@ -281,7 +281,7 @@ void GuiOptionBrowser::Update(GuiTrigger * t) int currChan = t->chan; - if(t->wpad.ir.valid && !optionBtn[i]->IsInside(t->wpad.ir.x, t->wpad.ir.y)) + if(t->wpad->ir.valid && !optionBtn[i]->IsInside(t->wpad->ir.x, t->wpad->ir.y)) t->chan = -1; optionBtn[i]->Update(t); diff --git a/source/ngc/gui/gui_savebrowser.cpp b/source/ngc/gui/gui_savebrowser.cpp index 486c740..cabd49f 100644 --- a/source/ngc/gui/gui_savebrowser.cpp +++ b/source/ngc/gui/gui_savebrowser.cpp @@ -389,11 +389,11 @@ void GuiSaveBrowser::Update(GuiTrigger * t) else if(focus && i == selectedItem && saveBtn[i]->GetState() == STATE_DEFAULT) saveBtn[selectedItem]->SetState(STATE_SELECTED, t->chan); - if(t->wpad.ir.valid) + if(t->wpad->ir.valid) { - if(!saveBtnLastOver[i] && saveBtn[i]->IsInside(t->wpad.ir.x, t->wpad.ir.y)) + if(!saveBtnLastOver[i] && saveBtn[i]->IsInside(t->wpad->ir.x, t->wpad->ir.y)) saveBtn[i]->ResetState(); - saveBtnLastOver[i] = saveBtn[i]->IsInside(t->wpad.ir.x, t->wpad.ir.y); + saveBtnLastOver[i] = saveBtn[i]->IsInside(t->wpad->ir.x, t->wpad->ir.y); } saveBtn[i]->Update(t); diff --git a/source/ngc/gui/gui_trigger.cpp b/source/ngc/gui/gui_trigger.cpp index e0a2020..3ee7128 100644 --- a/source/ngc/gui/gui_trigger.cpp +++ b/source/ngc/gui/gui_trigger.cpp @@ -18,8 +18,9 @@ static int scrollDelay = 0; GuiTrigger::GuiTrigger() { chan = -1; - memset(&wpad, 0, sizeof(WPADData)); + memset(&wpaddata, 0, sizeof(WPADData)); memset(&pad, 0, sizeof(PADData)); + wpad = &wpaddata; } /** @@ -38,7 +39,7 @@ void GuiTrigger::SetSimpleTrigger(s32 ch, u32 wiibtns, u16 gcbtns) { type = TRIGGER_SIMPLE; chan = ch; - wpad.btns_d = wiibtns; + wpaddata.btns_d = wiibtns; pad.btns_d = gcbtns; } @@ -51,7 +52,7 @@ void GuiTrigger::SetHeldTrigger(s32 ch, u32 wiibtns, u16 gcbtns) { type = TRIGGER_HELD; chan = ch; - wpad.btns_h = wiibtns; + wpaddata.btns_h = wiibtns; pad.btns_h = gcbtns; } @@ -63,7 +64,7 @@ void GuiTrigger::SetButtonOnlyTrigger(s32 ch, u32 wiibtns, u16 gcbtns) { type = TRIGGER_BUTTON_ONLY; chan = ch; - wpad.btns_d = wiibtns; + wpaddata.btns_d = wiibtns; pad.btns_d = gcbtns; } @@ -76,7 +77,7 @@ void GuiTrigger::SetButtonOnlyInFocusTrigger(s32 ch, u32 wiibtns, u16 gcbtns) { type = TRIGGER_BUTTON_ONLY_IN_FOCUS; chan = ch; - wpad.btns_d = wiibtns; + wpaddata.btns_d = wiibtns; pad.btns_d = gcbtns; } @@ -93,27 +94,27 @@ s8 GuiTrigger::WPAD_Stick(u8 right, int axis) float mag = 0.0; float ang = 0.0; - switch (wpad.exp.type) + switch (wpad->exp.type) { case WPAD_EXP_NUNCHUK: case WPAD_EXP_GUITARHERO3: if (right == 0) { - mag = wpad.exp.nunchuk.js.mag; - ang = wpad.exp.nunchuk.js.ang; + mag = wpad->exp.nunchuk.js.mag; + ang = wpad->exp.nunchuk.js.ang; } break; case WPAD_EXP_CLASSIC: if (right == 0) { - mag = wpad.exp.classic.ljs.mag; - ang = wpad.exp.classic.ljs.ang; + mag = wpad->exp.classic.ljs.mag; + ang = wpad->exp.classic.ljs.ang; } else { - mag = wpad.exp.classic.rjs.mag; - ang = wpad.exp.classic.rjs.ang; + mag = wpad->exp.classic.rjs.mag; + ang = wpad->exp.classic.rjs.ang; } break; @@ -142,12 +143,12 @@ bool GuiTrigger::Left() { u32 wiibtn = GCSettings.WiimoteOrientation ? WPAD_BUTTON_UP : WPAD_BUTTON_LEFT; - if((wpad.btns_d | wpad.btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_LEFT) + if((wpad->btns_d | wpad->btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_LEFT) || (pad.btns_d | pad.btns_h) & PAD_BUTTON_LEFT || pad.stickX < -PADCAL || WPAD_Stick(0,0) < -PADCAL) { - if(wpad.btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_LEFT) + if(wpad->btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_LEFT) || pad.btns_d & PAD_BUTTON_LEFT) { scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay. @@ -171,12 +172,12 @@ bool GuiTrigger::Right() { u32 wiibtn = GCSettings.WiimoteOrientation ? WPAD_BUTTON_DOWN : WPAD_BUTTON_RIGHT; - if((wpad.btns_d | wpad.btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_RIGHT) + if((wpad->btns_d | wpad->btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_RIGHT) || (pad.btns_d | pad.btns_h) & PAD_BUTTON_RIGHT || pad.stickX > PADCAL || WPAD_Stick(0,0) > PADCAL) { - if(wpad.btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_RIGHT) + if(wpad->btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_RIGHT) || pad.btns_d & PAD_BUTTON_RIGHT) { scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay. @@ -200,12 +201,12 @@ bool GuiTrigger::Up() { u32 wiibtn = GCSettings.WiimoteOrientation ? WPAD_BUTTON_RIGHT : WPAD_BUTTON_UP; - if((wpad.btns_d | wpad.btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_UP) + if((wpad->btns_d | wpad->btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_UP) || (pad.btns_d | pad.btns_h) & PAD_BUTTON_UP || pad.stickY > PADCAL || WPAD_Stick(0,1) > PADCAL) { - if(wpad.btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_UP) + if(wpad->btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_UP) || pad.btns_d & PAD_BUTTON_UP) { scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay. @@ -229,12 +230,12 @@ bool GuiTrigger::Down() { u32 wiibtn = GCSettings.WiimoteOrientation ? WPAD_BUTTON_LEFT : WPAD_BUTTON_DOWN; - if((wpad.btns_d | wpad.btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_DOWN) + if((wpad->btns_d | wpad->btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_DOWN) || (pad.btns_d | pad.btns_h) & PAD_BUTTON_DOWN || pad.stickY < -PADCAL || WPAD_Stick(0,1) < -PADCAL) { - if(wpad.btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_DOWN) + if(wpad->btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_DOWN) || pad.btns_d & PAD_BUTTON_DOWN) { scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay. diff --git a/source/ngc/gui/gui_window.cpp b/source/ngc/gui/gui_window.cpp index 6da58fd..d4d5e4b 100644 --- a/source/ngc/gui/gui_window.cpp +++ b/source/ngc/gui/gui_window.cpp @@ -195,7 +195,7 @@ void GuiWindow::ToggleFocus(GuiTrigger * t) } } // change focus - else if(t->wpad.btns_d & (WPAD_BUTTON_1 | WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) + else if(t->wpad->btns_d & (WPAD_BUTTON_1 | WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || t->pad.btns_d & PAD_BUTTON_B) { for (i = found; i < _elements.size(); i++) diff --git a/source/ngc/menu.cpp b/source/ngc/menu.cpp index f4aabdd..2e50b51 100644 --- a/source/ngc/menu.cpp +++ b/source/ngc/menu.cpp @@ -272,9 +272,9 @@ UpdateGUI (void *arg) #ifdef HW_RVL for(i=3; i >= 0; i--) // so that player 1's cursor appears on top! { - if(userInput[i].wpad.ir.valid) - Menu_DrawImg(userInput[i].wpad.ir.x-48, userInput[i].wpad.ir.y-48, - 96, 96, pointer[i]->GetImage(), userInput[i].wpad.ir.angle, 1, 1, 255); + if(userInput[i].wpad->ir.valid) + Menu_DrawImg(userInput[i].wpad->ir.x-48, userInput[i].wpad->ir.y-48, + 96, 96, pointer[i]->GetImage(), userInput[i].wpad->ir.angle, 1, 1, 255); DoRumble(i); } #endif @@ -855,9 +855,9 @@ static void WindowCredits(void * ptr) for(i=3; i >= 0; i--) { #ifdef HW_RVL - if(userInput[i].wpad.ir.valid) - Menu_DrawImg(userInput[i].wpad.ir.x-48, userInput[i].wpad.ir.y-48, - 96, 96, pointer[i]->GetImage(), userInput[i].wpad.ir.angle, 1, 1, 255); + if(userInput[i].wpad->ir.valid) + Menu_DrawImg(userInput[i].wpad->ir.x-48, userInput[i].wpad->ir.y-48, + 96, 96, pointer[i]->GetImage(), userInput[i].wpad->ir.angle, 1, 1, 255); DoRumble(i); #endif } @@ -866,7 +866,7 @@ static void WindowCredits(void * ptr) for(i=0; i < 4; i++) { - if(userInput[i].wpad.btns_d || userInput[i].pad.btns_d) + if(userInput[i].wpad->btns_d || userInput[i].pad.btns_d) exit = true; } usleep(THREAD_SLEEP); @@ -875,7 +875,7 @@ static void WindowCredits(void * ptr) // clear buttons pressed for(i=0; i < 4; i++) { - userInput[i].wpad.btns_d = 0; + userInput[i].wpad->btns_d = 0; userInput[i].pad.btns_d = 0; } @@ -1361,7 +1361,7 @@ static int MenuGame() if(WPAD_Probe(i, NULL) == WPAD_ERR_NONE) { newStatus = true; - newLevel = (userInput[i].wpad.battery_level / 100.0) * 4; + newLevel = (userInput[i].wpad->battery_level / 100.0) * 4; if(newLevel > 4) newLevel = 4; } else @@ -2448,12 +2448,12 @@ ButtonMappingWindow() userInput[0].pad.substickY > 70) pressed = WPAD_BUTTON_HOME; - if(userInput[0].wpad.btns_d == WPAD_BUTTON_HOME) + if(userInput[0].wpad->btns_d == WPAD_BUTTON_HOME) pressed = WPAD_BUTTON_HOME; } else { - pressed = userInput[0].wpad.btns_d; + pressed = userInput[0].wpad->btns_d; // always allow Home button to be pressed to cancel if(pressed != WPAD_BUTTON_HOME) @@ -2466,14 +2466,14 @@ ButtonMappingWindow() break; case CTRLR_CLASSIC: - if(userInput[0].wpad.exp.type != WPAD_EXP_CLASSIC) + if(userInput[0].wpad->exp.type != WPAD_EXP_CLASSIC) pressed = 0; // not a valid input else if(pressed <= 0x1000) pressed = 0; // not a valid input break; case CTRLR_NUNCHUK: - if(userInput[0].wpad.exp.type != WPAD_EXP_NUNCHUK) + if(userInput[0].wpad->exp.type != WPAD_EXP_NUNCHUK) pressed = 0; // not a valid input break; } diff --git a/source/ngc/pad.cpp b/source/ngc/pad.cpp index bda880d..56361ed 100644 --- a/source/ngc/pad.cpp +++ b/source/ngc/pad.cpp @@ -183,9 +183,10 @@ void SetControllers() /**************************************************************************** * UpdatePads * - * called by postRetraceCallback in InitGCVideo - scans pad and wpad + * Scans pad and wpad ***************************************************************************/ -void UpdatePads() +void +UpdatePads() { #ifdef HW_RVL WPAD_ScanPads(); @@ -194,11 +195,6 @@ void UpdatePads() for(int i=3; i >= 0; i--) { - #ifdef HW_RVL - memcpy(&userInput[i].wpad, WPAD_Data(i), sizeof(WPADData)); - #endif - - userInput[i].chan = i; userInput[i].pad.btns_d = PAD_ButtonsDown(i); userInput[i].pad.btns_u = PAD_ButtonsUp(i); userInput[i].pad.btns_h = PAD_ButtonsHeld(i); @@ -211,6 +207,33 @@ void UpdatePads() } } +/**************************************************************************** + * SetupPads + * + * Sets up userInput triggers for use + ***************************************************************************/ +void +SetupPads() +{ + PAD_Init(); + + #ifdef HW_RVL + WPAD_Init(); + + // read wiimote accelerometer and IR data + WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR); + WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight); + #endif + + for(int i=0; i < 4; i++) + { + userInput[i].chan = i; + #ifdef HW_RVL + userInput[i].wpad = WPAD_Data(i); + #endif + } +} + #ifdef HW_RVL /**************************************************************************** @@ -603,8 +626,8 @@ bool MenuRequested() userInput[i].pad.btns_h & PAD_BUTTON_B && userInput[i].pad.btns_h & PAD_TRIGGER_Z ) || - (userInput[i].wpad.btns_h & WPAD_BUTTON_HOME) || - (userInput[i].wpad.btns_h & WPAD_CLASSIC_BUTTON_HOME) + (userInput[i].wpad->btns_h & WPAD_BUTTON_HOME) || + (userInput[i].wpad->btns_h & WPAD_CLASSIC_BUTTON_HOME) ) { return true; diff --git a/source/ngc/pad.h b/source/ngc/pad.h index 26575a5..5cd0b17 100644 --- a/source/ngc/pad.h +++ b/source/ngc/pad.h @@ -33,6 +33,7 @@ s8 WPAD_StickY(u8 chan, u8 right); void GetJoy(); void DrawCursor(); bool MenuRequested(); +void SetupPads(); void UpdatePads(); #endif