matt-kempster / m2c

A MIPS and PowerPC decompiler.
GNU General Public License v3.0
386 stars 46 forks source link

Added compatibility for decomp-toolkit macros #275

Closed dbalatoni13 closed 1 month ago

dbalatoni13 commented 1 month ago

encounter/decomp-toolkit outputs assembly files that are currently not fully compatible with m2c. One problem is that labels have the format

.obj name, local
    .float 0
.endobj name

This makes m2c not detect any data, bss, rodata or jump table labels. Another problem is that jump tables have the prefix "jumptable_". Ultimately, strings use the type ".string".

simonlindholm commented 1 month ago

Thanks, compatibility with more formats is always welcome. (Sorry for not responding in time to #272, I've been a bit strapped for time.)

dbalatoni13 commented 1 month ago

No problem!

dbalatoni13 commented 1 month ago

Does it look alright? I also made sure to set z to True for .string.

dbalatoni13 commented 1 month ago

Sorry, my previous edit deleted the jump table change, I'm not really experienced with git yet. I added it back now. Why does black change the formatting for something that was already in the repo?

dbalatoni13 commented 1 month ago

I ran black and it was strange that it changed the formatting in other sections of this file and also multiple other files. I didn't commit those other changes, what do you think the issue probably is?

simonlindholm commented 1 month ago

Test failure due to too old black version? Because I don't get reformatting in flow_graph.py locally.

simonlindholm commented 1 month ago

23.12.1 is the version used in CI btw (mentioned in pyproject.toml), and 24.4.2 seems to be behave the same for me. You can probably just python3 -m pip install --upgrade black

simonlindholm commented 1 month ago

Actually, nvm, 23.12.1 and 24.4.2 do not behave the same, I just had parallel install of black somehow. (depot_tools??? this is a new way of screwing up python installs that I heretofore was not aware of.) I'll push an update to master to make things simple.

simonlindholm commented 1 month ago

so just rebase or merge with master and you should be good

dbalatoni13 commented 1 month ago

Oh, okay. I did a rebase.