mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-01-27 01:31:21 +00:00
ppcopcodes: fix TWI emulation.
This commit is contained in:
parent
7154e51d86
commit
3d13bc1ca6
@ -1786,15 +1786,16 @@ void ppc_tw() {
|
||||
}
|
||||
}
|
||||
|
||||
void ppc_twi() {
|
||||
simm = (int32_t)((int16_t)((ppc_cur_instruction) & 65535));
|
||||
reg_b = (ppc_cur_instruction >> 16) & 31;
|
||||
ppc_to = (ppc_cur_instruction >> 21) & 31;
|
||||
if ((((int32_t)ppc_state.gpr[reg_a] < simm) & (ppc_to & 0x10)) || \
|
||||
(((int32_t)ppc_state.gpr[reg_a] > simm)& (ppc_to & 0x08)) || \
|
||||
(((int32_t)ppc_state.gpr[reg_a] == simm) & (ppc_to & 0x04)) || \
|
||||
((ppc_state.gpr[reg_a] < (uint32_t)simm) & (ppc_to & 0x02)) || \
|
||||
((ppc_state.gpr[reg_a] > (uint32_t)simm)& (ppc_to & 0x01))) {
|
||||
void ppc_twi()
|
||||
{
|
||||
simm = (int32_t)((int16_t)((ppc_cur_instruction) & 0xFFFF));
|
||||
reg_a = (ppc_cur_instruction >> 16) & 0x1F;
|
||||
ppc_to = (ppc_cur_instruction >> 21) & 0x1F;
|
||||
if ((((int32_t)ppc_state.gpr[reg_a] < simm) && (ppc_to & 0x10)) ||
|
||||
(((int32_t)ppc_state.gpr[reg_a] > simm) && (ppc_to & 0x08)) ||
|
||||
(((int32_t)ppc_state.gpr[reg_a] == simm) && (ppc_to & 0x04)) ||
|
||||
((ppc_state.gpr[reg_a] < (uint32_t)simm) && (ppc_to & 0x02)) ||
|
||||
((ppc_state.gpr[reg_a] > (uint32_t)simm) && (ppc_to & 0x01))) {
|
||||
ppc_exception_handler(Except_Type::EXC_PROGRAM, 0x20000);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user