Merge pull request #9383 from lioncash/cr-fn

DSP: Eliminate some magic values related to the CR register
This commit is contained in:
Léo Lam authored and GitHub committed 2020-12-29 17:37:24 +01:00
commit 5ff2cb9a74
5 files changed
+11 -9

No files matched your search

@@ -122,7 +122,7 @@ void Interpreter::rti(const UDSPInstruction)
void Interpreter::halt(const UDSPInstruction)
{
auto& state = m_dsp_core.DSPState();
state.cr |= 0x4;
state.cr |= CR_HALT;
state.pc--;
}
@@ -205,7 +205,7 @@ void Interpreter::WriteCR(u16 val)
{
INFO_LOG_FMT(DSPLLE, "DSP_CONTROL RESET");
m_dsp_core.Reset();
val &= ~1;
val &= ~CR_RESET;
}
// init
else if (val == 4)
@@ -214,7 +214,7 @@ void Interpreter::WriteCR(u16 val)
// OSInitAudioSystem ucode should send this mail - not DSP core itself
INFO_LOG_FMT(DSPLLE, "DSP_CONTROL INIT");
m_dsp_core.SetInitHax(true);
val |= 0x800;
val |= CR_INIT;
}
// update cr
@@ -227,11 +227,11 @@ u16 Interpreter::ReadCR()
if ((state.pc & 0x8000) != 0)
{
state.cr |= 0x800;
state.cr |= CR_INIT;
}
else
{
state.cr &= ~0x800;
state.cr &= ~CR_INIT;
}
return state.cr;