DSPHLE: Early implementation of volume. I'm sure there's something missing but this makes the Zelda games sound a lot better, except WW which loses a lot of audio on the title screen and link's noises are too soft.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3635 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2009-07-01 20:55:43 +00:00
parent de83d1cda4
commit 5ca6d2761e
5 changed files with 104 additions and 79 deletions

View File

@ -38,9 +38,11 @@ struct ZeldaVoicePB
u16 IsBlank; // 0x06 | 0 = normal sound, 1 = samples are always the same
u16 Unk07; // 0x07 | unknown, in zelda always 0x0010
u16 SoundType; // 0x08 | Sound type: so far in zww: 0x0d00 for music, 0x4861 for sfx
u32 volumeRight; // 0x09 | Right Volume
u16 volumeLeft1; // 0x09 | Left Volume 1 // There's probably two of each because they should be ramped within each frame.
u16 volumeLeft2; // 0x0A | Left Volume 2
u16 Unk0B[2]; // 0x0B | unknown
u32 volumeLeft; // 0x0D | Left Volume
u16 volumeRight1; // 0x0D | Right Volume 1
u16 volumeRight2; // 0x0E | Right Volume 2
u16 Unk0F[0x8]; // 0x0F | unknown // Buffer / something, see 036e/ZWW. there's a pattern here
u16 Unk18[0x10]; // 0x18 | unknown
u16 Unk28; // 0x28 | unknown
@ -145,6 +147,7 @@ private:
u32 m_CRC;
s32* m_TempBuffer;
s32* m_LeftBuffer;
s32* m_RightBuffer;
@ -208,13 +211,14 @@ private:
void ReadVoicePB(u32 _Addr, ZeldaVoicePB& PB);
void WritebackVoicePB(u32 _Addr, ZeldaVoicePB& PB);
void MixAddVoice_PCM16(ZeldaVoicePB& PB, s32* _Buffer, int _Size);
void MixAddVoice_AFC(ZeldaVoicePB& PB, s32* _Buffer, int _Size);
void MixAddVoice(ZeldaVoicePB& PB, s32* _LeftBuffer, s32* _RightBuffer, int _Size);
// Voice formats
void RenderSynth_Constant(ZeldaVoicePB &PB, s32* _Buffer, int _Size);
void RenderSynth_Waveform(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 MixAddSynth_Constant(ZeldaVoicePB &PB, s32* _Buffer, int _Size);
void MixAddSynth_Waveform(ZeldaVoicePB &PB, s32* _Buffer, int _Size);
// Renders a voice and mixes it into LeftBuffer, RightBuffer
void RenderAddVoice(ZeldaVoicePB& PB, s32* _LeftBuffer, s32* _RightBuffer, int _Size);
};
#endif