UCodes: Make functions static

This commit is contained in:
Dr. Dystopia 2025-04-23 20:41:53 +02:00
parent 89873d6238
commit 564e7c3320
2 changed files with 9 additions and 9 deletions

View file

@ -49,12 +49,12 @@ protected:
// Convert a mixer_control bitfield to our internal representation for that
// value. Required because that bitfield has a different meaning in some
// versions of AX.
AXMixControl ConvertMixerControl(u32 mixer_control);
static AXMixControl ConvertMixerControl(u32 mixer_control);
// Generate a volume ramp from vol1 to vol2, interpolating n volume values.
// Uses floating point arithmetic, which isn't exactly what the UCode does,
// but this gives better precision and nicer code.
void GenerateVolumeRamp(u16* output, u16 vol1, u16 vol2, size_t nvals);
static void GenerateVolumeRamp(u16* output, u16 vol1, u16 vol2, size_t nvals);
void HandleCommandList() override;

View file

@ -56,7 +56,7 @@ private:
// Apply volume to a buffer. The volume is a fixed point integer, usually
// 1.15 or 4.12 in the DAC UCode.
template <size_t N, size_t B>
void ApplyVolumeInPlace(std::array<s16, N>* buf, u16 vol)
static void ApplyVolumeInPlace(std::array<s16, N>* buf, u16 vol)
{
for (size_t i = 0; i < N; ++i)
{
@ -83,8 +83,8 @@ private:
// Note: On a real GC, the stepping happens in 32 steps instead. But hey,
// we can do better here with very low risk. Why not? :)
template <size_t N>
s32 AddBuffersWithVolumeRamp(std::array<s16, N>* dst, const std::array<s16, N>& src, s32 vol,
s32 step)
static s32 AddBuffersWithVolumeRamp(std::array<s16, N>* dst, const std::array<s16, N>& src,
s32 vol, s32 step)
{
if (!vol && !step)
return vol;
@ -100,7 +100,7 @@ private:
// Does not use std::array because it needs to be able to process partial
// buffers. Volume is in 1.15 format.
void AddBuffersWithVolume(s16* dst, const s16* src, size_t count, u16 vol)
static void AddBuffersWithVolume(s16* dst, const s16* src, size_t count, u16 vol)
{
while (count--)
{
@ -157,7 +157,7 @@ private:
// Raw samples (pre-resampling) that need to be generated to result in 0x50
// post-resampling input samples.
u16 NeededRawSamplesCount(const VPB& vpb);
static u16 NeededRawSamplesCount(const VPB& vpb);
// Resamples raw samples to 0x50 input samples, using the resampling ratio
// and current position information from the VPB.
@ -185,8 +185,8 @@ private:
// behavior.
void DownloadRawSamplesFromMRAM(s16* dst, VPB* vpb, u16 requested_samples_count);
void ApplyLowPassFilter(MixingBuffer* buf, VPB* vpb);
void ApplyBiquadFilter(MixingBuffer* buf, VPB* vpb);
static void ApplyLowPassFilter(MixingBuffer* buf, VPB* vpb);
static void ApplyBiquadFilter(MixingBuffer* buf, VPB* vpb);
// Applies the reverb effect to Dolby mixed voices based on a set of
// per-buffer parameters. Is called twice: once before frame rendering and