mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Added AI FIFO wave logging to HLE plugin. Same for LLE plugin is coming soon. Plus some extra critical section locks in LLE plugin.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@797 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -14,13 +14,13 @@
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "Globals.h"
|
||||
#include "gdsp_interface.h"
|
||||
|
||||
extern uint16 dsp_swap16(uint16 x);
|
||||
|
||||
|
||||
// the hardware adpcm decoder :)
|
||||
// The hardware adpcm decoder :)
|
||||
sint16 ADPCM_Step(uint32& _rSamplePos, uint32 _BaseAddress)
|
||||
{
|
||||
sint16* pCoefTable = (sint16*)&gdsp_ifx_regs[DSP_COEF_A1_0];
|
||||
@ -42,30 +42,25 @@ sint16 ADPCM_Step(uint32& _rSamplePos, uint32 _BaseAddress)
|
||||
(g_dspInitialize.pARAM_Read_U8(_rSamplePos >> 1) >> 4);
|
||||
|
||||
if (temp >= 8)
|
||||
{
|
||||
temp -= 16; //temp += 0xFFFFFFF0;
|
||||
}
|
||||
temp -= 16;
|
||||
|
||||
//0x400 = 0.5 in 11-bit fixed point
|
||||
// 0x400 = 0.5 in 11-bit fixed point
|
||||
int val = (scale * temp) + ((0x400 + coef1 * (sint16)gdsp_ifx_regs[DSP_YN1] + coef2 * (sint16)gdsp_ifx_regs[DSP_YN2]) >> 11);
|
||||
|
||||
// Clamp values.
|
||||
if (val > 0x7FFF)
|
||||
{
|
||||
val = 0x7FFF;
|
||||
}
|
||||
else if (val < -0x7FFF)
|
||||
{
|
||||
val = -0x7FFF;
|
||||
}
|
||||
|
||||
gdsp_ifx_regs[DSP_YN2] = gdsp_ifx_regs[DSP_YN1];
|
||||
gdsp_ifx_regs[DSP_YN1] = val;
|
||||
|
||||
_rSamplePos++;
|
||||
|
||||
return(val);
|
||||
|
||||
// I think the interpolation (linear, polyphase,...) is done by the UCode
|
||||
// The advanced interpolation (linear, polyphase,...) is done by the UCode, so we don't
|
||||
// need to bother with it here.
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
@ -104,8 +99,12 @@ uint16 dsp_read_aram()
|
||||
if (Address > EndAddress)
|
||||
{
|
||||
Address = (gdsp_ifx_regs[DSP_ACSAH] << 16) | gdsp_ifx_regs[DSP_ACSAL];
|
||||
//ErrorLog("Should we generate a lvl5 exception !??!");
|
||||
//gdsp_exception(5);
|
||||
// ErrorLog("Should we generate a lvl5 exception !??!");
|
||||
// gdsp_exception(5);
|
||||
|
||||
// Somehow, YN1 and YN2 must be initialized with their "loop" values, so yeah,
|
||||
// it seems likely that we should raise an exception to let the DSP program do that,
|
||||
// at least if DSP_FORMAT == 0x0A.
|
||||
}
|
||||
|
||||
gdsp_ifx_regs[DSP_ACCAH] = Address >> 16;
|
||||
|
Reference in New Issue
Block a user