From ff626ae0b58fd7586772174b809bc54c6bfcaa2c Mon Sep 17 00:00:00 2001 From: joevt Date: Tue, 9 Apr 2024 01:12:41 -0700 Subject: [PATCH] poweropcodes: Fix clcs. For MPC601 CPUs, all values of rA return 64 though the manual says undefined values of rA produce undefined results. For non-MPC601 CPUs, if this instruction is included (such as for risu DPPC) then return results that are obtained from a G4 running Mac OS 9.2.2. --- cpu/ppc/poweropcodes.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/cpu/ppc/poweropcodes.cpp b/cpu/ppc/poweropcodes.cpp index a5204d3..679a733 100644 --- a/cpu/ppc/poweropcodes.cpp +++ b/cpu/ppc/poweropcodes.cpp @@ -77,10 +77,17 @@ void dppc_interpreter::power_clcs() { case 13: //data cache line size case 14: //minimum line size case 15: //maximum line size - ppc_result_d = 64; - break; - default: - ppc_result_d = 0; + default: ppc_result_d = is_601 ? 64 : 32; break; + case 7: + case 23: ppc_result_d = is_601 ? 64 : 0; break; + case 8: + case 9: + case 24: + case 25: ppc_result_d = is_601 ? 64 : 4; break; + case 10: + case 11: + case 26: + case 27: ppc_result_d = is_601 ? 64 : 0x4000; break; } ppc_store_iresult_reg(reg_d, ppc_result_d);