sdk-world
v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Toggle main menu visibility
Loading...
Searching...
No Matches
vm_noise.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
_SsVmNoiseOnWithAdsr(s32 voll, s32 volr, s32 arg2, s32 arg3)
14
{
15
int
voice_idx_tmp;
16
17
_svm_cur.m_prior = 127;
18
voice_idx_tmp = (u8)_SsVmAlloc();
19
_svm_cur.m_voice_idx = voice_idx_tmp;
20
if
( voice_idx_tmp < _SsVmMaxVoice )
21
vmNoiseOn2(_svm_cur.m_voice_idx, voll, volr, arg2, arg3);
22
}
23
24
void
_SsVmNoiseOff(
void
)
25
{
26
int
v0;
27
28
for
( v0 = 0; (s16)v0 < _SsVmMaxVoice; v0 += 1 )
29
{
30
if
( (_snd_vmask & (1 << v0)) == 0 )
31
{
32
const
libsnd2_spu_voice_t *voice_struct;
33
34
voice_struct = &_svm_voice[v0];
35
if
( voice_struct->m_unk1d == 2 )
36
{
37
vmNoiseOff(v0);
38
}
39
}
40
}
41
}
42
43
void
_SsVmNoiseOn(u16 voll, u16 volr)
44
{
45
_SsVmNoiseOnWithAdsr(voll, volr, 0x80ff, 0x5fc8);
46
}
libsnd2_internal.h
libsnd2
src
vm
vm_noise.c
Generated by
1.18.0