Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Allan Niles 2022-05-11 16:49:16 -06:00
commit bfb9be9e33
13 changed files with 665 additions and 6951 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
**/node_modules/

128
CODE_OF_CONDUCT.md Normal file
View file

@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
ethan.a.obrien@gmail.com.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

100
README.md
View file

@ -5,18 +5,34 @@
<br> <br>
<br> <br>
# Allancoding's Version of EmulatorJS
---
## <span style="color: red;">*These are the things that were change*d from: https://github.com/ethanaobrien/emulatorjs</span>
Added code:
- Background image code
- Remove the ad loader after 4.5 seconds
---
[![Badge License]][License] [![Badge License]][License]
Self-hosted **Javascript** emulation for various system. Self-hosted **Javascript** emulation for various system.
<br>
**⸢ [Website] ⸥** [![Badge Website]][Website]
**⸢ [Usage] ⸥** [![Badge Usage]][Usage]<br>
**⸢ [Example] ⸥** [![Badge Configurator]][Configurator]<br>
**⸢ [Demo] ⸥** [![Badge Demo]][Demo]
**⸢ [Beta] ⸥** [![Badge Legacy]][Legacy]
[![Badge Beta]][Beta]
</div> </div>
@ -29,9 +45,11 @@ Self-hosted **Javascript** emulation for various system.
<br> <br>
### Audio ### Extensions
*The* ***Screen Recording*** *option currently doesn't support* ***Audio*** *.* **[GameLibrary]**
*A library overview for your **ROM** folder.*
<br> <br>
@ -110,41 +128,67 @@ EJS_BETA = true;
<br> <br>
<!----------------------------------------------------------------------------->
[Badge License]: https://img.shields.io/badge/License-GPLv3-blue.svg <!-- 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 --->
[License]: LICENSE [License]: LICENSE
[Issue]: https://github.com/ethanaobrien/emulatorjs/issues [Issue]: https://github.com/ethanaobrien/emulatorjs/issues
[Example]: https://coldcast.org/games/1/Super-Mario-Bros <!-- 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 Extensions 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 --->
[GameLibrary]: https://github.com/Ramaerel/emulatorjs-GameLibrary
<!-- 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 Quicklinks 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 --->
[Configurator]: https://emulatorjs.ga/codehelper
[Website]: https://emulatorjs.ga/ [Website]: https://emulatorjs.ga/
[Legacy]: https://coldcast.org/games/1/Super-Mario-Bros
[Usage]: docs/Usage.md [Usage]: docs/Usage.md
[Demo]: https://emulatorjs.ga/demo/ [Demo]: https://emulatorjs.ga/demo/
[Beta]: https://emulatorjs.ga/beta/ [Beta]: https://emulatorjs.ga/beta/
[NES / Famicom]: docs/Systems/NES-Famicom.md
[SNES]: docs/Systems/SNES.md <!-- 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 Systems 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 -->
[Nintendo 64]: docs/Systems/Nintendo%2064.md
[Nintendo Game Boy]: docs/Systems/Nintendo%20Game%20Boy.md
[Nintendo Game Boy Advance]: docs/Systems/Nintendo%20Game%20Boy%20Advance.md [Nintendo Game Boy Advance]: docs/Systems/Nintendo%20Game%20Boy%20Advance.md
[Nintendo Game Boy]: docs/Systems/Nintendo%20Game%20Boy.md
[Nintendo 64]: docs/Systems/Nintendo%2064.md
[Nintendo DS]: docs/Systems/Nintendo%20DS.md [Nintendo DS]: docs/Systems/Nintendo%20DS.md
[PlayStation]: docs/Systems/PlayStation.md
[Virtual Boy]: docs/Systems/Virtual%20Boy.md
[Sega Mega Drive]: docs/Systems/Sega%20Mega%20Drive.md
[Sega Master System]: docs/Systems/Sega%20Master%20System.md [Sega Master System]: docs/Systems/Sega%20Master%20System.md
[Sega CD]: docs/Systems/Sega%20CD.md [Sega Mega Drive]: docs/Systems/Sega%20Mega%20Drive.md
[Atari Lynx]: docs/Systems/Atari%20Lynx.md
[MSX]: docs/Systems/MSX.md
[3DO]: docs/Systems/3DO.md
[Sega 32X]: docs/Systems/Sega%2032X.md
[Atari Jaguar]: docs/Systems/Atari%20Jaguar.md
[Neo Geo Poket]: docs/Systems/Neo%20Geo%20Poket.md
[Sega Game Gear]: docs/Systems/Sega%20Game%20Gear.md [Sega Game Gear]: docs/Systems/Sega%20Game%20Gear.md
[Sega Saturn]: docs/Systems/Sega%20Saturn.md [Sega Saturn]: docs/Systems/Sega%20Saturn.md
[Sega 32X]: docs/Systems/Sega%2032X.md
[Sega CD]: docs/Systems/Sega%20CD.md
[Atari Jaguar]: docs/Systems/Atari%20Jaguar.md
[Atari Lynx]: docs/Systems/Atari%20Lynx.md
[Atari 7800]: docs/Systems/Atari%207800.md [Atari 7800]: docs/Systems/Atari%207800.md
[WanderSwan / Color]: docs/Systems/WanderSwan-Color.md
[TurboGrafs-16 / PC Engine]: docs/Systems/TurboGrafs%2016-PC%20Engine.md
[Arcade]: docs/Systems/Arcade.md
[Atari 2600]: docs/Systems/Atari%202600.md [Atari 2600]: docs/Systems/Atari%202600.md
[NES / Famicom]: docs/Systems/NES-Famicom.md
[SNES]: docs/Systems/SNES.md
[TurboGrafs-16 / PC Engine]: docs/Systems/TurboGrafs%2016-PC%20Engine.md
[WanderSwan / Color]: docs/Systems/WanderSwan-Color.md
[Neo Geo Poket]: docs/Systems/Neo%20Geo%20Poket.md
[PlayStation]: docs/Systems/PlayStation.md
[Virtual Boy]: docs/Systems/Virtual%20Boy.md
[Arcade]: docs/Systems/Arcade.md
[MSX]: docs/Systems/MSX.md
[3DO]: docs/Systems/3DO.md
<!-- 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 Badges 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 --->
[Badge License]: https://img.shields.io/badge/License-GPLv3-blue.svg?style=for-the-badge
[Badge Configurator]: https://img.shields.io/badge/Configurator-992cb3?style=for-the-badge
[Badge Website]: https://img.shields.io/badge/Website-736e9b?style=for-the-badge
[Badge Legacy]: https://img.shields.io/badge/Legacy-ab910b?style=for-the-badge
[Badge Usage]: https://img.shields.io/badge/Usage-2478b5?style=for-the-badge
[Badge Demo]: https://img.shields.io/badge/Demo-528116?style=for-the-badge
[Badge Beta]: https://img.shields.io/badge/Beta-bb044f?style=for-the-badge

View file

@ -5,7 +5,6 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
window.EJS_RESET_VARS.push(k); window.EJS_RESET_VARS.push(k);
} }
_0x2c1832.r(_0x17edbf); _0x2c1832.r(_0x17edbf);
_0x2c1832(0xa2), _0x2c1832(0x16c), _0x2c1832(0x16d);
var _0x39ca5e = { var _0x39ca5e = {
'volume': 0.5, 'volume': 0.5,
'muted': false, 'muted': false,
@ -99,7 +98,7 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
'tabFocus': 'ejs__tab-focus' 'tabFocus': 'ejs__tab-focus'
} }
}, },
_0x3d61f9 = _0x2c1832(0x38), renderErrorPage = _0x2c1832(0),
_0x5127f4 = _0x2c1832(0x9d), _0x5127f4 = _0x2c1832(0x9d),
_0x48e5ff = _0x2c1832.n(_0x5127f4), _0x48e5ff = _0x2c1832.n(_0x5127f4),
_0x406e79 = function(_0x2aa74f) { _0x406e79 = function(_0x2aa74f) {
@ -584,10 +583,10 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
} }
}]) && _0x4c97b0(_0x17edbf.prototype, _0x2c1832), _0x4496fc && _0x4c97b0(_0x17edbf, _0x4496fc), _0x566dbe; }]) && _0x4c97b0(_0x17edbf.prototype, _0x2c1832), _0x4496fc && _0x4c97b0(_0x17edbf, _0x4496fc), _0x566dbe;
}(); }();
var _0x13fb79, _0x569918 = _0x2c1832(0x6c), var _0x13fb79, _0x569918 = _0x2c1832(108),
_0x4e4ca6 = _0x2c1832.n(_0x569918), _0x4e4ca6 = _0x2c1832.n(_0x569918),
_0x4ad1c6 = _0x2c1832(0x6), _0x4ad1c6 = _0x2c1832(6),
_0x4704b1 = _0x2c1832(0x9f), _0x4704b1 = _0x2c1832(159),
_0x3a58c8 = _0x2c1832.n(_0x4704b1), _0x3a58c8 = _0x2c1832.n(_0x4704b1),
_0x5032e6 = { _0x5032e6 = {
'2xScaleHQ.glslp': 'shaders = 1\n\nshader0 = "2xScaleHQ.glsl"\nfilter_linear0 = false\nscale_type_0 = source\n', '2xScaleHQ.glslp': 'shaders = 1\n\nshader0 = "2xScaleHQ.glsl"\nfilter_linear0 = false\nscale_type_0 = source\n',
@ -604,7 +603,7 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
_0x5bb4c9 = _0x2c1832(0x39), _0x5bb4c9 = _0x2c1832(0x39),
_0x50f370 = _0x2c1832.n(_0x5bb4c9), _0x50f370 = _0x2c1832.n(_0x5bb4c9),
_0x246d02 = _0x2c1832(0xb), _0x246d02 = _0x2c1832(0xb),
_0x550f17 = _0x2c1832.n(_0x246d02), _0x550f17 = _0x2c1832.n(_0x246d02).a,
_0x5ab74d = { _0x5ab74d = {
'addStyleHook': function() { 'addStyleHook': function() {
_0x3a8e2f(this.elements.container, this.config.selectors.container.replace('.', ''), true), _0x3a8e2f(this.elements.container, this.config.classNames.uiSupported, true), _0x3a8e2f(this.elements.container, this.config.classNames.hideControls, true); _0x3a8e2f(this.elements.container, this.config.selectors.container.replace('.', ''), true), _0x3a8e2f(this.elements.container, this.config.classNames.uiSupported, true), _0x3a8e2f(this.elements.container, this.config.classNames.hideControls, true);
@ -627,6 +626,39 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
} }
} }
}; };
_0x550f17.a.get = function(oldGet) {
return function(url, set) {
if (url.startsWith('blob:')) {
return new Promise(async function(resolve, reject) {
var a = await fetch(url);
if (set && set.responseType && set.responseType.toLowerCase() === 'arraybuffer') {
a = await a.arrayBuffer();
} else {
a = await a.text();
try {
a = JSON.parse(a);
} catch(e) {}
}
resolve({data:a});
})
} else {
return oldGet.apply(null, arguments);
}
}
}(_0x550f17.a.get);
_0x550f17.a.head = function(oldHead) {
return function(url) {
if (url.startsWith('blob:')) {
return new Promise(async function(resolve, reject) {
var a = await fetch(url);
a = await a.arrayBuffer();
resolve({headers:{'content-length': a.size}});
})
} else {
return oldHead.apply(null, arguments);
}
}
}(_0x550f17.a.head);
function _0x5272a8(_0x4d422a) { function _0x5272a8(_0x4d422a) {
return (_0x5272a8 = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function(_0x241239) { return (_0x5272a8 = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function(_0x241239) {
@ -1441,6 +1473,13 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
_0xb0c5d8 = -0x1, _0xb0c5d8 = -0x1,
_0x567713 = '', _0x567713 = '',
_0x567717 = function() { _0x567717 = function() {
var mainLoop = _0x4d7024.Module.cwrap('toggleMainLoop', 'null', ['number']);
_0x4d7024.Module.resumeMainLoop = function() {
mainLoop(1);
}
_0x4d7024.Module.pauseMainLoop = function() {
mainLoop(0);
}
if (typeof _0x55627a.loadStateOnStart == 'string') { if (typeof _0x55627a.loadStateOnStart == 'string') {
fetch(_0x55627a.loadStateOnStart).then(function(response) { fetch(_0x55627a.loadStateOnStart).then(function(response) {
response.arrayBuffer().then(function(ab) { response.arrayBuffer().then(function(ab) {
@ -1563,16 +1602,14 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
_0x139f1c = _0x154dc5[_0x154dc5.length - 0x1]; _0x139f1c = _0x154dc5[_0x154dc5.length - 0x1];
_0x139f1c.indexOf('?') > -0x1 && (_0x139f1c = _0x139f1c.substr(0x0, _0x139f1c.indexOf('?'))); _0x139f1c.indexOf('?') > -0x1 && (_0x139f1c = _0x139f1c.substr(0x0, _0x139f1c.indexOf('?')));
_0x139f1c.split('.').pop(); _0x139f1c.split('.').pop();
_0x2c1832.innerHTML = _0xa88a13.localization('Download Game Data'), ['arcade', 'mame', 'mame2003', 'fba0.2.97.29'].includes(_0x17edbf.system) && _0x17edbf.config.gameParentUrl && (_0x2c1832.innerHTML += ' (2/2)'), _0x17edbf.config.gamePatchUrl && (_0x2c1832.innerHTML += ' (2/2)'); _0x2c1832.innerHTML = _0xa88a13.localization('Download Game Data');
new Promise(async function(resolve, reject) { if (['arcade', 'mame', 'mame2003', 'fba0.2.97.29'].includes(_0x17edbf.system) && _0x17edbf.config.gameParentUrl) {
if (! _0x3cf3cf.startsWith('blob:')) { _0x2c1832.innerHTML += ' (2/2)';
resolve(await _0x550f17.a.head(_0x3cf3cf, {})) }
} else { if (_0x17edbf.config.gamePatchUrl) {
var a = await fetch(_0x3cf3cf) _0x2c1832.innerHTML += ' (2/2)';
var a = await a.blob() }
resolve({headers:{'content-length': a.size, 'content-type': 'text/plain'}}) _0x550f17.a.head(_0x3cf3cf, {}).then(function(_0x3d703e) {
}
}).then(function(_0x3d703e) {
var _0x21b526 = _0x3d703e.headers['content-length'], var _0x21b526 = _0x3d703e.headers['content-length'],
_0x7e8d4c = _0x3d703e.headers['content-type'], _0x7e8d4c = _0x3d703e.headers['content-type'],
_0x107e8a = (_0x3d703e.headers['last-modified'], '' .concat(_0x594488, '-').concat(_0x139f1c)), _0x107e8a = (_0x3d703e.headers['last-modified'], '' .concat(_0x594488, '-').concat(_0x139f1c)),
@ -1620,7 +1657,7 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
}); });
_0x3512e9(_0x139f1c, _0x17edbf); _0x3512e9(_0x139f1c, _0x17edbf);
}).catch(function(_0x2e4d62) { }).catch(function(_0x2e4d62) {
console.log(_0x2e4d62), _0x2c1832.innerHTML = '<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+_0xa88a13.localization('Network Error')+'</strong>'; renderErrorPage(_0x2e4d62, _0x2c1832, _0xa88a13);
}); });
}; };
_0x1ffb98.db ? _0x1ffb98.get(_0x107e8a, function(_0x5afc4a) { _0x1ffb98.db ? _0x1ffb98.get(_0x107e8a, function(_0x5afc4a) {
@ -1644,7 +1681,7 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
else _0x43a689(); else _0x43a689();
}) : _0x43a689(); }) : _0x43a689();
}).catch(function(_0x5ec6be) { }).catch(function(_0x5ec6be) {
_0x2c1832.innerHTML = '<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+_0xa88a13.localization('Network Error')+'</strong>'; renderErrorPage(_0x5ec6be, _0x2c1832, _0xa88a13);
}); });
}, },
_0x139f68 = function() { _0x139f68 = function() {
@ -1655,7 +1692,8 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
_0x179b43 = _0x227b23[_0x227b23.length - 0x1]; _0x179b43 = _0x227b23[_0x227b23.length - 0x1];
_0x179b43.indexOf('?') > -0x1 && (_0x179b43 = _0x179b43.substr(0x0, _0x179b43.indexOf('?'))); _0x179b43.indexOf('?') > -0x1 && (_0x179b43 = _0x179b43.substr(0x0, _0x179b43.indexOf('?')));
_0x179b43.split('.').pop(); _0x179b43.split('.').pop();
_0x2591d9.innerHTML = _0xa88a13.localization('Download Game Data')+' (1/2)', _0x550f17.a.get(_0x5c896f, { _0x2591d9.innerHTML = _0xa88a13.localization('Download Game Data')+' (1/2)';
_0x550f17.a.get(_0x5c896f, {
'onDownloadProgress': function(_0x3da9ab) { 'onDownloadProgress': function(_0x3da9ab) {
_0x2591d9.innerHTML = _0xa88a13.localization('Download Game Data')+' (1/2) '; _0x2591d9.innerHTML = _0xa88a13.localization('Download Game Data')+' (1/2) ';
var _0x17edbf = _0x3da9ab.total ? '' .concat(Math.floor(_0x3da9ab.loaded / _0x3da9ab.total * 0x64), '%') : ''; var _0x17edbf = _0x3da9ab.total ? '' .concat(Math.floor(_0x3da9ab.loaded / _0x3da9ab.total * 0x64), '%') : '';
@ -1693,7 +1731,7 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
}), _0x4c332a = true), _0x4c332a || (_0x468801 += _0x1097ca.length, _0x4d7024.gamePatch = '/' .concat(_0xe531f0), _0x4d7024._FS.createDataFile('/', _0xe531f0, _0x1097ca, true, !0x1), _0x5048db()); }), _0x4c332a = true), _0x4c332a || (_0x468801 += _0x1097ca.length, _0x4d7024.gamePatch = '/' .concat(_0xe531f0), _0x4d7024._FS.createDataFile('/', _0xe531f0, _0x1097ca, true, !0x1), _0x5048db());
}(_0x179b43, _0x39a81f); }(_0x179b43, _0x39a81f);
}).catch(function(_0x314293) { }).catch(function(_0x314293) {
console.log(_0x314293), _0x2591d9.innerHTML = '<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+_0xa88a13.localization('Network Error')+'</strong>'; renderErrorPage(_0x314293, _0x2c1832, _0xa88a13);
}); });
} else _0x5048db(); } else _0x5048db();
}, },
@ -1758,7 +1796,7 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
console.log(_0x125736); console.log(_0x125736);
} }
}).catch(function(_0x516cc3) { }).catch(function(_0x516cc3) {
console.log(_0x516cc3), _0x2c1832.innerHTML = '<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+_0xa88a13.localization('Network Error')+'</strong>'; renderErrorPage(_0x516cc3, _0x2c1832, _0xa88a13);
}); });
}; };
_0x1ffb98.db ? _0x1ffb98.get(_0x316472, function(_0x3e612b) { _0x1ffb98.db ? _0x1ffb98.get(_0x316472, function(_0x3e612b) {
@ -1778,7 +1816,7 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
else _0x31f098(); else _0x31f098();
}) : _0x31f098(); }) : _0x31f098();
}).catch(function(_0x20f2e3) { }).catch(function(_0x20f2e3) {
_0x2c1832.innerHTML = '<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+_0xa88a13.localization('Network Error')+'</strong>'; renderErrorPage(_0x20f2e3, _0x2c1832, _0xa88a13);
}); });
} else _0x139f68(); } else _0x139f68();
}, },
@ -1887,14 +1925,14 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
'data': _0x17edbf 'data': _0x17edbf
}), _0x57d85d(_0x103241, _0x17edbf); }), _0x57d85d(_0x103241, _0x17edbf);
}).catch(function(_0x58e374) { }).catch(function(_0x58e374) {
_0x1f8424.innerHTML = '<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+_0xa88a13.localization('Network Error')+'</strong>'; renderErrorPage(_0x58e374, _0x1f8424, _0xa88a13);
}); });
}; };
_0xa884ea.db ? _0xa884ea.get(_0x51bfef, function(_0x5cac21) { _0xa884ea.db ? _0xa884ea.get(_0x51bfef, function(_0x5cac21) {
_0x5cac21 && _0x5cac21.filename === _0x103241 && _0x5cac21.filesize - _0x8e30bf == 0x0 && _0x5cac21.filetype === _0x14309b ? _0x57d85d(_0x5cac21.filename, _0x5cac21.data) : _0x574747(); _0x5cac21 && _0x5cac21.filename === _0x103241 && _0x5cac21.filesize - _0x8e30bf == 0x0 && _0x5cac21.filetype === _0x14309b ? _0x57d85d(_0x5cac21.filename, _0x5cac21.data) : _0x574747();
}) : _0x574747(); }) : _0x574747();
}).catch(function(_0x4f39c1) { }).catch(function(_0x4f39c1) {
_0x1f8424.innerHTML = '<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+_0xa88a13.localization('Network Error')+'</strong>'; renderErrorPage(_0x4f39c1, _0x1f8424, _0xa88a13);
}); });
} else _0x452592(); } else _0x452592();
}, },
@ -2026,7 +2064,7 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
} }
}).catch(function(_0x2e06c8) { }).catch(function(_0x2e06c8) {
_0x3787ba.innerHTML = '<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+_0x2c1832.localization('Network Error')+'</strong>'; renderErrorPage(_0x2e06c8, _0x3787ba, _0xc6823);
}); });
}; };
_0x550f17.a.get(_0xa88a13, {}).then(function(_0x578a2b) { _0x550f17.a.get(_0xa88a13, {}).then(function(_0x578a2b) {
@ -2122,20 +2160,13 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
} else _0x3641d6(_0x2458d5, _0x124167); } else _0x3641d6(_0x2458d5, _0x124167);
}) : _0x3641d6(_0x2458d5, _0x124167); }) : _0x3641d6(_0x2458d5, _0x124167);
} }
if (_0x2c1832.coreVer === 2) { if (_0x2c1832.coreVer === 2 && !('undefined' != typeof EJS_DEBUG_XX && true === EJS_DEBUG_XX)) {
_0x1e2c68.element(_0x2c1832.elements.buttons.gamepad) && _0x132da7(_0x2c1832.elements.buttons.gamepad, true); _0x1e2c68.element(_0x2c1832.elements.buttons.gamepad) && _0x132da7(_0x2c1832.elements.buttons.gamepad, true);
if (Array.isArray(_0x2c1832.elements.buttons.play)) {
for (var i=0; i<_0x2c1832.elements.buttons.play.length; i++) {
_0x1e2c68.element(_0x2c1832.elements.buttons.play[i]) && _0x132da7(_0x2c1832.elements.buttons.play[i], true);
}
} else {
_0x1e2c68.element(_0x2c1832.elements.buttons.play) && _0x132da7(_0x2c1832.elements.buttons.play, true);
}
} }
_0x254bc2 || _0x1e2c68.element(_0x2c1832.elements.buttons.netplay) && _0x132da7(_0x2c1832.elements.buttons.netplay, true), _0x1e2c68.element(_0x2c1832.elements.buttons.saveState) && _0x132da7(_0x2c1832.elements.buttons.saveState, !_0x5b1dcd), _0x1e2c68.element(_0x2c1832.elements.buttons.loadState) && _0x132da7(_0x2c1832.elements.buttons.loadState, !_0x5b1dcd), _0x132da7(_0x2593da.contextMenu.querySelectorAll('ul li').item(0x2), !_0x5b1dcd), _0x132da7(_0x2593da.contextMenu.querySelectorAll('ul li').item(0x3), !_0x5b1dcd); _0x254bc2 || _0x1e2c68.element(_0x2c1832.elements.buttons.netplay) && _0x132da7(_0x2c1832.elements.buttons.netplay, true), _0x1e2c68.element(_0x2c1832.elements.buttons.saveState) && _0x132da7(_0x2c1832.elements.buttons.saveState, !_0x5b1dcd), _0x1e2c68.element(_0x2c1832.elements.buttons.loadState) && _0x132da7(_0x2c1832.elements.buttons.loadState, !_0x5b1dcd), _0x132da7(_0x2593da.contextMenu.querySelectorAll('ul li').item(0x2), !_0x5b1dcd), _0x132da7(_0x2593da.contextMenu.querySelectorAll('ul li').item(0x3), !_0x5b1dcd);
_0xc6823.setStatesSupported(_0x5b1dcd); _0xc6823.setStatesSupported(_0x5b1dcd);
}).catch(function(_0x2d06a9) { }).catch(function(_0x2d06a9) {
_0x3787ba.innerHTML = '<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+_0x2c1832.localization('Network Error')+'</strong>'; renderErrorPage(_0x2d06a9, _0x3787ba, _0xc6823);
}), clearInterval(_0x1c9c57), _0x4d7024.romdb = _0x4e171c; }), clearInterval(_0x1c9c57), _0x4d7024.romdb = _0x4e171c;
} }
}, 0x1f4); }, 0x1f4);
@ -3452,7 +3483,7 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
var _0xa88a13 = this, var _0xa88a13 = this,
_0x17edbf = this, _0x17edbf = this,
_0x2c1832 = this.elements.dialogs.gamepad.querySelector('.' .concat(_0x378b5c.classNames.overlay)), _0x2c1832 = this.elements.dialogs.gamepad.querySelector('.' .concat(_0x378b5c.classNames.overlay)),
_0x181250 = new _0x4ad1c6[('Gamepad')](); _0x181250 = new _0x4ad1c6.Gamepad();
_0x378b5c.gamepad = _0x181250, _0x181250.init() && (_0x181250.bind(_0x4ad1c6.Gamepad.Event.TICK, function(_0x2fe35d) { _0x378b5c.gamepad = _0x181250, _0x181250.init() && (_0x181250.bind(_0x4ad1c6.Gamepad.Event.TICK, function(_0x2fe35d) {
_0x2fe35d.forEach(function(_0x2b21f8) { _0x2fe35d.forEach(function(_0x2b21f8) {
var _0x17edbf; var _0x17edbf;
@ -3810,30 +3841,12 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
inputLocation = _0x2593da.getCoreOptionsValues()['joystick-input']; inputLocation = _0x2593da.getCoreOptionsValues()['joystick-input'];
} }
if (inputLocation === 'd-pad') { if (inputLocation === 'd-pad') {
return { return {downVal:1,4:4,5:5,6:6,7:7};
downVal: 1,
4: 4,
5: 5,
6: 6,
7: 7
}
} else { } else {
return { return {downVal:0x7fff,4:19,5:18,6:17,7:16};
downVal: 0x7fff,
4: 19,
5: 18,
6: 17,
7: 16
}
} }
} else { } else {
return { return {downVal:1,4:4,5:5,6:6,7:7};
downVal: 1,
4: 4,
5: 5,
6: 6,
7: 7
}
} }
} }
_0x17edbf.on('end', function(_0x27f006, _0x1fb527) { _0x17edbf.on('end', function(_0x27f006, _0x1fb527) {
@ -3868,92 +3881,28 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
_0x2ae626.stopPropagation(); _0x2ae626.stopPropagation();
}); });
} }
_0x1093f4.call(this, _0x530042.call(this, '.' .concat(_0x2c1832, ' .').concat(_0x449eac({ [
'b_a': true {id: {"b_a":true},number: 8},
}))), 'touchstart touchend mousedown mouseup mouseout', function(_0x185083) { {id: {"b_b":true},number: 0},
['touchend', 'mouseup', 'mouseout'].includes(_0x185083.type) ? (_0x3a8e2f(_0x185083.target, _0x2ec721, !0x1), window.setTimeout(function() { {id: {"b_x":true},number: 9},
_0x378b5c.syncInput(0x0, 0x8, 0x0); {id: {"b_y":true},number: 1},
}, 0x1e)) : (_0x3a8e2f(_0x185083.target, _0x2ec721, true), _0x378b5c.syncInput(0x0, 0x8, 0x1)), _0x185083.stopPropagation(); {id: {"b_l":true},number: 10},
{id: {"b_z":true},number: 12},
{id: {"b_r":true},number: 11},
{id: {"b_start":true},number: 3},
{id: {"b_select":true},number: 2},
{id: {"b_cu":true},number: 23},
{id: {"b_cd":true},number: 22},
{id: {"b_cl":true},number: 21},
{id: {"b_cr":true},number: 20}
].forEach((a) => {
_0x1093f4.call(this, _0x530042.call(this, '.'.concat(_0x2c1832, ' .').concat(_0x449eac(a.id))),
'touchstart touchend mousedown mouseup mouseout', function(e) {
['touchend', 'mouseup', 'mouseout'].includes(e.type) ? (_0x3a8e2f(e.target, _0x2ec721, false), window.setTimeout(function() {
_0x378b5c.syncInput(0, a.number, 0);
}, 30)) : (_0x3a8e2f(e.target, _0x2ec721, true), _0x378b5c.syncInput(0, a.number, 1)), e.stopPropagation();
})
}); });
_0x1093f4.call(this, _0x530042.call(this, '.' .concat(_0x2c1832, ' .').concat(_0x449eac({
'b_b': true
}))), 'touchstart touchend mousedown mouseup mouseout', function(_0x213c3d) {
['touchend', 'mouseup', 'mouseout'].includes(_0x213c3d.type) ? (_0x3a8e2f(_0x213c3d.target, _0x2ec721, !0x1), window.setTimeout(function() {
_0x378b5c.syncInput(0x0, 0x0, 0x0);
}, 0x1e)) : (_0x3a8e2f(_0x213c3d.target, _0x2ec721, true), _0x378b5c.syncInput(0x0, 0x0, 0x1)), _0x213c3d.stopPropagation();
});
_0x1093f4.call(this, _0x530042.call(this, '.' .concat(_0x2c1832, ' .').concat(_0x449eac({
'b_x': true
}))), 'touchstart touchend mousedown mouseup mouseout', function(_0x5ce708) {
['touchend', 'mouseup', 'mouseout'].includes(_0x5ce708.type) ? (_0x3a8e2f(_0x5ce708.target, _0x2ec721, !0x1), window.setTimeout(function() {
_0x378b5c.syncInput(0x0, 0x9, 0x0);
}, 0x1e)) : (_0x3a8e2f(_0x5ce708.target, _0x2ec721, true), _0x378b5c.syncInput(0x0, 0x9, 0x1)), _0x5ce708.stopPropagation();
});
_0x1093f4.call(this, _0x530042.call(this, '.' .concat(_0x2c1832, ' .').concat(_0x449eac({
'b_y': true
}))), 'touchstart touchend mousedown mouseup mouseout', function(_0x1cfae6) {
['touchend', 'mouseup', 'mouseout'].includes(_0x1cfae6.type) ? (_0x3a8e2f(_0x1cfae6.target, _0x2ec721, !0x1), window.setTimeout(function() {
_0x378b5c.syncInput(0x0, 0x1, 0x0);
}, 0x1e)) : (_0x3a8e2f(_0x1cfae6.target, _0x2ec721, true), _0x378b5c.syncInput(0x0, 0x1, 0x1)), _0x1cfae6.stopPropagation();
});
_0x1093f4.call(this, _0x530042.call(this, '.' .concat(_0x2c1832, ' .').concat(_0x449eac({
'b_l': true
}))), 'touchstart touchend mousedown mouseup mouseout', function(_0x1a50ab) {
['touchend', 'mouseup', 'mouseout'].includes(_0x1a50ab.type) ? (_0x3a8e2f(_0x1a50ab.target, _0x2ec721, !0x1), window.setTimeout(function() {
_0x378b5c.syncInput(0x0, 0xa, 0x0);
}, 0x1e)) : (_0x3a8e2f(_0x1a50ab.target, _0x2ec721, true), _0x378b5c.syncInput(0x0, 0xa, 0x1)), _0x1a50ab.stopPropagation();
});
_0x1093f4.call(this, _0x530042.call(this, '.' .concat(_0x2c1832, ' .').concat(_0x449eac({
'b_z': true
}))), 'touchstart touchend mousedown mouseup mouseout', function(_0x1a50ab) {
['touchend', 'mouseup', 'mouseout'].includes(_0x1a50ab.type) ? (_0x3a8e2f(_0x1a50ab.target, _0x2ec721, !0x1), window.setTimeout(function() {
_0x378b5c.syncInput(0x0, 12, 0x0);
}, 0x1e)) : (_0x3a8e2f(_0x1a50ab.target, _0x2ec721, true), _0x378b5c.syncInput(0x0, 12, 0x1)), _0x1a50ab.stopPropagation();
});
_0x1093f4.call(this, _0x530042.call(this, '.' .concat(_0x2c1832, ' .').concat(_0x449eac({
'b_r': true
}))), 'touchstart touchend mousedown mouseup mouseout', function(_0x3b8139) {
['touchend', 'mouseup', 'mouseout'].includes(_0x3b8139.type) ? (_0x3a8e2f(_0x3b8139.target, _0x2ec721, !0x1), window.setTimeout(function() {
_0x378b5c.syncInput(0x0, 0xb, 0x0);
}, 0x1e)) : (_0x3a8e2f(_0x3b8139.target, _0x2ec721, true), _0x378b5c.syncInput(0x0, 0xb, 0x1)), _0x3b8139.stopPropagation();
});
_0x1093f4.call(this, _0x530042.call(this, '.' .concat(_0x2c1832, ' .').concat(_0x449eac({
'b_start': true
}))), 'touchstart touchend mousedown mouseup mouseout', function(_0x47af91) {
['touchend', 'mouseup', 'mouseout'].includes(_0x47af91.type) ? (_0x3a8e2f(_0x47af91.target, _0x2ec721, !0x1), window.setTimeout(function() {
_0x378b5c.syncInput(0x0, 0x3, 0x0);
}, 0x1e)) : (_0x3a8e2f(_0x47af91.target, _0x2ec721, true), _0x378b5c.syncInput(0x0, 0x3, 0x1)), _0x47af91.stopPropagation();
});
_0x1093f4.call(this, _0x530042.call(this, '.' .concat(_0x2c1832, ' .').concat(_0x449eac({
'b_cu': true
}))), 'touchstart touchend mousedown mouseup mouseout', function(_0x47af91) {
['touchend', 'mouseup', 'mouseout'].includes(_0x47af91.type) ? (_0x3a8e2f(_0x47af91.target, _0x2ec721, !0x1), window.setTimeout(function() {
_0x378b5c.syncInput(0, 23, 0);
}, 0x1e)) : (_0x3a8e2f(_0x47af91.target, _0x2ec721, true), _0x378b5c.syncInput(0, 23, 0x7fff)), _0x47af91.stopPropagation();
});
_0x1093f4.call(this, _0x530042.call(this, '.' .concat(_0x2c1832, ' .').concat(_0x449eac({
'b_cd': true
}))), 'touchstart touchend mousedown mouseup mouseout', function(_0x47af91) {
['touchend', 'mouseup', 'mouseout'].includes(_0x47af91.type) ? (_0x3a8e2f(_0x47af91.target, _0x2ec721, !0x1), window.setTimeout(function() {
_0x378b5c.syncInput(0, 22, 0);
}, 0x1e)) : (_0x3a8e2f(_0x47af91.target, _0x2ec721, true), _0x378b5c.syncInput(0, 22, 0x7fff)), _0x47af91.stopPropagation();
});
_0x1093f4.call(this, _0x530042.call(this, '.' .concat(_0x2c1832, ' .').concat(_0x449eac({
'b_cl': true
}))), 'touchstart touchend mousedown mouseup mouseout', function(_0x47af91) {
['touchend', 'mouseup', 'mouseout'].includes(_0x47af91.type) ? (_0x3a8e2f(_0x47af91.target, _0x2ec721, !0x1), window.setTimeout(function() {
_0x378b5c.syncInput(0, 21, 0);
}, 0x1e)) : (_0x3a8e2f(_0x47af91.target, _0x2ec721, true), _0x378b5c.syncInput(0, 21, 0x7fff)), _0x47af91.stopPropagation();
});
_0x1093f4.call(this, _0x530042.call(this, '.' .concat(_0x2c1832, ' .').concat(_0x449eac({
'b_cr': true
}))), 'touchstart touchend mousedown mouseup mouseout', function(_0x47af91) {
['touchend', 'mouseup', 'mouseout'].includes(_0x47af91.type) ? (_0x3a8e2f(_0x47af91.target, _0x2ec721, !0x1), window.setTimeout(function() {
_0x378b5c.syncInput(0, 20, 0);
}, 0x1e)) : (_0x3a8e2f(_0x47af91.target, _0x2ec721, true), _0x378b5c.syncInput(0, 20, 0x7fff)), _0x47af91.stopPropagation();
});
var hideTimeout; var hideTimeout;
_0x1093f4.call(this, _0x530042.call(this, '.' .concat(_0x2c1832, ' .').concat(_0x449eac({ _0x1093f4.call(this, _0x530042.call(this, '.' .concat(_0x2c1832, ' .').concat(_0x449eac({
'b_c': true 'b_c': true
@ -3969,13 +3918,6 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
}, 5000) }, 5000)
} }
}); });
_0x1093f4.call(this, _0x530042.call(this, '.' .concat(_0x2c1832, ' .').concat(_0x449eac({
'b_select': true
}))), 'touchstart touchend mousedown mouseup mouseout', function(_0x37f594) {
['touchend', 'mouseup', 'mouseout'].includes(_0x37f594.type) ? (_0x3a8e2f(_0x37f594.target, _0x2ec721, !0x1), window.setTimeout(function() {
_0x378b5c.syncInput(0x0, 0x2, 0x0);
}, 0x1e)) : (_0x3a8e2f(_0x37f594.target, _0x2ec721, true), _0x378b5c.syncInput(0x0, 0x2, 0x1)), _0x37f594.stopPropagation();
});
} else _0x132da7(_0x378b5c.virtualGamepadContainer, !_0x1ed80b); } else _0x132da7(_0x378b5c.virtualGamepadContainer, !_0x1ed80b);
}, },
'setup': function() { 'setup': function() {
@ -4052,9 +3994,8 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
_0xa88a13.recordData = {started:false, data:[], stopped: false} _0xa88a13.recordData = {started:false, data:[], stopped: false}
} }
if (! _0xa88a13.recordData.started) { //start recording if (! _0xa88a13.recordData.started) { //start recording
_0xa88a13.elements.buttons.screenRecord.getElementsByClassName('ejs--74c6d4176d27e37a19d2e9e61de8f4')[0].innerHTML = _0xa88a13.localization('Stop Screen Recording');
if (MediaRecorder.isTypeSupported('video/webm; codecs=h264')) { if (MediaRecorder.isTypeSupported('video/webm; codecs=h264')) {
var options = {mimeType: 'video/webm; codecs=h264'}; // video/webm; codecs=h264,opus var options = {mimeType: 'video/webm; codecs=h264'};
} else if (MediaRecorder.isTypeSupported('video/webm; codecs=H264')) { } else if (MediaRecorder.isTypeSupported('video/webm; codecs=H264')) {
var options = {mimeType: 'video/webm; codecs=H264'}; var options = {mimeType: 'video/webm; codecs=H264'};
} else if (MediaRecorder.isTypeSupported('video/webm; codecs=vp9')) { } else if (MediaRecorder.isTypeSupported('video/webm; codecs=vp9')) {
@ -4070,28 +4011,57 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
} else { } else {
var options = {}; var options = {};
} }
_0xa88a13.recordData.stream = _0x27f4c4.Module.canvas.captureStream(30); function gotStreams(stream) {
//_0xa88a13.recordData.stream.addTrack(); // TODO - find audio element _0xa88a13.elements.buttons.screenRecord.querySelector('.'.concat(_0x449eac({
_0xa88a13.recordData.recorder = new MediaRecorder(_0xa88a13.recordData.stream, options); 'ejs__tooltip': true
_0xa88a13.recordData.recorder.ondataavailable = function(e) { }))).innerHTML = _0xa88a13.localization('Stop Screen Recording');
if (e.data.size > 0) { _0xa88a13.recordData.stream = stream;
_0xa88a13.recordData.data.push(e.data) _0xa88a13.recordData.recorder = new MediaRecorder(_0xa88a13.recordData.stream, options);
} _0xa88a13.recordData.recorder.ondataavailable = function(e) {
if (_0xa88a13.recordData.stopped) { if (e.data.size > 0) {
var a = document.createElement("a") _0xa88a13.recordData.data.push(e.data)
a.href = window.URL.createObjectURL(new Blob(_0xa88a13.recordData.data, {type: "video/webm"})) }
if (typeof _0xa88a13.gameName == 'string') { if (_0xa88a13.recordData.stopped) {
var aname = _0xa88a13.gameName var a = document.createElement("a")
a.href = window.URL.createObjectURL(new Blob(_0xa88a13.recordData.data, {type: "video/webm"}))
if (typeof _0xa88a13.gameName == 'string') {
var aname = _0xa88a13.gameName
}
a.download = aname ? '' .concat(aname, '-recording.webm') : 'record.webm';
a.click()
window.URL.revokeObjectURL(a.href)
delete _0xa88a13.recordData
_0xa88a13.elements.buttons.screenRecord.querySelector('.'.concat(_0x449eac({
'ejs__tooltip': true
}))).innerHTML = _0xa88a13.localization('Start Screen Recording');
} }
a.download = aname ? '' .concat(aname, '-recording.webm') : 'record.webm';
a.click()
window.URL.revokeObjectURL(a.href)
delete _0xa88a13.recordData
_0xa88a13.elements.buttons.screenRecord.getElementsByClassName('ejs--74c6d4176d27e37a19d2e9e61de8f4')[0].innerHTML = _0xa88a13.localization('Start Screen Recording');
} }
_0xa88a13.recordData.recorder.start()
_0xa88a13.recordData.started = true
} }
_0xa88a13.recordData.recorder.start() _0x27f4c4.Module.pauseMainLoop();
_0xa88a13.recordData.started = true _0xa88a13.playing = false;
alert('please check "share system audio" to have audio in the recording. We only need the audio stream so your entire screen will not be recorded');
var canvasStream = _0x27f4c4.Module.canvas.captureStream(30);
var time = setTimeout(function() {
_0xa88a13.playing = true;
_0x27f4c4.Module.resumeMainLoop();
}, 20000);
navigator.mediaDevices.getDisplayMedia({
audio: true, //we only need the audio, we dont use the video stream at all
video: {mediaSource: "screen"}
}).then(function(stream) {
try {
clearTimeout(time);
}catch(e){}
var audio = stream.getAudioTracks();
for (var i=0; i<audio.length; i++) {
canvasStream.addTrack(audio[i]);
}
gotStreams(canvasStream);
_0xa88a13.playing = true;
_0x27f4c4.Module.resumeMainLoop();
})
} else if (_0xa88a13.recordData.started) { //stop recording } else if (_0xa88a13.recordData.started) { //stop recording
_0xa88a13.recordData.recorder.stop() _0xa88a13.recordData.recorder.stop()
_0xa88a13.recordData.stopped = true _0xa88a13.recordData.stopped = true
@ -5581,15 +5551,20 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
'ejs__contextmenu': true 'ejs__contextmenu': true
}), ' ul')); }), ' ul'));
if (_0x4b9d55) { if (_0x4b9d55) {
_0x7f9f36.contextMenu.style.display = 'block', _0x7f9f36.contextMenu.style.left = '' .concat(_0x24b1f3.layerX, 'px'), _0x7f9f36.contextMenu.style.top = '' .concat(_0x24b1f3.layerY, 'px'); _0x7f9f36.contextMenu.style.display = 'block';
_0x7f9f36.contextMenu.style.left = ''.concat(_0x24b1f3.layerX, 'px');
_0x7f9f36.contextMenu.style.top = ''.concat(_0x24b1f3.layerY, 'px');
var _0x1b48e7 = _0x23ffa1.call(this, '.' .concat(_0x449eac({ var _0x1b48e7 = _0x23ffa1.call(this, '.' .concat(_0x449eac({
'ejs__contextmenu': true 'ejs__contextmenu': true
}), ' ul li')); }), ' ul li'));
if (Array.from(_0x1b48e7).forEach(function(_0x228a1f, _0x123a07) {}), null === _0x2a1dda.getAttribute('menu')) { if (null === _0x2a1dda.getAttribute('menu')) {
var _0x14264d = _0x428003('li', {}); var _0x14264d = _0x428003('li', {});
_0x14264d.appendChild(_0x428003('a', { _0x14264d.appendChild(_0x428003('a', {
'href': '#' 'target': '_blank',
}, 'EmulatorJS v' .concat(this.version))), _0x2a1dda.appendChild(_0x14264d), _0x2a1dda.setAttribute('menu', ''); 'href': 'https://github.com/ethanaobrien/emulatorjs'
}, 'EmulatorJS @allancoding v' .concat(this.version)));
_0x2a1dda.appendChild(_0x14264d);
_0x2a1dda.setAttribute('menu', '');
} }
_0x2c1832 && clearTimeout(_0x2c1832), _0x2c1832 = setTimeout(function() {}, 0xfa0), _0x7f9f36.contextMenu.timer = _0x2c1832; _0x2c1832 && clearTimeout(_0x2c1832), _0x2c1832 = setTimeout(function() {}, 0xfa0), _0x7f9f36.contextMenu.timer = _0x2c1832;
} else _0x7f9f36.contextMenu.style.display = 'none'; } else _0x7f9f36.contextMenu.style.display = 'none';
@ -5694,7 +5669,8 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
}); });
_0x530042.call(this, '.' .concat(_0x449eac({ _0x530042.call(this, '.' .concat(_0x449eac({
'ejs__dialogs': true 'ejs__dialogs': true
}))).appendChild(_0x2c1832), this.elements.dialogs.cache = _0x2c1832; }))).appendChild(_0x2c1832);
this.elements.dialogs.cache = _0x2c1832;
var _0x3c66db = _0x428003('div', { var _0x3c66db = _0x428003('div', {
'class': _0x449eac({ 'class': _0x449eac({
'ejs__dialog': true, 'ejs__dialog': true,
@ -5731,7 +5707,9 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
'step': 0.01, 'step': 0.01,
'value': this.config.volume 'value': this.config.volume
}; };
_0xd299b.appendChild(_0x7f9f36.createRange.call(this, 'volume', _0x5dc0c0(_0x4bbcd0, {}))), this.elements.volume = _0xd299b, _0x17edbf.appendChild(_0xd299b); _0xd299b.appendChild(_0x7f9f36.createRange.call(this, 'volume', _0x5dc0c0(_0x4bbcd0, {})));
this.elements.volume = _0xd299b;
_0x17edbf.appendChild(_0xd299b);
var _0x2746ab = _0x428003('div', { var _0x2746ab = _0x428003('div', {
'class': _0x449eac({ 'class': _0x449eac({
'ejs__menu': true 'ejs__menu': true
@ -6238,19 +6216,16 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
split1.push(split3[i]) split1.push(split3[i])
} }
} }
if (! path.startsWith('/') && path.split('://').length == 1 && path.split('http:').length == 1 && path.split('https:').length == 1 && path.split('file:').length == 1 && path.split('blob:').length == 1) { if (! path.startsWith('/') && !path.includes('://') && !path.includes('http:') && !path.includes('https:') && !path.includes('file:') && !path.includes('blob:')) {
for (var w=0; w<split2.length; w++) { for (var w=0; w<split2.length; w++) {
if (split2[w] == '' || split2[w] == '.') { if (split2[w] == '' || split2[w] == '.') {
} else if (split2[w] == '..') { } else if (split2[w] == '..') {
if (split1.length > 0) { if (split1.length > 0) {
var split1 = function(origpath) { var split1 = function(origpath) {
var fullrequestpath = origpath if (origpath === '/') {
var finpath = fullrequestpath.split('/').pop()
var finalpath = fullrequestpath.substring(0, fullrequestpath.length - finpath.length)
if (origpath == '/') {
return '/' return '/'
} else { } else {
return finalpath return origpath.substring(0, origpath.length - origpath.split('/').pop().length);
} }
}(split1.join('/')).split('/'); }(split1.join('/')).split('/');
} }
@ -6275,7 +6250,7 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
var a = function(_0x154660, _0x15626f) { var a = function(_0x154660, _0x15626f) {
if (!(_0x154660 instanceof _0x15626f)) throw new TypeError('Cannot call a class as a function'); if (!(_0x154660 instanceof _0x15626f)) throw new TypeError('Cannot call a class as a function');
}(this, _0x6954aa); }(this, _0x6954aa);
this.version = '1.1.2'; this.version = '1.1.6';
this.system = ''; this.system = '';
this.adUrl = null; this.adUrl = null;
this.gameName = null; this.gameName = null;
@ -6303,11 +6278,9 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
/*if (['dos'].includes(core)) { /*if (['dos'].includes(core)) {
return 2; return 2;
}*/ }*/
if (useBeta === true) { if (useBeta === true && window.WebAssembly) {
if (window.WebAssembly) { var supportedCores = ['nes', 'snes', 'gb', 'nds'];
var supportedCores = ['nes', 'snes', 'gb', 'nds']; return supportedCores.includes(core) ? 2 : 1;
return supportedCores.includes(core) ? 2 : 1;
}
} }
return 1; return 1;
}(this.config.system, this.config.useBeta); // 2 = beta cores, 1 = old cores }(this.config.system, this.config.useBeta); // 2 = beta cores, 1 = old cores

9
data/emu-min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,7 @@
(async function() { (async function() {
var VERSION = 1.2; var VERSION = 1.6;
if (window.location && ['localhost', '127.0.0.1'].includes(location.hostname)) { if ((window.location && ['localhost', '127.0.0.1'].includes(location.hostname)) ||
'undefined' != typeof EJS_DEBUG_XX && true === EJS_DEBUG_XX) {
fetch('https://raw.githack.com/ethanaobrien/emulatorjs/main/data/version.json').then(response => { fetch('https://raw.githack.com/ethanaobrien/emulatorjs/main/data/version.json').then(response => {
if (response.ok) { if (response.ok) {
response.text().then(body => { response.text().then(body => {
@ -12,7 +13,7 @@
} }
}) })
} }
var scriptTag = document.getElementsByTagName('script')[0] var scriptTag = document.getElementsByTagName('script')[0];
function loadScript(file) { function loadScript(file) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
var script = document.createElement('script'); var script = document.createElement('script');

21
data/minify/index.js Normal file
View file

@ -0,0 +1,21 @@
const UglifyJS = require("uglify-js");
const fs = require('fs');
if (!String.prototype.replaceAll) {
String.prototype.replaceAll = function(a, b) {
return this.split(a).join(b);
}
}
var a = fs.readFileSync('../emu-main.js', 'utf8').substring(18);
var code = fs.readFileSync('../emulator.js', 'utf8').replaceAll('window.EJS_main', a);
function minify(source){
var ast = UglifyJS.parse(source);
return UglifyJS.minify(ast).code;
}
console.log('minifying')
var min = minify(code);
console.log('done!')
fs.writeFileSync('../emu-min.js', min);

13
data/minify/package-lock.json generated Normal file
View file

@ -0,0 +1,13 @@
{
"name": "emulatorjs-minify",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"uglify-js": {
"version": "3.15.4",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.4.tgz",
"integrity": "sha512-vMOPGDuvXecPs34V74qDKk4iJ/SN4vL3Ow/23ixafENYvtrNvtbcgUeugTcUGRGsOF/5fU8/NYSL5Hyb3l1OJA=="
}
}
}

22
data/minify/package.json Normal file
View file

@ -0,0 +1,22 @@
{
"name": "emulatorjs-minify",
"version": "1.0.0",
"description": "Minify the emulatorjs javascript files",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "node index.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ethanaobrien/youtube-downloader.git"
},
"author": "Ethan O'Brien",
"bugs": {
"url": "https://github.com/ethanaobrien/emulatorjs/issues"
},
"homepage": "https://github.com/ethanaobrien/emulatorjs#readme",
"dependencies": {
"uglify-js": "^3.15.3"
}
}

Binary file not shown.

View file

@ -1 +1 @@
{ "current_version": 1.2 } { "current_version": 1.6 }

View file

@ -1,157 +1,179 @@
<!DOCTYPE html>
<html> <html>
<head> <head>
<title>Emulatorjs | Select Game Rom</title> <title>EmulatorJS</title>
<link rel="icon" type="image/png" href="docs/Emulatorjs Logo.png">
</head> <link rel = icon href = docs/Logo.png>
<meta name = viewport content = "width = device-width, initial-scale = 1">
<style>
body, html {
height: 100%;
}
body {
font-family: monospace;
font-weight: bold;
font-size: 20px;
margin: 0;
overflow: hidden;
background-color: #222
}
body, #box {
display: flex;
align-items: center;
justify-content: center;
}
#box {
color: #aaa;
height: 20em;
width: 30em;
max-width: 80%;
max-height: 80%;
background-color: #333;
border-radius: 0.4em;
border: 2px solid #555;
position: relative;
flex-direction: column;
transition-duration: 0.2s;
overflow: hidden
}
#box:hover, #box[drag] {
border-color: #38f;
color: #ddd
}
#input {
cursor: pointer;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
opacity: 0
}
#display {
width: 100%;
height: 100%
}
select, button {
padding: 0.6em 0.4em;
margin: 0.5em;
width: 15em;
max-width: 100%;
font-family: monospace;
font-weight: bold;
font-size: 16px;
background-color: #444;
color: #aaa;
border-radius: 0.4em;
border: 1px solid #555;
cursor: pointer;
transition-duration: 0.2s
}
select:hover, button:hover {
background-color: #666;
color: #ddd
}
</style>
</head>
<body> <body>
<style> <div id = box>
body{ <input type = file id = input>
background: #c4bdff; Drag ROM file or click here
margin: 0; </div>
padding: 0;
}
.form{
position: absolute;
top: 450px;
left: 50%;
margin-top: -150px;
margin-left: -250px;
width: 500px;
height: 200px;
border: 4px dashed #111;
}
.form p{
width: 100%;
height: 100%;
text-align: center;
line-height: 170px;
color: #111;
font-family: Arial;
}
.form input{
position: absolute;
margin: 0;
padding: 0;
width: 100%;
height: 100%;
outline: none;
opacity: 0;
}
.eimg{
width: 250px;
}
#uploadf, #uploadf1{
display: block;
}
</style>
<script> <script>
window.addEventListener('load', function() { input.onchange = async () => {
document.getElementById('file').onchange = async function(e) { const url = URL.createObjectURL(new Blob([input.files[0]]))
var ce = function(e) {return document.createElement(e);}; const parts = input.files[0].name.split(".")
var br = function(e) {e.appendChild(ce('br'))};
var gameUrl = URL.createObjectURL(new Blob([e.target.files[0]])) const core = await (async (ext) => {
var extension = e.target.files[0].name.split('.').pop() if (["fds", "nes", "unif", "unf"].includes(ext))
var gameName = e.target.files[0].name.replaceAll("'", "\\'") return "nes"
var gameName = gameName.substr(0, gameName.length - extension.length - 1)
e.target.remove(); if (["smc", "fig", "sfc", "gd3", "gd7", "dx2", "bsx", "swc"].includes(ext))
document.getElementById('uploadf').style.display = "none"; document.getElementById('uploadf1').style.display = "none"; return "snes"
if (['fds', 'nes', 'unif', 'unf'].includes(extension)) {
var core = 'nes'; if (["z64", "n64"].includes(ext))
} else if (['z64'].includes(extension)) { return "n64"
var core = 'n64';
} else if (['smc', 'fig', 'sfc', 'gd3', 'gd7', 'dx2', 'bsx', 'swc'].includes(extension)) { if (["nds", "gba", "gb", "z64", "n64"].includes(ext))
var core = 'snes'; return ext
} else if (['nds'].includes(extension)) {
var core = 'nds'; return await new Promise(resolve => {
} else if (['gba'].includes(extension)) { const cores = {
var core = 'gba'; "Nintendo 64": "n64",
} else if (['gb'].includes(extension)) { "Nintendo Game Boy": "gb",
var core = 'gb'; "Nintendo Game Boy Advance": "gba",
} else { "Nintendo DS": "nds",
var core = await function() { "Nintendo Entertainment System": "nes",
return new Promise(function(resolve, reject) { "Super Nintendo Entertainment System": "snes",
var cores = {"NES / Nintendo Entertainment System / Famicon": "nes", "PlayStation": "psx",
"SNES / Super Nintendo Entertainment System": "snes", "Virtual Boy": "vb",
"Nintendo 64": "n64", "Sega Mega Drive": "segaMD",
"Nintendo Game Boy": "gb", "Sega Master System": "segaMS",
"Nintendo Game Boy Advance": "gba", "Sega CD": "segaCD",
"Nintendo DS": "nds", "Atari Lynx": "lynx",
"PlayStation": "psx", "Sega 32X": "sega32x",
"Virtual Boy": "vb", "Atari Jaguar": "jaguar",
"Sega Mega Drive": "segaMD", "Sega Game Gear": "segaGG",
"Sega Master System": "segaMS", "Sega Saturn": "segaSaturn",
"Sega CD": "segaCD", "Atari 7800": "atari7800",
"Atari Lynx": "lynx", "Atari 2600": "atari2600"
"Sega 32X": "sega32x", }
"Atari Jaguar": "jaguar",
"Sega Game Gear": "segaGG", const button = document.createElement("button")
"Sega Saturn": "segaSaturn", const select = document.createElement("select")
"Atari 7800": "atari7800",
"Atari 2600": "atari2600"}; for (const type in cores) {
var a = ce('div'); const option = document.createElement("option")
a.style = 'padding: 50px;';
var p = ce('h2'); option.value = cores[type]
p.innerHTML = 'Unable to auto-detect system. Please select the desired system.'; option.textContent = type
a.appendChild(p); select.appendChild(option)
br(a); }
for (var k in cores) {
var input = ce('input'); button.onclick = () => resolve(select[select.selectedIndex].value)
input.type = 'radio'; button.textContent = "Load game"
input.id = 'game-' + cores[k]; box.innerHTML = ""
input.name = 'game';
input.value = cores[k]; box.appendChild(select)
a.appendChild(input); box.appendChild(button)
var label = ce('label'); })
label.for = 'game-' + cores[k]; })(parts.pop())
label.innerHTML = k;
a.appendChild(label); const div = document.createElement("div")
br(a); const sub = document.createElement("div")
}; const script = document.createElement("script")
br(a);
var submit = ce('input'); sub.id = "game"
submit.type = 'submit'; div.id = "display"
submit.value = 'Load Game';
submit.onclick = function(e) { box.remove()
var q = false; div.appendChild(sub)
var radios = document.getElementsByName('game'); document.body.appendChild(div)
for (var i=0; i<radios.length; i++) {
if (radios[i].checked) { window.EJS_player = "#game"
var q = radios[i].value; window.EJS_gameName = parts.shift()
break; window.EJS_biosUrl = ""
}; window.EJS_gameUrl = url
}; window.EJS_core = core
if (! q) { window.EJS_pathtodata = "data/"
return;
}; script.src = "data/loader.js"
a.remove(); document.body.appendChild(script)
resolve(q); }
};
a.appendChild(submit); box.ondragover = () => box.setAttribute("drag", true)
document.body.appendChild(a); box.ondragleave = () => box.removeAttribute("drag")
});
}();
};
var a = document.createElement('div');
a.style = "width:65%;height:100%;max-width:100%";
var b = document.createElement('div');
b.id = 'game';
a.appendChild(b);
document.getElementById("cont").appendChild(a);
var script = document.createElement('script');
script.innerHTML = "EJS_player = '#game'; EJS_gameName = '" + gameName + "'; EJS_biosUrl = ''; EJS_gameUrl = '" + gameUrl + "'; EJS_core = '" + core + "'; EJS_pathtodata = 'data/';";
document.body.appendChild(script);
var script = document.createElement('script');
script.src = 'data/loader.js';
document.body.appendChild(script);
}
})
</script> </script>
<center id="cont">
<img id="uploadf1" class="eimg" src="docs/Emulatorjs Logo.png">
</center>
<div id="uploadf" class="form">
<input type="file" id="file">
<b><p>Select Game Rom: Drag your files here or click in this area.</p></b>
</div>
</body> </body>
</html> </html>