v86 0.5.372 → 0.5.373

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.
@@ -8217,11 +8217,18 @@ $VMwareMouse$$module$src$vmware$$.prototype.port_read32 = function() {
8217
8217
  switch($reg32$$[1] & 65535) {
8218
8218
  case 10:
8219
8219
  return $reg32$$[3] = 1447909480, 6;
8220
+ case 23:
8221
+ var $n$jscomp$14_now$jscomp$13$$ = Date.now();
8222
+ $reg32$$[3] = $n$jscomp$14_now$jscomp$13$$ % 1000 * 1000;
8223
+ $reg32$$[1] = 1000000;
8224
+ $reg32$$[2] = -(new Date($n$jscomp$14_now$jscomp$13$$)).getTimezoneOffset();
8225
+ return $n$jscomp$14_now$jscomp$13$$ / 1000 >>> 0;
8220
8226
  case 40:
8221
8227
  return this.enabled ? this.queue.length : -65536;
8222
8228
  case 39:
8223
- const $n$jscomp$14$$ = Math.min($reg32$$[3] >>> 0, 4, this.queue.length), $v$jscomp$2$$ = [0, 0, 0, 0];
8224
- for (let $i$jscomp$85$$ = 0; $i$jscomp$85$$ < $n$jscomp$14$$; $i$jscomp$85$$++) {
8229
+ $n$jscomp$14_now$jscomp$13$$ = Math.min($reg32$$[3] >>> 0, 4, this.queue.length);
8230
+ const $v$jscomp$2$$ = [0, 0, 0, 0];
8231
+ for (let $i$jscomp$85$$ = 0; $i$jscomp$85$$ < $n$jscomp$14_now$jscomp$13$$; $i$jscomp$85$$++) {
8225
8232
  $v$jscomp$2$$[$i$jscomp$85$$] = this.queue.shift();
8226
8233
  }
8227
8234
  $reg32$$[3] = $v$jscomp$2$$[1];
@@ -12030,10 +12037,10 @@ $CPU$$module$src$cpu$$.prototype.log_uncompiled_code = function() {
12030
12037
  };
12031
12038
  $CPU$$module$src$cpu$$.prototype.dump_function_code = function() {
12032
12039
  };
12033
- $CPU$$module$src$cpu$$.prototype.run_hardware_timers = function($acpi_enabled$$, $now$jscomp$13$$) {
12034
- const $pit_time$$ = this.devices.pit.timer($now$jscomp$13$$, !1), $rtc_time$$ = this.devices.rtc.timer($now$jscomp$13$$, !1);
12040
+ $CPU$$module$src$cpu$$.prototype.run_hardware_timers = function($acpi_enabled$$, $now$jscomp$14$$) {
12041
+ const $pit_time$$ = this.devices.pit.timer($now$jscomp$14$$, !1), $rtc_time$$ = this.devices.rtc.timer($now$jscomp$14$$, !1);
12035
12042
  let $acpi_time$$ = 100, $apic_time$$ = 100;
12036
- $acpi_enabled$$ && ($acpi_time$$ = this.devices.acpi.timer($now$jscomp$13$$), $apic_time$$ = this.apic_timer($now$jscomp$13$$));
12043
+ $acpi_enabled$$ && ($acpi_time$$ = this.devices.acpi.timer($now$jscomp$14$$), $apic_time$$ = this.apic_timer($now$jscomp$14$$));
12037
12044
  return Math.min($pit_time$$, $rtc_time$$, $acpi_time$$, $apic_time$$);
12038
12045
  };
12039
12046
  $CPU$$module$src$cpu$$.prototype.debug_init = function() {
@@ -13309,13 +13316,13 @@ $Virtio9pProxy$$module$lib$9p$$.prototype.destroy = function() {
13309
13316
  $Virtio9pProxy$$module$lib$9p$$.prototype.connect = function() {
13310
13317
  if ("undefined" !== typeof WebSocket) {
13311
13318
  if (this.socket) {
13312
- var $now$jscomp$14_state$jscomp$74$$ = this.socket.readyState;
13313
- if (0 === $now$jscomp$14_state$jscomp$74$$ || 1 === $now$jscomp$14_state$jscomp$74$$) {
13319
+ var $now$jscomp$15_state$jscomp$74$$ = this.socket.readyState;
13320
+ if (0 === $now$jscomp$15_state$jscomp$74$$ || 1 === $now$jscomp$15_state$jscomp$74$$) {
13314
13321
  return;
13315
13322
  }
13316
13323
  }
13317
- $now$jscomp$14_state$jscomp$74$$ = Date.now();
13318
- if (!(this.last_connect_attempt + this.reconnect_interval > $now$jscomp$14_state$jscomp$74$$)) {
13324
+ $now$jscomp$15_state$jscomp$74$$ = Date.now();
13325
+ if (!(this.last_connect_attempt + this.reconnect_interval > $now$jscomp$15_state$jscomp$74$$)) {
13319
13326
  this.last_connect_attempt = Date.now();
13320
13327
  try {
13321
13328
  this.socket = new WebSocket(this.url);
@@ -8216,11 +8216,18 @@ $VMwareMouse$$module$src$vmware$$.prototype.port_read32 = function() {
8216
8216
  switch($reg32$$[1] & 65535) {
8217
8217
  case 10:
8218
8218
  return $reg32$$[3] = 1447909480, 6;
8219
+ case 23:
8220
+ var $n$jscomp$14_now$jscomp$13$$ = Date.now();
8221
+ $reg32$$[3] = $n$jscomp$14_now$jscomp$13$$ % 1000 * 1000;
8222
+ $reg32$$[1] = 1000000;
8223
+ $reg32$$[2] = -(new Date($n$jscomp$14_now$jscomp$13$$)).getTimezoneOffset();
8224
+ return $n$jscomp$14_now$jscomp$13$$ / 1000 >>> 0;
8219
8225
  case 40:
8220
8226
  return this.enabled ? this.queue.length : -65536;
8221
8227
  case 39:
8222
- const $n$jscomp$14$$ = Math.min($reg32$$[3] >>> 0, 4, this.queue.length), $v$jscomp$2$$ = [0, 0, 0, 0];
8223
- for (let $i$jscomp$85$$ = 0; $i$jscomp$85$$ < $n$jscomp$14$$; $i$jscomp$85$$++) {
8228
+ $n$jscomp$14_now$jscomp$13$$ = Math.min($reg32$$[3] >>> 0, 4, this.queue.length);
8229
+ const $v$jscomp$2$$ = [0, 0, 0, 0];
8230
+ for (let $i$jscomp$85$$ = 0; $i$jscomp$85$$ < $n$jscomp$14_now$jscomp$13$$; $i$jscomp$85$$++) {
8224
8231
  $v$jscomp$2$$[$i$jscomp$85$$] = this.queue.shift();
8225
8232
  }
8226
8233
  $reg32$$[3] = $v$jscomp$2$$[1];
@@ -12029,10 +12036,10 @@ $CPU$$module$src$cpu$$.prototype.log_uncompiled_code = function() {
12029
12036
  };
12030
12037
  $CPU$$module$src$cpu$$.prototype.dump_function_code = function() {
12031
12038
  };
12032
- $CPU$$module$src$cpu$$.prototype.run_hardware_timers = function($acpi_enabled$$, $now$jscomp$13$$) {
12033
- const $pit_time$$ = this.devices.pit.timer($now$jscomp$13$$, !1), $rtc_time$$ = this.devices.rtc.timer($now$jscomp$13$$, !1);
12039
+ $CPU$$module$src$cpu$$.prototype.run_hardware_timers = function($acpi_enabled$$, $now$jscomp$14$$) {
12040
+ const $pit_time$$ = this.devices.pit.timer($now$jscomp$14$$, !1), $rtc_time$$ = this.devices.rtc.timer($now$jscomp$14$$, !1);
12034
12041
  let $acpi_time$$ = 100, $apic_time$$ = 100;
12035
- $acpi_enabled$$ && ($acpi_time$$ = this.devices.acpi.timer($now$jscomp$13$$), $apic_time$$ = this.apic_timer($now$jscomp$13$$));
12042
+ $acpi_enabled$$ && ($acpi_time$$ = this.devices.acpi.timer($now$jscomp$14$$), $apic_time$$ = this.apic_timer($now$jscomp$14$$));
12036
12043
  return Math.min($pit_time$$, $rtc_time$$, $acpi_time$$, $apic_time$$);
12037
12044
  };
12038
12045
  $CPU$$module$src$cpu$$.prototype.debug_init = function() {
@@ -13308,13 +13315,13 @@ $Virtio9pProxy$$module$lib$9p$$.prototype.destroy = function() {
13308
13315
  $Virtio9pProxy$$module$lib$9p$$.prototype.connect = function() {
13309
13316
  if ("undefined" !== typeof WebSocket) {
13310
13317
  if (this.socket) {
13311
- var $now$jscomp$14_state$jscomp$74$$ = this.socket.readyState;
13312
- if (0 === $now$jscomp$14_state$jscomp$74$$ || 1 === $now$jscomp$14_state$jscomp$74$$) {
13318
+ var $now$jscomp$15_state$jscomp$74$$ = this.socket.readyState;
13319
+ if (0 === $now$jscomp$15_state$jscomp$74$$ || 1 === $now$jscomp$15_state$jscomp$74$$) {
13313
13320
  return;
13314
13321
  }
13315
13322
  }
13316
- $now$jscomp$14_state$jscomp$74$$ = Date.now();
13317
- if (!(this.last_connect_attempt + this.reconnect_interval > $now$jscomp$14_state$jscomp$74$$)) {
13323
+ $now$jscomp$15_state$jscomp$74$$ = Date.now();
13324
+ if (!(this.last_connect_attempt + this.reconnect_interval > $now$jscomp$15_state$jscomp$74$$)) {
13318
13325
  this.last_connect_attempt = Date.now();
13319
13326
  try {
13320
13327
  this.socket = new WebSocket(this.url);
package/build/libv86.js CHANGED
@@ -456,8 +456,9 @@ function(d){if(this.host_pointer_locked){this.rel_dx+=d[0];this.rel_dy+=d[1];d=t
456
456
  function(d){this.host_pointer_locked?this.push_relative(0,0,-d[0]|0,!1):this.push_absolute(-d[0]|0,!1)},this);a.io.register_read(22104,this,function(){return 255},function(){return 65535},this.port_read32);a.io.register_write(22104,this,c,c,c)}
457
457
  Nc.prototype.push_absolute=function(a,b){!this.enabled||!this.absolute||0>this.last_x||(b&&this.tail_is_move&&4<=this.queue.length&&!(this.queue[this.queue.length-4]&65536)?(this.queue[this.queue.length-3]=this.last_x,this.queue[this.queue.length-2]=this.last_y):this.push_packet(this.buttons,this.last_x,this.last_y,a,b))};
458
458
  Nc.prototype.push_relative=function(a,b,c,d){this.enabled&&(d&&this.tail_is_move&&4<=this.queue.length&&this.queue[this.queue.length-4]&65536?(this.queue[this.queue.length-3]+=a,this.queue[this.queue.length-2]+=b):this.push_packet(this.buttons|65536,a,b,c,d))};Nc.prototype.push_packet=function(a,b,c,d,e){1024<this.queue.length+4?(this.enabled=!1,this.queue.length=0):(this.queue.push(a,b,c,d),this.tail_is_move=e)};
459
- Nc.prototype.port_read32=function(){const a=this.cpu.reg32;if(1447909480!==a[0])return-1;switch(a[1]&65535){case 10:return a[3]=1447909480,6;case 40:return this.enabled?this.queue.length:-65536;case 39:const b=Math.min(a[3]>>>0,4,this.queue.length),c=[0,0,0,0];for(let d=0;d<b;d++)c[d]=this.queue.shift();a[3]=c[1];a[1]=c[2];a[2]=c[3];return c[0];case 41:switch(a[3]){case 1161905490:this.enabled=!0;this.queue.length=0;this.tail_is_move=!1;this.queue.push(876762442);break;case 245:this.absolute=this.enabled=
460
- !1;this.queue.length=0;this.bus.send("vmware-absolute-mouse",!1);break;case 1396851026:this.absolute=!0;this.bus.send("vmware-absolute-mouse",!0);break;case 1279611474:this.absolute=!1,this.bus.send("vmware-absolute-mouse",!1)}return 0}return-1};Nc.prototype.get_state=function(){return[this.enabled,this.absolute]};Nc.prototype.set_state=function(a){this.enabled=a[0];this.absolute=a[1];this.bus.send("vmware-absolute-mouse",this.absolute)};const Oc=DataView.prototype,Pc={size:1,get:Oc.getUint8,set:Oc.setUint8},Qc={size:2,get:Oc.getUint16,set:Oc.setUint16},V={size:4,get:Oc.getUint32,set:Oc.setUint32},Sc=Rc([{magic:V},{class:Pc},{data:Pc},{version0:Pc},{osabi:Pc},{abiversion:Pc},{pad0:function(a){return{size:a,get:()=>-1}}(7)},{type:Qc},{machine:Qc},{version1:V},{entry:V},{phoff:V},{shoff:V},{flags:V},{ehsize:Qc},{phentsize:Qc},{phnum:Qc},{shentsize:Qc},{shnum:Qc},{shstrndx:Qc}]);console.assert(52===Sc.reduce((a,b)=>a+b.size,0));
459
+ Nc.prototype.port_read32=function(){const a=this.cpu.reg32;if(1447909480!==a[0])return-1;switch(a[1]&65535){case 10:return a[3]=1447909480,6;case 23:var b=Date.now();a[3]=b%1E3*1E3;a[1]=1E6;a[2]=-(new Date(b)).getTimezoneOffset();return b/1E3>>>0;case 40:return this.enabled?this.queue.length:-65536;case 39:b=Math.min(a[3]>>>0,4,this.queue.length);const c=[0,0,0,0];for(let d=0;d<b;d++)c[d]=this.queue.shift();a[3]=c[1];a[1]=c[2];a[2]=c[3];return c[0];case 41:switch(a[3]){case 1161905490:this.enabled=
460
+ !0;this.queue.length=0;this.tail_is_move=!1;this.queue.push(876762442);break;case 245:this.absolute=this.enabled=!1;this.queue.length=0;this.bus.send("vmware-absolute-mouse",!1);break;case 1396851026:this.absolute=!0;this.bus.send("vmware-absolute-mouse",!0);break;case 1279611474:this.absolute=!1,this.bus.send("vmware-absolute-mouse",!1)}return 0}return-1};Nc.prototype.get_state=function(){return[this.enabled,this.absolute]};
461
+ Nc.prototype.set_state=function(a){this.enabled=a[0];this.absolute=a[1];this.bus.send("vmware-absolute-mouse",this.absolute)};const Oc=DataView.prototype,Pc={size:1,get:Oc.getUint8,set:Oc.setUint8},Qc={size:2,get:Oc.getUint16,set:Oc.setUint16},V={size:4,get:Oc.getUint32,set:Oc.setUint32},Sc=Rc([{magic:V},{class:Pc},{data:Pc},{version0:Pc},{osabi:Pc},{abiversion:Pc},{pad0:function(a){return{size:a,get:()=>-1}}(7)},{type:Qc},{machine:Qc},{version1:V},{entry:V},{phoff:V},{shoff:V},{flags:V},{ehsize:Qc},{phentsize:Qc},{phnum:Qc},{shentsize:Qc},{shnum:Qc},{shstrndx:Qc}]);console.assert(52===Sc.reduce((a,b)=>a+b.size,0));
461
462
  const Tc=Rc([{type:V},{offset:V},{vaddr:V},{paddr:V},{filesz:V},{memsz:V},{flags:V},{align:V}]);console.assert(32===Tc.reduce((a,b)=>a+b.size,0));const Uc=Rc([{name:V},{type:V},{flags:V},{addr:V},{offset:V},{size:V},{link:V},{info:V},{addralign:V},{entsize:V}]);console.assert(40===Uc.reduce((a,b)=>a+b.size,0));function Rc(a){return a.map(function(b){var c=Object.keys(b);console.assert(1===c.length);c=c[0];b=b[c];console.assert(0<b.size);return{name:c,type:b,size:b.size,get:b.get,set:b.set}})}
462
463
  function Vc(a,b){const c={};let d=0;for(const e of b)b=e.get.call(a,d,!0),console.assert(void 0===c[e.name]),c[e.name]=b,d+=e.size;return[c,d]}function Wc(a,b,c){const d=[];let e=0;for(var f=0;f<c;f++){const [g,h]=Vc(new DataView(a.buffer,a.byteOffset+e,void 0),b);d.push(g);e+=h}return[d,e]};const Xc={[0]:0,[1]:525,[2]:525,[3]:350,[4]:350,[5]:350};
463
464
  function W(a,b,c,d){this.io=a.io;this.cpu=a;this.dma=a.devices.dma;this.cmd_table=this.build_cmd_lookup_table();this.sra=0;this.srb=192;this.dor=12;this.tdr=0;this.msr=128;this.dsr=0;this.cmd_phase=1;this.cmd_flags=this.cmd_code=0;this.cmd_buffer=new Uint8Array(17);this.cmd_remaining=this.cmd_cursor=0;this.response_data=new Uint8Array(15);this.reset_sense_int_count=this.curr_drive_no=this.status1=this.status0=this.response_length=this.response_cursor=0;this.locked=!1;this.head_load_time=this.step_rate_interval=