Support using 4 controllers at once
This commit is contained in:
1 parent
c76c5824e3
commit
169e9cff2e
10 files changed
+33
-49
No files matched your search
@@ -1166,16 +1166,16 @@ void handle_cursor_button_input(void) {
|
||||
if (sSelectedButtonID == MENU_BUTTON_SCORE_FILE_A || sSelectedButtonID == MENU_BUTTON_SCORE_FILE_B
|
||||
|| sSelectedButtonID == MENU_BUTTON_SCORE_FILE_C
|
||||
|| sSelectedButtonID == MENU_BUTTON_SCORE_FILE_D) {
|
||||
if (gPlayer3Controller->buttonPressed & (B_BUTTON | START_BUTTON | Z_TRIG)) {
|
||||
if (gPlayer1Controller->buttonPressed & (B_BUTTON | START_BUTTON | Z_TRIG)) {
|
||||
sClickPos[0] = sCursorPos[0];
|
||||
sClickPos[1] = sCursorPos[1];
|
||||
sCursorClickingTimer = 1;
|
||||
} else if (gPlayer3Controller->buttonPressed & A_BUTTON) {
|
||||
} else if (gPlayer1Controller->buttonPressed & A_BUTTON) {
|
||||
sScoreFileCoinScoreMode = 1 - sScoreFileCoinScoreMode;
|
||||
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gGlobalSoundSource);
|
||||
}
|
||||
} else { // If cursor is clicked
|
||||
if (gPlayer3Controller->buttonPressed
|
||||
if (gPlayer1Controller->buttonPressed
|
||||
& (A_BUTTON | B_BUTTON | START_BUTTON)) {
|
||||
sClickPos[0] = sCursorPos[0];
|
||||
sClickPos[1] = sCursorPos[1];
|
||||
@@ -1188,8 +1188,8 @@ void handle_cursor_button_input(void) {
|
||||
* Cursor function that handles analog stick input and button presses with a function near the end.
|
||||
*/
|
||||
void handle_controller_cursor_input(void) {
|
||||
s16 rawStickX = gPlayer3Controller->rawStickX;
|
||||
s16 rawStickY = gPlayer3Controller->rawStickY;
|
||||
s16 rawStickX = gPlayer1Controller->rawStickX;
|
||||
s16 rawStickY = gPlayer1Controller->rawStickY;
|
||||
|
||||
// Handle deadzone
|
||||
if (rawStickY > -2 && rawStickY < 2) {
|
||||
|
||||
@@ -428,7 +428,7 @@ s32 lvl_init_act_selector_values_and_stars(UNUSED s32 arg, UNUSED s32 unused) {
|
||||
s32 lvl_update_obj_and_load_act_button_actions(UNUSED s32 arg, UNUSED s32 unused) {
|
||||
if (sActSelectorMenuTimer > 10) {
|
||||
// If any of these buttons are pressed, play sound and go to course act
|
||||
if ((gPlayer3Controller->buttonPressed & (A_BUTTON | START_BUTTON | B_BUTTON | Z_TRIG))) {
|
||||
if ((gPlayer1Controller->buttonPressed & (A_BUTTON | START_BUTTON | B_BUTTON | Z_TRIG))) {
|
||||
play_sound(SOUND_MENU_STAR_SOUND_LETS_A_GO, gGlobalSoundSource);
|
||||
#if ENABLE_RUMBLE
|
||||
queue_rumble_data(60, 70);
|
||||
|
||||
@@ -110,7 +110,7 @@ s32 intro_level_select(void) {
|
||||
if (((index ^ gLevelSelectHoldKeyIndex) & index) == 2) {
|
||||
if (gCurrLevelNum > LEVEL_MAX) {
|
||||
gCurrLevelNum = LEVEL_MIN;
|
||||
} else if (gPlayer3Controller->buttonDown & B_BUTTON) {
|
||||
} else if (gPlayer1Controller->buttonDown & B_BUTTON) {
|
||||
play_sound(SOUND_GENERAL_LEVEL_SELECT_CHANGE, gGlobalSoundSource);
|
||||
gCurrLevelNum += 10;
|
||||
} else {
|
||||
@@ -123,7 +123,7 @@ s32 intro_level_select(void) {
|
||||
if (gCurrLevelNum < LEVEL_MIN) {
|
||||
// Same applies to here as above
|
||||
gCurrLevelNum = LEVEL_MAX;
|
||||
} else if (gPlayer3Controller->buttonDown & B_BUTTON) {
|
||||
} else if (gPlayer1Controller->buttonDown & B_BUTTON) {
|
||||
play_sound(SOUND_GENERAL_LEVEL_SELECT_CHANGE, gGlobalSoundSource);
|
||||
gCurrLevelNum -= 10;
|
||||
} else {
|
||||
@@ -187,7 +187,7 @@ s32 intro_regular(void) {
|
||||
}
|
||||
print_intro_text();
|
||||
#ifdef DEBUG_LEVEL_SELECT
|
||||
if (gPlayer3Controller->buttonDown & L_TRIG) {
|
||||
if (gPlayer1Controller->buttonDown & L_TRIG) {
|
||||
gDebugLevelSelect = TRUE;
|
||||
}
|
||||
#endif
|
||||
@@ -263,7 +263,7 @@ s32 lvl_intro_update(s16 arg, UNUSED s32 unusedArg) {
|
||||
#else
|
||||
case LVL_INTRO_REGULAR:
|
||||
#ifdef DEBUG_LEVEL_SELECT
|
||||
if (gPlayer3Controller->buttonDown & L_TRIG) {
|
||||
if (gPlayer1Controller->buttonDown & L_TRIG) {
|
||||
gDebugLevelSelect = TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user