Try to (re-)implement AFC sound. This is an adaptation of the code I commented out in the PCM16 commit.

For some reason AFC sound is slightly wrong. I don't know if it also happened before, but I'll work on it.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3600 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
luigi2us
2009-06-29 18:11:32 +00:00
parent e1e9d609ed
commit c9cc3c355d
5 changed files with 339 additions and 229 deletions

View File

@ -46,8 +46,8 @@ struct ZeldaVoicePB
u32 CurAddr; // 0x38 | current address
u32 RemLength; // 0x3A | remaining length
u16 Unk3C[0x2A]; // 0x3C | unknown
u16 YN1; // 0x66 | YN1
u16 YN2; // 0x67 | YN2
u16 YN2; // 0x66 | YN2
u16 YN1; // 0x67 | YN1
u16 Unk68[0x18]; // 0x68 | unknown
// Read-only part
@ -111,7 +111,7 @@ private:
s32* m_LeftBuffer;
s32* m_RightBuffer;
u16 m_AFCCoefTable[32];
s16 m_AFCCoefTable[32];
bool m_bSyncInProgress;
u32 m_MaxVoice;
@ -172,6 +172,7 @@ private:
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);
};