beardypig / ghidra-emotionengine

Ghidra Processor for the Play Station 2's Emotion Engine MIPS based CPU
Apache License 2.0
198 stars 35 forks source link

EI/DI decompile improperly #7

Closed PSI-Rockin closed 5 years ago

PSI-Rockin commented 5 years ago

The EI and DI instructions modify bit 16 of the COP0 Status register, or the master interrupt enable. However, decompilation shows them as having the effect of Status = Status & 0xFFFFFFFE in the case of DI, which is incorrect.

A cleaner solution imo would be to decompile these instructions as EI() and DI() as if they were functions or macros.

beardypig commented 5 years ago

Much cleaner. Easily done too :)