Skip to content
Snippets Groups Projects
Commit f0dbc8c8 authored by Geo Ster's avatar Geo Ster
Browse files

Add special write to SIF_CTRL

* This register is pretty undocumented even though it's crucial
for EE <-> IOP synchronization. I asked a dev PCSX2 dev about this
and I was linked the code PCSX2 uses, so I will use it here as well.
parent 9a677135
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,37 @@ namespace common
fmt::print("[SIF][{}] Writing {:#x} to {}\n", COMP[comp], data, REGS[offset]);
*ptr = data;
/* Writing to SIF_CTRL is special and
a bit mysterious as not much is known
about this register */
if (offset == 4)
{
auto& control = regs.ctrl;
if (comp == 0) /* Writes from IOP */
{
uint8_t temp = data & 0xF0;
if (data & 0xA0)
{
control &= ~0xF000;
control |= 0x2000;
}
if (control & temp)
control &= ~temp;
else
control |= temp;
}
else /* Writes from the EE */
{
if (!(data & 0x100))
control &= ~0x100;
else
control |= 0x100;
}
}
else
{
*ptr = data;
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment