JSNes and running your rom in a browser.
Moderator: Moderators
- battagline
- Posts: 152
- Joined: Wed Sep 05, 2018 11:13 am
- Location: Colorado
- Contact:
JSNes and running your rom in a browser.
I'm not sure if anyone here is familiar with JSNes.org. I've been going through the open source project JSNes and trying to get it working with some of my roms on one of my websites, but I've been running into issues. It looks like you should be able to get it running without using React, but the example they use JSNes-web uses React, so I'm trying to figure out how to get it working without React.
Anyway, I suspect this is something I'm going to have to do on my own, but I wanted to ask if anyone else has done this before I waste a few days trying to figure it out. So if you've worked with JSNes in the past, and don't mind me asking you a few questions, please give me a shout.
Thanks,
Rick
Anyway, I suspect this is something I'm going to have to do on my own, but I wanted to ask if anyone else has done this before I waste a few days trying to figure it out. So if you've worked with JSNes in the past, and don't mind me asking you a few questions, please give me a shout.
Thanks,
Rick
A few of my web games
https://www.embed.com
Or if you're bored at work
https://www.classicsolitaire.com
https://www.embed.com
Or if you're bored at work
https://www.classicsolitaire.com
- samophlange
- Posts: 50
- Joined: Sun Apr 08, 2018 11:45 pm
- Location: Southern California
Re: JSNes and running your rom in a browser.
Have you tried contacting the developer? He's on twitter, and looks like a very experienced web developer. He could probably give you some good advice.
- battagline
- Posts: 152
- Joined: Wed Sep 05, 2018 11:13 am
- Location: Colorado
- Contact:
Re: JSNes and running your rom in a browser.
I tried sending him an email, but he never got back to me. I can figure this stuff out, it's just a lot more time consuming. I figured it was kind of a long shot asking if anyone here had worked with it, but you never know.samophlange wrote:Have you tried contacting the developer? He's on twitter, and looks like a very experienced web developer. He could probably give you some good advice.
Thanks for the suggestion
A few of my web games
https://www.embed.com
Or if you're bored at work
https://www.classicsolitaire.com
https://www.embed.com
Or if you're bored at work
https://www.classicsolitaire.com
Re: JSNes and running your rom in a browser.
I spent like a day or so on it a year ago. Ran into the same issues mostly. I tried contacting the dev as well, but maybe it wasn't an active email or something?
- battagline
- Posts: 152
- Joined: Wed Sep 05, 2018 11:13 am
- Location: Colorado
- Contact:
Re: JSNes and running your rom in a browser.
Got it working, but it seems to have some problems with sprites that are smaller than 8x8. By smaller I mean they have transparent pixels all the way around the edge so that they are effectively smaller than 8x8.
https://www.embed.com/nes/nesteroids.html
the controls are arrow keys for the d-pad and asdf for select, start, b, a Next week I'm on vacation. The week after that I'll try to get my jsnes helper out... I'll also need to try and figure out why jsnes has issues with the smaller than 8x8 sprites.
https://www.embed.com/nes/nesteroids.html
the controls are arrow keys for the d-pad and asdf for select, start, b, a Next week I'm on vacation. The week after that I'll try to get my jsnes helper out... I'll also need to try and figure out why jsnes has issues with the smaller than 8x8 sprites.
A few of my web games
https://www.embed.com
Or if you're bored at work
https://www.classicsolitaire.com
https://www.embed.com
Or if you're bored at work
https://www.classicsolitaire.com
-
- Posts: 102
- Joined: Fri Dec 27, 2013 4:28 pm
Re: JSNes and running your rom in a browser.
I had a bit of luck using a different emulator: https://github.com/peteward44/WebNES (It's MIT licensed) ... might be worth trying to see if it avoids your bug. There's a demo site you can load your rom in w/o setting it up to see: http://peteward44.github.io/WebNES
The version they use for their demo is a lot easier to look at: https://github.com/peteward44/WebNES/tree/gh-pages -- if you look at the index_app.html, that shows how to embed it and use it.
I'm using it for my starter kit app here if you want another demo: https://nes-starter-kit.nes.science/ -- I stripped out a lot of the formatting around it to make it simpler.
Updated in 2024: These days I use nez, though there are also a lot of other pretty great options. https://gh.nes.science/nez
Hope this helps!
The version they use for their demo is a lot easier to look at: https://github.com/peteward44/WebNES/tree/gh-pages -- if you look at the index_app.html, that shows how to embed it and use it.
I'm using it for my starter kit app here if you want another demo: https://nes-starter-kit.nes.science/ -- I stripped out a lot of the formatting around it to make it simpler.
Updated in 2024: These days I use nez, though there are also a lot of other pretty great options. https://gh.nes.science/nez
Hope this helps!
Last edited by cppchriscpp on Fri Jan 26, 2024 10:02 pm, edited 1 time in total.
Re: JSNes and running your rom in a browser.
I would go for an Emscripten-based emulator (asm.js/WebAssembly) such as https://github.com/ryanwmoore/fceux for better performance.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
Re: JSNes and running your rom in a browser.
I made a more stripped down version here:
http://files.slembcke.net/temp/nes-embe ... stack.html
At 100 lines, someone might find it a bit easier to embed in their own pages. I haven't gotten sound working yet though. The example version throws a ton of errors in the console for me so I was going to try something else. (edit: sound is working now, but like the original, it ignores sampling rate and changes game speed based on it. Bleh)
@thefox Performance isn't *really* an issue, ease of embedding is what I wanted. Also, that one doesn't work for me in the two browsers I bothered to try. (shrugs)
http://files.slembcke.net/temp/nes-embe ... stack.html
At 100 lines, someone might find it a bit easier to embed in their own pages. I haven't gotten sound working yet though. The example version throws a ton of errors in the console for me so I was going to try something else. (edit: sound is working now, but like the original, it ignores sampling rate and changes game speed based on it. Bleh)
@thefox Performance isn't *really* an issue, ease of embedding is what I wanted. Also, that one doesn't work for me in the two browsers I bothered to try. (shrugs)
- battagline
- Posts: 152
- Joined: Wed Sep 05, 2018 11:13 am
- Location: Colorado
- Contact:
Re: JSNes and running your rom in a browser.
slembcke wrote:I made a more stripped down version here:
http://files.slembcke.net/temp/nes-embe ... stack.html
At 100 lines, someone might find it a bit easier to embed in their own pages. I haven't gotten sound working yet though. The example version throws a ton of errors in the console for me so I was going to try something else. (edit: sound is working now, but like the original, it ignores sampling rate and changes game speed based on it. Bleh)
@thefox Performance isn't *really* an issue, ease of embedding is what I wanted. Also, that one doesn't work for me in the two browsers I bothered to try. (shrugs)
I'd give it a try. Do you have it on github?
A few of my web games
https://www.embed.com
Or if you're bored at work
https://www.classicsolitaire.com
https://www.embed.com
Or if you're bored at work
https://www.classicsolitaire.com
Re: JSNes and running your rom in a browser.
I sent a pull request to the original author as well, but never heard back:
https://github.com/slembcke/jsnes/tree/master/example
It doesn't fix any of the timing issues due to audio audio sampling rate from the original though.
https://github.com/slembcke/jsnes/tree/master/example
It doesn't fix any of the timing issues due to audio audio sampling rate from the original though.