CPU/Recompiler: Fix corrupted constant address byte/halfword writes
Fixes broken rendering in Dino Crisis.
This commit is contained in:
parent
fda106811c
commit
e842abfa8a
|
@ -120,11 +120,15 @@ void CodeGenerator::EmitStoreGuestMemory(const CodeBlockInstruction& cbi, const
|
||||||
{
|
{
|
||||||
void* ptr = GetDirectWriteMemoryPointer(
|
void* ptr = GetDirectWriteMemoryPointer(
|
||||||
static_cast<u32>(address.constant_value),
|
static_cast<u32>(address.constant_value),
|
||||||
(value.size == RegSize_8) ? MemoryAccessSize::Byte :
|
(size == RegSize_8) ? MemoryAccessSize::Byte :
|
||||||
((value.size == RegSize_16) ? MemoryAccessSize::HalfWord : MemoryAccessSize::Word));
|
((size == RegSize_16) ? MemoryAccessSize::HalfWord : MemoryAccessSize::Word));
|
||||||
if (ptr)
|
if (ptr)
|
||||||
{
|
{
|
||||||
|
if (value.size != size)
|
||||||
|
EmitStoreGlobal(ptr, value.ViewAsSize(size));
|
||||||
|
else
|
||||||
EmitStoreGlobal(ptr, value);
|
EmitStoreGlobal(ptr, value);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue