mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-12-23 06:29:38 +00:00
ppcopcodes: partial fix for XER[CA] updates.
This commit is contained in:
parent
9685be3154
commit
fc26660f11
@ -168,7 +168,7 @@ void ppc_changecrf0(uint32_t set_result){
|
||||
|
||||
//Affects the XER register's Carry Bit
|
||||
void ppc_carry(uint32_t a, uint32_t b){
|
||||
if (b > ~a){
|
||||
if (b < a){ // TODO: ensure it works everywhere
|
||||
ppc_state.ppc_spr[1] |= 0x20000000;
|
||||
}
|
||||
else{
|
||||
@ -384,9 +384,9 @@ void ppc_addcodot(){
|
||||
|
||||
void ppc_adde(){
|
||||
ppc_grab_regsdab();
|
||||
uint32_t grab_xer = ppc_state.ppc_spr[1] & 0x20000000;
|
||||
ppc_result_d = ppc_result_a + ppc_result_b + grab_xer;
|
||||
if (((grab_xer != 0) && (grab_xer > (~(ppc_result_b + ppc_result_a)))) || (ppc_result_d > ~ppc_result_a)){
|
||||
uint32_t xer_ca = !!(ppc_state.ppc_spr[1] & 0x20000000);
|
||||
ppc_result_d = ppc_result_a + ppc_result_b + xer_ca;
|
||||
if ((ppc_result_d < ppc_result_a) || (xer_ca && (ppc_result_d == ppc_result_a))){
|
||||
ppc_state.ppc_spr[1] |= 0x20000000;
|
||||
}
|
||||
else{
|
||||
@ -646,7 +646,7 @@ void ppc_subfic(){
|
||||
ppc_grab_regsdasimm();
|
||||
not_this = ~ppc_result_a;
|
||||
ppc_result_d = not_this + simm + 1;
|
||||
if (ppc_result_d < (not_this + 1)){
|
||||
if (ppc_result_d <= not_this) {
|
||||
ppc_state.ppc_spr[1] |= 0x20000000;
|
||||
}
|
||||
else{
|
||||
|
Loading…
Reference in New Issue
Block a user