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

View file

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