Git Product home page Git Product logo

emulatorjs's Introduction



Badge License

Self-hosted Javascript emulation for various system.


Button WebsiteButton Usage
Button Configurator
Button DemoButton Legacy

Button Contributors

Join our Discord server:

Join our Discord server!


Note

As of EmulatorJS version 4.0, this project is no longer a reverse-engineered version of the emulatorjs.com project. It is now a complete re-write.

Warning

As of version 4.0.9 cores and minified files are no longer included in the repository. You will need to get them separately. You can get the from releases or the * new CDN (see this for more info). There is also a new version system that we will be using. (read here for more info).

The history of the project has been rewritten and force pushed. You will likely need to redo any active commits you have. Sorry for the inconvenience.

Tip

Cloning the repository is no longer recommended for production use. You should use releases or the CDN instead.


Ads

This project has no ads.
Although, the demo page currently has an ad to help fund this project.
Ads on the demo page may come and go depending on how many people are
funding this project.

You can help fund this project on patreon


Issues

If something doesn't work, please consider opening an Issue
with as many details as possible, as well as the console log.


Versioning

There are 3 different version name that you need to be aware of:

  1. stable - This will be the most stable version of the emulator both code and cores will be tested before release. It will be updated every time a new version is released on GitHub. This is the default version on the Demo.
  2. latest - This will contain the latest code but use the stable cores. This will be updated every time the main branch is updated.
  3. nightly - This will contain the latest code and the latest cores. The cores will be updated every day, so this is consiterd alpha.

CDN

There is a new CDN that you can use to get any version of the emulator. The cdn is https://cdn.emulatorjs.org/. You can use this to get the stable, latest, nightly and any other main version by setting your EJS_pathtodata to https://cdn.emulatorjs.org/<version>/data/.

Extensions

GameLibrary

   A library overview for your ROM folder.


Development:

Run a local server with:

npm i
npm start

>> When reporting bugs, please specify that you are using the old version




Supported Systems


Nintendo

Game Boy Advance   |  Famicom / NES   |  Virtual Boy

Game Boy   |  SNES   |  DS   |  64



Sega

Master System   |  Mega Drive   |  Game Gear

Saturn   |  32X   |  CD



Atari

2600   |  5200   |  7800   |  Lynx   |  Jaguar



Other

PlayStation   |  Arcade   |  3DO   |  MAME 2003


PSP is not yet supported. Some of y'all may have seen that I pushed a "beta" ppsspp core, but this core is not ready for daily use. It still crashes randomly and any games that use 3d (so like, all of them) will just have a white screen (and might just crash). Do not open issues related to the "psp" core.

emulatorjs's People

Contributors

allancoding avatar andrigamerita avatar debuggerx01 avatar e-sh4rk avatar ethanaobrien avatar gantoine avatar incredibleidea avatar mattiapell avatar michael-j-green avatar n-at avatar oyepriyansh avatar timkieu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emulatorjs's Issues

Clean code causes range error

Uncaught RangeError: Maximum call stack size exceeded
    at String.indexOf (<anonymous>)
    at _0x2bd09e (emulator.js?v=0.4.23:36)
    at _0x4b4084 (emulator.js?v=0.4.23:43)
    at _0x2bd09e (emulator.js?v=0.4.23:37)
    at _0x4b4084 (emulator.js?v=0.4.23:43)
    at _0x2bd09e (emulator.js?v=0.4.23:37)
    at _0x4b4084 (emulator.js?v=0.4.23:43)
    at _0x2bd09e (emulator.js?v=0.4.23:37)
    at _0x4b4084 (emulator.js?v=0.4.23:43)
    at _0x2bd09e (emulator.js?v=0.4.23:37)

Some thing is wrong here.

This is the log:
loader.js:52 Path to data is set to https://allancoding.000webhostapp.com/snes-nes/emulator/
loader.js:7 Using emulatorjs version 0.4.23 but the newest version is 0.4.23-05
loader.js:1 Fetch finished loading: GET "https://raw.githack.com/ethanaobrien/emulatorjs/main/data/version.json".
(anonymous) @ loader.js:1
emulator.js?v=0.4.23:882 XHR finished loading: GET "https://allancoding.000webhostapp.com/snes-nes/emulator/v.json?t=1634329589".
(anonymous) @ emulator.js?v=0.4.23:882
_0x361fdc.exports @ emulator.js?v=0.4.23:839
_0x5db8bc.exports @ emulator.js?v=0.4.23:760
Promise.then (async)
_0x37287b.request @ emulator.js?v=0.4.23:684
_0x37287b. @ emulator.js?v=0.4.23:690
(anonymous) @ emulator.js?v=0.4.23:655
(anonymous) @ emulator.js?v=0.4.23:15457
setInterval (async)
(anonymous) @ emulator.js?v=0.4.23:15396
(anonymous) @ emulator.js?v=0.4.23:15499
_0x5127f4 @ emulator.js?v=0.4.23:13827
emulator.js?v=0.4.23:15046 Uncaught (in promise) ReferenceError: getHeadGameInfo is not defined
at _0x5048db (emulator.js?v=0.4.23:15046)
at _0x139f68 (emulator.js?v=0.4.23:15169)
at _0x452592 (emulator.js?v=0.4.23:15254)
at _0x10b71a (emulator.js?v=0.4.23:15336)
at Object._0x4d7024.wasmData.window.Module.monitorRunDependencies (emulator.js?v=0.4.23:15347)
at removeRunDependency (eval at _0x54d695 (emulator.js?v=0.4.23:15370), :8:15481)
at receiveInstance (eval at _0x54d695 (emulator.js?v=0.4.23:15370), :8:16978)
at receiveInstantiatedSource (eval at _0x54d695 (emulator.js?v=0.4.23:15370), :8:17098)
_0x5048db @ emulator.js?v=0.4.23:15046
_0x139f68 @ emulator.js?v=0.4.23:15169
_0x452592 @ emulator.js?v=0.4.23:15254
_0x10b71a @ emulator.js?v=0.4.23:15336
_0x4d7024.wasmData.window.Module.monitorRunDependencies @ emulator.js?v=0.4.23:15347
removeRunDependency @ VM68:8
receiveInstance @ VM68:8
receiveInstantiatedSource @ VM68:8
Promise.then (async)
instantiateArrayBuffer @ VM68:8
instantiateAsync @ VM68:8
createWasm @ VM68:8
Module.asm @ VM68:8
eval @ VM68:8
_0x54d695 @ emulator.js?v=0.4.23:15370
(anonymous) @ emulator.js?v=0.4.23:15374
_0xbae705 @ emulator.js?v=0.4.23:13842
_0x21d6a1 @ emulator.js?v=0.4.23:15378

Upload save to server, load save from server.

Hello

I was just wondering if we can create a button that, instead of downloading save file locally, it will upload it to server side.
Also it will need a button to load save files from server.
Is it possible?

Wasm cores compilation and code

I get that this is essentially just a repo trying to organize and document what has been achieved by who or whatever makes emulatorjs, but I don't see anywhere else that has a community for reaching out and discussing what is here.
This code is stellar, someone has taken the time to port libretro cores (I suspect) to wasm and wrapped it up in a fully HTML5 compliant loader with many bells and whistles like controller support etc, all standardized across each system.

There is a grey area here where people are trying to host rom sites and make ad revenue, but just in general this stack is incredible and it is my hope that the open source community can participate someday in a meaningful way. Being able to run all this stuff in a browser goes beyond the search for ad revenue and breaks into new frontier of compatibility for retro gaming across so many devices that have web browser support.

I guess I am creating this issue to get the discussion started to see if it is possible to get some build logic and source modifications for the current stack. Has anyone had any success with even just introductions to the team or person behind emulatorjs?

Video Pre-roll

Hi all, any idea how to implement the video pre-roll ad tag code below inside emulator.js file?

Ad Tag Code:

<script type="text/javascript">
(function(i,w,d,p,c,e,o,a,s,t){

p.poolid = 74997; 
c.background = null;  
c.close = null;    
c.type = 'game';  

t=d.getElementsByTagName('script');if(!w[i]){w[i]={ads:[]};s=d.createElement('script');s.src=(d.location.protocol=='https:'?'//server':'//cdn')+'.cpmstar.com/cached/js/global_v100.pack.js?poolid='+p.poolid;s.type='text/javascript';s.async='';t[0].parentNode.insertBefore(s,t[0]);}w[i].ads.push(a={params:p,config:c,events:e,overlay:o,placeholder:t[t.length-1]});})('cpmstar',window,document,{},{},{},{});
</script>

Thanks in advance for your usual support!

File type limitations are in the source

Just FYI:

                        'psx': ['bin', 'iso', 'cue', 'img', 'mdf', 'pbp', 'toc', 'cbn', 'm3u'],
                        'nds': ['nds', 'bin'],
                        'nes': ['fds', 'nes', 'unif', 'unf'],
                        'snes': ['smc', 'fig', 'sfc', 'gd3', 'gd7', 'dx2', 'bsx', 'swc'],
                        'snes2002': ['smc', 'fig', 'sfc', 'gd3', 'gd7', 'dx2', 'bsx', 'swc'],
                        'snes2005': ['smc', 'fig', 'sfc', 'gd3', 'gd7', 'dx2', 'bsx', 'swc'],
                        'snes2010': ['smc', 'fig', 'sfc', 'gd3', 'gd7', 'dx2', 'bsx', 'swc'],
                        'gb': ['gb', 'gbc', 'dmg'],
                        'gba': ['gb', 'gbc', 'gba'],
                        'vbanext': ['gba'],
                        'vb': ['vb', 'vboy', 'bin'],
                        '3do': ['iso', 'bin', 'cue'],
                        'lynx': ['lnx'],
                        'jaguar': ['j64', 'jag', 'rom', 'abs', 'cof', 'bin', 'prg'],
                        'a7800': ['a78', 'bin'],
                        'a2600': ['a26', 'bin'],
                        'ngp': ['ngp', 'ngc'],
                        'n64': ['n64', 'v64', 'z64', 'bin', 'u1', 'ndd'],
                        'pce': ['pce', 'bin', 'iso', 'cue', 'ccd', 'img', 'chd'],
                        'sega': ['mdx', 'md', 'smd', 'gen', 'bin', 'iso', 'cue', 'sms', 'gg', 'sg', '68k', 'chd'],
                        'segacd': ['mdx', 'md', 'smd', 'gen', 'bin', 'iso', 'cue', 'sms', 'gg', 'sg', '68k', 'chd'],
                        '32x': ['32x', 'bin', 'gen', 'smd', 'md', 'cue', 'iso', 'sms'],
                        'saturn': ['bin', 'cue', 'iso'],
                        'msx': ['rom', 'mx1', 'mx2', 'dsk', 'cas'],
                        'bluemsx': ['rom', 'ri', 'mx1', 'mx2', 'col', 'dsk', 'cas', 'sg', 'sc', 'm3u'],
                        'ws': ['ws', 'wsc'],
                        'arcade': ['zip'],
                        'fba0.2.97.29': ['zip'],
                        'mame2003': ['zip'],
                        'mame': ['zip']

Along with the emu linking, so IE segaMS supports every file extensions segaMD segaGG etc supports:

                        'psx': 'psx',
                        'nds': 'nds',
                        'nes': 'nes',
                        'snes': 'snes',
                        'snes2002': 'snes2002',
                        'snes2005': 'snes2005',
                        'snes2010': 'snes2010',
                        'gb': 'gb',
                        'gbc': 'gb',
                        'gba': 'gba',
                        'vbanext': 'vbanext',
                        'vb': 'vb',
                        'n64': 'n64',
                        '3do': '3do',
                        'segaMS': 'sega',
                        'segaGG': 'sega',
                        'segaMD': 'sega',
                        'segaCD': 'segacd',
                        'sega32x': '32x',
                        'segaSaturn': 'saturn',
                        'ngp': 'ngp',
                        'pce': 'pce',
                        'msx': 'bluemsx',
                        'atari2600': 'a2600',
                        'atari7800': 'a7800',
                        'lynx': 'lynx',
                        'ws': 'ws',
                        'arcade': 'arcade',
                        'fba0.2.97.29': 'fba0.2.97.29',
                        'jaguar': 'jaguar',
                        'mame2003': 'mame2003'

blob URL's

game URL cannot start with blob:

Can't really do anything about this. Just thought to open this in case I get bored or if someone else wants to do this.

Adverts

How would one add their own adverts into this? The same way EmulatorJS.com did it.

GBA RTC how to Make it open?

i know the vbanext is support the rtc time .
if i run "Pokémon Emerald" the rtc is open,
but i run "Pokemon Radical Red" is not open.

i use other wasm for vbanext ,fist run the "Pokémon Emerald", not close to change roms data to ""Pokemon Radical Red"", game restart ,then the ""Pokemon Radical Red"" will open the rtc time.

Save state on iOS browser and/or override UI logic

Hi there, thanks for your work on this.
I found that the Save State button doesn't work on iOS. I guess it is because that the save file dialog doesn't work iOS browser.

Do you know that if it is possible to save state on iOS browser without any hack?

Any chance that we could override UI logic to save data into indexDB of browser? Any advice will be appreciated.

Thanks again.

SAV

Hello. I was wondering if there was a way to use .sav files for the nds version. thx!

Local host

Is there anyway I could host this just from a micro sd card? with without a webserver?

Emulatorjs to wordpress

Thank you for the detailed explanation.
I would like to put this code on my site, but I am a beginner in JS 😔.
Do I have to upload the entire file to my server?
Can you give me the steps 🙏🙏
Thanks

How to put games on Wordpress?

I am a novice to both Wordpress and Github. After almost a year of work on my website and about 2000 custom CSS lines, it's time to add the games.

I created the FTP folders for the games, the bios and put the unzipped folder of your project.

I put the code you suggest for the Nintendo Gameboy Advance and put the link for bios and game, but it doesn't work. I'm doing something wrong.

`

<script type="text/javascript">
EJS_player = '#game';
EJS_biosUrl = 'public_html/Bios/Nintendo/Gameboy Advance/gba_bios.bin';
EJS_gameUrl = 'public_html/Games/Nintendo/Gameboy Advance/dragonball-z-buu-s-fury-usa.zip'; // Url to Game rom
EJS_core = 'gba';
EJS_pathtodata = 'data/'; //path to all of the wasm and js files. MUST all be in the same directory!!
</script> <script src="data/loader.js"></script>`

Sega Master System support

Hey, great work with this project. I saw that SMS is available on EmulatorJS, so I was wondering if it could be added here as well.

Cheers!

Make usable offline

Working on an offline thingy, want to add this but cant due to it fetching to other sites.

SEGA Saturn emulator not work

saturn-eml

You can check it yourself - https://play.retrogames.onl/saturn/amok-saturn.html .
Fully working emulator Sega Saturn in a browser on the same server with the same ZIP files (bios and cue/iso) files - https://play.retrogames.onl/saturn/amok.html .
If you think that I was mistaken in the HTML code or paths to the emulator files, then here is the proof of another game on the EmulatorJS on the same server - https://play.retrogames.onl/3do/wolfenstein-3do.html .

Please do not write comments like "it works for me" without a screenshot of the running Saturn game on your server with EmulatorJS.

At the moment, it doesn't matter what format the game files are in, because the emulatorjs doesn't even download them.

where are image assets defined?

hello, im trying to find out where image urls are for things like 'save state', 'load state', and 'fullscreen' buttons so that i can make my own assets. any help would be much apreciated!

[Request] Game search

Is it possible to add a search bar per game console to search for a specific game? If you have many roms, scrolling through can take a long while

blank key button

When on the press key screen to program a key, I would like to have a key (or a combination) to clear the key setting. we could also have a button on the screen to set the value to nothing. I think the button would be the best choice.

N64 network error

00723193-095F-4348-B457-B589A4E2F9B2
<script type="text/javascript"> EJS_player = '#game'; EJS_gameUrl = '{$emulatorRom}'; // Url to Game rom EJS_core = 'n64'; EJS_pathtodata = 'assets/data/'; //path to all of the wasm and js files. MUST all be in the same directory!! </script>
does anyone knows any solution all paths set right and im using z64 roms.

Is it possible to extract multiple files for the ROM?

Under the one of the gameurl scripts was libunrar.js, and that JavaScript was able to extract multiple rar files with them being part1.rar to partN.rar. I was wondering if this was possible under the current ussage of the emulator.

Visible "X"

Hi,

I added your codes to my page and it works great without ad. But after loading screen, close button of ad is still visible. I checked your example page, but it doesn't appear. How can I solve it?

image

Open source libs

@ethanaobrien I am in the process of publishing a web based emulator frontend. While building and tying things to emulatorJS I started tinkering with the libretro emscripten cores. I got most of the stuff working pretty much 1:1 compatible with emulatorJS var setting then loader here:
https://github.com/linuxserver/libretrojs

The frontend will be live soon but it can be tested with the docker image lsiodev/emulatorjs :

docker run --rm -it -p 3000:3000 -p 80:80 lsiodev/emulatorjs bash

I am consuming your repo for where I still use emulatorJS (32x, psx, saturn, 3do, n64, ds, pce), it would be cool if you could cut a release so I could ingest at latest release vs the the main branch.

What folders structure on web server?

Error log in google chrome -

loader.js:1 Uncaught ReferenceError: EJS_pathtodata is not defined
at loader.js:1
(anonymous) @ loader.js:1

Place "loader.js" in same folder where "index.html" and in "/data/" folder and in "/emulatorjs/" and in "/emulatorjs/data/" and root. Also change path to "loader.js" file. I don't understand what needs to be changed in "loader.js" file.

I really need a way to "Re-instantiate the class" without reloading the page. Any Ideas?

I've been reading through the loader script and i'm trying to re-init the class

so far i've got this, however it doesn't work 100% as expected.

container id: #gamecontainer

new EJS("#gamecontainer", {
biosUrl: '',
core: 'arcade',
gameUrl: 'mygamehere.zip',
pathtodata: 'data/path/here',
lightgun: false
})

Any ideas? I think the loader js file contains this logic but i'm having trouble decoding it. Any help would be appreciated.

how do I run roms from a github file path

i was wondering how to load a rom using the github path. also, if this script was in the repo of my site would i be able to skip the web server when the scripts are only being run from the same repo?

anyone use this with a framework?

i'm trying to figure out how to run this properly on a Single Page App.

re-instantiating the emulator doesn't work very well.....

any ideas?

/data/saves Browser storage IndexedDB

When launching a game there seems to be logic to store a stateful buffer in browser storage specifically named /data/saves which in turn acts like a memory card for the emulated game and stashes saved game data there for whenever it is re-launched.
For some reason I had it working initially, (have git pulled since then) but when hosting locally those buffers are no longer generated. I have tried walking back in the commit history with no luck.
Can anyone replicate this or am I alone here? (You can check for timestamp entries in the DB from your browser console under application)

Also side note looks like https://www.emulatorjs.com has been updated pretty extensively also added master system support.

load state from url

Hello everyone.
This is a question and not an issue.
IS there a way to customize js code in which users can save their states at server side and load them from there?
Any ideas anyone?

Sega Saturn not load

saturn
If run from the site - emulatorjs.com the problem is similar. Maybe you can understand what the problem is. On my part, there are no errors because the BIOS file and zip archive with the game work without problems on a similar emulator from the site - neptunjs.xyz.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.