Is this legal? I know decompiling is legal in some areas for specific reasons. But I don't think that you can open source the result of that decompilation. You end up with an artifact based on something you don't have the rights to relicense.
Well, its not legal obviously to decompile and share the code online. But its just a matter of "will they care" and the answer is most likely NO. Just like SM64, it is open sourced on GitHub but they never got any complain from Nintendo asking to shut down anything.
It's probably fair use. There's no harm to the market for the original work (ROMs and assets aren't shared, only the decompiled/recreated code), it's not made for profit/commercial use, the nature of the use and work is about the code and not the artistic aspects of the game, etc.
Nintendo hasn't gone after the repos because they have a very solid fair use defense. They have, however, taken action against shared EXEs derived from that source code which DO contain the copyrighted SM64 assets. The fact that they went against that and not the code-only project shows they probably agree with this analysis.