Skip to content
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
2 changes: 1 addition & 1 deletion src/actors/fake_item_box/update.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void update_actor_fake_item_box(struct FakeItemBox* fake_item_box) {
if ((temp_v0_4->type & PLAYER_HUMAN) != 0) {

if ((temp_v1_3->buttonDepressed & Z_TRIG) != 0) {
temp_v1_3->buttonDepressed &= 0xDFFF;
temp_v1_3->buttonDepressed &= ~Z_TRIG;
func_802A1064(fake_item_box);
temp_v0_4->triggers &= ~DRAG_ITEM_EFFECT;
func_800C9060((u8) (temp_v0_4 - gPlayerOne), SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12));
Expand Down
4 changes: 2 additions & 2 deletions src/cpu_vehicles_camera_path.c
Original file line number Diff line number Diff line change
Expand Up @@ -4582,11 +4582,11 @@ void render_bomb_karts_wrap(s32 cameraId) {

UNUSED void func_8001C42C(void) {
if (D_800DDB20 == 0) {
if ((gControllerThree->buttonPressed & 0x20) != 0) {
if ((gControllerThree->buttonPressed & L_TRIG) != 0) {
D_800DDB20 = 1;
}
} else {
if ((gControllerThree->buttonPressed & 0x20) != 0) {
if ((gControllerThree->buttonPressed & L_TRIG) != 0) {
D_800DDB20 = 0;
}
func_80057C60();
Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ void update_controller(s32 index) {
controller->rawStickX = gControllerPads[index].stick_x;
controller->rawStickY = gControllerPads[index].stick_y;

if ((gControllerPads[index].button & 4) != 0) {
if ((gControllerPads[index].button & D_CBUTTONS) != 0) {
gControllerPads[index].button |= Z_TRIG;
}
controller->buttonPressed = gControllerPads[index].button & (gControllerPads[index].button ^ controller->button);
Expand Down
66 changes: 33 additions & 33 deletions src/menu_items.c
Original file line number Diff line number Diff line change
Expand Up @@ -10893,7 +10893,7 @@ void func_800ACA14(MenuItem* arg0) {
break;
}

if ((gControllerFive->buttonPressed | gControllerFive->stickPressed) & 0x800) {
if ((gControllerFive->buttonPressed | gControllerFive->stickPressed) & U_JPAD) {
if (arg0->state >= 0xC) {
arg0->state--;
play_sound2(SOUND_MENU_CURSOR_MOVE);
Expand All @@ -10903,7 +10903,7 @@ void func_800ACA14(MenuItem* arg0) {
arg0->subState = -1;
}
}
if ((gControllerFive->buttonPressed | gControllerFive->stickPressed) & 0x400) {
if ((gControllerFive->buttonPressed | gControllerFive->stickPressed) & D_JPAD) {
if (arg0->state < 0xC) {
arg0->state++;
play_sound2(SOUND_MENU_CURSOR_MOVE);
Expand All @@ -10913,7 +10913,7 @@ void func_800ACA14(MenuItem* arg0) {
arg0->subState = 1;
}
}
if (gControllerFive->buttonPressed & 0x9000) {
if (gControllerFive->buttonPressed & (A_BUTTON | START_BUTTON)) {
func_8009DFE0(0x0000001E);
func_800CA330(0x19U);
play_sound2(SOUND_ACTION_CONTINUE_UNKNOWN);
Expand Down Expand Up @@ -10965,7 +10965,7 @@ void func_800ACC50(MenuItem* arg0) {
case 12:
case 13:
if (is_screen_being_faded() == 0) {
if ((gControllerFive->buttonPressed | gControllerFive->stickPressed) & 0x800) {
if ((gControllerFive->buttonPressed | gControllerFive->stickPressed) & U_JPAD) {
if (arg0->state >= 0xB) {
arg0->state--;
play_sound2(SOUND_MENU_CURSOR_MOVE);
Expand All @@ -10975,7 +10975,7 @@ void func_800ACC50(MenuItem* arg0) {
arg0->subState = -1;
}
}
if ((gControllerFive->buttonPressed | gControllerFive->stickPressed) & 0x400) {
if ((gControllerFive->buttonPressed | gControllerFive->stickPressed) & D_JPAD) {
if (arg0->state < 0xD) {
arg0->state++;
play_sound2(SOUND_MENU_CURSOR_MOVE);
Expand All @@ -10985,7 +10985,7 @@ void func_800ACC50(MenuItem* arg0) {
arg0->subState = 1;
}
}
if (gControllerFive->buttonPressed & 0x9000) {
if (gControllerFive->buttonPressed & (START_BUTTON | A_BUTTON)) {
func_8009DFE0(0x0000001E);
play_sound2(SOUND_MENU_OK_CLICKED);
if (gModeSelection == VERSUS) {
Expand Down Expand Up @@ -11158,7 +11158,7 @@ void func_800AD2E8(MenuItem* arg0) {
case 9: /* switch 3 */
case 10: /* switch 3 */
if (is_screen_being_faded() == 0) {
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) {
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & U_JPAD) {
if (arg0->state >= 6) {
arg0->state--;
if ((gPostTimeTrialReplayCannotSave == 1) && (arg0->state == 9)) {
Expand All @@ -11171,7 +11171,7 @@ void func_800AD2E8(MenuItem* arg0) {
arg0->subState = -1;
}
}
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x400) {
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & D_JPAD) {
if (arg0->state < 0xA) {
arg0->state++;
if ((gPostTimeTrialReplayCannotSave == 1) && (arg0->state == 9)) {
Expand All @@ -11188,7 +11188,7 @@ void func_800AD2E8(MenuItem* arg0) {
}
}
}
if (gControllerOne->buttonPressed & 0x9000) {
if (gControllerOne->buttonPressed & (START_BUTTON | A_BUTTON)) {
if (arg0->state == 0x0000000A) {
var_v1 = 0;
if (arg0->paramf < 4.2) {
Expand Down Expand Up @@ -11288,7 +11288,7 @@ void func_800AD2E8(MenuItem* arg0) {
case 15:
case 16:
case 26:
if (gControllerOne->buttonPressed & 0xD000) {
if (gControllerOne->buttonPressed & (A_BUTTON | B_BUTTON | START_BUTTON)) {
arg0->state = 0x0000000A;
play_sound2(SOUND_MENU_GO_BACK);
if (arg0->paramf < 4.2) {
Expand All @@ -11300,7 +11300,7 @@ void func_800AD2E8(MenuItem* arg0) {
case 18:
arg0->param2 = arg0->state - 0x11;
if (func_800B639C((gCupSelection * 4) + gCourseIndexInCup) != arg0->param2) {
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) {
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & U_JPAD) {
if (arg0->state >= 0x12) {
arg0->state--;
play_sound2(SOUND_MENU_CURSOR_MOVE);
Expand All @@ -11310,7 +11310,7 @@ void func_800AD2E8(MenuItem* arg0) {
arg0->subState = -1;
}
}
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x400) {
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & D_JPAD) {
if (arg0->state < 0x12) {
arg0->state++;
play_sound2(SOUND_MENU_CURSOR_MOVE);
Expand All @@ -11321,12 +11321,12 @@ void func_800AD2E8(MenuItem* arg0) {
}
}
}
if (gControllerOne->buttonPressed & 0x4000) {
if (gControllerOne->buttonPressed & B_BUTTON) {
arg0->state = 0x0000000A;
play_sound2(SOUND_MENU_GO_BACK);
return;
}
if (gControllerOne->buttonPressed & 0x9000) {
if (gControllerOne->buttonPressed & (START_BUTTON | A_BUTTON)) {
thing = &D_8018EE10[arg0->param2];
if (thing->ghostDataSaved == 0) {
arg0->state = 0x00000019;
Expand Down Expand Up @@ -11355,15 +11355,15 @@ void func_800AD2E8(MenuItem* arg0) {
break;
case 20:
case 21:
if (((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) && (arg0->state >= 0x15)) {
if (((gControllerOne->buttonPressed | gControllerOne->stickPressed) & U_JPAD) && (arg0->state >= 0x15)) {
arg0->state--;
play_sound2(SOUND_MENU_CURSOR_MOVE);
if (arg0->paramf < 4.2) {
arg0->paramf += 4.0;
}
arg0->subState = -1;
}
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x400) {
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & D_JPAD) {
if (arg0->state < 0x15) {
arg0->state++;
play_sound2(SOUND_MENU_CURSOR_MOVE);
Expand All @@ -11373,12 +11373,12 @@ void func_800AD2E8(MenuItem* arg0) {
arg0->subState = 1;
}
}
if (gControllerOne->buttonPressed & 0x4000) {
if (gControllerOne->buttonPressed & B_BUTTON) {
arg0->state = arg0->param2 + 0x11;
play_sound2(SOUND_MENU_GO_BACK);
return;
}
if (gControllerOne->buttonPressed & 0x9000) {
if (gControllerOne->buttonPressed & (START_BUTTON | A_BUTTON)) {
if (arg0->state == 0x00000015) {
arg0->state = 0x00000019;
arg0->param1 = 0;
Expand Down Expand Up @@ -11485,7 +11485,7 @@ void func_800ADF48(MenuItem* arg0) {
case 44:
if (is_screen_being_faded() == 0) {
controller = &gControllers[gIsGamePaused - 1];
if ((controller->buttonPressed | controller->stickPressed) & 0x800) {
if ((controller->buttonPressed | controller->stickPressed) & U_JPAD) {
if (D_800F0B50[gModeSelection] < arg0->state) {
arg0->state--;
play_sound2(SOUND_MENU_CURSOR_MOVE);
Expand All @@ -11495,7 +11495,7 @@ void func_800ADF48(MenuItem* arg0) {
arg0->subState = -1;
}
}
if ((controller->buttonPressed | controller->stickPressed) & 0x400) {
if ((controller->buttonPressed | controller->stickPressed) & D_JPAD) {
if (arg0->state < D_800F0B54[gModeSelection]) {
arg0->state++;
play_sound2(SOUND_MENU_CURSOR_MOVE);
Expand Down Expand Up @@ -11549,7 +11549,7 @@ void func_800AE218(MenuItem* arg0) {
if (arg0->param1 < 0x1E) {
arg0->param1++;
}
if (gControllerOne->buttonPressed & 0x1000) {
if (gControllerOne->buttonPressed & START_BUTTON) {
arg0->state = 0x0000000F;
play_sound2(SOUND_ACTION_GO_BACK_2);
} else if (playerHUD[PLAYER_ONE].raceCompleteBool != 0) {
Expand All @@ -11572,7 +11572,7 @@ void func_800AE218(MenuItem* arg0) {
case 15:
case 16:
if (is_screen_being_faded() == 0) {
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) {
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & U_JPAD) {
if (arg0->state >= 0xC) {
arg0->state--;
play_sound2(SOUND_MENU_CURSOR_MOVE);
Expand All @@ -11582,7 +11582,7 @@ void func_800AE218(MenuItem* arg0) {
arg0->subState = -1;
}
}
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x400) {
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & D_JPAD) {
if (arg0->state < 0x10) {
arg0->state++;
play_sound2(SOUND_MENU_CURSOR_MOVE);
Expand All @@ -11592,7 +11592,7 @@ void func_800AE218(MenuItem* arg0) {
arg0->subState = 1;
}
}
if (gControllerOne->buttonPressed & 0x9000) {
if (gControllerOne->buttonPressed & (START_BUTTON | A_BUTTON)) {
if (arg0->state == 0x00000010) {
var_v1 = 0;
if (arg0->paramf < 4.2) {
Expand Down Expand Up @@ -11690,7 +11690,7 @@ void func_800AE218(MenuItem* arg0) {
case 25:
case 26:
case 41:
if (gControllerOne->buttonPressed & 0xD000) {
if (gControllerOne->buttonPressed & (A_BUTTON | B_BUTTON | START_BUTTON)) {
arg0->state = 0x00000010;
play_sound2(SOUND_MENU_GO_BACK);
if (arg0->paramf < 4.2) {
Expand All @@ -11702,7 +11702,7 @@ void func_800AE218(MenuItem* arg0) {
case 31:
arg0->param2 = (u32) arg0->state - 0x1E;
if (func_800B639C((gCupSelection * 4) + gCourseIndexInCup) != arg0->param2) {
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) {
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & U_JPAD) {
if (arg0->state >= 0x1F) {
arg0->state--;
play_sound2(SOUND_MENU_CURSOR_MOVE);
Expand All @@ -11712,7 +11712,7 @@ void func_800AE218(MenuItem* arg0) {
arg0->subState = -1;
}
}
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x400) {
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & D_JPAD) {
if (arg0->state < 0x1F) {
arg0->state++;
play_sound2(SOUND_MENU_CURSOR_MOVE);
Expand All @@ -11723,10 +11723,10 @@ void func_800AE218(MenuItem* arg0) {
}
}
}
if (gControllerOne->buttonPressed & 0x4000) {
if (gControllerOne->buttonPressed & B_BUTTON) {
arg0->state = 0x00000010;
play_sound2(SOUND_MENU_GO_BACK);
} else if (gControllerOne->buttonPressed & 0x9000) {
} else if (gControllerOne->buttonPressed & (START_BUTTON | A_BUTTON)) {
thing = &D_8018EE10[arg0->param2];
if (thing->ghostDataSaved == 0) {
arg0->state = 0x00000028;
Expand Down Expand Up @@ -11754,7 +11754,7 @@ void func_800AE218(MenuItem* arg0) {
break;
case 35:
case 36:
if (((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) &&
if (((gControllerOne->buttonPressed | gControllerOne->stickPressed) & U_JPAD) &&
((s32) (u32) arg0->state >= 0x24)) {
arg0->state--;
play_sound2(SOUND_MENU_CURSOR_MOVE);
Expand All @@ -11763,7 +11763,7 @@ void func_800AE218(MenuItem* arg0) {
}
arg0->subState = -1;
}
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x400) {
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & D_JPAD) {
if (arg0->state < 0x24) {
arg0->state++;
play_sound2(SOUND_MENU_CURSOR_MOVE);
Expand All @@ -11773,10 +11773,10 @@ void func_800AE218(MenuItem* arg0) {
arg0->subState = 1;
}
}
if (gControllerOne->buttonPressed & 0x4000) {
if (gControllerOne->buttonPressed & B_BUTTON) {
arg0->state = arg0->param2 + 0x1E;
play_sound2(SOUND_MENU_GO_BACK);
} else if (gControllerOne->buttonPressed & 0x9000) {
} else if (gControllerOne->buttonPressed & (START_BUTTON | A_BUTTON)) {
if (arg0->state == 0x00000024) {
arg0->state = 0x00000028;
arg0->param1 = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/profiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ void resource_display(void) {
gDPSetCycleType(gDisplayListHead++, G_CYC_FILL);
gDPSetFillColor(gDisplayListHead++, GPACK_RGBA5551(0, 0, 0, 0) << 16 | GPACK_RGBA5551(0, 0, 0, 0));

if ((gControllerOne->buttonPressed & 0x20) != 0) {
if ((gControllerOne->buttonPressed & L_TRIG) != 0) {
D_800DC664 ^= 1;
}
draw_profiler_mode_0();
Expand Down
2 changes: 1 addition & 1 deletion src/racing/race_logic.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ void func_8028F970(void) {

if (gActiveScreenMode != SCREEN_MODE_3P_4P_SPLITSCREEN) {
if ((controller->buttonPressed & L_TRIG) && !(controller->button & R_TRIG)) {
controller->buttonPressed &= 0xFFDF;
controller->buttonPressed &= ~L_TRIG;

D_800DC5A8++;
if (D_800DC5A8 >= 3) {
Expand Down
2 changes: 1 addition & 1 deletion src/update_objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -3819,7 +3819,7 @@ void func_8007B34C(s32 playerId) {
sp38 = &gPlayerOne[playerId];
sp40 = 0;
new_var = &gControllerOne[playerId];
if (new_var->buttonPressed & 0x2000) {
if (new_var->buttonPressed & Z_TRIG) {
sp40 = 1;
}
if (D_80165888 != 0) {
Expand Down
Loading