Skip to content

Commit

Permalink
ppcopcodes: fix dcbz for BlockZero in Mac OS 8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
maximumspatium committed Jun 17, 2023
1 parent ee7b283 commit 73d0356
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions cpu/ppc/ppcopcodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1487,12 +1487,14 @@ void dppc_interpreter::ppc_dcbz() {
ppc_grab_regsdab();
ppc_effective_address = (reg_a == 0) ? ppc_result_b : (ppc_result_a + ppc_result_b);

ppc_effective_address &= 0xFFFFFFE0; // align EA on a 32-byte boundary

//mem_write_qword(ppc_effective_address, 0);
//mem_write_qword((ppc_effective_address + 8), 0);
//mem_write_qword((ppc_effective_address + 16), 0);
//mem_write_qword((ppc_effective_address + 24), 0);
ppc_effective_address &= 0xFFFFFFE0UL; // align EA on a 32-byte boundary

// the following is not especially efficient but necessary
// to make BlockZero under Mac OS 8.x and later to work
mmu_write_vmem<uint64_t>(ppc_effective_address + 0, 0);
mmu_write_vmem<uint64_t>(ppc_effective_address + 8, 0);
mmu_write_vmem<uint64_t>(ppc_effective_address + 16, 0);
mmu_write_vmem<uint64_t>(ppc_effective_address + 24, 0);
}


Expand Down

0 comments on commit 73d0356

Please sign in to comment.