[1] At least for now; burn in Hell, Oracle.
Incorrect. People say this all the time but no, it is not in fact legal. It's never been tested in court and Nintendo takes the explicit view that both it is illegal to rip your own roms and that said devices are illegal.
Now you and I can disagree with Nintendo, but Nintendo could sue someone for ripping their own roms. They won't however, because it would be an incredibly difficult case to prove. Don't mistake that for it being legal or illegal however.
Without a test case, we cannot state with certainty whether it is legal or illegal - particularly as some jurisdictions have carve-outs from copyright for format shifting.
Nintendo could sue for someone ripping their own ROMs; what is unclear, and also would determine legality, is whether Nintendo would win.
There are only so many sensible ways to do things. Straight copying would certainly be stupid but I think it won't be provable unless you decide to include specific aspects which would not be possible to discover through reverse-engineering, and it is likely such things wouldn't affect emulation anyway, so obviously as an emulator developer would be of no real use.
tl;dr: people are smart.
Except that people need ROMs to test emulators with.
Just like the old saying that it's impossible to actually start "from scratch", at some point everything is a derivative work of everything else; it just has to be far enough away to not attract legal attention.