Bus: Ignore SPU byte writes to unaligned addresses

This commit is contained in:
Stenzek 2024-05-31 21:00:46 +10:00
parent a7543ab365
commit 8ef73203b2
No known key found for this signature in database
1 changed files with 5 additions and 3 deletions

View File

@ -1505,7 +1505,6 @@ void Bus::HWHandlers::SPUWrite(PhysicalMemoryAddress address, u32 value)
const u32 offset = address & SPU_MASK;
// 32-bit writes are written as two 16-bit writes.
// TODO: Ignore if address is not aligned.
switch (size)
{
case MemoryAccessSize::Word:
@ -1525,8 +1524,11 @@ void Bus::HWHandlers::SPUWrite(PhysicalMemoryAddress address, u32 value)
case MemoryAccessSize::Byte:
{
SPU::WriteRegister(FIXUP_HALFWORD_OFFSET(size, offset),
Truncate16(FIXUP_HALFWORD_READ_VALUE(size, offset, value)));
// Byte writes to unaligned addresses are apparently ignored.
if (address & 1)
return;
SPU::WriteRegister(offset, Truncate16(FIXUP_HALFWORD_READ_VALUE(size, offset, value)));
break;
}
}