Open MasterKnightDH opened 4 years ago
The module should disassemble in whatever processor mode Ghidra tells it to. If you look at the readme you'll see the bit I wrote about processor options and register values, and the bit about "I don't know how well Ghidra will pick up on changes to the processor modes." This is particularly true across branches/jumps.
Unfortunately I can't help you much with getting Ghidra to set the right mode. When I tried to use this module myself I couldn't find a way to do it easily, and I did notice that Ghidra can sometimes get stuck into a particular processor mode. You might be able to see if this has happened by opening the register value view (orange diamond icon in the toolbar) and looking at the values of the mode register at addresses at or before the part you care about.
If it is in the wrong mode, I found undoing it to also be difficult. I can't remember exactly, but something like: clear the instructions in the function that is in the wrong mode, set the correct mode again, re-analyse the function. You'll have to experiment a bit, sorry.
@MasterKnightDH any luck with this?
This is from the ROM of Secret of Evermore. The OPCodes would be correct with a default of 8-Bit Accumulator Mode which is what the game uses in this instance and several surrounding ones; $1088C9 would be BIT #$0x20, then $1088CB would be BNE $#0x25, then $1088CD would be PHB. Unfortunately, since the Disassemble option assumes a default of 16-Bit Accumulator Mode, you get the spaghetti code above and the resulting error that I don't know how to fix properly.
Please provide a response to this.