DSPHLE: Do the resampling correctly for PCM16 and AFC. Added linear interpolation (that works, this time :P)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3764 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2009-07-12 13:45:01 +00:00
parent 304b34a451
commit 0bdf6656c5
4 changed files with 119 additions and 96 deletions

View File

@ -166,7 +166,7 @@ private:
// These are the only dynamically allocated things allowed in the ucode.
s32* m_VoiceBuffer;
s32* m_ResampleBuffer;
s16* m_ResampleBuffer;
s32* m_LeftBuffer;
s32* m_RightBuffer;
@ -237,11 +237,14 @@ private:
void RenderSynth_Constant(ZeldaVoicePB &PB, s32* _Buffer, int _Size);
void RenderSynth_RectWave(ZeldaVoicePB &PB, s32* _Buffer, int _Size);
void RenderSynth_SawWave(ZeldaVoicePB &PB, s32* _Buffer, int _Size);
void RenderVoice_PCM16(ZeldaVoicePB& PB, s32* _Buffer, int _Size);
void RenderVoice_AFC(ZeldaVoicePB& PB, s32* _Buffer, int _Size);
void RenderVoice_PCM16(ZeldaVoicePB& PB, s16* _Buffer, int _Size);
void RenderVoice_AFC(ZeldaVoicePB& PB, s16* _Buffer, int _Size);
void RenderVoice_Raw(ZeldaVoicePB& PB, s32* _Buffer, int _Size);
void Resample(ZeldaVoicePB &PB, int size, s32 *in, s32 *out);
void Resample(ZeldaVoicePB &PB, int size, s16 *in, s32 *out, bool do_resample = false);
int ConvertRatio(int pb_ratio);
int SizeForResampling(ZeldaVoicePB &PB, int size, int ratio);
// Renders a voice and mixes it into LeftBuffer, RightBuffer
void RenderAddVoice(ZeldaVoicePB& PB, s32* _LeftBuffer, s32* _RightBuffer, int _Size);