Nintendo doesn't own the source code to the game, but to develop a game for a Nintendo system, you have to sign a nondisclosure agreement which basically says you're not allowed to tell anybody about how to develop for the NES. That presumably includes giving away the source code to a game.