mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-12-23 21:29:28 +00:00
Further condition reg opcode patches
This commit is contained in:
parent
9cd7ca0077
commit
756d32df07
@ -1244,7 +1244,8 @@ void dppc_interpreter::ppc_mcrf() {
|
||||
|
||||
void dppc_interpreter::ppc_crand() {
|
||||
ppc_grab_regsdab();
|
||||
if ((ppc_state.cr & (0x80000000UL >> reg_a)) && (ppc_state.cr & (0x80000000UL >> reg_b))) {
|
||||
uint8_t ir = (ppc_state.cr >> (31 - reg_a)) & (ppc_state.cr >> (31 - reg_b));
|
||||
if (ir & 1) {
|
||||
ppc_state.cr |= (0x80000000UL >> reg_d);
|
||||
} else {
|
||||
ppc_state.cr &= ~(0x80000000UL >> reg_d);
|
||||
@ -1253,7 +1254,8 @@ void dppc_interpreter::ppc_crand() {
|
||||
|
||||
void dppc_interpreter::ppc_crandc() {
|
||||
ppc_grab_regsdab();
|
||||
if ((ppc_state.cr & (0x80000000UL >> reg_a)) && !(ppc_state.cr & (0x80000000UL >> reg_b))) {
|
||||
uint8_t ir = (ppc_state.cr >> (31 - reg_a)) & ~(ppc_state.cr >> (31 - reg_b));
|
||||
if (ir & 1) {
|
||||
ppc_state.cr |= (0x80000000UL >> reg_d);
|
||||
} else {
|
||||
ppc_state.cr &= ~(0x80000000UL >> reg_d);
|
||||
@ -1261,7 +1263,8 @@ void dppc_interpreter::ppc_crandc() {
|
||||
}
|
||||
void dppc_interpreter::ppc_creqv() {
|
||||
ppc_grab_regsdab();
|
||||
if (!((ppc_state.cr & (0x80000000UL >> reg_a)) ^ (ppc_state.cr & (0x80000000UL >> reg_b)))) {
|
||||
uint8_t ir = ~((ppc_state.cr & (31 - reg_a)) ^ (ppc_state.cr & (31 - reg_b)));
|
||||
if (ir & 1) {
|
||||
ppc_state.cr |= (0x80000000UL >> reg_d);
|
||||
} else {
|
||||
ppc_state.cr &= ~(0x80000000UL >> reg_d);
|
||||
@ -1269,7 +1272,8 @@ void dppc_interpreter::ppc_creqv() {
|
||||
}
|
||||
void dppc_interpreter::ppc_crnand() {
|
||||
ppc_grab_regsdab();
|
||||
if (!((ppc_state.cr & (0x80000000UL >> reg_a)) && (ppc_state.cr & (0x80000000UL >> reg_b)))) {
|
||||
uint8_t ir = ~((ppc_state.cr >> (31 - reg_a)) & (ppc_state.cr >> (31 - reg_b)));
|
||||
if (ir & 1) {
|
||||
ppc_state.cr |= (0x80000000UL >> reg_d);
|
||||
} else {
|
||||
ppc_state.cr &= ~(0x80000000UL >> reg_d);
|
||||
@ -1277,7 +1281,8 @@ void dppc_interpreter::ppc_crnand() {
|
||||
}
|
||||
void dppc_interpreter::ppc_crnor() {
|
||||
ppc_grab_regsdab();
|
||||
if (!((ppc_state.cr & (0x80000000UL >> reg_a)) || (ppc_state.cr & (0x80000000UL >> reg_b)))) {
|
||||
uint8_t ir = ~((ppc_state.cr >> (31 - reg_a)) | (ppc_state.cr >> (31 - reg_b)));
|
||||
if (ir & 1) {
|
||||
ppc_state.cr |= (0x80000000UL >> reg_d);
|
||||
} else {
|
||||
ppc_state.cr &= ~(0x80000000UL >> reg_d);
|
||||
@ -1286,7 +1291,8 @@ void dppc_interpreter::ppc_crnor() {
|
||||
|
||||
void dppc_interpreter::ppc_cror() {
|
||||
ppc_grab_regsdab();
|
||||
if ((ppc_state.cr & (0x80000000UL >> reg_a)) || (ppc_state.cr & (0x80000000UL >> reg_b))) {
|
||||
uint8_t ir = (ppc_state.cr >> (31 - reg_a)) || (ppc_state.cr >> (31 - reg_b));
|
||||
if (ir & 1) {
|
||||
ppc_state.cr |= (0x80000000UL >> reg_d);
|
||||
} else {
|
||||
ppc_state.cr &= ~(0x80000000UL >> reg_d);
|
||||
@ -1294,7 +1300,8 @@ void dppc_interpreter::ppc_cror() {
|
||||
}
|
||||
void dppc_interpreter::ppc_crorc() {
|
||||
ppc_grab_regsdab();
|
||||
if ((ppc_state.cr & (0x80000000UL >> reg_a)) || !(ppc_state.cr & (0x80000000UL >> reg_b))) {
|
||||
uint8_t ir = (ppc_state.cr >> (31 - reg_a)) || ~(ppc_state.cr >> (31 - reg_b));
|
||||
if (ir & 1) {
|
||||
ppc_state.cr |= (0x80000000UL >> reg_d);
|
||||
} else {
|
||||
ppc_state.cr &= ~(0x80000000UL >> reg_d);
|
||||
|
Loading…
Reference in New Issue
Block a user