79 lines
2.2 KiB
HTML
79 lines
2.2 KiB
HTML
<!-- <div style='width:640px;height:480px;max-width:100%'> -->
|
|
<div style='width:100%;height:100%;'>
|
|
<div id='game'></div>
|
|
</div>
|
|
|
|
<script type='text/javascript'>
|
|
EJS_player = '#game';
|
|
|
|
// Can also be fceumm or nestopia
|
|
EJS_core = getQueryString('core', 'string');
|
|
|
|
// Lightgun
|
|
EJS_lightgun = false; // can be true or false
|
|
|
|
// URL to BIOS file
|
|
EJS_biosUrl = emuBios;
|
|
|
|
// URL to Game rom
|
|
EJS_gameUrl = decodeURIComponent(getQueryString('rompath', 'string'));
|
|
|
|
// load state if defined
|
|
if (StateUrl) {
|
|
console.log('Loading saved state from: ' + StateUrl);
|
|
EJS_loadStateURL = StateUrl;
|
|
EJS_startOnLoaded = true;
|
|
}
|
|
|
|
// Path to the data directory
|
|
EJS_pathtodata = '/emulators/EmulatorJS/data/';
|
|
|
|
EJS_DEBUG_XX = emulatorDebugMode;
|
|
console.log("Debug enabled: " + EJS_DEBUG_XX);
|
|
|
|
EJS_backgroundImage = emuBackground;
|
|
EJS_backgroundBlur = true;
|
|
|
|
EJS_fullscreenOnLoaded = false;
|
|
|
|
EJS_gameName = emuGameTitle;
|
|
|
|
EJS_threads = false;
|
|
|
|
EJS_Buttons = {
|
|
saveSavFiles: false,
|
|
loadSavFiles: false
|
|
}
|
|
|
|
EJS_onSaveState = function(e) {
|
|
var returnValue = {
|
|
"ScreenshotByteArrayBase64": btoa(Uint8ToString(e.screenshot)),
|
|
"StateByteArrayBase64": btoa(Uint8ToString(e.state))
|
|
};
|
|
|
|
var url = '/api/v1.1/StateManager/' + romId + '?IsMediaGroup=' + IsMediaGroup;
|
|
|
|
ajaxCall(
|
|
url,
|
|
'POST',
|
|
function (result) {
|
|
console.log("Upload complete");
|
|
console.log(result);
|
|
|
|
displayNotification('State Saved', 'Game state has been saved.', '/api/v1.1/StateManager/' + romId + '/' + result.value.id + '/Screenshot/image.png?IsMediaGroup=' + IsMediaGroup);
|
|
},
|
|
function (error) {
|
|
console.log("An error occurred");
|
|
console.log(error);
|
|
},
|
|
JSON.stringify(returnValue)
|
|
);
|
|
|
|
returnValue = undefined;
|
|
}
|
|
|
|
EJS_onLoadState = function(e) {
|
|
showDialog('emulatorloadstate', { "romId": romId, "IsMediaGroup": IsMediaGroup });
|
|
}
|
|
</script>
|
|
<script src='/emulators/EmulatorJS/data/loader.js'></script> |