Best of both worlds (or hacks...). Music continues to play, no sound breakage in Pikmin2/ZTP. Wind Waker still echoes weirdly in ZWW though.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4344 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY
2009-09-29 19:15:34 +00:00
parent e6b30e574e
commit 48ed2ae852
4 changed files with 40 additions and 20 deletions

View File

@ -175,7 +175,7 @@ void CUCode_Zelda::RenderSynth_WaveTable(ZeldaVoicePB &PB, s32* _Buffer, int _Si
address = AddValueToReg(address, ((ACC0 >> 16) & 0xffff));
ACC0 &= 0xffff0000ffffULL;
for(int i = 0; i < _Size; i++)
for(int i = 0; i < 0x50; i++)
{
_Buffer[i] = m_MiscTable[address];
@ -185,7 +185,7 @@ void CUCode_Zelda::RenderSynth_WaveTable(ZeldaVoicePB &PB, s32* _Buffer, int _Si
ACC0 &= 0xffff0000ffffULL;
}
ACC0 = address << 16;
ACC0 += address << 16;
PB.CurSampleFrac = (ACC0 >> 6) & 0xffff;
}

View File

@ -272,12 +272,15 @@ void CUCode_Zelda::RenderVoice_AFC(ZeldaVoicePB &PB, s16 *_Buffer, int _Size)
restart:
if (PB.ReachedEnd)
{
PB.ReachedEnd = 0;
// HACK: AFC looping doesn't work.
if (PB.RepeatMode == 0) //MKDD excluded (hack) - strange menu sounds
{
PB.KeyOff = 1;
// PB.RemLength = 0;
// PB.CurAddr = PB.StartAddr + PB.RestartPos + PB.Length;
PB.RemLength = 0;
PB.CurAddr = PB.StartAddr + PB.RestartPos + PB.Length;
while (sampleCount < _RealSize)
_Buffer[sampleCount++] = 0;
return;
@ -293,6 +296,7 @@ restart:
// Hmm, this shouldn't be reversed .. or should it? Is it different between versions of the ucode?
PB.YN1 = PB.LoopYN2;
PB.YN2 = PB.LoopYN1;
}
}

View File

@ -278,6 +278,7 @@ HRESULT Create(int adapter, HWND wnd, bool _fullscreen, int _resolution, int aa_
dev->GetRenderTarget(0, &back_buffer);
if (dev->GetDepthStencilSurface(&back_buffer_z) == D3DERR_NOTFOUND)
back_buffer_z = NULL;
dev->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE );
// Device state would normally be set here
return S_OK;