bfirsh/jsnes — reverse-engineered prompt

Reverse engineered prompt

GitHub

Build me a JavaScript NES emulator that people can use both as a library and in a browser demo. I want someone to be able to drop a ROM file or load one from a URL, then play it on a canvas with sound, keyboard controls, and gamepad support handled automatically.

Please include a simple browser wrapper that manages the screen, audio, frame timing, controls, pause and restart, screenshots, and cleanup. Also expose a lower level emulator class for Node.js or custom setups, where I can run frames, send button presses, receive video frames, and receive audio samples.

Add support for saving and restoring emulator state, battery backed saves, custom key bindings saved in the browser, two player controls, turbo buttons, and basic Zapper actions. Include a React usage example and a full web example. Make sure it has npm scripts for building, testing, and formatting, plus clear README instructions. Look up current docs online if you need to.

Want more depth? Deep Reverse