mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Small changes to DSP HLE. Still no sound in Wii AX. Blocks are turned on but something is wrong, it seems like cur_addr was not moving (in Top Spin 3), if I understand the log correctly.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1111 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -408,7 +408,7 @@ void CUCode_AX::MixAdd(short* _pBuffer, int _iSize)
|
||||
// write logging data to debugger
|
||||
if (m_frame)
|
||||
{
|
||||
CUCode_AX::Logging(_pBuffer, _iSize, 0);
|
||||
CUCode_AX::Logging(_pBuffer, _iSize, 0, false);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
@ -464,7 +464,7 @@ void CUCode_AX::MixAdd(short* _pBuffer, int _iSize)
|
||||
// write logging data to debugger again after the update
|
||||
if (m_frame)
|
||||
{
|
||||
CUCode_AX::Logging(_pBuffer, _iSize, 1);
|
||||
CUCode_AX::Logging(_pBuffer, _iSize, 1, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
enum
|
||||
{
|
||||
NUMBER_OF_PBS = 64
|
||||
NUMBER_OF_PBS = 128
|
||||
};
|
||||
|
||||
class CUCode_AX : public IUCode
|
||||
@ -37,7 +37,9 @@ public:
|
||||
void Update();
|
||||
|
||||
// Logging
|
||||
void Logging(short* _pBuffer, int _iSize, int a);
|
||||
//template<class ParamBlockType>
|
||||
//void Logging(short* _pBuffer, int _iSize, int a, bool Wii, ParamBlockType &PBs, int numberOfPBs);
|
||||
void Logging(short* _pBuffer, int _iSize, int a, bool Wii);
|
||||
void SaveLog_(bool Wii, const char* _fmt, ...);
|
||||
void SaveMail(bool Wii, u32 _uMail);
|
||||
void SaveLogFile(std::string f, int resizeTo, bool type, bool Wii);
|
||||
|
@ -135,7 +135,7 @@ struct AXParamBlock
|
||||
u16 this_pb_lo;
|
||||
|
||||
u16 src_type; // Type of sample rate converter (none, ?, linear)
|
||||
u16 unknown1;
|
||||
u16 coef_select;
|
||||
|
||||
u16 mixer_control;
|
||||
u16 running; // 1=RUN 0=STOP
|
||||
|
@ -50,7 +50,7 @@ CUCode_AXWii::CUCode_AXWii(CMailHandler& _rMailHandler)
|
||||
templbuffer = new int[1024 * 1024];
|
||||
temprbuffer = new int[1024 * 1024];
|
||||
|
||||
lCUCode_AX = new CUCode_AX(_rMailHandler);
|
||||
lCUCode_AX = new CUCode_AX(_rMailHandler);
|
||||
}
|
||||
|
||||
CUCode_AXWii::~CUCode_AXWii()
|
||||
@ -76,24 +76,27 @@ int ReadOutPBsWii(u32 pbs_address, AXParamBlockWii* _pPBs, int _num)
|
||||
{
|
||||
int count = 0;
|
||||
u32 blockAddr = pbs_address;
|
||||
u32 pAddr = 0;
|
||||
|
||||
// reading and 'halfword' swap
|
||||
for (int i = 0; i < _num; i++)
|
||||
{
|
||||
const short *pSrc = (const short *)g_dspInitialize.pGetMemoryPointer(blockAddr);
|
||||
if (pSrc != NULL)
|
||||
pAddr = blockAddr;
|
||||
u32 nextBlock = (Common::swap16(pSrc[162]) << 16 | Common::swap16(pSrc[163]));
|
||||
if (pSrc != NULL && nextBlock == blockAddr + 320) // new way to stop
|
||||
{
|
||||
short *pDest = (short *)&_pPBs[i];
|
||||
for (size_t p = 0; p < sizeof(AXParamBlock) / 2; p++)
|
||||
{
|
||||
for (int p = 0; p < sizeof(AXParamBlockWii) / 2; p++)
|
||||
{
|
||||
pDest[p] = Common::swap16(pSrc[p]);
|
||||
|
||||
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
gLastBlock = blockAddr + p*2 + 2; // save last block location
|
||||
#endif
|
||||
}
|
||||
blockAddr = (_pPBs[i].next_pb_hi << 16) | _pPBs[i].next_pb_lo;
|
||||
count++;
|
||||
count++;
|
||||
}
|
||||
else
|
||||
break;
|
||||
@ -113,7 +116,7 @@ void WriteBackPBsWii(u32 pbs_address, AXParamBlockWii* _pPBs, int _num)
|
||||
short* pSrc = (short*)&_pPBs[i];
|
||||
short* pDest = (short*)g_dspInitialize.pGetMemoryPointer(blockAddr);
|
||||
for (size_t p = 0; p < sizeof(AXParamBlockWii) / 2; p++)
|
||||
{
|
||||
{
|
||||
pDest[p] = Common::swap16(pSrc[p]);
|
||||
}
|
||||
|
||||
@ -138,7 +141,7 @@ void CUCode_AXWii::MixAdd(short* _pBuffer, int _iSize)
|
||||
// write logging data to debugger
|
||||
if (m_frame)
|
||||
{
|
||||
lCUCode_AX->Logging(_pBuffer, _iSize, 0);
|
||||
lCUCode_AX->Logging(_pBuffer, _iSize, 0, true);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
@ -170,12 +173,11 @@ void CUCode_AXWii::MixAdd(short* _pBuffer, int _iSize)
|
||||
// ------------
|
||||
|
||||
for (int i = 0; i < numberOfPBs; i++)
|
||||
{
|
||||
{
|
||||
AXParamBlockWii& pb = PBs[i];
|
||||
MixAddVoice(pb, templbuffer, temprbuffer, _iSize);
|
||||
}
|
||||
}
|
||||
|
||||
// write back out pbs
|
||||
WriteBackPBsWii(m_addressPBs, PBs, numberOfPBs);
|
||||
|
||||
for (int i = 0; i < _iSize; i++)
|
||||
@ -192,9 +194,9 @@ void CUCode_AXWii::MixAdd(short* _pBuffer, int _iSize)
|
||||
}
|
||||
|
||||
// write logging data to debugger again after the update
|
||||
//if (m_frame)
|
||||
if (m_frame)
|
||||
{
|
||||
// CUCode_AXWii::Logging(_pBuffer, _iSize, 1);
|
||||
lCUCode_AX->Logging(_pBuffer, _iSize, 1, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include "UCode_AXStructs.h"
|
||||
|
||||
#define NUMBER_OF_PBS 64
|
||||
#define NUMBER_OF_PBS 128
|
||||
|
||||
class CUCode_AXWii : public IUCode
|
||||
{
|
||||
|
@ -67,10 +67,12 @@ inline u16 ADPCM_Vol(u16 vol, u16 delta, u16 mixer_control)
|
||||
int x = vol;
|
||||
if (delta && delta < 0x5000)
|
||||
x += delta * 20 * 8; // unsure what the right step is
|
||||
else if (delta && delta > 0x5000)
|
||||
//x += 1 * 20 * 8;
|
||||
else if (delta && delta > 05000)
|
||||
//x -= (0x10000 - delta); // this is to small, it's often 1
|
||||
x -= (0x10000 - delta) * 20 * 16; // if this was 20 * 8 the sounds in Fire Emblem and Paper Mario
|
||||
// did not have time to go to zero before the were closed
|
||||
//x -= 1 * 20 * 16;
|
||||
|
||||
// make lower limits
|
||||
if (x < 0) x = 0;
|
||||
|
@ -187,10 +187,18 @@ inline void MixAddVoice(ParamBlockType &pb, int *templbuffer, int *temprbuffer,
|
||||
}
|
||||
} // end of the _iSize loop
|
||||
|
||||
// Update volume
|
||||
if(m_frame->gVolume) // allow us to turn this off in the debugger
|
||||
{
|
||||
pb.mixer.volume_left = ADPCM_Vol(pb.mixer.volume_left, pb.mixer.unknown, pb.mixer_control);
|
||||
pb.mixer.volume_right = ADPCM_Vol(pb.mixer.volume_right, pb.mixer.unknown2, pb.mixer_control);
|
||||
}
|
||||
|
||||
|
||||
pb.src.cur_addr_frac = (u16)frac;
|
||||
pb.audio_addr.cur_addr_hi = samplePos >> 16;
|
||||
pb.audio_addr.cur_addr_lo = (u16)samplePos;
|
||||
}
|
||||
} //if (pb.running)
|
||||
}
|
||||
|
||||
#endif // _UCODE_AX_VOICE_H
|
||||
|
Reference in New Issue
Block a user