SPU: Implement Accurate DMA (#8822)

This commit is contained in:
Eladash 2020-09-03 00:58:29 +03:00 committed by GitHub
parent ddfa077c3e
commit 73d23eb6e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 170 additions and 60 deletions

View file

@ -4433,8 +4433,17 @@ bool ppu_interpreter::ICBI(ppu_thread& ppu, ppu_opcode_t op)
bool ppu_interpreter::DCBZ(ppu_thread& ppu, ppu_opcode_t op)
{
const u64 addr = op.ra ? ppu.gpr[op.ra] + ppu.gpr[op.rb] : ppu.gpr[op.rb];
const u32 addr0 = vm::cast(addr, HERE) & ~127;
std::memset(vm::base(vm::cast(addr, HERE) & ~127), 0, 128);
if (g_cfg.core.spu_accurate_dma)
{
auto [res, rtime] = vm::reservation_lock(addr0, 128, vm::dma_lockb);
std::memset(vm::base(addr0), 0, 128);
res.release(rtime + 128);
return true;
}
std::memset(vm::base(addr0), 0, 128);
return true;
}