-
Notifications
You must be signed in to change notification settings - Fork 828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic shell example. #219
Comments
Yes! I really want to do this, but unfortunately I haven't got the time right now. If others want to write this, it would be very welcome as a contribution. Here is an email I actually just sent to another dev, which has some clues about how to do this: You're right - it isn't documented clearly. I really want to make JSNES work well for homebrew devs, so I would love to document this better. Unfortunately I haven't got the time right now to write some proper documentation, but in the meantime I shall attempt to point you in the right direction. This is the chunk of code for writing to the screen. So, in short, This is the code for handling audio samples. Then, last bit to piece it together is calling Does that help? Let me know if you need any other pointers. It would be great to have a generalised solution for embedding a simple version of JSNES for homebrew devs... let me know if you'd be interested on collaborating on something like that. :) |
Here is the entrypoint for the emulator in jsnes-web, which has lots of clues about how to do it. You can probably use this React component standalone to run the emulator: https://github.com/bfirsh/jsnes-web/blob/master/src/RunPage.js An idea, for anyone who is interested: if the code in <div id="nes"></div>
<script>
ReactDOM.render(
React.createElement(Emulator, {romURL: 'roms/foo.nes'}, null),
document.getElementById('nes')
);
</script> Still requires React, but a heck of a lot easier than implementing from scratch. :) |
This came up on the NESDev forums recently here:
http://forums.nesdev.com/viewtopic.php?f=10&t=18018&p=228777#p228777
It would be really awesome to use jsnes to embed homebrew NES games in a webpage. For non-webdevs, the usage documentation is reminiscent of the "first draw a circle, then draw everything else" joke. I don't mind digging into assembly code or compute shaders, but I spent longer than I'd like to admit staring at a blank screen here. :-\
If there was a minimal example shell embedded in a single HTML file that set up a canvas and ran the IO loop that would be incredibly helpful. Otherwise the only example you have is written in a separate language, and requires installing a rather lot of tooling.
The text was updated successfully, but these errors were encountered: