mirror of
https://github.com/d07RiV/diabloweb.git
synced 2026-06-28 09:21:35 +00:00
21 lines
32 KiB
Plaintext
21 lines
32 KiB
Plaintext
|
|
var Diablo = (function() {
|
|
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
|
return (
|
|
function(Diablo) {
|
|
Diablo = Diablo || {};
|
|
|
|
var Module=typeof Diablo!=="undefined"?Diablo:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=function(status,toThrow){throw toThrow};Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_NODE=ENVIRONMENT_HAS_NODE&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}else{return scriptDirectory+path}}var read_,readAsync,readBinary,setWindowTitle;if(ENVIRONMENT_IS_NODE){scriptDirectory=__dirname+"/";var nodeFS;var nodePath;read_=function shell_read(filename,binary){var ret;if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);ret=nodeFS["readFileSync"](filename);return binary?ret:ret.toString()};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){Module["thisProgram"]=process["argv"][1].replace(/\\/g,"/")}Module["arguments"]=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);Module["quit"]=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){Module["arguments"]=scriptArgs}else if(typeof arguments!="undefined"){Module["arguments"]=arguments}if(typeof quit==="function"){Module["quit"]=function(status){quit(status)}}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)};setWindowTitle=function(title){document.title=title}}else{}var out=Module["print"]||(typeof console!=="undefined"?console.log.bind(console):typeof print!=="undefined"?print:null);var err=Module["printErr"]||(typeof printErr!=="undefined"?printErr:typeof console!=="undefined"&&console.warn.bind(console)||out);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=undefined;var asm2wasmImports={"f64-rem":function(x,y){return x%y},"debugger":function(){debugger}};var functionPointers=new Array(0);var tempRet0=0;var setTempRet0=function(value){tempRet0=value};var getTempRet0=function(){return tempRet0};if(typeof WebAssembly!=="object"){err("no native wasm support detected")}var wasmMemory;var wasmTable;var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(u8Array,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(u8Array[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else{var str="";while(idx<endPtr){var u0=u8Array[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|u8Array[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;var WASM_PAGE_SIZE=65536;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferViews(){Module["HEAP8"]=HEAP8=new Int8Array(buffer);Module["HEAP16"]=HEAP16=new Int16Array(buffer);Module["HEAP32"]=HEAP32=new Int32Array(buffer);Module["HEAPU8"]=HEAPU8=new Uint8Array(buffer);Module["HEAPU16"]=HEAPU16=new Uint16Array(buffer);Module["HEAPU32"]=HEAPU32=new Uint32Array(buffer);Module["HEAPF32"]=HEAPF32=new Float32Array(buffer);Module["HEAPF64"]=HEAPF64=new Float64Array(buffer)}var DYNAMIC_BASE=7107936,DYNAMICTOP_PTR=1865024;var TOTAL_STACK=5242880;var INITIAL_TOTAL_MEMORY=Module["TOTAL_MEMORY"]||134217728;if(INITIAL_TOTAL_MEMORY<TOTAL_STACK)err("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_TOTAL_MEMORY/WASM_PAGE_SIZE})}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_TOTAL_MEMORY=buffer.byteLength;updateGlobalBufferViews();HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE;function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){runtimeExited=true}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}var wasmBinaryFile="Diablo.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(Module["wasmBinary"]){return new Uint8Array(Module["wasmBinary"])}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!Module["wasmBinary"]&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(env){var info={"env":env,"global":{"NaN":NaN,Infinity:Infinity},"global.Math":Math,"asm2wasm":asm2wasmImports};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiatedSource(output){receiveInstance(output["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!Module["wasmBinary"]&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){return WebAssembly.instantiateStreaming(response,info).then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}Module["asm"]=function(global,env,providedBuffer){env["memory"]=wasmMemory;env["table"]=wasmTable=new WebAssembly.Table({"initial":778,"maximum":778,"element":"anyfunc"});env["__memory_base"]=1024;env["__table_base"]=0;var exports=createWasm(env);return exports};var ASM_CONSTS=[function($0){self.DApi.current_save_id($0)}];function _emscripten_asm_const_ii(code,a0){return ASM_CONSTS[code](a0)}function _api_close_keyboard(){self.DApi.close_keyboard()}function _api_create_sound_float(id,ptr,samples,channels,rate){self.DApi.create_sound(id,HEAPF32.slice(ptr/4,ptr/4+samples*channels),samples,channels,rate)}function _api_delete_sound(id){self.DApi.delete_sound(id)}function _api_draw_begin(){self.DApi.draw_begin()}function _api_draw_belt(items){self.DApi.draw_belt(HEAP32.subarray(items/4,items/4+8))}function _api_draw_blit(x,y,w,h,ptr){self.DApi.draw_blit(x,y,w,h,HEAPU8.subarray(ptr,ptr+w*h*4))}function _api_draw_clip_text(x0,y0,x1,y1){self.DApi.draw_clip_text(x0,y0,x1,y1)}function _api_draw_end(){self.DApi.draw_end()}function _api_draw_text(x,y,ptr,color){var end=HEAPU8.indexOf(0,ptr);var text=String.fromCharCode.apply(null,HEAPU8.subarray(ptr,end));self.DApi.draw_text(x,y,text,color)}function _api_duplicate_sound(id,srcId){self.DApi.duplicate_sound(id,srcId)}function _api_open_keyboard(){self.DApi.open_keyboard()}function _api_play_sound(id,volume,pan,loop){self.DApi.play_sound(id,volume,pan,loop)}function _api_set_cursor(x,y){self.DApi.set_cursor(x,y)}function _api_set_volume(id,volume){self.DApi.set_volume(id,volume)}function _api_stop_sound(id){self.DApi.stop_sound(id)}function _exit_error(err){var end=HEAPU8.indexOf(0,err);var text=String.fromCharCode.apply(null,HEAPU8.subarray(err,end));self.DApi.exit_error(text)}function _get_file_contents(path,ptr,offset,size){var end=HEAPU8.indexOf(0,path);var text=String.fromCharCode.apply(null,HEAPU8.subarray(path,end));self.DApi.get_file_contents(text,HEAPU8.subarray(ptr,ptr+size),offset)}function _get_file_size(path){var end=HEAPU8.indexOf(0,path);var text=String.fromCharCode.apply(null,HEAPU8.subarray(path,end));return self.DApi.get_file_size(text)}function _put_file_contents(path,ptr,size){var end=HEAPU8.indexOf(0,path);var text=String.fromCharCode.apply(null,HEAPU8.subarray(path,end));self.DApi.put_file_contents(text,HEAPU8.slice(ptr,ptr+size))}function _remove_file(path){var end=HEAPU8.indexOf(0,path);var text=String.fromCharCode.apply(null,HEAPU8.subarray(path,end));self.DApi.remove_file(text)}function _show_alert(err){var end=HEAPU8.indexOf(0,err);var text=String.fromCharCode.apply(null,HEAPU8.subarray(err,end));self.alert(text)}__ATINIT__.push({func:function(){__GLOBAL__sub_I_msgcmd_cpp()}});function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___cxa_allocate_exception(size){return _malloc(size)}var ___exception_infos={};var ___exception_caught=[];function ___exception_addRef(ptr){if(!ptr)return;var info=___exception_infos[ptr];info.refcount++}function ___exception_deAdjust(adjusted){if(!adjusted||___exception_infos[adjusted])return adjusted;for(var key in ___exception_infos){var ptr=+key;var adj=___exception_infos[ptr].adjusted;var len=adj.length;for(var i=0;i<len;i++){if(adj[i]===adjusted){return ptr}}}return adjusted}function ___cxa_begin_catch(ptr){var info=___exception_infos[ptr];if(info&&!info.caught){info.caught=true;__ZSt18uncaught_exceptionv.uncaught_exceptions--}if(info)info.rethrown=false;___exception_caught.push(ptr);___exception_addRef(___exception_deAdjust(ptr));return ptr}var ___exception_last=0;function ___cxa_free_exception(ptr){try{return _free(ptr)}catch(e){}}function ___exception_decRef(ptr){if(!ptr)return;var info=___exception_infos[ptr];info.refcount--;if(info.refcount===0&&!info.rethrown){if(info.destructor){Module["dynCall_vi"](info.destructor,ptr)}delete ___exception_infos[ptr];___cxa_free_exception(ptr)}}function ___cxa_end_catch(){_setThrew(0);var ptr=___exception_caught.pop();if(ptr){___exception_decRef(___exception_deAdjust(ptr));___exception_last=0}}function ___resumeException(ptr){if(!___exception_last){___exception_last=ptr}throw ptr}function ___cxa_find_matching_catch(){var thrown=___exception_last;if(!thrown){return(setTempRet0(0),0)|0}var info=___exception_infos[thrown];var throwntype=info.type;if(!throwntype){return(setTempRet0(0),thrown)|0}var typeArray=Array.prototype.slice.call(arguments);var pointer=___cxa_is_pointer_type(throwntype);var buffer=1865008;HEAP32[buffer>>2]=thrown;thrown=buffer;for(var i=0;i<typeArray.length;i++){if(typeArray[i]&&___cxa_can_catch(typeArray[i],throwntype,thrown)){thrown=HEAP32[thrown>>2];info.adjusted.push(thrown);return(setTempRet0(typeArray[i]),thrown)|0}}thrown=HEAP32[thrown>>2];return(setTempRet0(throwntype),thrown)|0}Module["___cxa_find_matching_catch"]=___cxa_find_matching_catch;function ___cxa_find_matching_catch_2(a0,a1){return ___cxa_find_matching_catch(a0,a1)}function ___cxa_find_matching_catch_3(a0,a1,a2){return ___cxa_find_matching_catch(a0,a1,a2)}function ___cxa_pure_virtual(){ABORT=true;throw"Pure virtual function called!"}function ___cxa_throw(ptr,type,destructor){___exception_infos[ptr]={ptr:ptr,adjusted:[ptr],type:type,destructor:destructor,refcount:0,caught:false,rethrown:false};___exception_last=ptr;if(!("uncaught_exception"in __ZSt18uncaught_exceptionv)){__ZSt18uncaught_exceptionv.uncaught_exceptions=1}else{__ZSt18uncaught_exceptionv.uncaught_exceptions++}throw ptr}function ___cxa_uncaught_exceptions(){return __ZSt18uncaught_exceptionv.uncaught_exceptions}function ___lock(){}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};var SYSCALLS={buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:0,get:function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(){var ret=UTF8ToString(SYSCALLS.get());return ret},get64:function(){var low=SYSCALLS.get(),high=SYSCALLS.get();return low},getZero:function(){SYSCALLS.get()}};function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.get(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAP32[iov+i*8>>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j<len;j++){SYSCALLS.printChar(stream,HEAPU8[ptr+j])}ret+=len}return ret}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD();return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___unlock(){}function _abort(){Module["abort"]()}function _emscripten_get_heap_size(){return HEAP8.length}function _exit(status){exit(status)}function _llvm_trap(){abort("trap!")}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest)}function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;return value}function abortOnCannotGrowMemory(requestedSize){abort("OOM")}function emscripten_realloc_buffer(size){var PAGE_MULTIPLE=65536;size=alignUp(size,PAGE_MULTIPLE);var oldSize=buffer.byteLength;try{var result=wasmMemory.grow((size-oldSize)/65536);if(result!==(-1|0)){buffer=wasmMemory.buffer;return true}else{return false}}catch(e){return false}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();var PAGE_MULTIPLE=65536;var LIMIT=2147483648-PAGE_MULTIPLE;if(requestedSize>LIMIT){return false}var MIN_TOTAL_MEMORY=16777216;var newSize=Math.max(oldSize,MIN_TOTAL_MEMORY);while(newSize<requestedSize){if(newSize<=536870912){newSize=alignUp(2*newSize,PAGE_MULTIPLE)}else{newSize=Math.min(alignUp((3*newSize+2147483648)/4,PAGE_MULTIPLE),LIMIT)}}if(!emscripten_realloc_buffer(newSize)){return false}updateGlobalBufferViews();return true}function _time(ptr){var ret=Date.now()/1e3|0;if(ptr){HEAP32[ptr>>2]=ret}return ret}function invoke_ii(index,a1){var sp=stackSave();try{return dynCall_ii(index,a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return dynCall_iii(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return dynCall_iiii(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_iiiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return dynCall_iiiiii(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_ji(index,a1){var sp=stackSave();try{return dynCall_ji(index,a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{dynCall_v(index)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{dynCall_vi(index,a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{dynCall_vii(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{dynCall_viii(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{dynCall_viiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{dynCall_viiiii(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viji(index,a1,a2,a3,a4){var sp=stackSave();try{dynCall_viji(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}var asmGlobalArg={};var asmLibraryArg={"l":abort,"I":setTempRet0,"b":getTempRet0,"g":invoke_ii,"h":invoke_iii,"o":invoke_iiii,"r":invoke_iiiii,"s":invoke_iiiiii,"H":invoke_ji,"x":invoke_v,"f":invoke_vi,"e":invoke_vii,"i":invoke_viii,"t":invoke_viiii,"q":invoke_viiiii,"G":invoke_viji,"w":___assert_fail,"k":___cxa_allocate_exception,"F":___cxa_begin_catch,"ka":___cxa_end_catch,"c":___cxa_find_matching_catch_2,"n":___cxa_find_matching_catch_3,"m":___cxa_free_exception,"ja":___cxa_pure_virtual,"j":___cxa_throw,"ia":___cxa_uncaught_exceptions,"ha":___lock,"d":___resumeException,"E":___setErrNo,"ga":___syscall140,"D":___syscall146,"fa":___syscall54,"ea":___syscall6,"C":___unlock,"da":_abort,"ca":_api_close_keyboard,"ba":_api_create_sound_float,"aa":_api_delete_sound,"$":_api_draw_begin,"_":_api_draw_belt,"B":_api_draw_blit,"Z":_api_draw_clip_text,"v":_api_draw_end,"Y":_api_draw_text,"X":_api_duplicate_sound,"A":_api_open_keyboard,"z":_api_play_sound,"W":_api_set_cursor,"V":_api_set_volume,"U":_api_stop_sound,"T":_emscripten_asm_const_ii,"S":_emscripten_get_heap_size,"R":_emscripten_memcpy_big,"Q":_emscripten_resize_heap,"p":_exit,"y":_exit_error,"u":_get_file_contents,"P":_get_file_size,"O":_llvm_trap,"N":_put_file_contents,"M":_remove_file,"L":_show_alert,"K":_time,"J":abortOnCannotGrowMemory,"a":DYNAMICTOP_PTR};var asm=Module["asm"](asmGlobalArg,asmLibraryArg,buffer);Module["asm"]=asm;var _DApi_Char=Module["_DApi_Char"]=function(){return Module["asm"]["la"].apply(null,arguments)};var _DApi_Init=Module["_DApi_Init"]=function(){return Module["asm"]["ma"].apply(null,arguments)};var _DApi_Key=Module["_DApi_Key"]=function(){return Module["asm"]["na"].apply(null,arguments)};var _DApi_Mouse=Module["_DApi_Mouse"]=function(){return Module["asm"]["oa"].apply(null,arguments)};var _DApi_Render=Module["_DApi_Render"]=function(){return Module["asm"]["pa"].apply(null,arguments)};var _DApi_SyncText=Module["_DApi_SyncText"]=function(){return Module["asm"]["qa"].apply(null,arguments)};var __GLOBAL__sub_I_msgcmd_cpp=Module["__GLOBAL__sub_I_msgcmd_cpp"]=function(){return Module["asm"]["ra"].apply(null,arguments)};var __ZSt18uncaught_exceptionv=Module["__ZSt18uncaught_exceptionv"]=function(){return Module["asm"]["sa"].apply(null,arguments)};var ___cxa_can_catch=Module["___cxa_can_catch"]=function(){return Module["asm"]["ta"].apply(null,arguments)};var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=function(){return Module["asm"]["ua"].apply(null,arguments)};var ___em_js__api_close_keyboard=Module["___em_js__api_close_keyboard"]=function(){return Module["asm"]["va"].apply(null,arguments)};var ___em_js__api_create_sound_float=Module["___em_js__api_create_sound_float"]=function(){return Module["asm"]["wa"].apply(null,arguments)};var ___em_js__api_delete_sound=Module["___em_js__api_delete_sound"]=function(){return Module["asm"]["xa"].apply(null,arguments)};var ___em_js__api_draw_begin=Module["___em_js__api_draw_begin"]=function(){return Module["asm"]["ya"].apply(null,arguments)};var ___em_js__api_draw_belt=Module["___em_js__api_draw_belt"]=function(){return Module["asm"]["za"].apply(null,arguments)};var ___em_js__api_draw_blit=Module["___em_js__api_draw_blit"]=function(){return Module["asm"]["Aa"].apply(null,arguments)};var ___em_js__api_draw_clip_text=Module["___em_js__api_draw_clip_text"]=function(){return Module["asm"]["Ba"].apply(null,arguments)};var ___em_js__api_draw_end=Module["___em_js__api_draw_end"]=function(){return Module["asm"]["Ca"].apply(null,arguments)};var ___em_js__api_draw_text=Module["___em_js__api_draw_text"]=function(){return Module["asm"]["Da"].apply(null,arguments)};var ___em_js__api_duplicate_sound=Module["___em_js__api_duplicate_sound"]=function(){return Module["asm"]["Ea"].apply(null,arguments)};var ___em_js__api_exit_game=Module["___em_js__api_exit_game"]=function(){return Module["asm"]["Fa"].apply(null,arguments)};var ___em_js__api_open_keyboard=Module["___em_js__api_open_keyboard"]=function(){return Module["asm"]["Ga"].apply(null,arguments)};var ___em_js__api_play_sound=Module["___em_js__api_play_sound"]=function(){return Module["asm"]["Ha"].apply(null,arguments)};var ___em_js__api_set_cursor=Module["___em_js__api_set_cursor"]=function(){return Module["asm"]["Ia"].apply(null,arguments)};var ___em_js__api_set_volume=Module["___em_js__api_set_volume"]=function(){return Module["asm"]["Ja"].apply(null,arguments)};var ___em_js__api_stop_sound=Module["___em_js__api_stop_sound"]=function(){return Module["asm"]["Ka"].apply(null,arguments)};var ___em_js__exit_error=Module["___em_js__exit_error"]=function(){return Module["asm"]["La"].apply(null,arguments)};var ___em_js__get_file_contents=Module["___em_js__get_file_contents"]=function(){return Module["asm"]["Ma"].apply(null,arguments)};var ___em_js__get_file_size=Module["___em_js__get_file_size"]=function(){return Module["asm"]["Na"].apply(null,arguments)};var ___em_js__put_file_contents=Module["___em_js__put_file_contents"]=function(){return Module["asm"]["Oa"].apply(null,arguments)};var ___em_js__remove_file=Module["___em_js__remove_file"]=function(){return Module["asm"]["Pa"].apply(null,arguments)};var ___em_js__show_alert=Module["___em_js__show_alert"]=function(){return Module["asm"]["Qa"].apply(null,arguments)};var ___em_js__trace_pop=Module["___em_js__trace_pop"]=function(){return Module["asm"]["Ra"].apply(null,arguments)};var ___em_js__trace_push=Module["___em_js__trace_push"]=function(){return Module["asm"]["Sa"].apply(null,arguments)};var _free=Module["_free"]=function(){return Module["asm"]["Ta"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return Module["asm"]["Ua"].apply(null,arguments)};var _setThrew=Module["_setThrew"]=function(){return Module["asm"]["Va"].apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return Module["asm"]["hb"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return Module["asm"]["ib"].apply(null,arguments)};var dynCall_ii=Module["dynCall_ii"]=function(){return Module["asm"]["Wa"].apply(null,arguments)};var dynCall_iii=Module["dynCall_iii"]=function(){return Module["asm"]["Xa"].apply(null,arguments)};var dynCall_iiii=Module["dynCall_iiii"]=function(){return Module["asm"]["Ya"].apply(null,arguments)};var dynCall_iiiii=Module["dynCall_iiiii"]=function(){return Module["asm"]["Za"].apply(null,arguments)};var dynCall_iiiiii=Module["dynCall_iiiiii"]=function(){return Module["asm"]["_a"].apply(null,arguments)};var dynCall_ji=Module["dynCall_ji"]=function(){return Module["asm"]["$a"].apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){return Module["asm"]["ab"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){return Module["asm"]["bb"].apply(null,arguments)};var dynCall_vii=Module["dynCall_vii"]=function(){return Module["asm"]["cb"].apply(null,arguments)};var dynCall_viii=Module["dynCall_viii"]=function(){return Module["asm"]["db"].apply(null,arguments)};var dynCall_viiii=Module["dynCall_viiii"]=function(){return Module["asm"]["eb"].apply(null,arguments)};var dynCall_viiiii=Module["dynCall_viiiii"]=function(){return Module["asm"]["fb"].apply(null,arguments)};var dynCall_viji=Module["dynCall_viji"]=function(){return Module["asm"]["gb"].apply(null,arguments)};Module["asm"]=asm;Module["then"]=function(func){if(Module["calledRun"]){func(Module)}else{var old=Module["onRuntimeInitialized"];Module["onRuntimeInitialized"]=function(){if(old)old();func(Module)}}return Module};function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}ExitStatus.prototype=new Error;ExitStatus.prototype.constructor=ExitStatus;dependenciesFulfilled=function runCaller(){if(!Module["calledRun"])run();if(!Module["calledRun"])dependenciesFulfilled=runCaller};function run(args){args=args||Module["arguments"];if(runDependencies>0){return}preRun();if(runDependencies>0)return;if(Module["calledRun"])return;function doRun(){if(Module["calledRun"])return;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){if(implicit&&Module["noExitRuntime"]&&status===0){return}if(Module["noExitRuntime"]){}else{ABORT=true;EXITSTATUS=status;exitRuntime();if(Module["onExit"])Module["onExit"](status)}Module["quit"](status,new ExitStatus(status))}function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";out(what);err(what);ABORT=true;EXITSTATUS=1;throw"abort("+what+"). Build with -s ASSERTIONS=1 for more info."}Module["abort"]=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}Module["noExitRuntime"]=true;run();Module["ready"]=new Promise(function(resolve,reject){delete Module["then"];Module["onAbort"]=function(what){reject(what)};addOnPostRun(function(){resolve(Module)})});
|
|
|
|
|
|
return Diablo
|
|
}
|
|
);
|
|
})();
|
|
if (typeof exports === 'object' && typeof module === 'object')
|
|
module.exports = Diablo;
|
|
else if (typeof define === 'function' && define['amd'])
|
|
define([], function() { return Diablo; });
|
|
else if (typeof exports === 'object')
|
|
exports["Diablo"] = Diablo;
|
|
|