mirror of
https://github.com/n64dev/cen64.git
synced 2024-06-15 10:37:48 -04:00
Fix SRA/SRAV opcodes
These opcodes surprisingly let the 33th bit shift in into the lower 32-bits, before sign-extension.
This commit is contained in:
parent
9f264b3208
commit
0902da8113
|
@ -1452,7 +1452,7 @@ int VR4300_SRA(struct vr4300 *vr4300,
|
|||
unsigned dest = GET_RD(iw);
|
||||
unsigned sa = iw >> 6 & 0x1F;
|
||||
|
||||
exdc_latch->result = (int32_t) rt >> sa;
|
||||
exdc_latch->result = (int32_t) (rt >> sa);
|
||||
exdc_latch->dest = dest;
|
||||
return 0;
|
||||
}
|
||||
|
@ -1466,7 +1466,7 @@ int VR4300_SRAV(struct vr4300 *vr4300,
|
|||
unsigned dest = GET_RD(iw);
|
||||
unsigned sa = rs & 0x1F;
|
||||
|
||||
exdc_latch->result = (int32_t) rt >> sa;
|
||||
exdc_latch->result = (int32_t) (rt >> sa);
|
||||
exdc_latch->dest = dest;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue