FAQ: Difference between revisions

81 bytes removed ,  19 July 2018
(→‎How many A presses are left?: Fixed ridiculous mistake)
Line 63: Line 63:
===How are you decompiling the game?===
===How are you decompiling the game?===


"It turned out that the reason we couldn't figure it out for so long was because the devs used the "-g" flag in the final version of the game
"It turned out that the reason we couldn't figure it out for so long was because the devs used the "-g" flag in the final version of the game, It's the same compiler for US, PAL(?), J, Shindou. The -g flag is for debugging, it basically disables a bunch of optimizations. You're not supposed to ship games with that kind of flag, even Nintendo told developers to be careful not to but they did. And that's really, really good for us since lack of optimization simplifies decompilation a ton. But they removed it in the Shindou version, which is why the game runs faster. Once you have the decompiler, you just start writing C code based on the assembly code, which we've been doing for a long time, but then you have to make the code match, meaning it compiles into the same assembly code and that is sort of trial and error, but once you learn how the compiler works, it becomes pretty routine.


It's the same compiler for US, J, Shindou, PAL I think
We get the assembly code from the rom. We used a hacking tool to help split it into assembly and assets, and to do some preprocessing on the assembly code. Worth noting for anyone who doesn't know much coding, when the stuff is decomped it loses nearly all labels, comments, etc. So getting back the logic and formulas is only part of the battle, you still have to go through and make the code readable.
 
The -g flag is for debugging
 
It basically disables a bunch of optimizations
 
You're not supposed to ship games with that kind of flag
 
Even Nintendo told developers to he careful not to
 
But they did. And that's really, really good for us since lack of optimization simplifies decompilation a ton
 
But they removed it in the Shindou version, which is why the game runs faster
 
Once you have the decompiler, you just start writing C code based on the assembly code, which we've been doing for a long time. But then you have to make the code match, meaning it compiles into the same assembly code
 
And that is sort of trial and error, but once you learn how the compiler works, it becomes pretty routine
 
We get the assembly code from the rom
 
We used a hacking tool to help split it into assembly and assets, and to do some preprocessing on the assembly code
 
Worth noting for anyone who doesn't know much coding, when the stuff is decomped it loses nearly all labels, comments, etc. So getting back the logic and formulas is only part of the battle, you still have to go through and make the code readable


- bad boot"
- bad boot"
(fix this aswell so it actually looks a bit nicer than it actually is lol)