mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-02-03 00:29:48 +00:00
ppcfpopcodes: Fix Revert Tweak.
Fixes lfsu, lfsux, lfdu, lfdux so they correctly update rA as before.
This commit is contained in:
parent
bf4ee72c0f
commit
49b8c4c39f
@ -1031,8 +1031,9 @@ void dppc_interpreter::ppc_lfsu(uint32_t opcode) {
|
|||||||
if (reg_a != 0) {
|
if (reg_a != 0) {
|
||||||
uint32_t ea = int32_t(int16_t(opcode));
|
uint32_t ea = int32_t(int16_t(opcode));
|
||||||
ea += val_reg_a;
|
ea += val_reg_a;
|
||||||
uint32_t result = mmu_read_vmem<uint32_t>(opcode, ea);
|
uint32_t result = mmu_read_vmem<uint32_t>(opcode, ea);
|
||||||
ppc_state.fpr[reg_d].dbl64_r = *(float*)(&result);
|
ppc_store_fpresult_flt(reg_d, *(float*)(&result));
|
||||||
|
ppc_store_iresult_reg(reg_a, ea);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ppc_exception_handler(Except_Type::EXC_PROGRAM, Exc_Cause::ILLEGAL_OP);
|
ppc_exception_handler(Except_Type::EXC_PROGRAM, Exc_Cause::ILLEGAL_OP);
|
||||||
@ -1049,11 +1050,11 @@ void dppc_interpreter::ppc_lfsx(uint32_t opcode) {
|
|||||||
void dppc_interpreter::ppc_lfsux(uint32_t opcode) {
|
void dppc_interpreter::ppc_lfsux(uint32_t opcode) {
|
||||||
ppc_grab_regsfpdiab(opcode);
|
ppc_grab_regsfpdiab(opcode);
|
||||||
|
|
||||||
|
|
||||||
if (reg_a != 0) {
|
if (reg_a != 0) {
|
||||||
uint32_t ea = val_reg_a + val_reg_b;
|
uint32_t ea = val_reg_a + val_reg_b;
|
||||||
uint32_t result = mmu_read_vmem<uint32_t>(opcode, ea);
|
uint32_t result = mmu_read_vmem<uint32_t>(opcode, ea);
|
||||||
ppc_state.fpr[reg_d].dbl64_r = *(float*)(&result);
|
ppc_store_fpresult_flt(reg_d, *(float*)(&result));
|
||||||
|
ppc_store_iresult_reg(reg_a, ea);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ppc_exception_handler(Except_Type::EXC_PROGRAM, Exc_Cause::ILLEGAL_OP);
|
ppc_exception_handler(Except_Type::EXC_PROGRAM, Exc_Cause::ILLEGAL_OP);
|
||||||
@ -1077,8 +1078,8 @@ void dppc_interpreter::ppc_lfdu(uint32_t opcode) {
|
|||||||
ea += val_reg_a;
|
ea += val_reg_a;
|
||||||
uint64_t ppc_result64_d = mmu_read_vmem<uint64_t>(opcode, ea);
|
uint64_t ppc_result64_d = mmu_read_vmem<uint64_t>(opcode, ea);
|
||||||
ppc_store_fpresult_int(reg_d, ppc_result64_d);
|
ppc_store_fpresult_int(reg_d, ppc_result64_d);
|
||||||
|
ppc_store_iresult_reg(reg_a, ea);
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
ppc_exception_handler(Except_Type::EXC_PROGRAM, Exc_Cause::ILLEGAL_OP);
|
ppc_exception_handler(Except_Type::EXC_PROGRAM, Exc_Cause::ILLEGAL_OP);
|
||||||
}
|
}
|
||||||
@ -1095,9 +1096,10 @@ void dppc_interpreter::ppc_lfdux(uint32_t opcode) {
|
|||||||
ppc_grab_regsfpdiab(opcode);
|
ppc_grab_regsfpdiab(opcode);
|
||||||
|
|
||||||
if (reg_a != 0) {
|
if (reg_a != 0) {
|
||||||
uint32_t ea = val_reg_a + val_reg_b;
|
uint32_t ea = val_reg_a + val_reg_b;
|
||||||
uint64_t ppc_result64_d = mmu_read_vmem<uint64_t>(opcode, ea);
|
uint64_t ppc_result64_d = mmu_read_vmem<uint64_t>(opcode, ea);
|
||||||
ppc_store_fpresult_int(reg_d, ppc_result64_d);
|
ppc_store_fpresult_int(reg_d, ppc_result64_d);
|
||||||
|
ppc_store_iresult_reg(reg_a, ea);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ppc_exception_handler(Except_Type::EXC_PROGRAM, Exc_Cause::ILLEGAL_OP);
|
ppc_exception_handler(Except_Type::EXC_PROGRAM, Exc_Cause::ILLEGAL_OP);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user