Merge pull request #13577 from tygyh/UCodes-Make-functions-static

UCodes: Make functions static
This commit is contained in:
JMC47 2025-04-24 00:48:46 -04:00 committed by GitHub
commit fc0aafca3b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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 // Convert a mixer_control bitfield to our internal representation for that
// value. Required because that bitfield has a different meaning in some // value. Required because that bitfield has a different meaning in some
// versions of AX. // 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. // Generate a volume ramp from vol1 to vol2, interpolating n volume values.
// Uses floating point arithmetic, which isn't exactly what the UCode does, // Uses floating point arithmetic, which isn't exactly what the UCode does,
// but this gives better precision and nicer code. // 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; void HandleCommandList() override;

View file

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