Swapping register values.

This commit is contained in:
Ben Vanik 2014-02-01 00:05:21 -08:00
parent 7044b74dc2
commit 10c9537836
3 changed files with 4 additions and 4 deletions

View File

@ -1219,8 +1219,6 @@ table->AddSequence(OPCODE_STORE, [](X64Emitter& e, Instr*& i) {
} }
e.EndOp(src2); e.EndOp(src2);
} }
// eh?
e.bswap(e.r8);
CallNative(e, cbs->write); CallNative(e, cbs->write);
i = e.Advance(i); i = e.Advance(i);
return true; return true;

View File

@ -187,10 +187,11 @@ uint64_t AudioSystem::ReadRegister(uint64_t addr) {
XELOGAPU("ReadRegister(%.4X)", r); XELOGAPU("ReadRegister(%.4X)", r);
// 1800h is read on startup and stored -- context? buffers? // 1800h is read on startup and stored -- context? buffers?
// 1818h is read during a lock? // 1818h is read during a lock?
return 0; return XESWAP32BE(0);
} }
void AudioSystem::WriteRegister(uint64_t addr, uint64_t value) { void AudioSystem::WriteRegister(uint64_t addr, uint64_t value) {
value = XESWAP32BE((uint32_t)value);
uint32_t r = addr & 0xFFFF; uint32_t r = addr & 0xFFFF;
XELOGAPU("WriteRegister(%.4X, %.8X)", r, value); XELOGAPU("WriteRegister(%.4X, %.8X)", r, value);
// 1804h is written to with 0x02000000 and 0x03000000 around a lock operation // 1804h is written to with 0x02000000 and 0x03000000 around a lock operation

View File

@ -152,10 +152,11 @@ uint64_t GraphicsSystem::ReadRegister(uint64_t addr) {
} }
XEASSERT(r >= 0 && r < kXEGpuRegisterCount); XEASSERT(r >= 0 && r < kXEGpuRegisterCount);
return regs->values[r].u32; return XESWAP32BE(regs->values[r].u32);
} }
void GraphicsSystem::WriteRegister(uint64_t addr, uint64_t value) { void GraphicsSystem::WriteRegister(uint64_t addr, uint64_t value) {
value = XESWAP32BE((uint32_t)value);
uint32_t r = addr & 0xFFFF; uint32_t r = addr & 0xFFFF;
XELOGGPU("WriteRegister(%.4X, %.8X)", r, value); XELOGGPU("WriteRegister(%.4X, %.8X)", r, value);