DSP: Add cycles parameter to all Update functions in HLE, might be useful someday :p A couple more signatures for the idle skip detector. no big functional changes

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2932 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2009-04-08 18:36:53 +00:00
parent 541832e4f0
commit 0c4d4835ac
22 changed files with 78 additions and 63 deletions
@@ -39,10 +39,10 @@ CDSPHandler::~CDSPHandler()
m_pUCode = NULL;
}
void CDSPHandler::Update()
void CDSPHandler::Update(int cycles)
{
if (m_pUCode != NULL)
m_pUCode->Update();
m_pUCode->Update(cycles);
}
unsigned short CDSPHandler::WriteControlRegister(unsigned short _Value)
@@ -25,7 +25,7 @@
class CDSPHandler
{
public:
void Update();
void Update(int cycles);
unsigned short WriteControlRegister(unsigned short _Value);
unsigned short ReadControlRegister();
void SendMailToDSP(u32 _uMail);
@@ -415,7 +415,6 @@ void CUCode_AX::HandleMail(u32 _uMail)
{
DEBUG_LOG(DSPHLE, " >>>> u32 MAIL : AXTask Mail (%08x)", _uMail);
AXTask(_uMail);
}
}
@@ -423,7 +422,7 @@ void CUCode_AX::HandleMail(u32 _uMail)
// ------------------------------------------------------------------------------
// Update with DSP Interrupt
// -----------
void CUCode_AX::Update()
void CUCode_AX::Update(int cycles)
{
// check if we have to sent something
if (!m_rMailHandler.IsEmpty())
@@ -35,7 +35,7 @@ public:
void HandleMail(u32 _uMail);
void MixAdd(short* _pBuffer, int _iSize);
void Update();
void Update(int cycles);
// Logging
//template<class ParamBlockType>
@@ -225,7 +225,7 @@ void CUCode_AXWii::MixAdd_(short* _pBuffer, int _iSize, ParamBlockType &PBs)
}
void CUCode_AXWii::Update()
void CUCode_AXWii::Update(int cycles)
{
// check if we have to sent something
if (!m_rMailHandler.IsEmpty())
@@ -33,7 +33,7 @@ public:
template<class ParamBlockType>
//void Logging(short* _pBuffer, int _iSize, int a, bool Wii, ParamBlockType &PBs, int numberOfPBs);
void MixAdd_(short* _pBuffer, int _iSize, ParamBlockType &PBs);
void Update();
void Update(int cycles);
// The logging function for the debugger
void Logging(short* _pBuffer, int _iSize, int a);
@@ -35,7 +35,7 @@ CUCode_CARD::~CUCode_CARD()
}
void CUCode_CARD::Update()
void CUCode_CARD::Update(int cycles)
{
// check if we have to sent something
if (!m_rMailHandler.IsEmpty())
@@ -38,7 +38,7 @@ public:
virtual ~CUCode_CARD();
void HandleMail(u32 _uMail);
void Update();
void Update(int cycles);
};
#endif
@@ -38,7 +38,7 @@ void CUCode_InitAudioSystem::Init()
{}
void CUCode_InitAudioSystem::Update()
void CUCode_InitAudioSystem::Update(int cycles)
{
if (m_rMailHandler.IsEmpty())
{
@@ -27,7 +27,7 @@ public:
virtual ~CUCode_InitAudioSystem();
void HandleMail(u32 _uMail);
void Update();
void Update(int cycles);
void Init();
private:
@@ -87,7 +87,7 @@ void CUCode_Jac::HandleMail(u32 _uMail)
}
void CUCode_Jac::Update()
void CUCode_Jac::Update(int cycles)
{
// check if we have to sent something
/* if (!g_MailHandler.empty())
@@ -67,7 +67,7 @@ public:
virtual ~CUCode_Jac();
void HandleMail(u32 _uMail);
void Update();
void Update(int cycles);
};
#endif
@@ -33,7 +33,7 @@ CUCode_Rom::CUCode_Rom(CMailHandler& _rMailHandler)
CUCode_Rom::~CUCode_Rom()
{}
void CUCode_Rom::Update()
void CUCode_Rom::Update(int cycles)
{}
void CUCode_Rom::HandleMail(u32 _uMail)
@@ -27,7 +27,7 @@ public:
virtual ~CUCode_Rom();
void HandleMail(u32 _uMail);
void Update();
void Update(int cycles);
private:
struct SUCode
@@ -47,7 +47,7 @@ CUCode_Zelda::~CUCode_Zelda()
}
void CUCode_Zelda::Update()
void CUCode_Zelda::Update(int cycles)
{
// check if we have to sent something
if (!m_rMailHandler.IsEmpty())
@@ -67,7 +67,7 @@ public:
virtual ~CUCode_Zelda();
void HandleMail(u32 _uMail);
void Update();
void Update(int cycles);
void MixAdd(short* buffer, int size);
};
@@ -36,7 +36,9 @@ public:
{}
virtual void HandleMail(u32 _uMail) = 0;
virtual void Update(void) = 0;
// Cycles are out of the 81/121mhz the DSP runs at.
virtual void Update(int cycles) = 0;
virtual void MixAdd(short* buffer, int size) {}
protected:
+2 -1
View File
@@ -308,7 +308,8 @@ unsigned short DSP_ReadControlRegister()
void DSP_Update(int cycles)
{
CDSPHandler::GetInstance().Update();
// This is called OFTEN - better not do anything expensive!
CDSPHandler::GetInstance().Update(cycles);
}
/* Other Audio will pass through here. The kind of audio that sometimes are