v86 0.5.327 → 0.5.330
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/libv86-debug.js +6 -4
- package/build/libv86-debug.mjs +6 -4
- package/build/libv86.js +6 -6
- package/build/libv86.mjs +7 -7
- package/build/v86-debug.wasm +0 -0
- package/build/v86-fallback.wasm +0 -0
- package/build/v86.wasm +0 -0
- package/package.json +1 -1
package/build/libv86-debug.js
CHANGED
|
@@ -173,8 +173,11 @@ $Bitmap$$module$src$lib$$.prototype.get_buffer = function() {
|
|
|
173
173
|
var $load_file$$module$src$lib$$, $get_file_size$$module$src$lib$$;
|
|
174
174
|
if ("undefined" === typeof XMLHttpRequest || "undefined" !== typeof process && process.versions && process.versions.node) {
|
|
175
175
|
let $fs$$;
|
|
176
|
+
const $get_fs$$ = async function() {
|
|
177
|
+
return "undefined" !== typeof require ? require("fs").promises : import("node:fs/promises");
|
|
178
|
+
};
|
|
176
179
|
$load_file$$module$src$lib$$ = async function($fd_filename$jscomp$2$$, $options$jscomp$34$$) {
|
|
177
|
-
$fs$$ || ($fs$$ = await
|
|
180
|
+
$fs$$ || ($fs$$ = await $get_fs$$());
|
|
178
181
|
if ($options$jscomp$34$$.range) {
|
|
179
182
|
$dbg_assert$$module$src$log$$(!$options$jscomp$34$$.as_json);
|
|
180
183
|
$fd_filename$jscomp$2$$ = await $fs$$.open($fd_filename$jscomp$2$$, "r");
|
|
@@ -191,7 +194,7 @@ if ("undefined" === typeof XMLHttpRequest || "undefined" !== typeof process && p
|
|
|
191
194
|
}
|
|
192
195
|
};
|
|
193
196
|
$get_file_size$$module$src$lib$$ = async function($path$jscomp$5$$) {
|
|
194
|
-
$fs$$ || ($fs$$ = await
|
|
197
|
+
$fs$$ || ($fs$$ = await $get_fs$$());
|
|
195
198
|
return (await $fs$$.stat($path$jscomp$5$$)).size;
|
|
196
199
|
};
|
|
197
200
|
} else {
|
|
@@ -6254,8 +6257,7 @@ $v86$$module$src$main$$.prototype.destroy = function() {
|
|
|
6254
6257
|
this.unregister_yield();
|
|
6255
6258
|
};
|
|
6256
6259
|
$v86$$module$src$main$$.prototype.restart = function() {
|
|
6257
|
-
this.cpu.
|
|
6258
|
-
this.cpu.load_bios();
|
|
6260
|
+
this.cpu.reboot_internal();
|
|
6259
6261
|
};
|
|
6260
6262
|
$v86$$module$src$main$$.prototype.init = function($settings$jscomp$1$$) {
|
|
6261
6263
|
this.cpu.init($settings$jscomp$1$$, this.bus);
|
package/build/libv86-debug.mjs
CHANGED
|
@@ -172,8 +172,11 @@ $Bitmap$$module$src$lib$$.prototype.get_buffer = function() {
|
|
|
172
172
|
var $load_file$$module$src$lib$$, $get_file_size$$module$src$lib$$;
|
|
173
173
|
if ("undefined" === typeof XMLHttpRequest || "undefined" !== typeof process && process.versions && process.versions.node) {
|
|
174
174
|
let $fs$$;
|
|
175
|
+
const $get_fs$$ = async function() {
|
|
176
|
+
return "undefined" !== typeof require ? require("fs").promises : import("node:fs/promises");
|
|
177
|
+
};
|
|
175
178
|
$load_file$$module$src$lib$$ = async function($fd_filename$jscomp$2$$, $options$jscomp$34$$) {
|
|
176
|
-
$fs$$ || ($fs$$ = await
|
|
179
|
+
$fs$$ || ($fs$$ = await $get_fs$$());
|
|
177
180
|
if ($options$jscomp$34$$.range) {
|
|
178
181
|
$dbg_assert$$module$src$log$$(!$options$jscomp$34$$.as_json);
|
|
179
182
|
$fd_filename$jscomp$2$$ = await $fs$$.open($fd_filename$jscomp$2$$, "r");
|
|
@@ -190,7 +193,7 @@ if ("undefined" === typeof XMLHttpRequest || "undefined" !== typeof process && p
|
|
|
190
193
|
}
|
|
191
194
|
};
|
|
192
195
|
$get_file_size$$module$src$lib$$ = async function($path$jscomp$5$$) {
|
|
193
|
-
$fs$$ || ($fs$$ = await
|
|
196
|
+
$fs$$ || ($fs$$ = await $get_fs$$());
|
|
194
197
|
return (await $fs$$.stat($path$jscomp$5$$)).size;
|
|
195
198
|
};
|
|
196
199
|
} else {
|
|
@@ -6253,8 +6256,7 @@ $v86$$module$src$main$$.prototype.destroy = function() {
|
|
|
6253
6256
|
this.unregister_yield();
|
|
6254
6257
|
};
|
|
6255
6258
|
$v86$$module$src$main$$.prototype.restart = function() {
|
|
6256
|
-
this.cpu.
|
|
6257
|
-
this.cpu.load_bios();
|
|
6259
|
+
this.cpu.reboot_internal();
|
|
6258
6260
|
};
|
|
6259
6261
|
$v86$$module$src$main$$.prototype.init = function($settings$jscomp$1$$) {
|
|
6260
6262
|
this.cpu.init($settings$jscomp$1$$, this.bus);
|
package/build/libv86.js
CHANGED
|
@@ -5,11 +5,11 @@ function ka(a){var b=new Uint8Array(a),c,d;this.length=0;this.push=function(e){t
|
|
|
5
5
|
la.prototype.push=function(a){this.length===this.size?this.start=this.start+1&this.size-1:this.length++;this.data[this.end]=a;this.end=this.end+1&this.size-1};la.prototype.shift=function(){if(this.length){var a=this.data[this.start];this.start=this.start+1&this.size-1;this.length--;return a}};
|
|
6
6
|
la.prototype.shift_block=function(a){var b=new Float32Array(a);a>this.length&&(a=this.length);var c=this.start+a,d=this.data.subarray(this.start,c);b.set(d);c>=this.size&&(c-=this.size,b.set(this.data.subarray(0,c),d.length));this.start=c;this.length-=a;return b};la.prototype.peek=function(){if(this.length)return this.data[this.start]};la.prototype.clear=function(){this.length=this.end=this.start=0};
|
|
7
7
|
function ma(a){"number"===typeof a?this.view=new Uint8Array(a+7>>3):a instanceof ArrayBuffer&&(this.view=new Uint8Array(a))}ma.prototype.set=function(a,b){const c=a>>3;a=1<<(a&7);this.view[c]=b?this.view[c]|a:this.view[c]&~a};ma.prototype.get=function(a){return this.view[a>>3]>>(a&7)&1};ma.prototype.get_buffer=function(){return this.view.buffer};var oa,pa;
|
|
8
|
-
if("undefined"===typeof XMLHttpRequest||"undefined"!==typeof process&&process.versions&&process.versions.node){let a;
|
|
9
|
-
(a=await
|
|
10
|
-
"identity"),e.onreadystatechange=function(){200===e.status&&(console.error("Server sent full file in response to ranged request, aborting",{filename:a}),e.abort())});e.onload=function(){if(4===e.readyState)if(200!==e.status&&206!==e.status)console.error("Loading the image "+a+" failed (status %d)",e.status),500<=e.status&&600>e.status&&d();else if(e.response){if(b.range){const l=e.getResponseHeader("Content-Encoding");
|
|
11
|
-
{filename:a,enc:l})}b.done&&b.done(e.response,e)}};e.onerror=function(l){console.error("Loading the image "+a+" failed",l);d()};b.progress&&(e.onprogress=function(l){b.progress(l)});e.send(null)},pa=async function(a){return new Promise((b,c)=>{oa(a,{done:(d,e)=>{d=e.getResponseHeader("Content-Range")||"";(e=d.match(/\/(\d+)\s*$/))?b(+e[1]):c(Error("`Range: bytes=...` header not supported (Got `"+d+"`)"))},
|
|
12
|
-
function qa(a,b,c){return String.fromCharCode(...(new Uint8Array(a.buffer,b>>>0,c>>>0)))}
|
|
8
|
+
if("undefined"===typeof XMLHttpRequest||"undefined"!==typeof process&&process.versions&&process.versions.node){let a;const b=async function(){return"undefined"!==typeof require?require("fs").promises:import("node:fs/promises")};oa=async function(c,d){a||(a=await b());if(d.range){c=await a.open(c,"r");const e=Buffer.allocUnsafe(d.range.length);try{await c.read({buffer:e,position:d.range.start})}finally{await c.close()}d.done&&d.done(new Uint8Array(e))}else c=await a.readFile(c,{encoding:d.as_json?
|
|
9
|
+
"utf-8":null}),c=d.as_json?JSON.parse(c):(new Uint8Array(c)).buffer,d.done(c)};pa=async function(c){a||(a=await b());return(await a.stat(c)).size}}else oa=async function(a,b,c){function d(){const l=c||0;setTimeout(()=>{oa(a,b,l+1)},1E3*([1,1,2,3,5,8,13,21][l]||34))}var e=new XMLHttpRequest;e.open(b.method||"get",a,!0);e.responseType=b.as_json?"json":"arraybuffer";if(b.headers)for(var f=Object.keys(b.headers),g=0;g<f.length;g++){var h=f[g];e.setRequestHeader(h,b.headers[h])}b.range&&(f=b.range.start,
|
|
10
|
+
e.setRequestHeader("Range","bytes="+f+"-"+(f+b.range.length-1)),e.setRequestHeader("X-Accept-Encoding","identity"),e.onreadystatechange=function(){200===e.status&&(console.error("Server sent full file in response to ranged request, aborting",{filename:a}),e.abort())});e.onload=function(){if(4===e.readyState)if(200!==e.status&&206!==e.status)console.error("Loading the image "+a+" failed (status %d)",e.status),500<=e.status&&600>e.status&&d();else if(e.response){if(b.range){const l=e.getResponseHeader("Content-Encoding");
|
|
11
|
+
l&&"identity"!==l&&console.error("Server sent Content-Encoding in response to ranged request",{filename:a,enc:l})}b.done&&b.done(e.response,e)}};e.onerror=function(l){console.error("Loading the image "+a+" failed",l);d()};b.progress&&(e.onprogress=function(l){b.progress(l)});e.send(null)},pa=async function(a){return new Promise((b,c)=>{oa(a,{done:(d,e)=>{d=e.getResponseHeader("Content-Range")||"";(e=d.match(/\/(\d+)\s*$/))?b(+e[1]):c(Error("`Range: bytes=...` header not supported (Got `"+d+"`)"))},
|
|
12
|
+
headers:{Range:"bytes=0-0","X-Accept-Encoding":"identity"}})})};function qa(a,b,c){return String.fromCharCode(...(new Uint8Array(a.buffer,b>>>0,c>>>0)))}
|
|
13
13
|
const ra={cp437:" \u263a\u263b\u2665\u2666\u2663\u2660\u2022\u25d8\u25cb\u25d9\u2642\u2640\u266a\u266b\u263c\u25ba\u25c4\u2195\u203c\u00b6\u00a7\u25ac\u21a8\u2191\u2193\u2192\u2190\u221f\u2194\u25b2\u25bc !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00a2\u00a3\u00a5\u20a7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u2310\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u00df\u0393\u03c0\u03a3\u03c3\u00b5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0 ",cp858:"\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u00c1\u00c2\u00c0\u00a9\u2563\u2551\u2557\u255d\u00a2\u00a5\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u00e3\u00c3\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u00a4\u00f0\u00d0\u00ca\u00cb\u00c8\u20ac\u00cd\u00ce\u00cf\u2518\u250c\u2588\u2584\u00a6\u00cc\u2580\u00d3\u00df\u00d4\u00d2\u00f5\u00d5\u00b5\u00fe\u00de\u00da\u00db\u00d9\u00fd\u00dd\u00af\u00b4\u00ad\u00b1\u2017\u00be\u00b6\u00a7\u00f7\u00b8\u00b0\u00a8\u00b7\u00b9\u00b3\u00b2\u25a0 "};
|
|
14
14
|
ra.cp858=ra.cp437.slice(0,128)+ra.cp858;ra.ascii=ra.cp437.split("").map((a,b)=>31<b&&128>b?a:".").join("");function sa(a){return a&&ra[a]?ra[a]:ra.cp437};function ua(){}function va(){};function wa(a,b){function c(w){w=w.toString(16);return"#"+"0".repeat(6-w.length)+w}function d(w){var u=256*na,H=8*R,K=Ta?Ta.canvas:null;K&&K.width===u&&K.height===H||(K?(K.width=u,K.height=H):(K=new OffscreenCanvas(u,H),Ta=K.getContext("2d")),Kb=Ta.createImageData(u,H));const Q=Kb.data;let P=0,S;H=Lb?function(Z){S=S||Z;Q[P+3]=Z;Q[P+7]=Z;P+=8}:function(Z){S=S||Z;Q[P+3]=Z;P+=4};K=32-R;const ja=u*(R-1)*4;u=4*(na-u*R);const fa=1020*na;for(let Z=0,Ea=0;2048>Z;++Z,Ea+=K,P+=u){const Fa=Z%256;Z&&!Fa&&(P+=
|
|
15
15
|
ja);S=!1;for(let La=0;La<R;++La,++Ea,P+=fa){const Ma=w[Ea];for(let ta=128;0<ta;ta>>=1)H(Ma&ta?255:0);Mb&&H(Nb&&192<=Fa&&223>=Fa&&Ma&1?255:0)}fc[Z]=S?1:0}Ta.putImageData(Kb,0,0)}function e(w,u,H,K){if(u&&H){w.style.width="";w.style.height="";K&&(w.style.transform="");var Q=w.getBoundingClientRect();K?w.style.transform=(1===u?"":" scaleX("+u+")")+(1===H?"":" scaleY("+H+")"):(0===u%1&&0===H%1?(g.style.imageRendering="crisp-edges",g.style.imageRendering="pixelated",g.style["-ms-interpolation-mode"]="nearest-neighbor"):
|
|
@@ -347,7 +347,7 @@ N.prototype.get_instruction_stats=function(){var a=this.v86.cpu;var b="";var c="
|
|
|
347
347
|
d=0;const e={};for(let g=0;g<c.length;g++){const h=c[g];var f=void 0;if(h.includes("/")){d++;const [l,m]=h.split("/");f=e[l]/e[m]}else f=e[h]=a.wm.exports.profiler_stat_get(g-d),f=1E8<=f?Math.round(f/1E6)+"m":1E5<=f?Math.round(f/1E3)+"k":f;b+=h+"="+f+"\n"}b+="\n";c=a.wm.exports.get_valid_tlb_entries_count();d=a.wm.exports.get_valid_global_tlb_entries_count();b=b+("TLB_ENTRIES="+c+" ("+d+" global, "+(c-d)+" non-global)\nWASM_TABLE_FREE=")+(a.wm.exports.jit_get_wasm_table_index_free_list_count()+"\n");
|
|
348
348
|
b+="JIT_CACHE_SIZE="+a.wm.exports.jit_get_cache_size()+"\n";b+="FLAT_SEGMENTS="+a.wm.exports.has_flat_segmentation()+"\n";b+="wasm memory size: "+(a.wasm_memory.buffer.byteLength>>20)+"m\n";b=b+"Config:\nJIT_DISABLED="+(a.wm.exports.get_jit_config(0)+"\n");b+="MAX_PAGES="+a.wm.exports.get_jit_config(1)+"\n";b+="JIT_USE_LOOP_SAFETY="+!!a.wm.exports.get_jit_config(2)+"\n";b+="MAX_EXTRA_BASIC_BLOCKS="+a.wm.exports.get_jit_config(3)+"\n";a=[fb(a,!1,!1,!1,!1),fb(a,!0,!1,!1,!1),fb(a,!1,!0,!1,!1),fb(a,!1,
|
|
349
349
|
!1,!0,!1),fb(a,!1,!1,!1,!0)].join("\n\n");return b+a};function xc(a){this.message=a||"File not found"}xc.prototype=Error.prototype;"undefined"!==typeof module&&"undefined"!==typeof module.exports?module.exports.V86=N:"undefined"!==typeof window?window.V86=N:"function"===typeof importScripts&&(self.V86=N);function F(a,b){this.stopping=this.running=!1;this.idle=!0;this.tick_counter=0;this.worker=null;this.cpu=new O(a,b,()=>{this.idle&&this.next_tick(0)});this.bus=a;this.register_yield()}F.prototype.run=function(){this.stopping=!1;this.running||(this.running=!0,this.bus.send("emulator-started"));this.next_tick(0)};F.prototype.do_tick=function(){if(this.stopping||!this.running)this.stopping=this.running=!1,this.bus.send("emulator-stopped");else{this.idle=!1;var a=this.cpu.main_loop();this.next_tick(a)}};
|
|
350
|
-
F.prototype.next_tick=function(a){const b=++this.tick_counter;this.idle=!0;this.yield(a,b)};F.prototype.yield_callback=function(a){a===this.tick_counter&&this.do_tick()};F.prototype.stop=function(){this.running&&(this.stopping=!0)};F.prototype.destroy=function(){this.unregister_yield()};F.prototype.restart=function(){this.cpu.
|
|
350
|
+
F.prototype.next_tick=function(a){const b=++this.tick_counter;this.idle=!0;this.yield(a,b)};F.prototype.yield_callback=function(a){a===this.tick_counter&&this.do_tick()};F.prototype.stop=function(){this.running&&(this.stopping=!0)};F.prototype.destroy=function(){this.unregister_yield()};F.prototype.restart=function(){this.cpu.reboot_internal()};F.prototype.init=function(a){this.cpu.init(a,this.bus);this.bus.send("emulator-ready")};
|
|
351
351
|
if("undefined"!==typeof process)F.prototype.yield=function(a,b){1>a?global.setImmediate(c=>this.yield_callback(c),b):setTimeout(c=>this.yield_callback(c),a,b)},F.prototype.register_yield=function(){},F.prototype.unregister_yield=function(){};else if(globalThis.scheduler&&"function"===typeof globalThis.scheduler.postTask&&location.href.includes("use-scheduling-api"))F.prototype.yield=function(a,b){a=Math.max(0,a);globalThis.scheduler.postTask(()=>this.yield_callback(b),{delay:a})},F.prototype.register_yield=
|
|
352
352
|
function(){},F.prototype.unregister_yield=function(){};else if("undefined"!==typeof Worker){function a(){let b;globalThis.onmessage=function(c){const d=c.data.t;b=b&&clearTimeout(b);1>d?postMessage(c.data.tick):b=setTimeout(()=>postMessage(c.data.tick),d)}}F.prototype.register_yield=function(){const b=URL.createObjectURL(new Blob(["("+a.toString()+")()"],{type:"text/javascript"}));this.worker=new Worker(b);this.worker.onmessage=c=>this.yield_callback(c.data);URL.revokeObjectURL(b)};F.prototype.yield=
|
|
353
353
|
function(b,c){this.worker.postMessage({t:b,tick:c})};F.prototype.unregister_yield=function(){this.worker&&this.worker.terminate();this.worker=null}}else F.prototype.yield=function(a){setTimeout(()=>{this.do_tick()},a)},F.prototype.register_yield=function(){},F.prototype.unregister_yield=function(){};
|
package/build/libv86.mjs
CHANGED
|
@@ -3,11 +3,11 @@ return a[0]}}else if("undefined"!==typeof require){const a=require("crypto");ba=
|
|
|
3
3
|
a>>>8)?8+da[c]:da[a]}}function ia(a){return 1>=a?1:1<<1+ca(a-1)}function ka(a){var b=new Uint8Array(a),c,d;this.length=0;this.push=function(e){this.length!==a&&this.length++;b[d]=e;d=d+1&a-1};this.shift=function(){if(this.length){var e=b[c];c=c+1&a-1;this.length--;return e}return-1};this.peek=function(){return this.length?b[c]:-1};this.clear=function(){this.length=d=c=0};this.clear()}function la(a){this.size=a;this.data=new Float32Array(a);this.length=this.end=this.start=0}la.prototype.push=function(a){this.length===
|
|
4
4
|
this.size?this.start=this.start+1&this.size-1:this.length++;this.data[this.end]=a;this.end=this.end+1&this.size-1};la.prototype.shift=function(){if(this.length){var a=this.data[this.start];this.start=this.start+1&this.size-1;this.length--;return a}};la.prototype.shift_block=function(a){var b=new Float32Array(a);a>this.length&&(a=this.length);var c=this.start+a,d=this.data.subarray(this.start,c);b.set(d);c>=this.size&&(c-=this.size,b.set(this.data.subarray(0,c),d.length));this.start=c;this.length-=
|
|
5
5
|
a;return b};la.prototype.peek=function(){if(this.length)return this.data[this.start]};la.prototype.clear=function(){this.length=this.end=this.start=0};function ma(a){"number"===typeof a?this.view=new Uint8Array(a+7>>3):a instanceof ArrayBuffer&&(this.view=new Uint8Array(a))}ma.prototype.set=function(a,b){const c=a>>3;a=1<<(a&7);this.view[c]=b?this.view[c]|a:this.view[c]&~a};ma.prototype.get=function(a){return this.view[a>>3]>>(a&7)&1};ma.prototype.get_buffer=function(){return this.view.buffer};var oa,
|
|
6
|
-
pa;if("undefined"===typeof XMLHttpRequest||"undefined"!==typeof process&&process.versions&&process.versions.node){let a;
|
|
7
|
-
(a=await
|
|
8
|
-
"identity"),e.onreadystatechange=function(){200===e.status&&(console.error("Server sent full file in response to ranged request, aborting",{filename:a}),e.abort())});e.onload=function(){if(4===e.readyState)if(200!==e.status&&206!==e.status)console.error("Loading the image "+a+" failed (status %d)",e.status),500<=e.status&&600>e.status&&d();else if(e.response){if(b.range){const l=e.getResponseHeader("Content-Encoding");
|
|
9
|
-
{filename:a,enc:l})}b.done&&b.done(e.response,e)}};e.onerror=function(l){console.error("Loading the image "+a+" failed",l);d()};b.progress&&(e.onprogress=function(l){b.progress(l)});e.send(null)},pa=async function(a){return new Promise((b,c)=>{oa(a,{done:(d,e)=>{d=e.getResponseHeader("Content-Range")||"";(e=d.match(/\/(\d+)\s*$/))?b(+e[1]):c(Error("`Range: bytes=...` header not supported (Got `"+d+"`)"))},
|
|
10
|
-
b>>>0,c>>>0)))}const ra={cp437:" \u263a\u263b\u2665\u2666\u2663\u2660\u2022\u25d8\u25cb\u25d9\u2642\u2640\u266a\u266b\u263c\u25ba\u25c4\u2195\u203c\u00b6\u00a7\u25ac\u21a8\u2191\u2193\u2192\u2190\u221f\u2194\u25b2\u25bc !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00a2\u00a3\u00a5\u20a7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u2310\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u00df\u0393\u03c0\u03a3\u03c3\u00b5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0 ",
|
|
6
|
+
pa;if("undefined"===typeof XMLHttpRequest||"undefined"!==typeof process&&process.versions&&process.versions.node){let a;const b=async function(){return"undefined"!==typeof require?require("fs").promises:import("node:fs/promises")};oa=async function(c,d){a||(a=await b());if(d.range){c=await a.open(c,"r");const e=Buffer.allocUnsafe(d.range.length);try{await c.read({buffer:e,position:d.range.start})}finally{await c.close()}d.done&&d.done(new Uint8Array(e))}else c=await a.readFile(c,{encoding:d.as_json?
|
|
7
|
+
"utf-8":null}),c=d.as_json?JSON.parse(c):(new Uint8Array(c)).buffer,d.done(c)};pa=async function(c){a||(a=await b());return(await a.stat(c)).size}}else oa=async function(a,b,c){function d(){const l=c||0;setTimeout(()=>{oa(a,b,l+1)},1E3*([1,1,2,3,5,8,13,21][l]||34))}var e=new XMLHttpRequest;e.open(b.method||"get",a,!0);e.responseType=b.as_json?"json":"arraybuffer";if(b.headers)for(var f=Object.keys(b.headers),g=0;g<f.length;g++){var h=f[g];e.setRequestHeader(h,b.headers[h])}b.range&&(f=b.range.start,
|
|
8
|
+
e.setRequestHeader("Range","bytes="+f+"-"+(f+b.range.length-1)),e.setRequestHeader("X-Accept-Encoding","identity"),e.onreadystatechange=function(){200===e.status&&(console.error("Server sent full file in response to ranged request, aborting",{filename:a}),e.abort())});e.onload=function(){if(4===e.readyState)if(200!==e.status&&206!==e.status)console.error("Loading the image "+a+" failed (status %d)",e.status),500<=e.status&&600>e.status&&d();else if(e.response){if(b.range){const l=e.getResponseHeader("Content-Encoding");
|
|
9
|
+
l&&"identity"!==l&&console.error("Server sent Content-Encoding in response to ranged request",{filename:a,enc:l})}b.done&&b.done(e.response,e)}};e.onerror=function(l){console.error("Loading the image "+a+" failed",l);d()};b.progress&&(e.onprogress=function(l){b.progress(l)});e.send(null)},pa=async function(a){return new Promise((b,c)=>{oa(a,{done:(d,e)=>{d=e.getResponseHeader("Content-Range")||"";(e=d.match(/\/(\d+)\s*$/))?b(+e[1]):c(Error("`Range: bytes=...` header not supported (Got `"+d+"`)"))},
|
|
10
|
+
headers:{Range:"bytes=0-0","X-Accept-Encoding":"identity"}})})};function qa(a,b,c){return String.fromCharCode(...(new Uint8Array(a.buffer,b>>>0,c>>>0)))}const ra={cp437:" \u263a\u263b\u2665\u2666\u2663\u2660\u2022\u25d8\u25cb\u25d9\u2642\u2640\u266a\u266b\u263c\u25ba\u25c4\u2195\u203c\u00b6\u00a7\u25ac\u21a8\u2191\u2193\u2192\u2190\u221f\u2194\u25b2\u25bc !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00a2\u00a3\u00a5\u20a7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u2310\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u00df\u0393\u03c0\u03a3\u03c3\u00b5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0 ",
|
|
11
11
|
cp858:"\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u00c1\u00c2\u00c0\u00a9\u2563\u2551\u2557\u255d\u00a2\u00a5\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u00e3\u00c3\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u00a4\u00f0\u00d0\u00ca\u00cb\u00c8\u20ac\u00cd\u00ce\u00cf\u2518\u250c\u2588\u2584\u00a6\u00cc\u2580\u00d3\u00df\u00d4\u00d2\u00f5\u00d5\u00b5\u00fe\u00de\u00da\u00db\u00d9\u00fd\u00dd\u00af\u00b4\u00ad\u00b1\u2017\u00be\u00b6\u00a7\u00f7\u00b8\u00b0\u00a8\u00b7\u00b9\u00b3\u00b2\u25a0 "};
|
|
12
12
|
ra.cp858=ra.cp437.slice(0,128)+ra.cp858;ra.ascii=ra.cp437.split("").map((a,b)=>31<b&&128>b?a:".").join("");function sa(a){return a&&ra[a]?ra[a]:ra.cp437}function ua(){}function va(){}function wa(a,b){function c(w){w=w.toString(16);return"#"+"0".repeat(6-w.length)+w}function d(w){var u=256*na,H=8*R,K=Ta?Ta.canvas:null;K&&K.width===u&&K.height===H||(K?(K.width=u,K.height=H):(K=new OffscreenCanvas(u,H),Ta=K.getContext("2d")),Kb=Ta.createImageData(u,H));const Q=Kb.data;let P=0,S;H=Lb?function(Z){S=S||
|
|
13
13
|
Z;Q[P+3]=Z;Q[P+7]=Z;P+=8}:function(Z){S=S||Z;Q[P+3]=Z;P+=4};K=32-R;const ja=u*(R-1)*4;u=4*(na-u*R);const fa=1020*na;for(let Z=0,Ea=0;2048>Z;++Z,Ea+=K,P+=u){const Fa=Z%256;Z&&!Fa&&(P+=ja);S=!1;for(let La=0;La<R;++La,++Ea,P+=fa){const Ma=w[Ea];for(let ta=128;0<ta;ta>>=1)H(Ma&ta?255:0);Mb&&H(Nb&&192<=Fa&&223>=Fa&&Ma&1?255:0)}fc[Z]=S?1:0}Ta.putImageData(Kb,0,0)}function e(w,u,H,K){if(u&&H){w.style.width="";w.style.height="";K&&(w.style.transform="");var Q=w.getBoundingClientRect();K?w.style.transform=
|
|
@@ -309,8 +309,8 @@ d=0;const e={};for(let g=0;g<c.length;g++){const h=c[g];var f=void 0;if(h.includ
|
|
|
309
309
|
b+="JIT_CACHE_SIZE="+a.wm.exports.jit_get_cache_size()+"\n";b+="FLAT_SEGMENTS="+a.wm.exports.has_flat_segmentation()+"\n";b+="wasm memory size: "+(a.wasm_memory.buffer.byteLength>>20)+"m\n";b=b+"Config:\nJIT_DISABLED="+(a.wm.exports.get_jit_config(0)+"\n");b+="MAX_PAGES="+a.wm.exports.get_jit_config(1)+"\n";b+="JIT_USE_LOOP_SAFETY="+!!a.wm.exports.get_jit_config(2)+"\n";b+="MAX_EXTRA_BASIC_BLOCKS="+a.wm.exports.get_jit_config(3)+"\n";a=[fb(a,!1,!1,!1,!1),fb(a,!0,!1,!1,!1),fb(a,!1,!0,!1,!1),fb(a,!1,
|
|
310
310
|
!1,!0,!1),fb(a,!1,!1,!1,!0)].join("\n\n");return b+a};function xc(a){this.message=a||"File not found"}xc.prototype=Error.prototype;"undefined"!==typeof module&&"undefined"!==typeof module.exports?module.exports.V86=N:"undefined"!==typeof window?window.V86=N:"function"===typeof importScripts&&(self.V86=N);function F(a,b){this.stopping=this.running=!1;this.idle=!0;this.tick_counter=0;this.worker=null;this.cpu=new O(a,b,()=>{this.idle&&this.next_tick(0)});this.bus=a;this.register_yield()}F.prototype.run=
|
|
311
311
|
function(){this.stopping=!1;this.running||(this.running=!0,this.bus.send("emulator-started"));this.next_tick(0)};F.prototype.do_tick=function(){if(this.stopping||!this.running)this.stopping=this.running=!1,this.bus.send("emulator-stopped");else{this.idle=!1;var a=this.cpu.main_loop();this.next_tick(a)}};F.prototype.next_tick=function(a){const b=++this.tick_counter;this.idle=!0;this.yield(a,b)};F.prototype.yield_callback=function(a){a===this.tick_counter&&this.do_tick()};F.prototype.stop=function(){this.running&&
|
|
312
|
-
(this.stopping=!0)};F.prototype.destroy=function(){this.unregister_yield()};F.prototype.restart=function(){this.cpu.
|
|
313
|
-
|
|
312
|
+
(this.stopping=!0)};F.prototype.destroy=function(){this.unregister_yield()};F.prototype.restart=function(){this.cpu.reboot_internal()};F.prototype.init=function(a){this.cpu.init(a,this.bus);this.bus.send("emulator-ready")};if("undefined"!==typeof process)F.prototype.yield=function(a,b){1>a?global.setImmediate(c=>this.yield_callback(c),b):setTimeout(c=>this.yield_callback(c),a,b)},F.prototype.register_yield=function(){},F.prototype.unregister_yield=function(){};else if(globalThis.scheduler&&"function"===
|
|
313
|
+
typeof globalThis.scheduler.postTask&&location.href.includes("use-scheduling-api"))F.prototype.yield=function(a,b){a=Math.max(0,a);globalThis.scheduler.postTask(()=>this.yield_callback(b),{delay:a})},F.prototype.register_yield=function(){},F.prototype.unregister_yield=function(){};else if("undefined"!==typeof Worker){function a(){let b;globalThis.onmessage=function(c){const d=c.data.t;b=b&&clearTimeout(b);1>d?postMessage(c.data.tick):b=setTimeout(()=>postMessage(c.data.tick),d)}}F.prototype.register_yield=
|
|
314
314
|
function(){const b=URL.createObjectURL(new Blob(["("+a.toString()+")()"],{type:"text/javascript"}));this.worker=new Worker(b);this.worker.onmessage=c=>this.yield_callback(c.data);URL.revokeObjectURL(b)};F.prototype.yield=function(b,c){this.worker.postMessage({t:b,tick:c})};F.prototype.unregister_yield=function(){this.worker&&this.worker.terminate();this.worker=null}}else F.prototype.yield=function(a){setTimeout(()=>{this.do_tick()},a)},F.prototype.register_yield=function(){},F.prototype.unregister_yield=
|
|
315
315
|
function(){};F.prototype.save_state=function(){for(var a=[],b=cb(this.cpu,a),c=[],d=0,e=0;e<a.length;e++){var f=a[e].byteLength;c[e]={offset:d,length:f};d+=f;d=d+3&-4}e=JSON.stringify({buffer_infos:c,state:b});e=(new TextEncoder).encode(e);b=16+e.length;b=b+3&-4;f=b+d;d=new ArrayBuffer(f);var g=new Int32Array(d,0,4);(new Uint8Array(d,16,e.length)).set(e);b=new Uint8Array(d,b);g[0]=-2039052682;g[1]=6;g[2]=f;g[3]=e.length;for(e=0;e<a.length;e++)b.set(a[e],c[e].offset);return d};F.prototype.restore_state=
|
|
316
316
|
function(a){return eb(this.cpu,a)};if("object"===typeof performance&&performance.now)F.microtick=performance.now.bind(performance);else if("function"===typeof require){const {performance:a}=require("perf_hooks");F.microtick=a.now.bind(a)}else F.microtick="object"===typeof process&&process.hrtime?function(){var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:Date.now;function yc(a){this.cpu=a;var b=a.io;a.devices.pci.register_device({pci_id:56,pci_space:[134,128,19,113,7,0,128,2,8,0,128,6,0,0,128,0,0,
|
package/build/v86-debug.wasm
CHANGED
|
Binary file
|
package/build/v86-fallback.wasm
CHANGED
|
Binary file
|
package/build/v86.wasm
CHANGED
|
Binary file
|