dmae: Implement 16bit endian swap for DMAECopyMem (#1564)
Some checks failed
Build check / build (push) Waiting to run
Generate translation template / generate-pot (push) Failing after 1s

This commit is contained in:
Mefiresu 2025-05-12 18:16:14 +02:00 committed by GitHub
parent caef34f2ff
commit 05617a332b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,6 +36,16 @@ void dmaeExport_DMAECopyMem(PPCInterpreter_t* hCPU)
dstBuffer[i] = _swapEndianU32(srcBuffer[i]);
}
}
else if( hCPU->gpr[6] == DMAE_ENDIAN_16 )
{
// swap per uint16
uint16* srcBuffer = (uint16*)memory_getPointerFromVirtualOffset(hCPU->gpr[4]);
uint16* dstBuffer = (uint16*)memory_getPointerFromVirtualOffset(hCPU->gpr[3]);
for(uint32 i=0; i<hCPU->gpr[5]*2; i++)
{
dstBuffer[i] = _swapEndianU16(srcBuffer[i]);
}
}
else
{
cemuLog_logDebug(LogType::Force, "DMAECopyMem(): Unsupported endian swap\n");