Merge pull request #679 from lioncash/ucode-update-params

Core: Remove the unused cycle parameter from DSPHLE update calls
This commit is contained in:
Pierre Bourdon 2014-08-02 10:37:19 -07:00
commit da2833c0e6
14 changed files with 30 additions and 27 deletions

View File

@ -66,10 +66,8 @@ void DSPHLE::Shutdown()
void DSPHLE::DSP_Update(int cycles) void DSPHLE::DSP_Update(int cycles)
{ {
// This is called OFTEN - better not do anything expensive!
// ~1/6th as many cycles as the period PPC-side.
if (m_pUCode != nullptr) if (m_pUCode != nullptr)
m_pUCode->Update(cycles / 6); m_pUCode->Update();
} }
u32 DSPHLE::DSP_UpdateRate() u32 DSPHLE::DSP_UpdateRate()

View File

@ -661,7 +661,7 @@ void AXUCode::CopyCmdList(u32 addr, u16 size)
m_cmdlist_size = size; m_cmdlist_size = size;
} }
void AXUCode::Update(int cycles) void AXUCode::Update()
{ {
// Used for UCode switching. // Used for UCode switching.
if (NeedsResumeMail()) if (NeedsResumeMail())

View File

@ -56,7 +56,7 @@ public:
virtual ~AXUCode(); virtual ~AXUCode();
virtual void HandleMail(u32 mail) override; virtual void HandleMail(u32 mail) override;
virtual void Update(int cycles) override; virtual void Update() override;
virtual void DoState(PointerWrap& p) override; virtual void DoState(PointerWrap& p) override;
u32 GetUpdateMs() override; u32 GetUpdateMs() override;

View File

@ -23,7 +23,7 @@ CARDUCode::~CARDUCode()
} }
void CARDUCode::Update(int cycles) void CARDUCode::Update()
{ {
// check if we have to sent something // check if we have to sent something
if (!m_mail_handler.IsEmpty()) if (!m_mail_handler.IsEmpty())

View File

@ -14,6 +14,6 @@ public:
u32 GetUpdateMs() override; u32 GetUpdateMs() override;
void HandleMail(u32 mail) override; void HandleMail(u32 mail) override;
void Update(int cycles) override; void Update() override;
}; };

View File

@ -18,7 +18,7 @@ GBAUCode::~GBAUCode()
m_mail_handler.Clear(); m_mail_handler.Clear();
} }
void GBAUCode::Update(int cycles) void GBAUCode::Update()
{ {
// check if we have to send something // check if we have to send something
if (!m_mail_handler.IsEmpty()) if (!m_mail_handler.IsEmpty())

View File

@ -13,5 +13,5 @@ struct GBAUCode : public UCodeInterface
u32 GetUpdateMs() override; u32 GetUpdateMs() override;
void HandleMail(u32 mail) override; void HandleMail(u32 mail) override;
void Update(int cycles) override; void Update() override;
}; };

View File

@ -12,18 +12,15 @@ INITUCode::INITUCode(DSPHLE *dsphle, u32 crc)
DEBUG_LOG(DSPHLE, "INITUCode - initialized"); DEBUG_LOG(DSPHLE, "INITUCode - initialized");
} }
INITUCode::~INITUCode() INITUCode::~INITUCode()
{ {
} }
void INITUCode::Init() void INITUCode::Init()
{ {
} }
void INITUCode::Update()
void INITUCode::Update(int cycles)
{ {
if (m_mail_handler.IsEmpty()) if (m_mail_handler.IsEmpty())
{ {

View File

@ -14,6 +14,6 @@ public:
u32 GetUpdateMs() override; u32 GetUpdateMs() override;
void HandleMail(u32 mail) override; void HandleMail(u32 mail) override;
void Update(int cycles) override; void Update() override;
void Init(); void Init();
}; };

View File

@ -26,10 +26,12 @@ ROMUCode::ROMUCode(DSPHLE *dsphle, u32 crc)
} }
ROMUCode::~ROMUCode() ROMUCode::~ROMUCode()
{} {
}
void ROMUCode::Update(int cycles) void ROMUCode::Update()
{} {
}
void ROMUCode::HandleMail(u32 mail) void ROMUCode::HandleMail(u32 mail)
{ {

View File

@ -14,7 +14,7 @@ public:
u32 GetUpdateMs() override; u32 GetUpdateMs() override;
void HandleMail(u32 mail) override; void HandleMail(u32 mail) override;
void Update(int cycles) override; void Update() override;
void DoState(PointerWrap &p) override; void DoState(PointerWrap &p) override;

View File

@ -68,20 +68,26 @@ public:
, m_next_ucode() , m_next_ucode()
, m_next_ucode_steps(0) , m_next_ucode_steps(0)
, m_needs_resume_mail(false) , m_needs_resume_mail(false)
{} {
}
virtual ~UCodeInterface() virtual ~UCodeInterface()
{} {
}
virtual void HandleMail(u32 mail) = 0; virtual void HandleMail(u32 mail) = 0;
virtual void Update() = 0;
// Cycles are out of the 81/121mhz the DSP runs at.
virtual void Update(int cycles) = 0;
virtual u32 GetUpdateMs() = 0; virtual u32 GetUpdateMs() = 0;
virtual void DoState(PointerWrap &p) { DoStateShared(p); } virtual void DoState(PointerWrap &p)
{
DoStateShared(p);
}
static u32 GetCRC(UCodeInterface* ucode) { return ucode ? ucode->m_crc : UCODE_NULL; } static u32 GetCRC(UCodeInterface* ucode)
{
return ucode ? ucode->m_crc : UCODE_NULL;
}
protected: protected:
void PrepareBootUCode(u32 mail); void PrepareBootUCode(u32 mail);

View File

@ -82,7 +82,7 @@ u8 *ZeldaUCode::GetARAMPointer(u32 address)
return DSP::GetARAMPtr() + address; return DSP::GetARAMPtr() + address;
} }
void ZeldaUCode::Update(int cycles) void ZeldaUCode::Update()
{ {
if (!IsLightVersion()) if (!IsLightVersion())
{ {

View File

@ -125,7 +125,7 @@ public:
void HandleMail_LightVersion(u32 mail); void HandleMail_LightVersion(u32 mail);
void HandleMail_SMSVersion(u32 mail); void HandleMail_SMSVersion(u32 mail);
void HandleMail_NormalVersion(u32 mail); void HandleMail_NormalVersion(u32 mail);
void Update(int cycles) override; void Update() override;
void CopyPBsFromRAM(); void CopyPBsFromRAM();
void CopyPBsToRAM(); void CopyPBsToRAM();