mirror of
https://github.com/dingusdev/dingusppc.git
synced 2026-04-25 19:18:34 +00:00
Fix LR update in bc instructions
Only executes when the branch path is taken.
This commit is contained in:
+13
-12
@@ -1138,11 +1138,12 @@ void dppc_interpreter::ppc_bc() {
|
||||
ppc_next_instruction_address = br_bd;
|
||||
else
|
||||
ppc_next_instruction_address = uint32_t(ppc_state.pc + br_bd);
|
||||
exec_flags = EXEF_BRANCH;
|
||||
}
|
||||
|
||||
if (l)
|
||||
ppc_state.spr[SPR::LR] = uint32_t(ppc_state.pc + 4);
|
||||
exec_flags = EXEF_BRANCH;
|
||||
|
||||
if (l)
|
||||
ppc_state.spr[SPR::LR] = uint32_t(ppc_state.pc + 4);
|
||||
}
|
||||
}
|
||||
|
||||
template void dppc_interpreter::ppc_bc<LK0, AA0>();
|
||||
@@ -1174,11 +1175,11 @@ void dppc_interpreter::ppc_bcctr() {
|
||||
|
||||
if (ctr_ok && cnd_ok) {
|
||||
ppc_next_instruction_address = (ctr & ~3UL);
|
||||
exec_flags = EXEF_BRANCH;
|
||||
}
|
||||
exec_flags = EXEF_BRANCH;
|
||||
|
||||
if (l)
|
||||
ppc_state.spr[SPR::LR] = uint32_t(ppc_state.pc + 4);
|
||||
if (l)
|
||||
ppc_state.spr[SPR::LR] = uint32_t(ppc_state.pc + 4);
|
||||
}
|
||||
}
|
||||
|
||||
template void dppc_interpreter::ppc_bcctr<LK0, NOT601>();
|
||||
@@ -1201,11 +1202,11 @@ void dppc_interpreter::ppc_bclr() {
|
||||
|
||||
if (ctr_ok && cnd_ok) {
|
||||
ppc_next_instruction_address = (ppc_state.spr[SPR::LR] & ~3UL);
|
||||
exec_flags = EXEF_BRANCH;
|
||||
}
|
||||
exec_flags = EXEF_BRANCH;
|
||||
|
||||
if (l)
|
||||
ppc_state.spr[SPR::LR] = uint32_t(ppc_state.pc + 4);
|
||||
if (l)
|
||||
ppc_state.spr[SPR::LR] = uint32_t(ppc_state.pc + 4);
|
||||
}
|
||||
}
|
||||
|
||||
template void dppc_interpreter::ppc_bclr<LK0>();
|
||||
|
||||
Reference in New Issue
Block a user