mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-29 09:05:41 +00:00
Bus: Ignore SPU byte writes to unaligned addresses
This commit is contained in:
parent
a7543ab365
commit
8ef73203b2
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue