2022-02-23 01:42:42 +00:00
( async function ( ) {
var VERSION = 1.1 ;
if ( window . location && [ 'localhost' , '127.0.0.1' ] . includes ( location . hostname ) ) {
fetch ( 'https://raw.githack.com/ethanaobrien/emulatorjs/main/data/version.json' ) . then ( response => {
if ( response . ok ) {
response . text ( ) . then ( body => {
var version = JSON . parse ( body ) ;
if ( VERSION < version . current _version ) {
console . log ( 'Using emulatorjs version ' + usingVersion + ' but the newest version is ' + version . current _version + '\nopen https://github.com/ethanaobrien/emulatorjs to update' ) ;
}
} )
}
} )
}
var scriptTag = document . getElementsByTagName ( 'script' ) [ 0 ]
function loadScript ( file ) {
return new Promise ( function ( resolve , reject ) {
var script = document . createElement ( 'script' ) ;
script . src = function ( ) {
if ( 'undefined' != typeof EJS _paths && typeof EJS _paths [ file ] == 'string' ) {
return EJS _paths [ file ] ;
} else if ( 'undefined' != typeof EJS _pathtodata ) {
return EJS _pathtodata + file + '?v=' + VERSION ;
} else {
return file + '?v=' + VERSION ;
}
} ( ) ;
scriptTag . parentNode . insertBefore ( script , scriptTag ) ;
script . onload = function ( ) {
resolve ( ) ;
}
} )
}
if ( 'undefined' != typeof EJS _DEBUG _XX && true === EJS _DEBUG _XX ) {
await loadScript ( 'emu-main.js' ) ;
await loadScript ( 'emulator.js' ) ;
2022-01-05 00:17:43 +00:00
} else {
2022-02-23 01:42:42 +00:00
await loadScript ( 'emu-min.js' ) ;
2022-01-05 00:17:43 +00:00
}
2022-02-23 01:42:42 +00:00
var config = { } ;
config . gameUrl = EJS _gameUrl ;
'undefined' != typeof EJS _mameCore && ( config . mameCore = EJS _mameCore ) ;
'undefined' != typeof EJS _biosUrl && ( config . biosUrl = EJS _biosUrl ) ;
'undefined' != typeof EJS _gameID && ( config . gameId = EJS _gameID ) ;
'undefined' != typeof EJS _gameParentUrl && ( config . gameParentUrl = EJS _gameParentUrl ) ;
'undefined' != typeof EJS _gamePatchUrl && ( config . gamePatchUrl = EJS _gamePatchUrl ) ;
'undefined' != typeof EJS _AdUrl && ( config . adUrl = EJS _AdUrl ) ;
'undefined' != typeof EJS _paths && ( config . paths = EJS _paths ) ;
'undefined' != typeof EJS _netplayUrl && ( config . netplayUrl = EJS _netplayUrl ) ;
'undefined' != typeof EJS _startOnLoaded && ( config . startOnLoad = EJS _startOnLoaded ) ;
'undefined' != typeof EJS _core && ( config . system = EJS _core ) ;
'undefined' != typeof EJS _loadStateURL && ( config . loadStateOnStart = EJS _loadStateURL ) ;
'undefined' != typeof EJS _language && ( config . lang = EJS _language ) ;
'undefined' != typeof EJS _oldEJSNetplayServer && ( config . oldNetplayServer = EJS _oldEJSNetplayServer ) ;
'undefined' != typeof EJS _BETA && ( config . useBeta = EJS _BETA ) ;
config . onsavestate = null ;
config . onloadstate = null ;
'undefined' != typeof EJS _onSaveState && ( config . onsavestate = EJS _onSaveState ) ;
'undefined' != typeof EJS _onLoadState && ( config . onloadstate = EJS _onLoadState ) ;
'undefined' != typeof EJS _lightgun && ( config . lightgun = EJS _lightgun ) ;
'undefined' != typeof EJS _gameName && ( config . gameName = EJS _gameName ) ;
'undefined' != typeof EJS _pathtodata && ( config . dataPath = EJS _pathtodata ) ;
'undefined' != typeof EJS _mouse && ( config . mouse = EJS _mouse ) ;
'undefined' != typeof EJS _multitap && ( config . multitap = EJS _multitap ) ;
'undefined' != typeof EJS _playerName && ( config . playerName = EJS _playerName ) ;
'undefined' != typeof EJS _cheats && ( config . cheats = EJS _cheats ) ;
'undefined' != typeof EJS _color && ( config . color = EJS _color ) ;
window . EJS _emulator = new EJS ( EJS _player , config ) ;
'undefined' != typeof EJS _onGameStart && EJS _emulator . on ( 'start-game' , EJS _onGameStart ) ;
} ) ( ) ;
2022-01-12 22:50:40 +00:00
2021-12-01 17:46:24 +00:00
2022-01-31 21:41:00 +00:00
$ ( document ) . ready ( function ( ) {
$ ( ".ejs--73f9b4e94a7a1fe74e11107d5ab2ef" ) . attr ( "id" , "start" ) ;
$ ( ".ejs--cbcfe0a1421cadac9a04c81d6431d6" ) . attr ( "id" , "loding" ) ;
$ ( ".ejs--71527b6509aa48afce3ce1a11c02f0" ) . attr ( "id" , "naming" ) ;
$ ( ".ejs--057800d021995e1347ec07cb748672" ) . addClass ( "backg" ) ;
$ ( "#loding" ) . attr ( "hidden" , "" ) ;
$ ( "#loding" ) . hide ( ) ;
$ ( "#start" ) . on ( 'touchstart click' , function ( ) {
$ ( ".ejs--057800d021995e1347ec07cb748672" ) . removeClass ( "backg" ) ;
$ ( "#loding" ) . show ( ) ;
$ ( "#loding" ) . removeAttr ( "hidden" ) ;
$ ( "div" ) . remove ( ".ejs--f3a1903d935f6cf720d4a0498db62a" ) ;
setTimeout (
function ( )
{
$ ( "div" ) . remove ( ".ejs--cbcfe0a1421cadac9a04c81d6431d6" ) ;
} , 4500 ) ;
} ) ;
} ) ;