Nintendo (or any other software manufacturer) can benefit from several forms of intellectual property protection to prevent copies and imitations, including utility patents but also design patents, trademarks and copyright. Besides intellectual property protection, other protections exist including laws against unfair competition or parasitic copying.
Utility patents cover inventions. To obtain such a patent, Nintendo will have to file an application and be the first to solve a given problem in a non-obvious way to the skilled of the art. First being understood as based on what is published and disclosed at the time of their filing.
If you reproduce a software (i.e. a game) without access to the source code you might still violate a patent if you solve the same problem and come up with the same solution.
Coming with the same solution could happen because the technical solution invented by the original author was revealed, even without access to the source code. You could have reverse engineered the software, or the solution could simply be revealed by using the original software. Please note that non-obvious solutions often seem obvious when disclosed.
Coming with the same solution could also happen by chance. Yet this would also be a violation. If you came with the same solution independently, it might be easier (in case of a lawsuit) to find prior art and eventually invalidate the patent. Indeed, in such a scenario, it is more likely an obvious solution at the time of filing. But the fact that you came with the same solution is no proof of obviousness.
The only way to not violate a patent is to come up with another solution of the problem. If you knew which patents cover the software, you could engineer your other solution to circumvent the patents claims.
Of course, as you mention, simulating the gameboy color game Pokemon in HTML5 will likely violate copyright and trademark.