mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 15:19:42 -06:00
Same as the last change but for Wii AX.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4377 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -174,14 +174,17 @@ void CUCode_AXWii::MixAdd_(short* _pBuffer, int _iSize, ParamBlockType &PB)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
u32 blockAddr = m_addressPBs;
|
u32 blockAddr = m_addressPBs;
|
||||||
|
if (!blockAddr)
|
||||||
|
return;
|
||||||
for (int i = 0; i < NUMBER_OF_PBS; i++)
|
for (int i = 0; i < NUMBER_OF_PBS; i++)
|
||||||
{
|
{
|
||||||
// read out pbs
|
// read out pbs
|
||||||
ReadOutPBWii(blockAddr, PB);
|
if (!ReadOutPBWii(blockAddr, PB))
|
||||||
|
break;
|
||||||
ProcessUpdates(PB);
|
ProcessUpdates(PB);
|
||||||
MixAddVoice(PB, templbuffer, temprbuffer, _iSize, true);
|
MixAddVoice(PB, templbuffer, temprbuffer, _iSize, true);
|
||||||
WriteBackPBWii(blockAddr, PB);
|
if (!WriteBackPBWii(blockAddr, PB))
|
||||||
|
break;
|
||||||
|
|
||||||
// next block
|
// next block
|
||||||
blockAddr = (PB.next_pb_hi << 16) | PB.next_pb_lo;
|
blockAddr = (PB.next_pb_hi << 16) | PB.next_pb_lo;
|
||||||
|
@ -37,12 +37,14 @@ extern float ratioFactor;
|
|||||||
|
|
||||||
|
|
||||||
template<class ParamBlockType>
|
template<class ParamBlockType>
|
||||||
inline void ReadOutPBWii(u32 pbs_address, ParamBlockType& PB)
|
inline bool ReadOutPBWii(u32 pbs_address, ParamBlockType& PB)
|
||||||
{
|
{
|
||||||
u32 blockAddr = pbs_address;
|
u32 blockAddr = pbs_address;
|
||||||
u32 pAddr = 0;
|
u32 pAddr = 0;
|
||||||
|
|
||||||
const short *pSrc = (const short *)g_dspInitialize.pGetMemoryPointer(blockAddr);
|
const short *pSrc = (const short *)g_dspInitialize.pGetMemoryPointer(blockAddr);
|
||||||
|
if (!pSrc)
|
||||||
|
return false;
|
||||||
pAddr = blockAddr;
|
pAddr = blockAddr;
|
||||||
short *pDest = (short *)&PB;
|
short *pDest = (short *)&PB;
|
||||||
for (u32 p = 0; p < sizeof(ParamBlockType) / 2; p++)
|
for (u32 p = 0; p < sizeof(ParamBlockType) / 2; p++)
|
||||||
@ -58,21 +60,25 @@ inline void ReadOutPBWii(u32 pbs_address, ParamBlockType& PB)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PB.mixer_control = Common::swap32(PB.mixer_control);
|
PB.mixer_control = Common::swap32(PB.mixer_control);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class ParamBlockType>
|
template<class ParamBlockType>
|
||||||
inline void WriteBackPBWii(u32 pb_address, ParamBlockType& PB)
|
inline bool WriteBackPBWii(u32 pb_address, ParamBlockType& PB)
|
||||||
//void WriteBackPBsWii(u32 pbs_address, AXParamBlockWii* _pPBs, int _num)
|
//void WriteBackPBsWii(u32 pbs_address, AXParamBlockWii* _pPBs, int _num)
|
||||||
{
|
{
|
||||||
// write back and 'halfword'swap
|
// write back and 'halfword'swap
|
||||||
short* pSrc = (short*)&PB;
|
short* pSrc = (short*)&PB;
|
||||||
short* pDest = (short*)g_dspInitialize.pGetMemoryPointer(pb_address);
|
short* pDest = (short*)g_dspInitialize.pGetMemoryPointer(pb_address);
|
||||||
|
if (!pDest)
|
||||||
|
return false;
|
||||||
PB.mixer_control = Common::swap32(PB.mixer_control);
|
PB.mixer_control = Common::swap32(PB.mixer_control);
|
||||||
for (size_t p = 0; p < sizeof(ParamBlockType) / 2; p++)
|
for (size_t p = 0; p < sizeof(ParamBlockType) / 2; p++)
|
||||||
{
|
{
|
||||||
if (p == 6 || p == 7) pDest[p] = pSrc[p]; // control for the u32
|
if (p == 6 || p == 7) pDest[p] = pSrc[p]; // control for the u32
|
||||||
else pDest[p] = Common::swap16(pSrc[p]);
|
else pDest[p] = Common::swap16(pSrc[p]);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class ParamBlockType>
|
template<class ParamBlockType>
|
||||||
@ -89,7 +95,7 @@ inline void MixAddVoice(ParamBlockType &pb, int *templbuffer, int *temprbuffer,
|
|||||||
// Read initial parameters
|
// Read initial parameters
|
||||||
// ------------
|
// ------------
|
||||||
//constants
|
//constants
|
||||||
const u32 ratio = (u32)(((pb.src.ratio_hi << 16) + pb.src.ratio_lo) * ratioFactor);
|
const u32 ratio = (u32)(((pb.src.ratio_hi << 16) + pb.src.ratio_lo) * ratioFactor);
|
||||||
u32 sampleEnd = (pb.audio_addr.end_addr_hi << 16) | pb.audio_addr.end_addr_lo;
|
u32 sampleEnd = (pb.audio_addr.end_addr_hi << 16) | pb.audio_addr.end_addr_lo;
|
||||||
u32 loopPos = (pb.audio_addr.loop_addr_hi << 16) | pb.audio_addr.loop_addr_lo;
|
u32 loopPos = (pb.audio_addr.loop_addr_hi << 16) | pb.audio_addr.loop_addr_lo;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user