r/decomps • • 6d ago

Question AI-assisted PS2 reverse engineering for a native Switch port?

Hi everyone!

I'm trying to port Persona 3 FES from PS2 to Nintendo Switch using OpenAI Codex, aiming for native ARM64 execution without a full PS2 emulator.

I've provided the game's CHD image, and Codex has helped with file extraction, MIPS analysis, and partial static recompilation.

However, Codex refuses to directly recompile the game's proprietary binaries due to its collaboration rules.

I'm considering a different approach:

  1. Use Codex with IDA/Ghidra to extract and decompile as much of the game as possible.
  2. Export the MIPS assembly, C-like pseudocode, function relationships, and data structures.
  3. Pass the results to another AI tool that allows further recompilation and porting work.

My questions:

  • Can most of a PS2 game's code be automatically decompiled this way?
  • Is transferring these results between AI tools practical?
  • Is this a reasonable path toward a native Switch port, or would you recommend another approach?

I'm looking for technical advice on the workflow, not asking anyone to make the port for me. I also want to respect applicable licensing and tool restrictions.

Thanks for any suggestions!

4 Upvotes

2 comments sorted by

2

u/Necessary_Pool 6d ago

I feel like I'd almost recommend finishing up/heavily cleaning the work in progress bytematching decompilation over what you're doing: https://github.com/Raikaru/Persona3-FES-Decompilation. That being said, the code there right now is quite poor, so you'd have to do essentially a comprehensive cleanup. This is my skill for doing that kind of thing: link. It was designed around Claude models but works with other models as well. If you want to do it yourself, I'd at least read the code rules in there and take a look at the Persona 3 FES decomp so you get a sense of common and specific issues there. AI can do this kind of thing very, very well, especially if you can find debug symbols for your game/a related game. I couldn't find anything on debugging.games, but I only looked for Shin Megami Tensei and Persona stuff. I wouldn't be surprised if another Atlus PS2 game using a lot of the same code DOES have debug symbols on there.

If you went that route, you'd need to then make a source port of the game to Switch. My experience has been that source-porting with AI can be tricky. My experience has lead me to believe that it's best to have an AI agent write up a skill and significant scaffolding for the exact kind of port (in this case, PS2 to Switch) that you're doing. My recommendation after a first porting pass would be giving an agent access to both a PS2 and a Switch emulator, and attempting to verify total port parity through that.

If you're determined to go the recomp route, my feeling is that the best way to do so is taking a pre existing PS2 recomp tool targetting PS2 MIPS to Windows x86 or (if you can find one) to Android, and modify it to recompile to Switch compatible code. You'd then want to perform the same kinds of port parity tests described above for the decomp strategy.

1

u/WhopplerPlopper 6d ago

Did you explicitly tell codex you own the game?