PS2SDK
PS2 Homebrew Libraries
ssstop.c
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright ps2dev - http://www.ps2dev.org
7 # Licenced under Academic Free License version 2.0
8 # Review ps2sdk README & LICENSE files for further details.
9 */
10 
11 #include "libsnd2_internal.h"
12 
13 void _SsSndStop(s16 sep_no, s16 seq_no)
14 {
15  libsnd2_sequence_struct_t *score_struct;
16  int i_tmp;
17  u8 *m_unk04;
18 
19  score_struct = &_ss_score[sep_no][seq_no];
20  score_struct->m_flags &= ~1u;
21  score_struct->m_flags &= ~2u;
22  score_struct->m_flags &= ~8u;
23  score_struct->m_flags &= ~0x400u;
24  score_struct->m_flags |= 4u;
25  _SsVmSeqKeyOff(sep_no | (seq_no << 8));
26  _SsVmDamperOff();
27  m_unk04 = score_struct->m_unk04;
28  score_struct->m_play_mode = SSPLAY_PAUSE;
29  score_struct->m_unk88 = 0;
30  score_struct->m_unk1C = 0;
31  score_struct->m_unk18 = 0;
32  score_struct->m_unk19 = 0;
33  score_struct->m_unk1E = 0;
34  score_struct->m_fn_idx = 0;
35  score_struct->m_unk1B = 0;
36  score_struct->m_unk1F = 0;
37  score_struct->m_channel_idx = 0;
38  score_struct->m_unk21 = 0;
39  score_struct->m_unk1C = 0;
40  score_struct->m_unk1D = 0;
41  score_struct->m_unk15 = 0;
42  score_struct->m_running_status = 0;
43  score_struct->m_delta_value = score_struct->m_unk84;
44  score_struct->m_unk94 = score_struct->m_tempo;
45  score_struct->m_unk54 = score_struct->m_unk56;
46  score_struct->m_seq_ptr = m_unk04;
47  score_struct->m_unk08 = m_unk04;
48  for ( i_tmp = 0; i_tmp < 16; i_tmp += 1 )
49  {
50  score_struct->m_programs[i_tmp] = i_tmp;
51  score_struct->m_panpot[i_tmp] = 64;
52  score_struct->m_vol[i_tmp] = 127;
53  }
54  score_struct->m_unk5C = 127;
55  score_struct->m_unk5E = 127;
56 }
57 
58 void SsSeqStop(s16 sep_no)
59 {
60  _SsSndStop(sep_no, 0);
61 }
62 
63 void SsSepStop(s16 sep_no, s16 seq_no)
64 {
65  _SsSndStop(sep_no, seq_no);
66 }
libsnd2_sequence_struct_
Definition: libsnd2_internal.h:47