Skip to content

Commit

Permalink
Merge pull request #679 from lioncash/ucode-update-params
Browse files Browse the repository at this point in the history
Core: Remove the unused cycle parameter from DSPHLE update calls
  • Loading branch information
delroth committed Aug 2, 2014
2 parents 8f768e5 + 551cf4b commit da2833c
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 27 deletions.
4 changes: 1 addition & 3 deletions Source/Core/Core/HW/DSPHLE/DSPHLE.cpp
Expand Up @@ -66,10 +66,8 @@ void DSPHLE::Shutdown()

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)
m_pUCode->Update(cycles / 6);
m_pUCode->Update();
}

u32 DSPHLE::DSP_UpdateRate()
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/DSPHLE/UCodes/AX.cpp
Expand Up @@ -661,7 +661,7 @@ void AXUCode::CopyCmdList(u32 addr, u16 size)
m_cmdlist_size = size;
}

void AXUCode::Update(int cycles)
void AXUCode::Update()
{
// Used for UCode switching.
if (NeedsResumeMail())
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/DSPHLE/UCodes/AX.h
Expand Up @@ -56,7 +56,7 @@ class AXUCode : public UCodeInterface
virtual ~AXUCode();

virtual void HandleMail(u32 mail) override;
virtual void Update(int cycles) override;
virtual void Update() override;
virtual void DoState(PointerWrap& p) override;
u32 GetUpdateMs() override;

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/DSPHLE/UCodes/CARD.cpp
Expand Up @@ -23,7 +23,7 @@ CARDUCode::~CARDUCode()
}


void CARDUCode::Update(int cycles)
void CARDUCode::Update()
{
// check if we have to sent something
if (!m_mail_handler.IsEmpty())
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/DSPHLE/UCodes/CARD.h
Expand Up @@ -14,6 +14,6 @@ class CARDUCode : public UCodeInterface
u32 GetUpdateMs() override;

void HandleMail(u32 mail) override;
void Update(int cycles) override;
void Update() override;
};

2 changes: 1 addition & 1 deletion Source/Core/Core/HW/DSPHLE/UCodes/GBA.cpp
Expand Up @@ -18,7 +18,7 @@ GBAUCode::~GBAUCode()
m_mail_handler.Clear();
}

void GBAUCode::Update(int cycles)
void GBAUCode::Update()
{
// check if we have to send something
if (!m_mail_handler.IsEmpty())
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/DSPHLE/UCodes/GBA.h
Expand Up @@ -13,5 +13,5 @@ struct GBAUCode : public UCodeInterface
u32 GetUpdateMs() override;

void HandleMail(u32 mail) override;
void Update(int cycles) override;
void Update() override;
};
5 changes: 1 addition & 4 deletions Source/Core/Core/HW/DSPHLE/UCodes/INIT.cpp
Expand Up @@ -12,18 +12,15 @@ INITUCode::INITUCode(DSPHLE *dsphle, u32 crc)
DEBUG_LOG(DSPHLE, "INITUCode - initialized");
}


INITUCode::~INITUCode()
{
}


void INITUCode::Init()
{
}


void INITUCode::Update(int cycles)
void INITUCode::Update()
{
if (m_mail_handler.IsEmpty())
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/DSPHLE/UCodes/INIT.h
Expand Up @@ -14,6 +14,6 @@ class INITUCode : public UCodeInterface
u32 GetUpdateMs() override;

void HandleMail(u32 mail) override;
void Update(int cycles) override;
void Update() override;
void Init();
};
8 changes: 5 additions & 3 deletions Source/Core/Core/HW/DSPHLE/UCodes/ROM.cpp
Expand Up @@ -26,10 +26,12 @@ ROMUCode::ROMUCode(DSPHLE *dsphle, u32 crc)
}

ROMUCode::~ROMUCode()
{}
{
}

void ROMUCode::Update(int cycles)
{}
void ROMUCode::Update()
{
}

void ROMUCode::HandleMail(u32 mail)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/DSPHLE/UCodes/ROM.h
Expand Up @@ -14,7 +14,7 @@ class ROMUCode : public UCodeInterface
u32 GetUpdateMs() override;

void HandleMail(u32 mail) override;
void Update(int cycles) override;
void Update() override;

void DoState(PointerWrap &p) override;

Expand Down
20 changes: 13 additions & 7 deletions Source/Core/Core/HW/DSPHLE/UCodes/UCodes.h
Expand Up @@ -68,20 +68,26 @@ class UCodeInterface
, m_next_ucode()
, m_next_ucode_steps(0)
, m_needs_resume_mail(false)
{}
{
}

virtual ~UCodeInterface()
{}
{
}

virtual void HandleMail(u32 mail) = 0;

// Cycles are out of the 81/121mhz the DSP runs at.
virtual void Update(int cycles) = 0;
virtual void Update() = 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:
void PrepareBootUCode(u32 mail);
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/DSPHLE/UCodes/Zelda.cpp
Expand Up @@ -82,7 +82,7 @@ u8 *ZeldaUCode::GetARAMPointer(u32 address)
return DSP::GetARAMPtr() + address;
}

void ZeldaUCode::Update(int cycles)
void ZeldaUCode::Update()
{
if (!IsLightVersion())
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/DSPHLE/UCodes/Zelda.h
Expand Up @@ -125,7 +125,7 @@ class ZeldaUCode : public UCodeInterface
void HandleMail_LightVersion(u32 mail);
void HandleMail_SMSVersion(u32 mail);
void HandleMail_NormalVersion(u32 mail);
void Update(int cycles) override;
void Update() override;

void CopyPBsFromRAM();
void CopyPBsToRAM();
Expand Down

0 comments on commit da2833c

Please sign in to comment.