Skip to content

Instantly share code, notes, and snippets.

@camprevail
Last active February 18, 2025 01:41
Show Gist options
  • Save camprevail/bf7628726386c9245ba7b7fd041fc84b to your computer and use it in GitHub Desktop.
Save camprevail/bf7628726386c9245ba7b7fd041fc84b to your computer and use it in GitHub Desktop.
museca - judge_notes decomp. Calls the appropriate judge functions
void __fastcall judge_notes(CGameSceneComponent *cGSC_)
{
//skipping less relevant code before and after this snippet.
NS = cGSC->CGameSequence.curNoteStructWindow;
cGSC->hit_note_judgedLaneMask = 0;
while ( NS != cGSC->CGameSequence.curNoteStructWindow_endloc )
{
noteStruct = *NS;
if ( *NS && !cGSC->note_hit_array[noteStruct->lane] )
{
switch ( noteStruct->kind_internal )
{
case EVENT_KIND_HIT_NOTE:
noteTimeDelta = (cGSC->currentTime - noteStruct->stime_ms);
if ( (-PlayScore::GetJudgeWindow(&cGSC->PlayScore, NEAR) * 2.0) < noteTimeDelta ) // if -144 < noteTimeDelta (if note is within judgement range. Notes above the judge
// line will have a negative time delta. Notes below will be positive.
{
judge_hit_note(cGSC, noteStruct);
goto LABEL_42;
}
break;
case EVENT_KIND_HOLD:
v19 = noteStruct->stime_ms;
if ( cGSC->currentTime - v19 > (-2 * PlayScore::GetJudgeWindow(&cGSC->PlayScore, NEAR)) )
{
judge_hold_note(cGSC, noteStruct, some_holdnote_flag);
goto LABEL_42;
}
break;
case EVENT_KIND_LARGE_SPINNER:
case EVENT_KIND_LARGE_SPINNER_LEFT:
case EVENT_KIND_LARGE_SPINNER_RIGHT:
case EVENT_KIND_SMALL_SPINNER:
case EVENT_KIND_SMALL_SPINNER_LEFT:
case EVENT_KIND_SMALL_SPINNER_RIGHT:
v18 = noteStruct->stime_ms;
if ( cGSC->currentTime - v18 > (-2 * PlayScore::GetJudgeWindow(&cGSC->PlayScore, NEAR)) )
{
judge_spin_note(cGSC, noteStruct);
goto LABEL_42;
}
break;
default:
v20 = noteStruct->stime_ms;
if ( cGSC->currentTime - v20 <= -PlayScore::GetJudgeWindow(&cGSC->PlayScore, NEAR) )
break;
LABEL_42:
v21 = isMissionMode(ptr_CNetworkSystem);
if ( !GameOptionParam::get_fictional_curator_setting(cGSC->mission_mode == 0, v21) || noteStruct->field_2B )
break;
v22 = noteStruct->kind_internal;
if ( v22 == EVENT_KIND_HOLD )
goto LABEL_47;
if ( noteStruct->judged )
goto LABEL_51;
if ( v22 == EVENT_KIND_HOLD )
{
LABEL_47:
if ( noteStruct->hold_note_ended
|| v22 == EVENT_KIND_HOLD
&& noteStruct->hold_note_ended
&& noteStruct->holdnote_active_frames_ == EVENT_KIND_HOLD )
{
LABEL_51:
v23 = cGSC->field_50C4 == 0;
cGSC->field_50C0 = cGSC->PlayScore.field_68;
v24 = sub_1802FDCC0(&cGSC->field_2058, v23);
if ( noteStruct->duration_ms > 0.0 && noteStruct->kind_internal == EVENT_KIND_HOLD )
v24 += sub_1802FDCC0(&cGSC->field_2058, 0);
cGSC->field_50C4 += v24;
noteStruct->field_2B = 1;
}
}
break;
}
}
++NS;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment