11#include "libsnd2_internal.h"
13void _SsSndCrescendo(s16 sep_no, s16 seq_no)
17 score_struct = &_ss_score[sep_no][seq_no];
18 score_struct->m_unkA0 += 1;
19 if ( score_struct->m_unk9C >= score_struct->m_unkA0 )
25 mulfield_tmp = score_struct->m_unk48 * score_struct->m_unkA0;
26 new_field_4a = mulfield_tmp / score_struct->m_unk9C;
27 if ( score_struct->m_unk9C == -1 && (
unsigned int)mulfield_tmp == 0x80000000 )
29 vol_inc_by = new_field_4a - score_struct->m_unk4A;
30 if ( new_field_4a != score_struct->m_unk4A )
37 score_struct->m_unk4A = new_field_4a;
38 _SsVmGetSeqVol(sep_no | (seq_no << 8), &seq_left_vol, &seq_right_vol);
39 voll_clamped = (u16)seq_left_vol + vol_inc_by;
40 if ( voll_clamped >= 128 )
42 if ( voll_clamped < 0 )
44 volr_clamped = (u16)seq_right_vol + vol_inc_by;
45 if ( volr_clamped >= 128 )
47 if ( volr_clamped < 0 )
49 _SsVmSetSeqVol(sep_no | (seq_no << 8), voll_clamped, volr_clamped);
50 if ( (voll_clamped == 127 && volr_clamped == 127) || (voll_clamped == 0 && volr_clamped == 0) )
52 score_struct->m_flags &= ~0x10u;
58 score_struct->m_flags &= ~0x10u;
60 _SsVmGetSeqVol(sep_no | (seq_no << 8), &score_struct->m_unk5C, &score_struct->m_unk5E);