v86 0.5.420 → 0.5.424
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 +12 -12
- package/build/libv86-debug.mjs +12 -12
- package/build/libv86.js +29 -29
- package/build/libv86.mjs +212 -212
- package/package.json +1 -1
package/build/libv86-debug.js
CHANGED
|
@@ -4323,12 +4323,12 @@ function $KeyboardAdapter$$module$src$browser$keyboard$$($bus$jscomp$10$$) {
|
|
|
4323
4323
|
}
|
|
4324
4324
|
function $mousemove_handler$$($e$jscomp$31$$) {
|
|
4325
4325
|
if ($mouse$$.bus && $may_handle$jscomp$1$$($e$jscomp$31$$) && $mouse$$.is_running) {
|
|
4326
|
-
var $
|
|
4327
|
-
$touch$jscomp$1_touches$jscomp$3$$ ? $touch$jscomp$1_touches$jscomp$3$$.length && ($touch$jscomp$1_touches$jscomp$3$$ = $touch$jscomp$1_touches$jscomp$3$$[$touch$jscomp$1_touches$jscomp$3$$.length - 1], $
|
|
4328
|
-
typeof $e$jscomp$31$$.movementX ? ($
|
|
4329
|
-
$last_x$$ = $e$jscomp$31$$.clientX, $last_y$$ = $e$jscomp$31$$.clientY);
|
|
4330
|
-
$mouse$$.bus.send("mouse-delta", [1 * $
|
|
4331
|
-
$screen_container$jscomp$1$$ && !document.pointerLockElement && $mouse$$.bus.send("mouse-absolute", [$e$jscomp$31$$.
|
|
4326
|
+
var $delta_x_rect$$ = 0, $delta_y$$ = 0, $touch$jscomp$1_touches$jscomp$3$$ = $e$jscomp$31$$.changedTouches;
|
|
4327
|
+
$touch$jscomp$1_touches$jscomp$3$$ ? $touch$jscomp$1_touches$jscomp$3$$.length && ($touch$jscomp$1_touches$jscomp$3$$ = $touch$jscomp$1_touches$jscomp$3$$[$touch$jscomp$1_touches$jscomp$3$$.length - 1], $delta_x_rect$$ = $touch$jscomp$1_touches$jscomp$3$$.clientX - $last_x$$, $delta_y$$ = $touch$jscomp$1_touches$jscomp$3$$.clientY - $last_y$$, $last_x$$ = $touch$jscomp$1_touches$jscomp$3$$.clientX, $last_y$$ = $touch$jscomp$1_touches$jscomp$3$$.clientY, $e$jscomp$31$$.preventDefault()) : "number" ===
|
|
4328
|
+
typeof $e$jscomp$31$$.movementX ? ($delta_x_rect$$ = $e$jscomp$31$$.movementX, $delta_y$$ = $e$jscomp$31$$.movementY) : "number" === typeof $e$jscomp$31$$.webkitMovementX ? ($delta_x_rect$$ = $e$jscomp$31$$.webkitMovementX, $delta_y$$ = $e$jscomp$31$$.webkitMovementY) : "number" === typeof $e$jscomp$31$$.mozMovementX ? ($delta_x_rect$$ = $e$jscomp$31$$.mozMovementX, $delta_y$$ = $e$jscomp$31$$.mozMovementY) : ($delta_x_rect$$ = $e$jscomp$31$$.clientX - $last_x$$, $delta_y$$ = $e$jscomp$31$$.clientY -
|
|
4329
|
+
$last_y$$, $last_x$$ = $e$jscomp$31$$.clientX, $last_y$$ = $e$jscomp$31$$.clientY);
|
|
4330
|
+
$mouse$$.bus.send("mouse-delta", [1 * $delta_x_rect$$, -(1 * $delta_y$$)]);
|
|
4331
|
+
$screen_container$jscomp$1$$ && !document.pointerLockElement && ($delta_x_rect$$ = $screen_container$jscomp$1$$.getBoundingClientRect(), $mouse$$.bus.send("mouse-absolute", [$e$jscomp$31$$.clientX - $delta_x_rect$$.left, $e$jscomp$31$$.clientY - $delta_x_rect$$.top, $delta_x_rect$$.width, $delta_x_rect$$.height]));
|
|
4332
4332
|
}
|
|
4333
4333
|
}
|
|
4334
4334
|
function $mousedown_handler$$($e$jscomp$32$$) {
|
|
@@ -7796,10 +7796,7 @@ function $PS2$$module$src$ps2$$($cpu$jscomp$19$$, $bus$jscomp$24$$) {
|
|
|
7796
7796
|
this.mouse_send_delta($data$jscomp$184$$[0], $data$jscomp$184$$[1]);
|
|
7797
7797
|
}, this);
|
|
7798
7798
|
this.bus.register("mouse-wheel", function($data$jscomp$185$$) {
|
|
7799
|
-
this.wheel_movement -= $data$jscomp$185$$[0];
|
|
7800
|
-
this.wheel_movement -= 2 * $data$jscomp$185$$[1];
|
|
7801
|
-
this.wheel_movement = Math.min(7, Math.max(-8, this.wheel_movement));
|
|
7802
|
-
this.send_mouse_packet(0, 0);
|
|
7799
|
+
this.have_mouse && this.use_mouse && this.mouse_stream_active() && (this.wheel_movement -= $data$jscomp$185$$[0], this.wheel_movement -= 2 * $data$jscomp$185$$[1], this.wheel_movement = Math.min(7, Math.max(-8, this.wheel_movement)), this.send_mouse_packet(0, 0));
|
|
7803
7800
|
}, this);
|
|
7804
7801
|
$cpu$jscomp$19$$.io.register_read(96, this, this.port60_read);
|
|
7805
7802
|
$cpu$jscomp$19$$.io.register_read(100, this, this.port64_read);
|
|
@@ -7889,6 +7886,9 @@ $PS2$$module$src$ps2$$.prototype.set_state = function($state$jscomp$39$$) {
|
|
|
7889
7886
|
this.mouse_buffer.clear();
|
|
7890
7887
|
this.bus.send("mouse-enable", this.use_mouse);
|
|
7891
7888
|
};
|
|
7889
|
+
$PS2$$module$src$ps2$$.prototype.mouse_stream_active = function() {
|
|
7890
|
+
return this.enable_mouse_stream && !(this.command_register & 32);
|
|
7891
|
+
};
|
|
7892
7892
|
$PS2$$module$src$ps2$$.prototype.raise_irq = function() {
|
|
7893
7893
|
this.next_byte_is_ready || (this.kbd_buffer.length ? this.kbd_irq() : this.mouse_buffer.length && this.mouse_irq());
|
|
7894
7894
|
};
|
|
@@ -7905,11 +7905,11 @@ $PS2$$module$src$ps2$$.prototype.kbd_send_code = function($code$jscomp$9$$) {
|
|
|
7905
7905
|
this.enable_keyboard_stream && ($dbg_log$$module$src$log$$("adding kbd code: " + $h$$module$src$lib$$($code$jscomp$9$$), 64), this.kbd_buffer.push($code$jscomp$9$$), this.raise_irq());
|
|
7906
7906
|
};
|
|
7907
7907
|
$PS2$$module$src$ps2$$.prototype.mouse_send_delta = function($change_x_delta_x$jscomp$2$$, $change_y_delta_y$jscomp$2$$) {
|
|
7908
|
-
this.have_mouse && this.use_mouse && (this.mouse_delta_x += 1 * $change_x_delta_x$jscomp$2$$, this.mouse_delta_y += 1 * $change_y_delta_y$jscomp$2$$, this.
|
|
7908
|
+
this.have_mouse && this.use_mouse && (this.mouse_delta_x += 1 * $change_x_delta_x$jscomp$2$$, this.mouse_delta_y += 1 * $change_y_delta_y$jscomp$2$$, this.mouse_stream_active() && ($change_x_delta_x$jscomp$2$$ = this.mouse_delta_x | 0, $change_y_delta_y$jscomp$2$$ = this.mouse_delta_y | 0, $change_x_delta_x$jscomp$2$$ || $change_y_delta_y$jscomp$2$$)) && (this.mouse_delta_x -= $change_x_delta_x$jscomp$2$$, this.mouse_delta_y -= $change_y_delta_y$jscomp$2$$, this.send_mouse_packet($change_x_delta_x$jscomp$2$$,
|
|
7909
7909
|
$change_y_delta_y$jscomp$2$$));
|
|
7910
7910
|
};
|
|
7911
7911
|
$PS2$$module$src$ps2$$.prototype.mouse_send_click = function($left$jscomp$5$$, $middle$$, $right$jscomp$5$$) {
|
|
7912
|
-
this.have_mouse && this.use_mouse && (this.mouse_clicks = $left$jscomp$5$$ | $right$jscomp$5$$ << 1 | $middle$$ << 2, this.
|
|
7912
|
+
this.have_mouse && this.use_mouse && (this.mouse_clicks = $left$jscomp$5$$ | $right$jscomp$5$$ << 1 | $middle$$ << 2, this.mouse_stream_active() && this.send_mouse_packet(0, 0));
|
|
7913
7913
|
};
|
|
7914
7914
|
$PS2$$module$src$ps2$$.prototype.send_mouse_packet = function($dx$jscomp$4$$, $dy$jscomp$4$$) {
|
|
7915
7915
|
var $info_byte$$ = (0 > $dy$jscomp$4$$) << 5 | (0 > $dx$jscomp$4$$) << 4 | 8 | this.mouse_clicks;
|
package/build/libv86-debug.mjs
CHANGED
|
@@ -4322,12 +4322,12 @@ function $MouseAdapter$$module$src$browser$mouse$$($bus$jscomp$11$$, $screen_con
|
|
|
4322
4322
|
}
|
|
4323
4323
|
function $mousemove_handler$$($e$jscomp$31$$) {
|
|
4324
4324
|
if ($mouse$$.bus && $may_handle$jscomp$1$$($e$jscomp$31$$) && $mouse$$.is_running) {
|
|
4325
|
-
var $
|
|
4326
|
-
$touch$jscomp$1_touches$jscomp$3$$ ? $touch$jscomp$1_touches$jscomp$3$$.length && ($touch$jscomp$1_touches$jscomp$3$$ = $touch$jscomp$1_touches$jscomp$3$$[$touch$jscomp$1_touches$jscomp$3$$.length - 1], $
|
|
4327
|
-
typeof $e$jscomp$31$$.movementX ? ($
|
|
4328
|
-
$last_x$$ = $e$jscomp$31$$.clientX, $last_y$$ = $e$jscomp$31$$.clientY);
|
|
4329
|
-
$mouse$$.bus.send("mouse-delta", [1 * $
|
|
4330
|
-
$screen_container$jscomp$1$$ && !document.pointerLockElement && $mouse$$.bus.send("mouse-absolute", [$e$jscomp$31$$.
|
|
4325
|
+
var $delta_x_rect$$ = 0, $delta_y$$ = 0, $touch$jscomp$1_touches$jscomp$3$$ = $e$jscomp$31$$.changedTouches;
|
|
4326
|
+
$touch$jscomp$1_touches$jscomp$3$$ ? $touch$jscomp$1_touches$jscomp$3$$.length && ($touch$jscomp$1_touches$jscomp$3$$ = $touch$jscomp$1_touches$jscomp$3$$[$touch$jscomp$1_touches$jscomp$3$$.length - 1], $delta_x_rect$$ = $touch$jscomp$1_touches$jscomp$3$$.clientX - $last_x$$, $delta_y$$ = $touch$jscomp$1_touches$jscomp$3$$.clientY - $last_y$$, $last_x$$ = $touch$jscomp$1_touches$jscomp$3$$.clientX, $last_y$$ = $touch$jscomp$1_touches$jscomp$3$$.clientY, $e$jscomp$31$$.preventDefault()) : "number" ===
|
|
4327
|
+
typeof $e$jscomp$31$$.movementX ? ($delta_x_rect$$ = $e$jscomp$31$$.movementX, $delta_y$$ = $e$jscomp$31$$.movementY) : "number" === typeof $e$jscomp$31$$.webkitMovementX ? ($delta_x_rect$$ = $e$jscomp$31$$.webkitMovementX, $delta_y$$ = $e$jscomp$31$$.webkitMovementY) : "number" === typeof $e$jscomp$31$$.mozMovementX ? ($delta_x_rect$$ = $e$jscomp$31$$.mozMovementX, $delta_y$$ = $e$jscomp$31$$.mozMovementY) : ($delta_x_rect$$ = $e$jscomp$31$$.clientX - $last_x$$, $delta_y$$ = $e$jscomp$31$$.clientY -
|
|
4328
|
+
$last_y$$, $last_x$$ = $e$jscomp$31$$.clientX, $last_y$$ = $e$jscomp$31$$.clientY);
|
|
4329
|
+
$mouse$$.bus.send("mouse-delta", [1 * $delta_x_rect$$, -(1 * $delta_y$$)]);
|
|
4330
|
+
$screen_container$jscomp$1$$ && !document.pointerLockElement && ($delta_x_rect$$ = $screen_container$jscomp$1$$.getBoundingClientRect(), $mouse$$.bus.send("mouse-absolute", [$e$jscomp$31$$.clientX - $delta_x_rect$$.left, $e$jscomp$31$$.clientY - $delta_x_rect$$.top, $delta_x_rect$$.width, $delta_x_rect$$.height]));
|
|
4331
4331
|
}
|
|
4332
4332
|
}
|
|
4333
4333
|
function $mousedown_handler$$($e$jscomp$32$$) {
|
|
@@ -7795,10 +7795,7 @@ function $PS2$$module$src$ps2$$($cpu$jscomp$19$$, $bus$jscomp$24$$) {
|
|
|
7795
7795
|
this.mouse_send_delta($data$jscomp$184$$[0], $data$jscomp$184$$[1]);
|
|
7796
7796
|
}, this);
|
|
7797
7797
|
this.bus.register("mouse-wheel", function($data$jscomp$185$$) {
|
|
7798
|
-
this.wheel_movement -= $data$jscomp$185$$[0];
|
|
7799
|
-
this.wheel_movement -= 2 * $data$jscomp$185$$[1];
|
|
7800
|
-
this.wheel_movement = Math.min(7, Math.max(-8, this.wheel_movement));
|
|
7801
|
-
this.send_mouse_packet(0, 0);
|
|
7798
|
+
this.have_mouse && this.use_mouse && this.mouse_stream_active() && (this.wheel_movement -= $data$jscomp$185$$[0], this.wheel_movement -= 2 * $data$jscomp$185$$[1], this.wheel_movement = Math.min(7, Math.max(-8, this.wheel_movement)), this.send_mouse_packet(0, 0));
|
|
7802
7799
|
}, this);
|
|
7803
7800
|
$cpu$jscomp$19$$.io.register_read(96, this, this.port60_read);
|
|
7804
7801
|
$cpu$jscomp$19$$.io.register_read(100, this, this.port64_read);
|
|
@@ -7888,6 +7885,9 @@ $PS2$$module$src$ps2$$.prototype.set_state = function($state$jscomp$39$$) {
|
|
|
7888
7885
|
this.mouse_buffer.clear();
|
|
7889
7886
|
this.bus.send("mouse-enable", this.use_mouse);
|
|
7890
7887
|
};
|
|
7888
|
+
$PS2$$module$src$ps2$$.prototype.mouse_stream_active = function() {
|
|
7889
|
+
return this.enable_mouse_stream && !(this.command_register & 32);
|
|
7890
|
+
};
|
|
7891
7891
|
$PS2$$module$src$ps2$$.prototype.raise_irq = function() {
|
|
7892
7892
|
this.next_byte_is_ready || (this.kbd_buffer.length ? this.kbd_irq() : this.mouse_buffer.length && this.mouse_irq());
|
|
7893
7893
|
};
|
|
@@ -7904,11 +7904,11 @@ $PS2$$module$src$ps2$$.prototype.kbd_send_code = function($code$jscomp$9$$) {
|
|
|
7904
7904
|
this.enable_keyboard_stream && ($dbg_log$$module$src$log$$("adding kbd code: " + $h$$module$src$lib$$($code$jscomp$9$$), 64), this.kbd_buffer.push($code$jscomp$9$$), this.raise_irq());
|
|
7905
7905
|
};
|
|
7906
7906
|
$PS2$$module$src$ps2$$.prototype.mouse_send_delta = function($change_x_delta_x$jscomp$2$$, $change_y_delta_y$jscomp$2$$) {
|
|
7907
|
-
this.have_mouse && this.use_mouse && (this.mouse_delta_x += 1 * $change_x_delta_x$jscomp$2$$, this.mouse_delta_y += 1 * $change_y_delta_y$jscomp$2$$, this.
|
|
7907
|
+
this.have_mouse && this.use_mouse && (this.mouse_delta_x += 1 * $change_x_delta_x$jscomp$2$$, this.mouse_delta_y += 1 * $change_y_delta_y$jscomp$2$$, this.mouse_stream_active() && ($change_x_delta_x$jscomp$2$$ = this.mouse_delta_x | 0, $change_y_delta_y$jscomp$2$$ = this.mouse_delta_y | 0, $change_x_delta_x$jscomp$2$$ || $change_y_delta_y$jscomp$2$$)) && (this.mouse_delta_x -= $change_x_delta_x$jscomp$2$$, this.mouse_delta_y -= $change_y_delta_y$jscomp$2$$, this.send_mouse_packet($change_x_delta_x$jscomp$2$$,
|
|
7908
7908
|
$change_y_delta_y$jscomp$2$$));
|
|
7909
7909
|
};
|
|
7910
7910
|
$PS2$$module$src$ps2$$.prototype.mouse_send_click = function($left$jscomp$5$$, $middle$$, $right$jscomp$5$$) {
|
|
7911
|
-
this.have_mouse && this.use_mouse && (this.mouse_clicks = $left$jscomp$5$$ | $right$jscomp$5$$ << 1 | $middle$$ << 2, this.
|
|
7911
|
+
this.have_mouse && this.use_mouse && (this.mouse_clicks = $left$jscomp$5$$ | $right$jscomp$5$$ << 1 | $middle$$ << 2, this.mouse_stream_active() && this.send_mouse_packet(0, 0));
|
|
7912
7912
|
};
|
|
7913
7913
|
$PS2$$module$src$ps2$$.prototype.send_mouse_packet = function($dx$jscomp$4$$, $dy$jscomp$4$$) {
|
|
7914
7914
|
var $info_byte$$ = (0 > $dy$jscomp$4$$) << 5 | (0 > $dx$jscomp$4$$) << 4 | 8 | this.mouse_clicks;
|
package/build/libv86.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
;(function(){'use strict';function ba(a,b){return(a||0===a?a+"":"").padEnd(b," ")}function k(a,b,c,d){return new Proxy({},{get:function(e,f){e=new a(b.buffer,c,d);const g=e[f];if("function"===typeof g)return g.bind(e);/^\d+$/.test(f);return g},set:function(e,f,g){/^\d+$/.test(f);(new a(b.buffer,c,d))[f]=g;return!0}})}function y(a,b){a=(a?a.toString(16):"").toUpperCase();return"0x"+(a||0===a?a+"":"").padStart(b||1,"0")}var ca;
|
|
2
2
|
if("undefined"!==typeof crypto&&crypto.getRandomValues){const a=new Int32Array(1);ca=function(){crypto.getRandomValues(a);return a[0]}}else if("undefined"!==typeof require){const a=require("crypto");ca=function(){return a.randomBytes(4).readInt32LE(0)}}else"undefined"!==typeof process&&import("node:crypto").then(a=>{ca=function(){return a.randomBytes(4).readInt32LE(0)}});var da;
|
|
3
|
-
if("function"===typeof Math.clz32)da=function(a){return 31-Math.clz32(a)};else{for(var ea=new Int8Array(256),fa=0,
|
|
3
|
+
if("function"===typeof Math.clz32)da=function(a){return 31-Math.clz32(a)};else{for(var ea=new Int8Array(256),fa=0,ha=-2;256>fa;fa++)fa&fa-1||ha++,ea[fa]=ha;da=function(a){a>>>=0;var b=a>>>16;if(b){var c=b>>>8;return c?24+ea[c]:16+ea[b]}return(c=a>>>8)?8+ea[c]:ea[a]}}function ja(a){return 1>=a?1:1<<1+da(a-1)}
|
|
4
4
|
function ma(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 na(a){this.size=a;this.data=new Float32Array(a);this.length=this.end=this.start=0}
|
|
5
5
|
na.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};na.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
|
na.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};na.prototype.peek=function(){if(this.length)return this.data[this.start]};na.prototype.clear=function(){this.length=this.end=this.start=0};
|
|
@@ -11,21 +11,21 @@ h=0;h<g.length;h++){var m=g[h];e.setRequestHeader(m,b.headers[m])}b.range&&(g=b.
|
|
|
11
11
|
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");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){b.signal&&b.signal.removeEventListener("abort",f);console.error("Loading the image "+a+" failed",l);d()};b.progress&&(e.onprogress=function(l){b.progress(l)});e.send(null)},qa=async function(a){return new Promise((b,
|
|
12
12
|
c)=>{pa(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+"`)"))},headers:{Range:"bytes=0-0","X-Accept-Encoding":"identity"}})})};function ra(a,b,c){return String.fromCharCode(...(new Uint8Array(a.buffer,b>>>0,c>>>0)))}
|
|
13
13
|
const sa={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
|
-
sa.cp858=sa.cp437.slice(0,128)+sa.cp858;sa.ascii=sa.cp437.split("").map((a,b)=>31<b&&128>b?a:".").join("");function ta(a){return a&&sa[a]?sa[a]:sa.cp437};function va(){}function wa(){};function xa(a,b){function c(v){v=v.toString(16);return"#"+"0".repeat(6-v.length)+v}function d(v){var
|
|
15
|
-
aa&&!Ga&&(Q+=la);U=!1;for(let Ma=0;Ma<T;++Ma,++Fa,Q+=
|
|
16
|
-
"nearest-neighbor"):(g.style.imageRendering="",g.style["-ms-interpolation-mode"]=""),M=window.devicePixelRatio||1,0!==M%1&&(
|
|
17
|
-
f.getElementsByTagName("div")[0];m||(m=document.createElement("div"),f.appendChild(m));const l=document.createElement("div");var n,p,q=void 0!==a.scale?a.scale:1,r=void 0!==a.scale?a.scale:1,x=1,E,B,C,w,
|
|
18
|
-
25);2===B&&this.set_size_graphical(720,400,720,400);this.set_scale(q,r);this.timer()};this.make_screenshot=function(){const v=new Image;if(1===B||2===B)v.src=g.toDataURL("image/png");else{const
|
|
19
|
-
R*
|
|
20
|
-
B?this.update_text():1===B?this.update_graphical():this.update_graphical_text());this.timer()};this.update_text=function(){for(var v=0;v<
|
|
21
|
-
w*ka,Q=T;let U=0;for(let la=0,
|
|
22
|
-
Ga,T);O.globalCompositeOperation="destination-in";O.drawImage(
|
|
23
|
-
this.clear_text_state=function(){vb=ub=
|
|
24
|
-
E.fill(1)};this.clear_screen=function(){h.fillStyle="#000";h.fillRect(0,0,g.width,g.height)};this.set_size_graphical_text=function(){if(Ua){var v=ka*w,
|
|
25
|
-
|
|
26
|
-
2:1;e(g,q*x,r*x,!1)};this.set_scale=function(v,
|
|
27
|
-
0;Q<w;){var U=document.createElement("span");var la=C[
|
|
28
|
-
|
|
14
|
+
sa.cp858=sa.cp437.slice(0,128)+sa.cp858;sa.ascii=sa.cp437.split("").map((a,b)=>31<b&&128>b?a:".").join("");function ta(a){return a&&sa[a]?sa[a]:sa.cp437};function va(){}function wa(){};function xa(a,b){function c(v){v=v.toString(16);return"#"+"0".repeat(6-v.length)+v}function d(v){var u=256*ka,J=8*T,M=Ua?Ua.canvas:null;M&&M.width===u&&M.height===J||(M?(M.width=u,M.height=J):(M=new OffscreenCanvas(u,J),Ua=M.getContext("2d")),Ob=Ua.createImageData(u,J));const R=Ob.data;let Q=0,U;J=Pb?function(aa){U=U||aa;R[Q+3]=aa;R[Q+7]=aa;Q+=8}:function(aa){U=U||aa;R[Q+3]=aa;Q+=4};M=32-T;const la=u*(T-1)*4;u=4*(ka-u*T);const ia=1020*ka;for(let aa=0,Fa=0;2048>aa;++aa,Fa+=M,Q+=u){const Ga=aa%256;
|
|
15
|
+
aa&&!Ga&&(Q+=la);U=!1;for(let Ma=0;Ma<T;++Ma,++Fa,Q+=ia){const Na=v[Fa];for(let ua=128;0<ua;ua>>=1)J(Na&ua?255:0);Qb&&J(Rb&&192<=Ga&&223>=Ga&&Na&1?255:0)}hc[aa]=U?1:0}Ua.putImageData(Ob,0,0)}function e(v,u,J,M){if(u&&J){v.style.width="";v.style.height="";M&&(v.style.transform="");var R=v.getBoundingClientRect();M?v.style.transform=(1===u?"":" scaleX("+u+")")+(1===J?"":" scaleY("+J+")"):(0===u%1&&0===J%1?(g.style.imageRendering="crisp-edges",g.style.imageRendering="pixelated",g.style["-ms-interpolation-mode"]=
|
|
16
|
+
"nearest-neighbor"):(g.style.imageRendering="",g.style["-ms-interpolation-mode"]=""),M=window.devicePixelRatio||1,0!==M%1&&(u/=M,J/=M));1!==u&&(v.style.width=R.width*u+"px");1!==J&&(v.style.height=R.height*J+"px")}}const f=a.container;this.screen_fill_buffer=b;console.assert(f,"options.container must be provided");this.FLAG_BLINKING=1;this.FLAG_FONT_PAGE_B=2;let g=f.getElementsByTagName("canvas")[0];g||(g=document.createElement("canvas"),f.appendChild(g));const h=g.getContext("2d",{alpha:!1});let m=
|
|
17
|
+
f.getElementsByTagName("div")[0];m||(m=document.createElement("div"),f.appendChild(m));const l=document.createElement("div");var n,p,q=void 0!==a.scale?a.scale:1,r=void 0!==a.scale?a.scale:1,x=1,E,B,C,w,t,I,O,Ua,Ob,hc=new Int8Array(2048),T,ka,Qb,Pb,Rb,ub=0,vb=0,wb,ic=0,xb,Sb,yb,Tb=ta(a.encoding),zb=0,Ub=!1;this.init=function(){l.classList.add("cursor");l.style.position="absolute";l.style.backgroundColor="#ccc";l.style.width="7px";l.style.display="inline-block";this.set_mode(!1);this.set_size_text(80,
|
|
18
|
+
25);2===B&&this.set_size_graphical(720,400,720,400);this.set_scale(q,r);this.timer()};this.make_screenshot=function(){const v=new Image;if(1===B||2===B)v.src=g.toDataURL("image/png");else{const u=[9,16],J=document.createElement("canvas");J.width=w*u[0];J.height=t*u[1];const M=J.getContext("2d");M.imageSmoothingEnabled=!1;M.font=window.getComputedStyle(m).font;M.textBaseline="top";for(let R=0;R<t;R++)for(let Q=0;Q<w;Q++){const U=4*(R*w+Q),la=C[U+0],ia=C[U+3];M.fillStyle=c(C[U+2]);M.fillRect(Q*u[0],
|
|
19
|
+
R*u[1],u[0],u[1]);M.fillStyle=c(ia);M.fillText(Tb[la],Q*u[0],R*u[1])}"none"!==l.style.display&&n<t&&p<w&&(M.fillStyle=l.style.backgroundColor,M.fillRect(p*u[0],n*u[1]+parseInt(l.style.marginTop,10),parseInt(l.style.width,10),parseInt(l.style.height,10)));v.src=J.toDataURL("image/png")}return v};this.put_char=function(v,u,J,M,R,Q){u=4*(v*w+u);C[u+0]=J;C[u+1]=M;C[u+2]=R;C[u+3]=Q;E[v]=1};this.timer=function(){zb=requestAnimationFrame(()=>this.update_screen())};this.update_screen=function(){Ub||(0===
|
|
20
|
+
B?this.update_text():1===B?this.update_graphical():this.update_graphical_text());this.timer()};this.update_text=function(){for(var v=0;v<t;v++)E[v]&&(this.text_update_row(v),E[v]=0)};this.update_graphical=function(){this.screen_fill_buffer()};this.update_graphical_text=function(){if(I){var v=performance.now();if(266<v-ic){wb=!wb;yb&&(E[n]=1);var u=4*w;for(let la=0,ia=0;la<t;++la)if(E[la])ia+=u;else for(var J=0;J<w;++J,ia+=4)if(C[ia+1]&1){E[la]=1;ia+=u-4*J;break}ic=v}v=Ua.canvas;u=O.canvas;J=4*w;const R=
|
|
21
|
+
w*ka,Q=T;let U=0;for(let la=0,ia=0,aa=0;la<t;++la,ia+=T){if(!E[la]){aa+=J;continue}++U;O.clearRect(0,Q,R,T);let Fa,Ga,Ma,Na;for(let ua=0;ua<R;ua+=ka,aa+=4){const jc=C[aa+0];var M=C[aa+1];const kc=C[aa+2],lc=C[aa+3],mc=M&2?vb:ub;M=(!(M&1)||wb)&&hc[(mc<<8)+jc];Ma!==kc&&(void 0!==Ma&&(I.fillStyle=c(Ma),I.fillRect(Na,ia,ua-Na,T)),Ma=kc,Na=ua);Fa!==lc&&(void 0!==Fa&&(O.fillStyle=c(Fa),O.fillRect(Ga,0,ua-Ga,T)),Fa=lc,Ga=ua);M&&O.drawImage(v,jc*ka,mc*T,ka,T,ua,Q,ka,T)}O.fillStyle=c(Fa);O.fillRect(Ga,0,R-
|
|
22
|
+
Ga,T);O.globalCompositeOperation="destination-in";O.drawImage(u,0,Q,R,T,0,0,R,T);O.globalCompositeOperation="source-over";I.fillStyle=c(Ma);I.fillRect(Na,ia,R-Na,T);I.drawImage(u,0,0,R,T,0,ia,R,T)}U&&(wb&&yb&&E[n]&&(I.fillStyle=c(C[4*(n*w+p)+3]),I.fillRect(p*ka,n*T+xb,ka,Sb-xb+1)),E.fill(0));U&&h.drawImage(I.canvas,0,0)}};this.destroy=function(){zb&&(cancelAnimationFrame(zb),zb=0)};this.pause=function(){Ub=!0;l.classList.remove("blinking-cursor")};this.continue=function(){Ub=!1;l.classList.add("blinking-cursor")};
|
|
23
|
+
this.clear_text_state=function(){vb=ub=t=w=T=ka=null};this.set_mode=function(v){B=v?1:a.use_graphical_text?2:0;0===B?(m.style.display="block",g.style.display="none"):(m.style.display="none",g.style.display="block",2===B&&E&&E.fill(1))};this.set_font_bitmap=function(v,u,J,M,R,Q){const U=J?16:u?9:8;if(T!==v||ka!==U||Qb!==u||Pb!==J||Rb!==M||Q)Q=ka!==U||T!==v,T=v,ka=U,Qb=u,Pb=J,Rb=M,2===B&&(d(R),E.fill(1),Q&&this.set_size_graphical_text())};this.set_font_page=function(v,u){if(ub!==v||vb!==u)ub=v,vb=u,
|
|
24
|
+
E.fill(1)};this.clear_screen=function(){h.fillStyle="#000";h.fillRect(0,0,g.width,g.height)};this.set_size_graphical_text=function(){if(Ua){var v=ka*w,u=T*t,J=2*T;I&&I.canvas.width===v&&I.canvas.height===u&&O.canvas.height===J||(I?(I.canvas.width=v,I.canvas.height=u,O.canvas.width=v,O.canvas.height=J):(I=(new OffscreenCanvas(v,u)).getContext("2d",{alpha:!1}),O=(new OffscreenCanvas(v,J)).getContext("2d")),this.set_size_graphical(v,u,v,u),E.fill(1))}};this.set_size_text=function(v,u){if(v!==w||u!==
|
|
25
|
+
t)if(E=new Int8Array(u),E.fill(1),C=new Int32Array(v*u*4),w=v,t=u,0===B){for(;m.childNodes.length>u;)m.removeChild(m.firstChild);for(;m.childNodes.length<u;)m.appendChild(document.createElement("div"));for(v=0;v<u;v++)this.text_update_row(v);e(m,q,r,!0)}else 2===B&&this.set_size_graphical_text()};this.set_size_graphical=function(v,u){g.style.display="block";g.width=v;g.height=u;h.imageSmoothingEnabled=!1;x=640>=v&&2*v<window.innerWidth*window.devicePixelRatio&&2*u<window.innerHeight*window.devicePixelRatio?
|
|
26
|
+
2:1;e(g,q*x,r*x,!1)};this.set_scale=function(v,u){q=v;r=u;e(m,q,r,!0);e(g,q*x,r*x,!1)};this.update_cursor_scanline=function(v,u,J){if(v!==xb||u!==Sb||J!==yb)0===B?J?(l.style.display="inline",l.style.height=u-v+"px",l.style.marginTop=v+"px"):l.style.display="none":2===B&&n<t&&(E[n]=1),xb=v,Sb=u,yb=J};this.update_cursor=function(v,u){if(v!==n||u!==p)v<t&&(E[v]=1),n<t&&(E[n]=1),n=v,p=u};this.text_update_row=function(v){var u=4*v*w,J;var M=m.childNodes[v];var R=document.createElement("div");for(var Q=
|
|
27
|
+
0;Q<w;){var U=document.createElement("span");var la=C[u+1]&1;var ia=C[u+2];var aa=C[u+3];la&&U.classList.add("blink");U.style.backgroundColor=c(ia);U.style.color=c(aa);for(J="";Q<w&&(C[u+1]&1)===la&&C[u+2]===ia&&C[u+3]===aa;)if(J+=Tb[C[u+0]],Q++,u+=4,v===n)if(Q===p)break;else if(Q===p+1){l.style.backgroundColor=U.style.color;R.appendChild(l);break}U.textContent=J;R.appendChild(U)}M.parentNode.replaceChild(R,M)};this.update_buffer=function(v){for(const u of v)h.putImageData(u.image_data,u.screen_x-
|
|
28
|
+
u.buffer_x,u.screen_y-u.buffer_y,u.buffer_x,u.buffer_y,u.buffer_width,u.buffer_height)};this.get_text_screen=function(){for(var v=[],u=0;u<t;u++)v.push(this.get_text_row(u));return v};this.get_text_row=function(v){var u=v*w*4;v=u+4*w;let J="";for(;u<v;u+=4)J+=Tb[C[u]];return J};this.init()};function z(a){this.buffer=a;this.byteLength=a.byteLength;this.onprogress=this.onload=void 0}z.prototype.load=function(){this.onload&&this.onload({buffer:this.buffer})};z.prototype.get=function(a,b,c){c(new Uint8Array(this.buffer,a,b))};z.prototype.set=function(a,b,c){(new Uint8Array(this.buffer,a,b.byteLength)).set(b);c()};z.prototype.get_buffer=function(a){a(this.buffer)};z.prototype.get_state=function(){const a=[];a[0]=this.byteLength;a[1]=new Uint8Array(this.buffer);return a};
|
|
29
29
|
z.prototype.set_state=function(a){this.byteLength=a[0];this.buffer=a[1].slice().buffer};function ya(a,b,c){this.filename=a;this.byteLength=b;this.block_cache=new Map;this.block_cache_is_write=new Set;this.fixed_chunk_size=c;this.cache_reads=!!c;this.onprogress=this.onload=void 0}ya.prototype.load=async function(){void 0===this.byteLength&&(this.byteLength=await qa(this.filename));this.onload&&this.onload(Object.create(null))};
|
|
30
30
|
ya.prototype.get_from_cache=function(a,b){var c=b/256;a/=256;for(var d=0;d<c;d++)if(!this.block_cache.get(a+d))return;if(1===c)return this.block_cache.get(a);b=new Uint8Array(b);for(d=0;d<c;d++)b.set(this.block_cache.get(a+d),256*d);return b};
|
|
31
31
|
ya.prototype.get=function(a,b,c,d){var e=this.get_from_cache(a,b);if(e)c(e);else{var f=a,g=b;this.fixed_chunk_size&&(f=a-a%this.fixed_chunk_size,g=Math.ceil((a-f+b)/this.fixed_chunk_size)*this.fixed_chunk_size);pa(this.filename,{done:function(h){h=new Uint8Array(h);this.handle_read(f,g,h);f===a&&g===b?c(h):c(h.subarray(a-f,a-f+b))}.bind(this),range:{start:f,length:g},signal:d?.signal})}};
|
|
@@ -232,18 +232,18 @@ $b.prototype.send_wisp_frame=function(a){let b,c;switch(a.type){case "CONNECT":c
|
|
|
232
232
|
2);c.setUint32(1,a.stream_id,!0);b.set(a.data,5);break;case "CLOSE":b=new Uint8Array(6),c=new DataView(b.buffer),c.setUint8(0,4),c.setUint32(1,a.stream_id,!0),c.setUint8(5,a.reason)}this.send_packet(b,a.type,a.stream_id)};$b.prototype.destroy=function(){this.wispws&&(this.wispws.onmessage=null,this.wispws.onclose=null,this.wispws.close(),this.wispws=null)};
|
|
233
233
|
$b.prototype.on_tcp_connection=function(a,b){a.stream_id=this.last_stream++;a.on("data",c=>{0!==c.length&&this.send_wisp_frame({type:"DATA",stream_id:a.stream_id,data:c})});a.on_close=()=>{this.send_wisp_frame({type:"CLOSE",stream_id:a.stream_id,reason:2})};a.on_shutdown=a.on_close;this.send_wisp_frame({type:"CONNECT",stream_id:a.stream_id,hostname:b.ipv4.dest.join("."),port:a.sport,data_callback:c=>{a.write(c)},close_callback:()=>{a.close()}});a.accept();return!0};
|
|
234
234
|
$b.prototype.send=function(a){Kb(a,this)};$b.prototype.receive=function(a){this.bus.send("net"+this.id+"-receive",new Uint8Array(a))};const ac="undefined"!==typeof window&&0<=window.navigator.platform.toString().toLowerCase().search("win");
|
|
235
|
-
function bc(a){function b(
|
|
236
|
-
0;I<
|
|
237
|
-
q);p=null},10),!1;h(
|
|
235
|
+
function bc(a){function b(t){return t.shiftKey&&t.ctrlKey&&(73===t.keyCode||74===t.keyCode||75===t.keyCode)||!x.emu_enabled?!1:t.target?t.target.classList.contains("phone_keyboard")||"INPUT"!==t.target.nodeName&&"TEXTAREA"!==t.target.nodeName:!0}function c(t){!t.altKey&&n[56]&&m(56,!1);return g(t,!1)}function d(t){!t.altKey&&n[56]&&m(56,!1);return g(t,!0)}function e(){for(var t=Object.keys(n),I,O=0;O<t.length;O++)I=+t[O],n[I]&&m(I,!1);n={}}function f(t){if(x.bus&&b(t))switch(t.inputType){case "insertText":for(var I=
|
|
236
|
+
0;I<t.data.length;I++)x.simulate_char(t.data[I]);break;case "insertLineBreak":x.simulate_press(13);break;case "deleteContentBackward":x.simulate_press(8)}}function g(t,I){if(x.bus&&b(t)&&""!==t.code&&"Process"!==t.key&&"Unidentified"!==t.key&&229!==t.keyCode){t.preventDefault&&t.preventDefault();if(ac&&(p&&(clearTimeout(r),t.getModifierState&&t.getModifierState("AltGraph")&&q===I&&"ControlLeft"===p.code&&"AltRight"===t.code||h(p,q),p=null),"ControlLeft"===t.code))return p=t,q=I,r=setTimeout(()=>{h(p,
|
|
237
|
+
q);p=null},10),!1;h(t,I);return!1}}function h(t,I){a:{if(void 0!==t.code){var O=w[t.code];if(void 0!==O)break a}O=E[t.keyCode]}O?m(O,I,t.repeat):console.log("Missing char in map: keyCode="+(t.keyCode||-1).toString(16)+" code="+t.code)}function m(t,I,O){if(I)n[t]&&!O&&m(t,!1);else if(!n[t])return;(n[t]=I)||(t|=128);255<t?(l(t>>8),l(t&255)):l(t)}function l(t){x.bus.send("keyboard-code",t)}var n={},p=null,q=!1,r=0,x=this;this.emu_enabled=!0;const E=new Uint16Array([0,0,0,0,0,0,0,0,14,15,0,0,0,28,0,0,
|
|
238
238
|
42,29,56,0,58,0,0,0,0,0,0,1,0,0,0,0,57,57417,57425,57423,57415,57419,57416,57421,80,0,0,0,0,82,83,0,11,2,3,4,5,6,7,8,9,10,0,39,0,13,0,0,0,30,48,46,32,18,33,34,35,23,36,37,38,50,49,24,25,16,19,31,20,22,47,17,45,21,44,57435,57436,57437,0,0,82,79,80,81,75,76,77,71,72,73,0,0,0,0,0,0,59,60,61,62,63,64,65,66,67,68,87,88,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,39,13,51,12,52,53,41,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
239
239
|
0,0,0,0,0,0,0,26,43,27,40,0,57435,57400,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),B={8:8,10:13,32:32,39:222,44:188,45:189,46:190,47:191,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,59:186,61:187,91:219,92:220,93:221,96:192,97:65,98:66,99:67,100:68,101:69,102:70,103:71,104:72,105:73,106:74,107:75,108:76,109:77,110:78,111:79,112:80,113:81,114:82,115:83,116:84,117:85,118:86,119:87,120:88,121:89,122:90},C={33:49,34:222,35:51,36:52,37:53,38:55,40:57,41:48,42:56,43:187,58:186,60:188,62:190,63:191,64:50,
|
|
240
240
|
65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,94:54,95:189,123:219,124:220,125:221,126:192};var w={Escape:1,Digit1:2,Digit2:3,Digit3:4,Digit4:5,Digit5:6,Digit6:7,Digit7:8,Digit8:9,Digit9:10,Digit0:11,Minus:12,Equal:13,Backspace:14,Tab:15,KeyQ:16,KeyW:17,KeyE:18,KeyR:19,KeyT:20,KeyY:21,KeyU:22,KeyI:23,KeyO:24,KeyP:25,BracketLeft:26,BracketRight:27,Enter:28,ControlLeft:29,KeyA:30,KeyS:31,KeyD:32,
|
|
241
241
|
KeyF:33,KeyG:34,KeyH:35,KeyJ:36,KeyK:37,KeyL:38,Semicolon:39,Quote:40,Backquote:41,ShiftLeft:42,Backslash:43,KeyZ:44,KeyX:45,KeyC:46,KeyV:47,KeyB:48,KeyN:49,KeyM:50,Comma:51,Period:52,Slash:53,IntlRo:53,ShiftRight:54,NumpadMultiply:55,AltLeft:56,Space:57,CapsLock:58,F1:59,F2:60,F3:61,F4:62,F5:63,F6:64,F7:65,F8:66,F9:67,F10:68,NumLock:69,ScrollLock:70,Numpad7:71,Numpad8:72,Numpad9:73,NumpadSubtract:74,Numpad4:75,Numpad5:76,Numpad6:77,NumpadAdd:78,Numpad1:79,Numpad2:80,Numpad3:81,Numpad0:82,NumpadDecimal:83,
|
|
242
242
|
IntlBackslash:86,F11:87,F12:88,NumpadEnter:57372,ControlRight:57373,NumpadDivide:57397,AltRight:57400,Home:57415,ArrowUp:57416,PageUp:57417,ArrowLeft:57419,ArrowRight:57421,End:57423,ArrowDown:57424,PageDown:57425,Insert:57426,Delete:57427,MetaLeft:57435,OSLeft:57435,MetaRight:57436,OSRight:57436,ContextMenu:57437};this.bus=a;this.destroy=function(){"undefined"!==typeof window&&(window.removeEventListener("keyup",c,!1),window.removeEventListener("keydown",d,!1),window.removeEventListener("blur",e,
|
|
243
|
-
!1),window.removeEventListener("input",f,!1))};this.init=function(){"undefined"!==typeof window&&(this.destroy(),window.addEventListener("keyup",c,!1),window.addEventListener("keydown",d,!1),window.addEventListener("blur",e,!1),window.addEventListener("input",f,!1))};this.init();this.simulate_press=function(
|
|
244
|
-
I,
|
|
245
|
-
e(w)&&C.is_running){var
|
|
246
|
-
[w.
|
|
243
|
+
!1),window.removeEventListener("input",f,!1))};this.init=function(){"undefined"!==typeof window&&(this.destroy(),window.addEventListener("keyup",c,!1),window.addEventListener("keydown",d,!1),window.addEventListener("blur",e,!1),window.addEventListener("input",f,!1))};this.init();this.simulate_press=function(t){t={keyCode:t};g(t,!0);g(t,!1)};this.simulate_char=function(t){var I=t.charCodeAt(0);I in B?this.simulate_press(B[I]):I in C?(l(42),this.simulate_press(C[I]),l(170)):console.log("ascii -> keyCode not found: ",
|
|
244
|
+
I,t)}};function cc(a,b){function c(){C.bus.send("mouse-pointer-lock",!!document.pointerLockElement)}function d(w){e(w)&&w.preventDefault()}function e(w){if(!C.enabled||!C.emu_enabled)return!1;var t=b||document.body,I;if(!(I=document.pointerLockElement))a:{for(w=w.target;w.parentNode;){if(w===t){I=!0;break a}w=w.parentNode}I=!1}return I}function f(w){e(w)&&(w=w.changedTouches)&&w.length&&(w=w[w.length-1],E=w.clientX,B=w.clientY)}function g(){if(q||x||r)C.bus.send("mouse-click",[!1,!1,!1]),q=x=r=!1}function h(w){if(C.bus&&
|
|
245
|
+
e(w)&&C.is_running){var t=0,I=0,O=w.changedTouches;O?O.length&&(O=O[O.length-1],t=O.clientX-E,I=O.clientY-B,E=O.clientX,B=O.clientY,w.preventDefault()):"number"===typeof w.movementX?(t=w.movementX,I=w.movementY):"number"===typeof w.webkitMovementX?(t=w.webkitMovementX,I=w.webkitMovementY):"number"===typeof w.mozMovementX?(t=w.mozMovementX,I=w.mozMovementY):(t=w.clientX-E,I=w.clientY-B,E=w.clientX,B=w.clientY);C.bus.send("mouse-delta",[1*t,-(1*I)]);b&&!document.pointerLockElement&&(t=b.getBoundingClientRect(),
|
|
246
|
+
C.bus.send("mouse-absolute",[w.clientX-t.left,w.clientY-t.top,t.width,t.height]))}}function m(w){e(w)&&n(w,!0)}function l(w){e(w)&&n(w,!1)}function n(w,t){C.bus&&(1===w.which?q=t:2===w.which?x=t:3===w.which&&(r=t),C.bus.send("mouse-click",[q,x,r]),w.preventDefault())}function p(w){if(e(w)){var t=w.wheelDelta||-w.detail;0>t?t=-1:0<t&&(t=1);C.bus.send("mouse-wheel",[t,0]);w.preventDefault()}}var q=!1,r=!1,x=!1,E=0,B=0,C=this;this.enabled=!1;this.emu_enabled=!0;this.absolute_mouse=!1;this.bus=a;this.bus.register("mouse-enable",
|
|
247
247
|
function(w){this.enabled=w;this.update_cursor()},this);this.bus.register("vmware-absolute-mouse",function(w){this.absolute_mouse=w;this.update_cursor()},this);this.is_running=!1;this.bus.register("emulator-stopped",function(){this.is_running=!1},this);this.bus.register("emulator-started",function(){this.is_running=!0},this);this.update_cursor=function(){b&&(b.style.cursor=this.absolute_mouse&&this.enabled&&this.emu_enabled?"none":"")};this.destroy=function(){"undefined"!==typeof window&&(window.removeEventListener("touchstart",
|
|
248
248
|
f,!1),window.removeEventListener("touchend",g,!1),window.removeEventListener("touchmove",h,!1),window.removeEventListener("mousemove",h,!1),window.removeEventListener("mousedown",m,!1),window.removeEventListener("mouseup",l,!1),window.removeEventListener("wheel",p,{passive:!1}),window.removeEventListener("contextmenu",d,!1),document.removeEventListener("pointerlockchange",c,!1))};this.init=function(){"undefined"!==typeof window&&(this.destroy(),window.addEventListener("touchstart",f,!1),window.addEventListener("touchend",
|
|
249
249
|
g,!1),window.addEventListener("touchmove",h,!1),window.addEventListener("mousemove",h,!1),window.addEventListener("mousedown",m,!1),window.addEventListener("mouseup",l,!1),window.addEventListener("wheel",p,{passive:!1}),window.addEventListener("contextmenu",d,!1),document.addEventListener("pointerlockchange",c,!1))};this.init()};function dc(a){var b,c=0,d=0,e=ta(a?.encoding);this.put_char=function(f,g,h){b[f*c+g]=h};this.destroy=function(){};this.pause=function(){};this.continue=function(){};this.clear_text_state=function(){d=c=null};this.set_mode=function(){};this.set_font_bitmap=function(){};this.set_font_page=function(){};this.clear_screen=function(){};this.set_size_text=function(f,g){if(f!==c||g!==d)b=new Uint8Array(f*g),c=f,d=g};this.set_size_graphical=function(){};this.set_scale=function(){};this.update_cursor_scanline=
|
|
@@ -431,17 +431,17 @@ single_handler:!1,handlers:[()=>{},c=>{const d=this.virtio.queues[c],e=3<c?c-3>>
|
|
|
431
431
|
this.ports;++c){const d=0===c?0:2*c+2;this.bus.register("virtio-console"+c+"-input-bytes",function(e){var f=this.virtio.queues[d];f.has_request()&&(f=f.pop_request(),this.Send(d,f,new Uint8Array(e)))},this);this.bus.register("virtio-console"+c+"-resize",function(e){0===c&&(this.cols=e[0],this.rows=e[1]);this.virtio.queues[2].is_configured()&&this.virtio.queues[2].has_request()&&this.SendWindowSize(c,e[0],e[1])},this)}}
|
|
432
432
|
Mc.prototype.SendWindowSize=function(a,b,c){c=c||this.rows;b=b||this.cols;const d=this.virtio.queues[2].pop_request(),e=new Uint8Array(12);K(["w","h","h","h","h"],[a,5,0,c,b],e,0);this.Send(2,d,e)};Mc.prototype.SendName=function(a,b){const c=this.virtio.queues[2].pop_request();b=(new TextEncoder).encode(b);const d=new Uint8Array(8+b.length+1);K(["w","h","h"],[a,7,1],d,0);for(a=0;a<b.length;++a)d[a+8]=b[a];d[8+b.length]=0;this.Send(2,c,d)};
|
|
433
433
|
Mc.prototype.get_state=function(){const a=[];a[0]=this.virtio;a[1]=this.rows;a[2]=this.cols;a[3]=this.ports;return a};Mc.prototype.set_state=function(a){this.virtio.set_state(a[0]);this.rows=a[1];this.cols=a[2];this.ports=a[3]};Mc.prototype.reset=function(){this.virtio.reset()};Mc.prototype.SendEvent=function(a,b,c){const d=this.virtio.queues[2].pop_request(),e=new Uint8Array(8);K(["w","h","h"],[a,b,c],e,0);this.Send(2,d,e)};
|
|
434
|
-
Mc.prototype.Send=function(a,b,c){b.set_next_blob(c);this.virtio.queues[a].push_reply(b);this.virtio.queues[a].flush_replies()};Mc.prototype.Ack=function(a,b){b.set_next_blob(new Uint8Array(0));this.virtio.queues[a].push_reply(b);this.virtio.queues[a].flush_replies()};function Oc(a,b){this.cpu=a;this.bus=b;this.reset();this.bus.register("keyboard-code",function(c){this.kbd_send_code(c)},this);this.bus.register("mouse-click",function(c){this.mouse_send_click(c[0],c[1],c[2])},this);this.bus.register("mouse-delta",function(c){this.mouse_send_delta(c[0],c[1])},this);this.bus.register("mouse-wheel",function(c){this.wheel_movement-=c[0]
|
|
435
|
-
this,this.port60_read);a.io.register_read(100,this,this.port64_read);a.io.register_write(96,this,this.port60_write);a.io.register_write(100,this,this.port64_write)}
|
|
434
|
+
Mc.prototype.Send=function(a,b,c){b.set_next_blob(c);this.virtio.queues[a].push_reply(b);this.virtio.queues[a].flush_replies()};Mc.prototype.Ack=function(a,b){b.set_next_blob(new Uint8Array(0));this.virtio.queues[a].push_reply(b);this.virtio.queues[a].flush_replies()};function Oc(a,b){this.cpu=a;this.bus=b;this.reset();this.bus.register("keyboard-code",function(c){this.kbd_send_code(c)},this);this.bus.register("mouse-click",function(c){this.mouse_send_click(c[0],c[1],c[2])},this);this.bus.register("mouse-delta",function(c){this.mouse_send_delta(c[0],c[1])},this);this.bus.register("mouse-wheel",function(c){this.have_mouse&&this.use_mouse&&this.mouse_stream_active()&&(this.wheel_movement-=c[0],this.wheel_movement-=2*c[1],this.wheel_movement=Math.min(7,Math.max(-8,
|
|
435
|
+
this.wheel_movement)),this.send_mouse_packet(0,0))},this);a.io.register_read(96,this,this.port60_read);a.io.register_read(100,this,this.port64_read);a.io.register_write(96,this,this.port60_write);a.io.register_write(100,this,this.port64_write)}
|
|
436
436
|
Oc.prototype.reset=function(){this.use_mouse=this.enable_mouse_stream=!1;this.have_mouse=!0;this.mouse_clicks=this.mouse_delta_y=this.mouse_delta_x=0;this.have_keyboard=!0;this.next_read_resolution=this.next_read_rate=this.next_handle_scan_code_set=this.next_read_led=this.next_read_sample=this.next_is_mouse_command=this.enable_keyboard_stream=!1;this.kbd_buffer=new ma(1024);this.last_port60_byte=0;this.sample_rate=100;this.mouse_id=this.mouse_detect_state=0;this.mouse_reset_workaround=!1;this.wheel_movement=
|
|
437
437
|
0;this.resolution=4;this.scaling2=!1;this.last_mouse_packet=-1;this.mouse_buffer=new ma(1024);this.next_byte_is_aux=this.next_byte_is_ready=!1;this.command_register=5;this.controller_output_port=0;this.read_controller_output_port=this.read_command_register=this.read_output_register=!1};
|
|
438
438
|
Oc.prototype.get_state=function(){var a=[];a[0]=this.enable_mouse_stream;a[1]=this.use_mouse;a[2]=this.have_mouse;a[3]=this.mouse_delta_x;a[4]=this.mouse_delta_y;a[5]=this.mouse_clicks;a[6]=this.have_keyboard;a[7]=this.enable_keyboard_stream;a[8]=this.next_is_mouse_command;a[9]=this.next_read_sample;a[10]=this.next_read_led;a[11]=this.next_handle_scan_code_set;a[12]=this.next_read_rate;a[13]=this.next_read_resolution;a[15]=this.last_port60_byte;a[16]=this.sample_rate;a[17]=this.resolution;a[18]=this.scaling2;
|
|
439
439
|
a[20]=this.command_register;a[21]=this.read_output_register;a[22]=this.read_command_register;a[23]=this.controller_output_port;a[24]=this.read_controller_output_port;a[25]=this.mouse_id;a[26]=this.mouse_detect_state;a[27]=this.mouse_reset_workaround;return a};
|
|
440
440
|
Oc.prototype.set_state=function(a){this.enable_mouse_stream=a[0];this.use_mouse=a[1];this.have_mouse=a[2];this.mouse_delta_x=a[3];this.mouse_delta_y=a[4];this.mouse_clicks=a[5];this.have_keyboard=a[6];this.enable_keyboard_stream=a[7];this.next_is_mouse_command=a[8];this.next_read_sample=a[9];this.next_read_led=a[10];this.next_handle_scan_code_set=a[11];this.next_read_rate=a[12];this.next_read_resolution=a[13];this.last_port60_byte=a[15];this.sample_rate=a[16];this.resolution=a[17];this.scaling2=a[18];
|
|
441
441
|
this.command_register=a[20];this.read_output_register=a[21];this.read_command_register=a[22];this.controller_output_port=a[23];this.read_controller_output_port=a[24];this.mouse_id=a[25]||0;this.mouse_detect_state=a[26]||0;this.mouse_reset_workaround=a[27]||!1;this.next_byte_is_aux=this.next_byte_is_ready=!1;this.kbd_buffer.clear();this.mouse_buffer.clear();this.bus.send("mouse-enable",this.use_mouse)};
|
|
442
|
-
Oc.prototype.raise_irq=function(){this.next_byte_is_ready||(this.kbd_buffer.length?this.kbd_irq():this.mouse_buffer.length&&this.mouse_irq())};Oc.prototype.mouse_irq=function(){this.next_byte_is_aux=this.next_byte_is_ready=!0;this.command_register&2&&(this.cpu.device_lower_irq(12),this.cpu.device_raise_irq(12))};
|
|
443
|
-
Oc.prototype.
|
|
444
|
-
Oc.prototype.mouse_send_click=function(a,b,c){this.have_mouse&&this.use_mouse&&(this.mouse_clicks=a|c<<1|b<<2,this.
|
|
442
|
+
Oc.prototype.mouse_stream_active=function(){return this.enable_mouse_stream&&!(this.command_register&32)};Oc.prototype.raise_irq=function(){this.next_byte_is_ready||(this.kbd_buffer.length?this.kbd_irq():this.mouse_buffer.length&&this.mouse_irq())};Oc.prototype.mouse_irq=function(){this.next_byte_is_aux=this.next_byte_is_ready=!0;this.command_register&2&&(this.cpu.device_lower_irq(12),this.cpu.device_raise_irq(12))};
|
|
443
|
+
Oc.prototype.kbd_irq=function(){this.next_byte_is_ready=!0;this.next_byte_is_aux=!1;this.command_register&1&&(this.cpu.device_lower_irq(1),this.cpu.device_raise_irq(1))};Oc.prototype.kbd_send_code=function(a){this.enable_keyboard_stream&&(y(a),this.kbd_buffer.push(a),this.raise_irq())};
|
|
444
|
+
Oc.prototype.mouse_send_delta=function(a,b){this.have_mouse&&this.use_mouse&&(this.mouse_delta_x+=1*a,this.mouse_delta_y+=1*b,this.mouse_stream_active()&&(a=this.mouse_delta_x|0,b=this.mouse_delta_y|0,a||b))&&(this.mouse_delta_x-=a,this.mouse_delta_y-=b,this.send_mouse_packet(a,b))};Oc.prototype.mouse_send_click=function(a,b,c){this.have_mouse&&this.use_mouse&&(this.mouse_clicks=a|c<<1|b<<2,this.mouse_stream_active()&&this.send_mouse_packet(0,0))};
|
|
445
445
|
Oc.prototype.send_mouse_packet=function(a,b){var c=(0>b)<<5|(0>a)<<4|8|this.mouse_clicks;this.last_mouse_packet=Date.now();this.mouse_buffer.push(c);this.mouse_buffer.push(a);this.mouse_buffer.push(b);4===this.mouse_id?(this.mouse_buffer.push(0|this.wheel_movement&15),this.wheel_movement=0):3===this.mouse_id&&(this.mouse_buffer.push(this.wheel_movement&255),this.wheel_movement=0);this.raise_irq()};
|
|
446
446
|
Oc.prototype.apply_scaling2=function(a){var b=a>>31;switch(Math.abs(a)){case 0:case 1:case 3:return a;case 2:return b;case 4:return 6*b;case 5:return 9*b;default:return a<<1}};
|
|
447
447
|
Oc.prototype.port60_read=function(){this.next_byte_is_ready=!1;if(!this.kbd_buffer.length&&!this.mouse_buffer.length)return this.last_port60_byte;this.next_byte_is_aux?(this.cpu.device_lower_irq(12),this.last_port60_byte=this.mouse_buffer.shift()):(this.cpu.device_lower_irq(1),this.last_port60_byte=this.kbd_buffer.shift());y(this.last_port60_byte);(this.kbd_buffer.length||this.mouse_buffer.length)&&this.raise_irq();return this.last_port60_byte};
|
|
@@ -661,7 +661,7 @@ d.pop_request();const f=new Uint8Array(e.length_readable);e.get_next_blob(f);thi
|
|
|
661
661
|
this.virtio.queues[c];for(;d.has_request();){const f=d.pop_request();if(0<f.length_readable){var e=new Uint8Array(f.length_readable);f.get_next_blob(e);[e]=L(["w"],e,{offset:0});0===e&&(this.free_cb&&this.free_cb(this.zeroed),1<this.fp_cmd&&(this.fp_cmd=1),this.virtio.notify_config_changes())}if(0<f.length_writable)for(new Uint8Array(0),e=0;e<f.write_buffers.length;++e){let g=f.write_buffers[e];this.zeroed+=g.len;this.virtio.cpu.zero_memory(g.addr_low,g.len)}this.virtio.queues[c].push_reply(f)}this.virtio.queues[c].flush_replies()}]},
|
|
662
662
|
isr_status:{initial_port:55040},device_specific:{initial_port:54784,struct:[{bytes:4,name:"num_pages",read:()=>this.num_pages,write:()=>{}},{bytes:4,name:"actual",read:()=>this.actual,write:()=>{}},{bytes:4,name:"free_page_hint_cmd_id",read:()=>this.fp_cmd,write:()=>{}}]}})}id.prototype.Inflate=function(a){this.num_pages+=a;this.virtio.notify_config_changes()};id.prototype.Deflate=function(a){this.num_pages-=a;this.virtio.notify_config_changes()};
|
|
663
663
|
id.prototype.Cleanup=function(a){this.fp_cmd=2;this.free_cb=a;this.zeroed=0;this.virtio.notify_config_changes()};id.prototype.get_state=function(){const a=[];a[0]=this.virtio;a[1]=this.num_pages;a[2]=this.actual;return a};id.prototype.set_state=function(a){this.virtio.set_state(a[0]);this.num_pages=a[1];this.actual=a[2]};id.prototype.GetStats=function(a){this.stats_cb=a;for(a=this.virtio.queues[2];a.has_request();){const b=a.pop_request();this.virtio.queues[2].push_reply(b)}this.virtio.queues[2].flush_replies()};
|
|
664
|
-
id.prototype.Reset=function(){};function jd(a,b,c,d){var e=new Uint8Array(b);const f=new Uint16Array(b);var g=new Uint32Array(b),h=e[497]||4,m=f[255];if(43605!==m)y(m);else if(m=f[257]|f[258]<<16,1400005704!==m)y(m);else{m=f[259];var l=e[529],n=f[283],p=g[139],q=g[140],r=e[565],x=518<=m?g[142]:255,E=g[146],B=g[147],C=g[150],w=g[151],
|
|
664
|
+
id.prototype.Reset=function(){};function jd(a,b,c,d){var e=new Uint8Array(b);const f=new Uint16Array(b);var g=new Uint32Array(b),h=e[497]||4,m=f[255];if(43605!==m)y(m);else if(m=f[257]|f[258]<<16,1400005704!==m)y(m);else{m=f[259];var l=e[529],n=f[283],p=g[139],q=g[140],r=e[565],x=518<=m?g[142]:255,E=g[146],B=g[147],C=g[150],w=g[151],t=g[152];y(m);y(l);y(n);y(g[133]);y(p);y(q);y(r);y(x);y(E);y(B);y(w);y(C);y(t);e[528]=255;e[529]=l&-97|128;f[274]=56832;f[253]=65535;y(56832);d+="\x00";y(581632);g[138]=581632;for(e=0;e<d.length;e++)a[581632+
|
|
665
665
|
e]=d.charCodeAt(e);h=512*(h+1);y(h);d=new Uint8Array(b,0,h);b=new Uint8Array(b,h);e=h=0;c&&(h=67108864,e=c.byteLength,a.set(new Uint8Array(c),h));g[134]=h;g[135]=e;a.set(d,524288);a.set(b,1048576);a=new Uint8Array(512);(new Uint16Array(a.buffer))[0]=43605;a[2]=1;c=3;a[c++]=250;a[c++]=184;a[c++]=32768;a[c++]=128;a[c++]=142;a[c++]=192;a[c++]=142;a[c++]=216;a[c++]=142;a[c++]=224;a[c++]=142;a[c++]=232;a[c++]=142;a[c++]=208;a[c++]=188;a[c++]=57344;a[c++]=224;a[c++]=234;a[c++]=0;a[c++]=0;a[c++]=32800;a[c++]=
|
|
666
666
|
128;g=a[c]=0;for(b=0;b<a.length;b++)g+=a[b];a[c]=-g;return{name:"genroms/kernel.bin",data:a}}};function S(a,b,c){this.stop_idling=c;this.wm=b;this.wasm_patch();this.create_jit_imports();this.wasm_memory=b=this.wm.exports.memory;this.memory_size=k(Uint32Array,b,812,1);this.mem8=new Uint8Array(0);this.mem32s=new Int32Array(this.mem8.buffer);this.segment_is_null=k(Uint8Array,b,724,8);this.segment_offsets=k(Int32Array,b,736,8);this.segment_limits=k(Uint32Array,b,768,8);this.segment_access_bytes=k(Uint8Array,b,512,8);this.protected_mode=k(Int32Array,b,800,1);this.idtr_size=k(Int32Array,b,564,1);
|
|
667
667
|
this.idtr_offset=k(Int32Array,b,568,1);this.gdtr_size=k(Int32Array,b,572,1);this.gdtr_offset=k(Int32Array,b,576,1);this.tss_size_32=k(Int32Array,b,1128,1);this.cr=k(Int32Array,b,580,8);this.cpl=k(Uint8Array,b,612,1);this.is_32=k(Int32Array,b,804,1);this.stack_size_32=k(Int32Array,b,808,1);this.in_hlt=k(Uint8Array,b,616,1);this.last_virt_eip=k(Int32Array,b,620,1);this.eip_phys=k(Int32Array,b,624,1);this.sysenter_cs=k(Int32Array,b,636,1);this.sysenter_esp=k(Int32Array,b,640,1);this.sysenter_eip=k(Int32Array,
|