Skip to content

Commit

Permalink
IOP/EE: Add SBUS interrupts
Browse files Browse the repository at this point in the history
Lets the CPUs trigger an interrupt on the other.
  • Loading branch information
Ziemas authored and F0bes committed Oct 14, 2024
1 parent 444b110 commit 35ada36
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pcsx2/HwWrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "CDVD/Ps1CD.h"
#include "CDVD/CDVD.h"

#include "IopDma.h" // for iopIntcIrq

using namespace R5900;

// Shift the middle 8 bits (bits 4-12) into the lower 8 bits.
Expand Down Expand Up @@ -165,7 +167,11 @@ void _hwWrite32( u32 mem, u32 value )
psHu32(mem) &= ~value;
return;

mcase(SBUS_F240) :
mcase(SBUS_F240):
if (value & (1 << 18))
{
iopIntcIrq(1);
}
if (value & (1 << 19))
{
u32 cycle = psxRegs.cycle;
Expand Down
7 changes: 7 additions & 0 deletions pcsx2/ps2/Iop/IopHwWrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,13 @@ static __fi void _HwWrite_16or32_Page1( u32 addr, T val )
{
switch( masked_addr )
{
case 0x450:
psxHu(addr) = val;
if (val & (1 << 1))
{
hwIntcIrq(INTC_SBUS);
}
break;
// ------------------------------------------------------------------------
case (HW_SIO_DATA & 0x0fff):
Console.Error("%s(%08X, %08X) Unexpected 16 or 32 bit write to SIO0 DATA!", __FUNCTION__, addr, val);
Expand Down

0 comments on commit 35ada36

Please sign in to comment.