DSP: Eliminate some magic values related to the CR register

Makes some values more immediately readable.
This commit is contained in:
Lioncash committed 2020-12-29 09:43:04 -05:00
1 parent 3f68aceaca
commit 64f93610ee
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--;
}
@@ -201,7 +201,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)
@@ -210,7 +210,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
@@ -223,11 +223,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;