Fix emulation of doz, dozi, and nabs POWER instructions

doz and dozi were storing the result into the wrong register.

nabs was not taking into account two's complement storage of numbers
and was just setting the signed bit.

These two instructions are used in the implementation of text
measurement in native QuickDraw on 7.1.2/the PDM ROM, and the incorrect
values were resulting in nothing being rendered. With the fix text
appears when booting from the 7.1.2 CD.
This commit is contained in:
Mihai Parparita 2023-12-01 01:30:03 -08:00
parent 87b8a8e0a0
commit 1b4de3b64e
1 changed files with 3 additions and 3 deletions

View File

@ -115,7 +115,7 @@ void dppc_interpreter::power_doz() {
if (oe_flag)
power_setsoov(ppc_result_a, ppc_result_b, ppc_result_d);
ppc_store_result_rega();
ppc_store_result_regd();
}
void dppc_interpreter::power_dozi() {
@ -125,7 +125,7 @@ void dppc_interpreter::power_dozi() {
} else {
ppc_result_d = simm - ppc_result_a;
}
ppc_store_result_rega();
ppc_store_result_regd();
}
void dppc_interpreter::power_lscbx() {
@ -223,7 +223,7 @@ void dppc_interpreter::power_mul() {
void dppc_interpreter::power_nabs() {
ppc_grab_regsda();
ppc_result_d = (0x80000000 | ppc_result_a);
ppc_result_d = ppc_result_a & 0x80000000 ? ppc_result_a : -ppc_result_a;
if (rc_flag)
ppc_changecrf0(ppc_result_d);