PS2SDK
PS2 Homebrew Libraries
ut_cp.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 s16 SsUtChangePitch(s16 vc, s16 vab_id, s16 prog, s16 old_note, s16 old_fine, s16 new_note, s16 new_fine)
14 {
15  int m_vab_id;
16  int m_prog;
17  const libsnd2_spu_voice_t *voice_struct;
18 
19  (void)old_fine;
20 
21  if ( (u16)vc >= 0x18u )
22  return -1;
23  voice_struct = &_svm_voice[vc];
24  m_vab_id = voice_struct->m_vab_id;
25  if ( m_vab_id != vab_id )
26  {
27  return -1;
28  }
29  m_prog = voice_struct->m_prog;
30  if ( m_prog != prog )
31  {
32  return -1;
33  }
34  if ( voice_struct->m_note != old_note )
35  {
36  return -1;
37  }
38  _SsVmVSetUp(m_vab_id, m_prog);
39  _svm_cur.m_seq_sep_no = 33;
40  _svm_cur.m_voice_idx = vc;
41  _svm_cur.m_tone = voice_struct->m_tone;
42  _svm_sreg_buf[vc].m_pitch = note2pitch2(new_note, new_fine);
43  _svm_sreg_dirty[vc] |= 4u;
44  return 0;
45 }
libsnd2_spu_voice_
Definition: libsnd2_internal.h:117