mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
Core/DSPHLE: Remove global System access from CMailHandler.
This commit is contained in:
parent
9be9cbda2f
commit
a9bf93cf2a
@ -14,7 +14,7 @@
|
||||
|
||||
namespace DSP::HLE
|
||||
{
|
||||
DSPHLE::DSPHLE(Core::System& system) : m_system(system)
|
||||
DSPHLE::DSPHLE(Core::System& system) : m_mail_handler(system.GetDSP()), m_system(system)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -8,11 +8,10 @@
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
#include "Core/HW/DSP.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
namespace DSP::HLE
|
||||
{
|
||||
CMailHandler::CMailHandler()
|
||||
CMailHandler::CMailHandler(DSP::DSPManager& dsp) : m_dsp(dsp)
|
||||
{
|
||||
}
|
||||
|
||||
@ -26,8 +25,7 @@ void CMailHandler::PushMail(u32 mail, bool interrupt, int cycles_into_future)
|
||||
{
|
||||
if (m_pending_mails.empty())
|
||||
{
|
||||
Core::System::GetInstance().GetDSP().GenerateDSPInterruptFromDSPEmu(DSP::INT_DSP,
|
||||
cycles_into_future);
|
||||
m_dsp.GenerateDSPInterruptFromDSPEmu(DSP::INT_DSP, cycles_into_future);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -60,7 +58,7 @@ u16 CMailHandler::ReadDSPMailboxLow()
|
||||
|
||||
if (generate_interrupt)
|
||||
{
|
||||
Core::System::GetInstance().GetDSP().GenerateDSPInterruptFromDSPEmu(DSP::INT_DSP);
|
||||
m_dsp.GenerateDSPInterruptFromDSPEmu(DSP::INT_DSP);
|
||||
}
|
||||
}
|
||||
// Clear the top bit of the high mail word after the mail has been read.
|
||||
|
@ -8,6 +8,10 @@
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
namespace DSP
|
||||
{
|
||||
class DSPManager;
|
||||
}
|
||||
class PointerWrap;
|
||||
|
||||
namespace DSP::HLE
|
||||
@ -15,7 +19,11 @@ namespace DSP::HLE
|
||||
class CMailHandler
|
||||
{
|
||||
public:
|
||||
CMailHandler();
|
||||
explicit CMailHandler(DSP::DSPManager& dsp);
|
||||
CMailHandler(const CMailHandler& other) = delete;
|
||||
CMailHandler(CMailHandler&& other) = delete;
|
||||
CMailHandler& operator=(const CMailHandler& other) = delete;
|
||||
CMailHandler& operator=(CMailHandler&& other) = delete;
|
||||
~CMailHandler();
|
||||
|
||||
// TODO: figure out correct timing for interrupts rather than defaulting to "immediately."
|
||||
@ -44,5 +52,7 @@ private:
|
||||
u32 m_last_mail = 0;
|
||||
// When halted, the DSP itself is not running, but the last mail can be read.
|
||||
bool m_halted = false;
|
||||
|
||||
DSP::DSPManager& m_dsp;
|
||||
};
|
||||
} // namespace DSP::HLE
|
||||
|
Loading…
x
Reference in New Issue
Block a user