summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorGaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com>2022-07-19 01:29:24 +0200
committerGitHub <noreply@github.com>2022-07-18 19:29:24 -0400
commit660897ff63eed203d7759d3fa4b8039f9730e8d3 (patch)
tree4cf56146750e4cb6855e548b7a569e5bba3beaa9 /soh/src/code
parent37afdbd84c51c9dd1f6742f414c617640a9958c8 (diff)
Avoid UB on ocarinaAction shifts (#809)
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_message_PAL.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c
index 9631c5a12..79326ee81 100644
--- a/soh/src/code/z_message_PAL.c
+++ b/soh/src/code/z_message_PAL.c
@@ -2237,14 +2237,14 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
}
} else {
osSyncPrintf("Na_StartOcarinaSinglePlayCheck2( message->ocarina_no );\n");
- func_800ECC04((1 << msgCtx->ocarinaAction) + 0x8000);
+ func_800ECC04((1 << (msgCtx->ocarinaAction % 32)) + 0x8000);
}
msgCtx->msgMode = MSGMODE_OCARINA_PLAYING;
} else if (msgCtx->msgMode == MSGMODE_SONG_DEMONSTRATION_STARTING) {
msgCtx->stateTimer = 20;
msgCtx->msgMode = MSGMODE_SONG_DEMONSTRATION_SELECT_INSTRUMENT;
} else {
- func_800ECC04((1 << (msgCtx->ocarinaAction + 0x11)) + 0x8000);
+ func_800ECC04((1 << ((msgCtx->ocarinaAction + 0x11) % 32)) + 0x8000);
// "Performance Check"
osSyncPrintf("演奏チェック=%d\n", msgCtx->ocarinaAction - OCARINA_ACTION_PLAYBACK_MINUET);
msgCtx->msgMode = MSGMODE_SONG_PLAYBACK;