mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-03-11 18:30:26 +00:00
ppcfpopcodes: Fix stfs*.
It should try to convert its operand to a single precision floating point number at least.
This commit is contained in:
parent
cb85d358d1
commit
bd419912b5
@ -779,7 +779,8 @@ void dppc_interpreter::ppc_stfs() {
|
||||
ppc_grab_regsfpsia();
|
||||
ppc_effective_address = (int32_t)((int16_t)(ppc_cur_instruction & 0xFFFF));
|
||||
ppc_effective_address += (reg_a) ? val_reg_a : 0;
|
||||
mmu_write_vmem<uint32_t>(ppc_effective_address, uint32_t(ppc_state.fpr[reg_s].int64_r));
|
||||
float result = ppc_state.fpr[reg_s].dbl64_r;
|
||||
mmu_write_vmem<uint32_t>(ppc_effective_address, uint32_t(result));
|
||||
}
|
||||
|
||||
void dppc_interpreter::ppc_stfsu() {
|
||||
@ -787,7 +788,8 @@ void dppc_interpreter::ppc_stfsu() {
|
||||
if (reg_a != 0) {
|
||||
ppc_effective_address = (int32_t)((int16_t)(ppc_cur_instruction & 0xFFFF));
|
||||
ppc_effective_address += val_reg_a;
|
||||
mmu_write_vmem<uint32_t>(ppc_effective_address, uint32_t(ppc_state.fpr[reg_s].int64_r));
|
||||
float result = ppc_state.fpr[reg_s].dbl64_r;
|
||||
mmu_write_vmem<uint32_t>(ppc_effective_address, uint32_t(result));
|
||||
ppc_state.gpr[reg_a] = ppc_effective_address;
|
||||
} else {
|
||||
ppc_exception_handler(Except_Type::EXC_PROGRAM, Exc_Cause::ILLEGAL_OP);
|
||||
@ -797,14 +799,16 @@ void dppc_interpreter::ppc_stfsu() {
|
||||
void dppc_interpreter::ppc_stfsx() {
|
||||
ppc_grab_regsfpsiab();
|
||||
ppc_effective_address = (reg_a) ? val_reg_a + val_reg_b : val_reg_b;
|
||||
mmu_write_vmem<uint32_t>(ppc_effective_address, uint32_t(ppc_state.fpr[reg_s].int64_r));
|
||||
float result = ppc_state.fpr[reg_s].dbl64_r;
|
||||
mmu_write_vmem<uint32_t>(ppc_effective_address, uint32_t(result));
|
||||
}
|
||||
|
||||
void dppc_interpreter::ppc_stfsux() {
|
||||
ppc_grab_regsfpsiab();
|
||||
if (reg_a) {
|
||||
ppc_effective_address = val_reg_a + val_reg_b;
|
||||
mmu_write_vmem<uint32_t>(ppc_effective_address, uint32_t(ppc_state.fpr[reg_s].int64_r));
|
||||
float result = ppc_state.fpr[reg_s].dbl64_r;
|
||||
mmu_write_vmem<uint32_t>(ppc_effective_address, uint32_t(result));
|
||||
ppc_state.gpr[reg_a] = ppc_effective_address;
|
||||
} else {
|
||||
ppc_exception_handler(Except_Type::EXC_PROGRAM, Exc_Cause::ILLEGAL_OP);
|
||||
|
Loading…
x
Reference in New Issue
Block a user