A current project I have been working on involves implementing a .nes ROM player. That is, a way for people to play Nintendo Entertainment System games on a web page. Individual Nintendo Entertainment System (NES) games are available in a digital file format with a .nes file format. I need to figure out a way to make those games playable on a WordPress page.
First, I started with JSNES – a JavaScript NES Emulator. I successfully got this working on an HTML page outside of WordPress. At first, it was only working in Mozilla Firefox, but once I removed a Google Chrome Extension that was causing an issue (some iMacro extension), it worked in that browser as well. Here you can click to play Castelvania using JNES.
In the end, I continued to have problems with JSNES Emulator in Google Chrome Browser so, I had to abandon this for the time being and seek alternatives.
Otherwise, the source code for using JSNES is straightforward.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>JSNES Demo</title> <script type="text/javascript" src="https://unpkg.com/jsnes/dist/jsnes.min.js"></script> <script type="text/javascript" src="nes-embed.js"></script> <script>window.onload = function(){nes_load_url("nes-canvas", "Castlevania.nes");}</script> </head> <body> <div style="margin: auto; width: 75%;"> <canvas id="nes-canvas" width="256" height="240" style="width: 60%"/> </div> <p><b>Direction Pad:</b> Arrow keys<br/><b>Start:</b> Enter, <b>Select:</b> Tab<br/><b>A Button:</b> A, <b>B Button:</b> S</p> </body> </html> |
About the Nintendo Entertainment System (NES)
The Nintendo Entertainment System (NES), a trailblazing gaming console from the 1980s, holds an esteemed position in the annals of video game history. This groundbreaking system, featuring a distinct gray box with a vibrant red light, introduced players to an enchanting realm of pixels and challenges. With titles like Super Mario Bros., Duck Hunt, and Donkey Kong, the NES revolutionized home entertainment, igniting a gaming revolution that continues to influence the industry’s evolution today.