Avoid UB on ocarinaAction shifts (#809)

This commit is contained in:
GaryOderNichts 2022-07-19 01:29:24 +02:00 committed by GitHub
parent 37afdbd84c
commit 660897ff63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;