diff options
Diffstat (limited to 'libpore/p9_stop_api.C')
-rw-r--r-- | libpore/p9_stop_api.C | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libpore/p9_stop_api.C b/libpore/p9_stop_api.C index 26a14bb..33a3bf3 100644 --- a/libpore/p9_stop_api.C +++ b/libpore/p9_stop_api.C @@ -255,12 +255,10 @@ static uint32_t getOrisInstruction( const uint16_t i_Rs, const uint16_t i_Ra, */ static uint32_t getMtsprInstruction( const uint16_t i_Rs, const uint16_t i_Spr ) { - uint32_t mtsprInstOpcode = 0; - uint32_t temp = (( i_Spr & 0x03FF ) << 11); - mtsprInstOpcode = (uint8_t)i_Rs << 21; - mtsprInstOpcode = ( temp & 0x0000F800 ) << 5; - mtsprInstOpcode |= ( temp & 0x001F0000 ) >> 5; - mtsprInstOpcode |= MTSPR_BASE_OPCODE; + uint32_t mtsprInstOpcode = MTSPR_BASE_OPCODE; + uint32_t temp = ((i_Spr & 0x1F) << 5) | ((i_Spr & 0x8F) >> 5); + + mtsprInstOpcode |= ((i_Rs & 0x1F) << 21) | ((temp & 0x03FF) << 11); return SWIZZLE_4_BYTE(mtsprInstOpcode); } |