v86 0.5.306 → 0.5.307

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.
@@ -4362,13 +4362,13 @@ function $DummyScreenAdapter$$module$src$browser$dummy_screen$$($options$jscomp$
4362
4362
  };
4363
4363
  this.set_size_text(80, 25);
4364
4364
  }
4365
- function $SerialAdapter$$module$src$browser$serial$$($element$jscomp$8$$, $bus$jscomp$12$$) {
4365
+ function $TextAreaAdapter$$module$src$browser$serial$$($element$jscomp$8$$) {
4366
4366
  function $keypress_handler$$($e$jscomp$36$$) {
4367
- $serial$$.bus && $serial$$.enabled && ($serial$$.send_char($e$jscomp$36$$.which), $e$jscomp$36$$.preventDefault());
4367
+ $serial$$.enabled && ($serial$$.send_char($e$jscomp$36$$.which), $e$jscomp$36$$.preventDefault());
4368
4368
  }
4369
4369
  function $keydown_handler$jscomp$1$$($e$jscomp$37$$) {
4370
- var $chr$jscomp$9$$ = $e$jscomp$37$$.which;
4371
- 8 === $chr$jscomp$9$$ ? ($serial$$.send_char(127), $e$jscomp$37$$.preventDefault()) : 9 === $chr$jscomp$9$$ && ($serial$$.send_char(9), $e$jscomp$37$$.preventDefault());
4370
+ var $chr$jscomp$8$$ = $e$jscomp$37$$.which;
4371
+ 8 === $chr$jscomp$8$$ ? ($serial$$.send_char(127), $e$jscomp$37$$.preventDefault()) : 9 === $chr$jscomp$8$$ && ($serial$$.send_char(9), $e$jscomp$37$$.preventDefault());
4372
4372
  }
4373
4373
  function $paste_handler$$($e$jscomp$38$$) {
4374
4374
  if ($serial$$.enabled) {
@@ -4383,15 +4383,11 @@ function $SerialAdapter$$module$src$browser$serial$$($element$jscomp$8$$, $bus$j
4383
4383
  }
4384
4384
  var $serial$$ = this;
4385
4385
  this.enabled = !0;
4386
- this.bus = $bus$jscomp$12$$;
4387
4386
  this.text = "";
4388
4387
  this.text_new_line = !1;
4389
4388
  this.last_update = 0;
4390
- this.bus.register("serial0-output-byte", function($byte_chr$jscomp$6$$) {
4391
- $byte_chr$jscomp$6$$ = String.fromCharCode($byte_chr$jscomp$6$$);
4392
- this.show_char($byte_chr$jscomp$6$$);
4393
- }, this);
4394
4389
  this.destroy = function() {
4390
+ this.enabled = !1;
4395
4391
  $element$jscomp$8$$.removeEventListener("keypress", $keypress_handler$$, !1);
4396
4392
  $element$jscomp$8$$.removeEventListener("keydown", $keydown_handler$jscomp$1$$, !1);
4397
4393
  $element$jscomp$8$$.removeEventListener("paste", $paste_handler$$, !1);
@@ -4399,6 +4395,7 @@ function $SerialAdapter$$module$src$browser$serial$$($element$jscomp$8$$, $bus$j
4399
4395
  };
4400
4396
  this.init = function() {
4401
4397
  this.destroy();
4398
+ this.enabled = !0;
4402
4399
  $element$jscomp$8$$.style.display = "block";
4403
4400
  $element$jscomp$8$$.addEventListener("keypress", $keypress_handler$$, !1);
4404
4401
  $element$jscomp$8$$.addEventListener("keydown", $keydown_handler$jscomp$1$$, !1);
@@ -4406,8 +4403,8 @@ function $SerialAdapter$$module$src$browser$serial$$($element$jscomp$8$$, $bus$j
4406
4403
  window.addEventListener("mousedown", $window_click_handler$$, !1);
4407
4404
  };
4408
4405
  this.init();
4409
- this.show_char = function($chr$jscomp$7$$) {
4410
- "\b" === $chr$jscomp$7$$ ? (this.text = this.text.slice(0, -1), this.update()) : "\r" !== $chr$jscomp$7$$ && (this.text += $chr$jscomp$7$$, "\n" === $chr$jscomp$7$$ && (this.text_new_line = !0), this.update());
4406
+ this.show_char = function($chr$jscomp$6$$) {
4407
+ "\b" === $chr$jscomp$6$$ ? (this.text = this.text.slice(0, -1), this.update()) : "\r" !== $chr$jscomp$6$$ && (this.text += $chr$jscomp$6$$, "\n" === $chr$jscomp$6$$ && (this.text_new_line = !0), this.update());
4411
4408
  };
4412
4409
  this.update = function() {
4413
4410
  var $now$jscomp$8$$ = Date.now(), $delta$jscomp$3$$ = $now$jscomp$8$$ - this.last_update;
@@ -4423,35 +4420,83 @@ function $SerialAdapter$$module$src$browser$serial$$($element$jscomp$8$$, $bus$j
4423
4420
  $element$jscomp$8$$.value = this.text;
4424
4421
  this.text_new_line && (this.text_new_line = !1, $element$jscomp$8$$.scrollTop = 1e9);
4425
4422
  };
4426
- this.send_char = function($chr_code$$) {
4427
- $serial$$.bus && $serial$$.bus.send("serial0-input", $chr_code$$);
4423
+ this.send_char = function() {
4428
4424
  };
4429
4425
  }
4430
- function $SerialAdapterXtermJS$$module$src$browser$serial$$($element$jscomp$9$$, $bus$jscomp$14$$) {
4431
- this.element = $element$jscomp$9$$;
4432
- if (window.Terminal) {
4433
- var $term$$ = this.term = new window.Terminal({logLevel:"off", convertEol:"true", });
4434
- $term$$.write("This is the serial console. Whatever you type or paste here will be sent to COM1");
4435
- var $utf8_encoder$$ = new TextEncoder, $on_data_disposable$$ = $term$$.onData(function($data_str$$) {
4436
- for (const $utf8_byte$$ of $utf8_encoder$$.encode($data_str$$)) {
4437
- $bus$jscomp$14$$.send("serial0-input", $utf8_byte$$);
4426
+ function $SerialAdapter$$module$src$browser$serial$$($element$jscomp$9$$, $bus$jscomp$12$$) {
4427
+ var $adapter$jscomp$13$$ = Reflect.construct($TextAreaAdapter$$module$src$browser$serial$$, [$element$jscomp$9$$], $SerialAdapter$$module$src$browser$serial$$);
4428
+ $adapter$jscomp$13$$.send_char = function($chr_code$jscomp$1$$) {
4429
+ $bus$jscomp$12$$.send("serial0-input", $chr_code$jscomp$1$$);
4430
+ };
4431
+ $bus$jscomp$12$$.register("serial0-output-byte", function($byte_chr$jscomp$9$$) {
4432
+ $byte_chr$jscomp$9$$ = String.fromCharCode($byte_chr$jscomp$9$$);
4433
+ $adapter$jscomp$13$$.show_char && $adapter$jscomp$13$$.show_char($byte_chr$jscomp$9$$);
4434
+ }, $adapter$jscomp$13$$);
4435
+ return $adapter$jscomp$13$$;
4436
+ }
4437
+ Reflect.setPrototypeOf($SerialAdapter$$module$src$browser$serial$$.prototype, $TextAreaAdapter$$module$src$browser$serial$$.prototype);
4438
+ Reflect.setPrototypeOf($SerialAdapter$$module$src$browser$serial$$, $TextAreaAdapter$$module$src$browser$serial$$);
4439
+ function $VirtioConsoleAdapter$$module$src$browser$serial$$($element$jscomp$10$$, $bus$jscomp$13$$) {
4440
+ var $adapter$jscomp$14$$ = Reflect.construct($TextAreaAdapter$$module$src$browser$serial$$, [$element$jscomp$10$$], $VirtioConsoleAdapter$$module$src$browser$serial$$);
4441
+ $adapter$jscomp$14$$.send_char = function($chr_code$jscomp$2$$) {
4442
+ $bus$jscomp$13$$.send("virtio-console0-input-bytes", new Uint8Array([$chr_code$jscomp$2$$]));
4443
+ };
4444
+ const $decoder$$ = new TextDecoder;
4445
+ $bus$jscomp$13$$.register("virtio-console0-output-bytes", function($bytes$jscomp$4$$) {
4446
+ for (const $chr$jscomp$10$$ of $decoder$$.decode($bytes$jscomp$4$$)) {
4447
+ $adapter$jscomp$14$$.show_char && $adapter$jscomp$14$$.show_char($chr$jscomp$10$$);
4448
+ }
4449
+ }, $adapter$jscomp$14$$);
4450
+ return $adapter$jscomp$14$$;
4451
+ }
4452
+ Reflect.setPrototypeOf($VirtioConsoleAdapter$$module$src$browser$serial$$.prototype, $TextAreaAdapter$$module$src$browser$serial$$.prototype);
4453
+ Reflect.setPrototypeOf($VirtioConsoleAdapter$$module$src$browser$serial$$, $TextAreaAdapter$$module$src$browser$serial$$);
4454
+ function $XtermJSAdapter$$module$src$browser$serial$$($element$jscomp$11$$, $xterm_lib$$) {
4455
+ this.element = $element$jscomp$11$$;
4456
+ var $term$$ = this.term = new $xterm_lib$$({logLevel:"off", convertEol:"true", });
4457
+ this.destroy = function() {
4458
+ this.on_data_disposable && this.on_data_disposable.dispose();
4459
+ $term$$.dispose();
4460
+ };
4461
+ }
4462
+ $XtermJSAdapter$$module$src$browser$serial$$.prototype.show = function() {
4463
+ this.term && this.term.open(this.element);
4464
+ };
4465
+ function $SerialAdapterXtermJS$$module$src$browser$serial$$($element$jscomp$12$$, $bus$jscomp$15$$, $xterm_lib$jscomp$1$$) {
4466
+ if ($xterm_lib$jscomp$1$$) {
4467
+ var $adapter$jscomp$15$$ = Reflect.construct($XtermJSAdapter$$module$src$browser$serial$$, [$element$jscomp$12$$, $xterm_lib$jscomp$1$$], $SerialAdapterXtermJS$$module$src$browser$serial$$);
4468
+ $bus$jscomp$15$$.register("serial0-output-byte", function($utf8_byte$$) {
4469
+ $adapter$jscomp$15$$.term.write(Uint8Array.of($utf8_byte$$));
4470
+ }, $adapter$jscomp$15$$);
4471
+ var $utf8_encoder$$ = new TextEncoder;
4472
+ $adapter$jscomp$15$$.on_data_disposable = $adapter$jscomp$15$$.term.onData(function($data_str$$) {
4473
+ for (const $utf8_byte$jscomp$1$$ of $utf8_encoder$$.encode($data_str$$)) {
4474
+ $bus$jscomp$15$$.send("serial0-input", $utf8_byte$jscomp$1$$);
4438
4475
  }
4439
4476
  });
4440
- $bus$jscomp$14$$.register("serial0-output-byte", function($utf8_byte$jscomp$1$$) {
4441
- $term$$.write(Uint8Array.of($utf8_byte$jscomp$1$$));
4442
- }, this);
4443
- this.destroy = function() {
4444
- $on_data_disposable$$.dispose();
4445
- $term$$.dispose();
4446
- };
4477
+ return $adapter$jscomp$15$$;
4447
4478
  }
4448
4479
  }
4449
- $SerialAdapterXtermJS$$module$src$browser$serial$$.prototype.show = function() {
4450
- this.term && this.term.open(this.element);
4451
- };
4452
- function $InBrowserNetworkAdapter$$module$src$browser$inbrowser_network$$($bus$jscomp$15$$, $config$jscomp$4_id$jscomp$6$$) {
4480
+ Reflect.setPrototypeOf($SerialAdapterXtermJS$$module$src$browser$serial$$.prototype, $XtermJSAdapter$$module$src$browser$serial$$.prototype);
4481
+ Reflect.setPrototypeOf($SerialAdapterXtermJS$$module$src$browser$serial$$, $XtermJSAdapter$$module$src$browser$serial$$);
4482
+ function $VirtioConsoleAdapterXtermJS$$module$src$browser$serial$$($element$jscomp$13$$, $bus$jscomp$16$$, $xterm_lib$jscomp$2$$) {
4483
+ if ($xterm_lib$jscomp$2$$) {
4484
+ var $adapter$jscomp$16$$ = Reflect.construct($XtermJSAdapter$$module$src$browser$serial$$, [$element$jscomp$13$$, $xterm_lib$jscomp$2$$], $VirtioConsoleAdapterXtermJS$$module$src$browser$serial$$);
4485
+ $bus$jscomp$16$$.register("virtio-console0-output-bytes", function($utf8_bytes$$) {
4486
+ $adapter$jscomp$16$$.term.write($utf8_bytes$$);
4487
+ }, $adapter$jscomp$16$$);
4488
+ var $utf8_encoder$jscomp$1$$ = new TextEncoder;
4489
+ $adapter$jscomp$16$$.on_data_disposable = $adapter$jscomp$16$$.term.onData(function($data_str$jscomp$1$$) {
4490
+ $bus$jscomp$16$$.send("virtio-console0-input-bytes", $utf8_encoder$jscomp$1$$.encode($data_str$jscomp$1$$));
4491
+ });
4492
+ return $adapter$jscomp$16$$;
4493
+ }
4494
+ }
4495
+ Reflect.setPrototypeOf($VirtioConsoleAdapterXtermJS$$module$src$browser$serial$$.prototype, $XtermJSAdapter$$module$src$browser$serial$$.prototype);
4496
+ Reflect.setPrototypeOf($VirtioConsoleAdapterXtermJS$$module$src$browser$serial$$, $XtermJSAdapter$$module$src$browser$serial$$);
4497
+ function $InBrowserNetworkAdapter$$module$src$browser$inbrowser_network$$($bus$jscomp$17$$, $config$jscomp$4_id$jscomp$6$$) {
4453
4498
  $config$jscomp$4_id$jscomp$6$$ = $config$jscomp$4_id$jscomp$6$$.id || 0;
4454
- this.bus = $bus$jscomp$15$$;
4499
+ this.bus = $bus$jscomp$17$$;
4455
4500
  this.bus_send_msgid = `net${$config$jscomp$4_id$jscomp$6$$}-send`;
4456
4501
  this.bus_recv_msgid = `net${$config$jscomp$4_id$jscomp$6$$}-receive`;
4457
4502
  this.channel = new BroadcastChannel(`v86-inbrowser-${$config$jscomp$4_id$jscomp$6$$}`);
@@ -5452,12 +5497,12 @@ function $V86$$module$src$browser$starter$$($options$jscomp$41$$) {
5452
5497
  this.cpu_is_running = !1;
5453
5498
  this.cpu_exception_hook = function() {
5454
5499
  };
5455
- var $bus$jscomp$16_wasm_shared_funcs$$ = $Bus$$module$src$bus$$.create();
5456
- this.bus = $bus$jscomp$16_wasm_shared_funcs$$[0];
5457
- this.emulator_bus = $bus$jscomp$16_wasm_shared_funcs$$[1];
5500
+ var $bus$jscomp$18_wasm_shared_funcs$$ = $Bus$$module$src$bus$$.create();
5501
+ this.bus = $bus$jscomp$18_wasm_shared_funcs$$[0];
5502
+ this.emulator_bus = $bus$jscomp$18_wasm_shared_funcs$$[1];
5458
5503
  var $cpu$jscomp$12$$, $wasm_memory$$;
5459
5504
  const $wasm_table$$ = new WebAssembly.Table({element:"anyfunc", initial:1924});
5460
- $bus$jscomp$16_wasm_shared_funcs$$ = {cpu_exception_hook:$n$jscomp$11$$ => this.cpu_exception_hook($n$jscomp$11$$), run_hardware_timers:function($a$jscomp$6$$, $t$jscomp$4$$) {
5505
+ $bus$jscomp$18_wasm_shared_funcs$$ = {cpu_exception_hook:$n$jscomp$11$$ => this.cpu_exception_hook($n$jscomp$11$$), run_hardware_timers:function($a$jscomp$6$$, $t$jscomp$4$$) {
5461
5506
  return $cpu$jscomp$12$$.run_hardware_timers($a$jscomp$6$$, $t$jscomp$4$$);
5462
5507
  }, cpu_event_halt:() => {
5463
5508
  this.emulator_bus.send("cpu-event-halt");
@@ -5510,15 +5555,15 @@ function $V86$$module$src$browser$starter$$($options$jscomp$41$$) {
5510
5555
  $wasm_fn$$ || ($wasm_fn$$ = $env$$ => new Promise($resolve$jscomp$2$$ => {
5511
5556
  let $v86_bin$$ = "v86-debug.wasm", $v86_bin_fallback$$ = "v86-fallback.wasm";
5512
5557
  $options$jscomp$41$$.wasm_path ? ($v86_bin$$ = $options$jscomp$41$$.wasm_path, $v86_bin_fallback$$ = $v86_bin$$.replace("v86.wasm", "v86-fallback.wasm")) : "undefined" === typeof window && "string" === typeof __dirname ? ($v86_bin$$ = __dirname + "/" + $v86_bin$$, $v86_bin_fallback$$ = __dirname + "/" + $v86_bin_fallback$$) : ($v86_bin$$ = "build/" + $v86_bin$$, $v86_bin_fallback$$ = "build/" + $v86_bin_fallback$$);
5513
- $load_file$$module$src$lib$$($v86_bin$$, {done:async $bytes$jscomp$4$$ => {
5558
+ $load_file$$module$src$lib$$($v86_bin$$, {done:async $bytes$jscomp$5$$ => {
5514
5559
  try {
5515
- const {instance:$instance$$} = await WebAssembly.instantiate($bytes$jscomp$4$$, $env$$);
5516
- this.wasm_source = $bytes$jscomp$4$$;
5560
+ const {instance:$instance$$} = await WebAssembly.instantiate($bytes$jscomp$5$$, $env$$);
5561
+ this.wasm_source = $bytes$jscomp$5$$;
5517
5562
  $resolve$jscomp$2$$($instance$$.exports);
5518
5563
  } catch ($err$jscomp$3$$) {
5519
- $load_file$$module$src$lib$$($v86_bin_fallback$$, {done:async $bytes$jscomp$5$$ => {
5520
- const {instance:$instance$jscomp$1$$} = await WebAssembly.instantiate($bytes$jscomp$5$$, $env$$);
5521
- this.wasm_source = $bytes$jscomp$5$$;
5564
+ $load_file$$module$src$lib$$($v86_bin_fallback$$, {done:async $bytes$jscomp$6$$ => {
5565
+ const {instance:$instance$jscomp$1$$} = await WebAssembly.instantiate($bytes$jscomp$6$$, $env$$);
5566
+ this.wasm_source = $bytes$jscomp$6$$;
5522
5567
  $resolve$jscomp$2$$($instance$jscomp$1$$.exports);
5523
5568
  }, });
5524
5569
  }
@@ -5526,7 +5571,7 @@ function $V86$$module$src$browser$starter$$($options$jscomp$41$$) {
5526
5571
  this.emulator_bus.send("download-progress", {file_index:0, file_count:1, file_name:$v86_bin$$, lengthComputable:$e$jscomp$40$$.lengthComputable, total:$e$jscomp$40$$.total, loaded:$e$jscomp$40$$.loaded, });
5527
5572
  }});
5528
5573
  }));
5529
- $wasm_fn$$({env:$bus$jscomp$16_wasm_shared_funcs$$}).then($emulator_exports$$ => {
5574
+ $wasm_fn$$({env:$bus$jscomp$18_wasm_shared_funcs$$}).then($emulator_exports$$ => {
5530
5575
  $wasm_memory$$ = $emulator_exports$$.memory;
5531
5576
  $emulator_exports$$.rust_init();
5532
5577
  $emulator_exports$$ = this.v86 = new $v86$$module$src$main$$(this.emulator_bus, {exports:$emulator_exports$$, wasm_table:$wasm_table$$});
@@ -5596,6 +5641,7 @@ $V86$$module$src$browser$starter$$.prototype.continue_init = async function($emu
5596
5641
  $dbg_assert$$module$src$log$$(!$options$jscomp$42$$.bzimage_initrd_from_filesystem || $settings$$.initial_state, "bzimage_initrd_from_filesystem: Requires a filesystem");
5597
5642
  }
5598
5643
  this.serial_adapter && this.serial_adapter.show && this.serial_adapter.show();
5644
+ this.virtio_console_adapter && this.virtio_console_adapter.show && this.virtio_console_adapter.show();
5599
5645
  this.v86.init($settings$$);
5600
5646
  $settings$$.initial_state && ($emulator$jscomp$1$$.restore_state($settings$$.initial_state), $settings$$.initial_state = void 0);
5601
5647
  $options$jscomp$42$$.autostart && this.v86.run();
@@ -5611,13 +5657,13 @@ $V86$$module$src$browser$starter$$.prototype.continue_init = async function($emu
5611
5657
  }, this);
5612
5658
  var $settings$$ = {};
5613
5659
  this.disk_images = {fda:void 0, fdb:void 0, hda:void 0, hdb:void 0, cdrom:void 0, };
5614
- var $add_file_boot_order_fs_url_relay_url_screen_options$$ = $options$jscomp$42$$.boot_order ? $options$jscomp$42$$.boot_order : $options$jscomp$42$$.fda ? 801 : $options$jscomp$42$$.hda ? 786 : 291;
5660
+ var $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ = $options$jscomp$42$$.boot_order ? $options$jscomp$42$$.boot_order : $options$jscomp$42$$.fda ? 801 : $options$jscomp$42$$.hda ? 786 : 291;
5615
5661
  $settings$$.acpi = $options$jscomp$42$$.acpi;
5616
5662
  $settings$$.disable_jit = $options$jscomp$42$$.disable_jit;
5617
5663
  $settings$$.load_devices = !0;
5618
5664
  $settings$$.memory_size = $options$jscomp$42$$.memory_size || 67108864;
5619
5665
  $settings$$.vga_memory_size = $options$jscomp$42$$.vga_memory_size || 8388608;
5620
- $settings$$.boot_order = $add_file_boot_order_fs_url_relay_url_screen_options$$;
5666
+ $settings$$.boot_order = $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$;
5621
5667
  $settings$$.fastboot = $options$jscomp$42$$.fastboot || !1;
5622
5668
  $settings$$.fda = void 0;
5623
5669
  $settings$$.fdb = void 0;
@@ -5629,23 +5675,28 @@ $V86$$module$src$browser$starter$$.prototype.continue_init = async function($emu
5629
5675
  $settings$$.mac_address_translation = $options$jscomp$42$$.mac_address_translation;
5630
5676
  $settings$$.cpuid_level = $options$jscomp$42$$.cpuid_level;
5631
5677
  $settings$$.virtio_balloon = $options$jscomp$42$$.virtio_balloon;
5632
- $settings$$.virtio_console = $options$jscomp$42$$.virtio_console;
5633
- if ($add_file_boot_order_fs_url_relay_url_screen_options$$ = $options$jscomp$42$$.network_relay_url || $options$jscomp$42$$.net_device && $options$jscomp$42$$.net_device.relay_url) {
5634
- "fetch" === $add_file_boot_order_fs_url_relay_url_screen_options$$ ? this.network_adapter = new $FetchNetworkAdapter$$module$src$browser$fetch_network$$(this.bus, $options$jscomp$42$$.net_device) : "inbrowser" === $add_file_boot_order_fs_url_relay_url_screen_options$$ ? this.network_adapter = new $InBrowserNetworkAdapter$$module$src$browser$inbrowser_network$$(this.bus, $options$jscomp$42$$.net_device) : $add_file_boot_order_fs_url_relay_url_screen_options$$.startsWith("wisp://") || $add_file_boot_order_fs_url_relay_url_screen_options$$.startsWith("wisps://") ?
5635
- this.network_adapter = new $WispNetworkAdapter$$module$src$browser$wisp_network$$($add_file_boot_order_fs_url_relay_url_screen_options$$, this.bus, $options$jscomp$42$$.net_device) : this.network_adapter = new $NetworkAdapter$$module$src$browser$network$$($add_file_boot_order_fs_url_relay_url_screen_options$$, this.bus);
5678
+ $settings$$.virtio_console = !!$options$jscomp$42$$.virtio_console;
5679
+ if ($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ = $options$jscomp$42$$.network_relay_url || $options$jscomp$42$$.net_device && $options$jscomp$42$$.net_device.relay_url) {
5680
+ "fetch" === $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ ? this.network_adapter = new $FetchNetworkAdapter$$module$src$browser$fetch_network$$(this.bus, $options$jscomp$42$$.net_device) : "inbrowser" === $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ ? this.network_adapter = new $InBrowserNetworkAdapter$$module$src$browser$inbrowser_network$$(this.bus, $options$jscomp$42$$.net_device) : $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.startsWith("wisp://") ||
5681
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.startsWith("wisps://") ? this.network_adapter = new $WispNetworkAdapter$$module$src$browser$wisp_network$$($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$, this.bus, $options$jscomp$42$$.net_device) : this.network_adapter = new $NetworkAdapter$$module$src$browser$network$$($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$, this.bus);
5636
5682
  }
5637
5683
  $settings$$.net_device = $options$jscomp$42$$.net_device || {type:"ne2k"};
5638
- $add_file_boot_order_fs_url_relay_url_screen_options$$ = $options$jscomp$42$$.screen || {};
5639
- $options$jscomp$42$$.screen_container && ($add_file_boot_order_fs_url_relay_url_screen_options$$.container = $options$jscomp$42$$.screen_container);
5684
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ = $options$jscomp$42$$.screen || {};
5685
+ $options$jscomp$42$$.screen_container && ($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.container = $options$jscomp$42$$.screen_container);
5640
5686
  $options$jscomp$42$$.disable_keyboard || (this.keyboard_adapter = new $KeyboardAdapter$$module$src$browser$keyboard$$(this.bus));
5641
- $options$jscomp$42$$.disable_mouse || (this.mouse_adapter = new $MouseAdapter$$module$src$browser$mouse$$(this.bus, $add_file_boot_order_fs_url_relay_url_screen_options$$.container));
5642
- this.screen_adapter = $add_file_boot_order_fs_url_relay_url_screen_options$$.container ? new $ScreenAdapter$$module$src$browser$screen$$($add_file_boot_order_fs_url_relay_url_screen_options$$, () => this.v86.cpu.devices.vga && this.v86.cpu.devices.vga.screen_fill_buffer()) : new $DummyScreenAdapter$$module$src$browser$dummy_screen$$($add_file_boot_order_fs_url_relay_url_screen_options$$);
5687
+ $options$jscomp$42$$.disable_mouse || (this.mouse_adapter = new $MouseAdapter$$module$src$browser$mouse$$(this.bus, $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.container));
5688
+ this.screen_adapter = $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.container ? new $ScreenAdapter$$module$src$browser$screen$$($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$, () => this.v86.cpu.devices.vga && this.v86.cpu.devices.vga.screen_fill_buffer()) : new $DummyScreenAdapter$$module$src$browser$dummy_screen$$($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$);
5643
5689
  $settings$$.screen = this.screen_adapter;
5644
- $settings$$.screen_options = $add_file_boot_order_fs_url_relay_url_screen_options$$;
5645
- $options$jscomp$42$$.serial_container_xtermjs ? this.serial_adapter = new $SerialAdapterXtermJS$$module$src$browser$serial$$($options$jscomp$42$$.serial_container_xtermjs, this.bus) : $options$jscomp$42$$.serial_container && (this.serial_adapter = new $SerialAdapter$$module$src$browser$serial$$($options$jscomp$42$$.serial_container, this.bus));
5690
+ $settings$$.screen_options = $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$;
5691
+ $settings$$.serial_console = $options$jscomp$42$$.serial_console || {type:"none"};
5692
+ $options$jscomp$42$$.serial_container_xtermjs ? ($settings$$.serial_console.type = "xtermjs", $settings$$.serial_console.container = $options$jscomp$42$$.serial_container_xtermjs) : $options$jscomp$42$$.serial_container && ($settings$$.serial_console.type = "textarea", $settings$$.serial_console.container = $options$jscomp$42$$.serial_container);
5693
+ "xtermjs" === $settings$$.serial_console?.type ? this.serial_adapter = new $SerialAdapterXtermJS$$module$src$browser$serial$$($settings$$.serial_console.container, this.bus, $settings$$.serial_console.xterm_lib || window.Terminal) : "textarea" === $settings$$.serial_console?.type && (this.serial_adapter = new $SerialAdapter$$module$src$browser$serial$$($settings$$.serial_console.container, this.bus));
5694
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ = $options$jscomp$42$$.virtio_console && "boolean" === typeof $options$jscomp$42$$.virtio_console ? {type:"none"} : $options$jscomp$42$$.virtio_console;
5695
+ "xtermjs" === $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$?.type ? this.virtio_console_adapter = new $VirtioConsoleAdapterXtermJS$$module$src$browser$serial$$($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.container, this.bus, $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.xterm_lib || window.Terminal) : "textarea" === $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$?.type &&
5696
+ (this.virtio_console_adapter = new $VirtioConsoleAdapter$$module$src$browser$serial$$($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.container, this.bus));
5646
5697
  $options$jscomp$42$$.disable_speaker || (this.speaker_adapter = new $SpeakerAdapter$$module$src$browser$speaker$$(this.bus));
5647
5698
  var $files_to_load$$ = [];
5648
- $add_file_boot_order_fs_url_relay_url_screen_options$$ = ($name$jscomp$101$$, $file$jscomp$4$$) => {
5699
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ = ($name$jscomp$101$$, $file$jscomp$4$$) => {
5649
5700
  if ($file$jscomp$4$$) {
5650
5701
  if ($file$jscomp$4$$.get && $file$jscomp$4$$.set && $file$jscomp$4$$.load) {
5651
5702
  $files_to_load$$.push({name:$name$jscomp$101$$, loadable:$file$jscomp$4$$, });
@@ -5661,17 +5712,17 @@ $V86$$module$src$browser$starter$$.prototype.continue_init = async function($emu
5661
5712
  }
5662
5713
  };
5663
5714
  $options$jscomp$42$$.state && console.warn("Warning: Unknown option 'state'. Did you mean 'initial_state'?");
5664
- $add_file_boot_order_fs_url_relay_url_screen_options$$("bios", $options$jscomp$42$$.bios);
5665
- $add_file_boot_order_fs_url_relay_url_screen_options$$("vga_bios", $options$jscomp$42$$.vga_bios);
5666
- $add_file_boot_order_fs_url_relay_url_screen_options$$("cdrom", $options$jscomp$42$$.cdrom);
5667
- $add_file_boot_order_fs_url_relay_url_screen_options$$("hda", $options$jscomp$42$$.hda);
5668
- $add_file_boot_order_fs_url_relay_url_screen_options$$("hdb", $options$jscomp$42$$.hdb);
5669
- $add_file_boot_order_fs_url_relay_url_screen_options$$("fda", $options$jscomp$42$$.fda);
5670
- $add_file_boot_order_fs_url_relay_url_screen_options$$("fdb", $options$jscomp$42$$.fdb);
5671
- $add_file_boot_order_fs_url_relay_url_screen_options$$("initial_state", $options$jscomp$42$$.initial_state);
5672
- $add_file_boot_order_fs_url_relay_url_screen_options$$("multiboot", $options$jscomp$42$$.multiboot);
5673
- $add_file_boot_order_fs_url_relay_url_screen_options$$("bzimage", $options$jscomp$42$$.bzimage);
5674
- $add_file_boot_order_fs_url_relay_url_screen_options$$("initrd", $options$jscomp$42$$.initrd);
5715
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("bios", $options$jscomp$42$$.bios);
5716
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("vga_bios", $options$jscomp$42$$.vga_bios);
5717
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("cdrom", $options$jscomp$42$$.cdrom);
5718
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("hda", $options$jscomp$42$$.hda);
5719
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("hdb", $options$jscomp$42$$.hdb);
5720
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("fda", $options$jscomp$42$$.fda);
5721
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("fdb", $options$jscomp$42$$.fdb);
5722
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("initial_state", $options$jscomp$42$$.initial_state);
5723
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("multiboot", $options$jscomp$42$$.multiboot);
5724
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("bzimage", $options$jscomp$42$$.bzimage);
5725
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$("initrd", $options$jscomp$42$$.initrd);
5675
5726
  if ($options$jscomp$42$$.filesystem && $options$jscomp$42$$.filesystem.handle9p) {
5676
5727
  $settings$$.handle9p = $options$jscomp$42$$.filesystem.handle9p;
5677
5728
  } else {
@@ -5679,19 +5730,19 @@ $V86$$module$src$browser$starter$$.prototype.continue_init = async function($emu
5679
5730
  $settings$$.proxy9p = $options$jscomp$42$$.filesystem.proxy_url;
5680
5731
  } else {
5681
5732
  if ($options$jscomp$42$$.filesystem) {
5682
- $add_file_boot_order_fs_url_relay_url_screen_options$$ = $options$jscomp$42$$.filesystem.basefs;
5733
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ = $options$jscomp$42$$.filesystem.basefs;
5683
5734
  var $base_url$$ = $options$jscomp$42$$.filesystem.baseurl;
5684
5735
  let $file_storage$jscomp$1$$ = new $MemoryFileStorage$$module$src$browser$filestorage$$;
5685
5736
  $base_url$$ && ($file_storage$jscomp$1$$ = new $ServerFileStorageWrapper$$module$src$browser$filestorage$$($file_storage$jscomp$1$$, $base_url$$, this.zstd_decompress.bind(this)));
5686
5737
  $settings$$.fs9p = this.fs9p = new $FS$$module$lib$filesystem$$($file_storage$jscomp$1$$);
5687
- if ($add_file_boot_order_fs_url_relay_url_screen_options$$) {
5738
+ if ($add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$) {
5688
5739
  $dbg_assert$$module$src$log$$($base_url$$, "Filesystem: baseurl must be specified");
5689
- if ("object" === typeof $add_file_boot_order_fs_url_relay_url_screen_options$$) {
5690
- var $size$jscomp$35$$ = $add_file_boot_order_fs_url_relay_url_screen_options$$.size;
5691
- $add_file_boot_order_fs_url_relay_url_screen_options$$ = $add_file_boot_order_fs_url_relay_url_screen_options$$.url;
5740
+ if ("object" === typeof $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$) {
5741
+ var $size$jscomp$35$$ = $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.size;
5742
+ $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$ = $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$.url;
5692
5743
  }
5693
- $dbg_assert$$module$src$log$$("string" === typeof $add_file_boot_order_fs_url_relay_url_screen_options$$);
5694
- $files_to_load$$.push({name:"fs9p_json", url:$add_file_boot_order_fs_url_relay_url_screen_options$$, size:$size$jscomp$35$$, as_json:!0, });
5744
+ $dbg_assert$$module$src$log$$("string" === typeof $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$);
5745
+ $files_to_load$$.push({name:"fs9p_json", url:$add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$, size:$size$jscomp$35$$, as_json:!0, });
5695
5746
  }
5696
5747
  }
5697
5748
  }
@@ -5797,6 +5848,7 @@ $V86$$module$src$browser$starter$$.prototype.destroy = async function() {
5797
5848
  this.screen_adapter && this.screen_adapter.destroy();
5798
5849
  this.serial_adapter && this.serial_adapter.destroy();
5799
5850
  this.speaker_adapter && this.speaker_adapter.destroy();
5851
+ this.virtio_console_adapter && this.virtio_console_adapter.destroy();
5800
5852
  };
5801
5853
  $V86$$module$src$browser$starter$$.prototype.restart = function() {
5802
5854
  this.v86.restart();
@@ -6048,11 +6100,16 @@ $V86$$module$src$browser$starter$$.prototype.read_memory = function($offset$jsco
6048
6100
  $V86$$module$src$browser$starter$$.prototype.write_memory = function($blob$jscomp$13$$, $offset$jscomp$63$$) {
6049
6101
  this.v86.cpu.write_blob($blob$jscomp$13$$, $offset$jscomp$63$$);
6050
6102
  };
6051
- $V86$$module$src$browser$starter$$.prototype.set_serial_container_xtermjs = function($element$jscomp$10$$) {
6103
+ $V86$$module$src$browser$starter$$.prototype.set_serial_container_xtermjs = function($element$jscomp$14$$, $xterm_lib$jscomp$5$$ = window.Terminal) {
6052
6104
  this.serial_adapter && this.serial_adapter.destroy && this.serial_adapter.destroy();
6053
- this.serial_adapter = new $SerialAdapterXtermJS$$module$src$browser$serial$$($element$jscomp$10$$, this.bus);
6105
+ this.serial_adapter = new $SerialAdapterXtermJS$$module$src$browser$serial$$($element$jscomp$14$$, this.bus, $xterm_lib$jscomp$5$$);
6054
6106
  this.serial_adapter.show();
6055
6107
  };
6108
+ $V86$$module$src$browser$starter$$.prototype.set_virtio_console_container_xtermjs = function($element$jscomp$15$$, $xterm_lib$jscomp$6$$ = window.Terminal) {
6109
+ this.virtio_console_adapter && this.virtio_console_adapter.destroy && this.virtio_console_adapter.destroy();
6110
+ this.virtio_console_adapter = new $VirtioConsoleAdapterXtermJS$$module$src$browser$serial$$($element$jscomp$15$$, this.bus, $xterm_lib$jscomp$6$$);
6111
+ this.virtio_console_adapter.show();
6112
+ };
6056
6113
  $V86$$module$src$browser$starter$$.prototype.get_instruction_stats = function() {
6057
6114
  var $JSCompiler_inline_result$jscomp$inline_371_cpu$jscomp$inline_363$$ = this.v86.cpu;
6058
6115
  var $JSCompiler_inline_result$jscomp$inline_364_text$jscomp$inline_365$$ = "";
@@ -6093,15 +6150,15 @@ function $FileNotFoundError$$module$src$browser$starter$$($message$jscomp$32$$)
6093
6150
  }
6094
6151
  $FileNotFoundError$$module$src$browser$starter$$.prototype = Error.prototype;
6095
6152
  "undefined" !== typeof module && "undefined" !== typeof module.exports ? module.exports.V86 = $V86$$module$src$browser$starter$$ : "undefined" !== typeof window ? window.V86 = $V86$$module$src$browser$starter$$ : "function" === typeof importScripts && (self.V86 = $V86$$module$src$browser$starter$$);
6096
- function $v86$$module$src$main$$($bus$jscomp$17$$, $wasm$jscomp$1$$) {
6153
+ function $v86$$module$src$main$$($bus$jscomp$19$$, $wasm$jscomp$1$$) {
6097
6154
  this.stopping = this.running = !1;
6098
6155
  this.idle = !0;
6099
6156
  this.tick_counter = 0;
6100
6157
  this.worker = null;
6101
- this.cpu = new $CPU$$module$src$cpu$$($bus$jscomp$17$$, $wasm$jscomp$1$$, () => {
6158
+ this.cpu = new $CPU$$module$src$cpu$$($bus$jscomp$19$$, $wasm$jscomp$1$$, () => {
6102
6159
  this.idle && this.next_tick(0);
6103
6160
  });
6104
- this.bus = $bus$jscomp$17$$;
6161
+ this.bus = $bus$jscomp$19$$;
6105
6162
  this.register_yield();
6106
6163
  }
6107
6164
  $v86$$module$src$main$$.prototype.run = function() {
@@ -6330,8 +6387,8 @@ $ACPI$$module$src$acpi$$.prototype.set_state = function($state$jscomp$29$$) {
6330
6387
  this.pm1_enable = $state$jscomp$29$$[2];
6331
6388
  this.gpe = $state$jscomp$29$$[3];
6332
6389
  };
6333
- function $UART$$module$src$uart$$($cpu$jscomp$15_io$jscomp$2$$, $port$jscomp$2$$, $bus$jscomp$18$$) {
6334
- this.bus = $bus$jscomp$18$$;
6390
+ function $UART$$module$src$uart$$($cpu$jscomp$15_io$jscomp$2$$, $port$jscomp$2$$, $bus$jscomp$20$$) {
6391
+ this.bus = $bus$jscomp$20$$;
6335
6392
  this.cpu = $cpu$jscomp$15_io$jscomp$2$$;
6336
6393
  this.ints = 4;
6337
6394
  this.line_control = this.baud_rate = 0;
@@ -6741,13 +6798,13 @@ function $translate_mac_address$$module$src$ne2k$$($arp_packet_ipv4_packet_packe
6741
6798
  function $format_mac$$module$src$ne2k$$($mac$jscomp$2$$) {
6742
6799
  return [$mac$jscomp$2$$[0].toString(16).padStart(2, "0"), $mac$jscomp$2$$[1].toString(16).padStart(2, "0"), $mac$jscomp$2$$[2].toString(16).padStart(2, "0"), $mac$jscomp$2$$[3].toString(16).padStart(2, "0"), $mac$jscomp$2$$[4].toString(16).padStart(2, "0"), $mac$jscomp$2$$[5].toString(16).padStart(2, "0"), ].join(":");
6743
6800
  }
6744
- function $Ne2k$$module$src$ne2k$$($cpu$jscomp$17$$, $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$, $preserve_mac_from_state_image$$, $mac_address_translation$$, $id$jscomp$23$$) {
6801
+ function $Ne2k$$module$src$ne2k$$($cpu$jscomp$17$$, $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$, $preserve_mac_from_state_image$$, $mac_address_translation$$, $id$jscomp$23$$) {
6745
6802
  this.cpu = $cpu$jscomp$17$$;
6746
6803
  this.pci = $cpu$jscomp$17$$.devices.pci;
6747
6804
  this.id = $id$jscomp$23$$ || 0;
6748
6805
  this.preserve_mac_from_state_image = $preserve_mac_from_state_image$$;
6749
6806
  this.mac_address_translation = $mac_address_translation$$;
6750
- this.bus = $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$;
6807
+ this.bus = $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$;
6751
6808
  this.bus.register("net" + this.id + "-receive", function($data$jscomp$170$$) {
6752
6809
  this.receive($data$jscomp$170$$);
6753
6810
  }, this);
@@ -6766,8 +6823,8 @@ function $Ne2k$$module$src$ne2k$$($cpu$jscomp$17$$, $bus$jscomp$19_i$jscomp$78_i
6766
6823
  this.bus.send("net" + this.id + "-mac", $format_mac$$module$src$ne2k$$(this.mac));
6767
6824
  this.mar = Uint8Array.of(255, 255, 255, 255, 255, 255, 255, 255);
6768
6825
  this.mac_address_in_state = null;
6769
- for ($bus$jscomp$19_i$jscomp$78_io$jscomp$3$$ = 0; 6 > $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$; $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$++) {
6770
- this.memory[$bus$jscomp$19_i$jscomp$78_io$jscomp$3$$ << 1] = this.memory[$bus$jscomp$19_i$jscomp$78_io$jscomp$3$$ << 1 | 1] = this.mac[$bus$jscomp$19_i$jscomp$78_io$jscomp$3$$];
6826
+ for ($bus$jscomp$21_i$jscomp$78_io$jscomp$3$$ = 0; 6 > $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$; $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$++) {
6827
+ this.memory[$bus$jscomp$21_i$jscomp$78_io$jscomp$3$$ << 1] = this.memory[$bus$jscomp$21_i$jscomp$78_io$jscomp$3$$ << 1 | 1] = this.mac[$bus$jscomp$21_i$jscomp$78_io$jscomp$3$$];
6771
6828
  }
6772
6829
  this.memory[28] = this.memory[29] = 87;
6773
6830
  this.memory[30] = this.memory[31] = 87;
@@ -6776,22 +6833,22 @@ function $Ne2k$$module$src$ne2k$$($cpu$jscomp$17$$, $bus$jscomp$19_i$jscomp$78_i
6776
6833
  this.pstart = 64;
6777
6834
  this.pstop = 128;
6778
6835
  this.boundary = this.curpg = 76;
6779
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$ = $cpu$jscomp$17$$.io;
6780
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 0, this, function() {
6836
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$ = $cpu$jscomp$17$$.io;
6837
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 0, this, function() {
6781
6838
  $dbg_log$$module$src$log$$("Read cmd", 1048576);
6782
6839
  return this.cr;
6783
6840
  }, function() {
6784
6841
  $dbg_log$$module$src$log$$("Read16 cmd", 1048576);
6785
6842
  return this.cr;
6786
6843
  });
6787
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 0, this, function($data$jscomp$171_data_byte$jscomp$9_start$jscomp$29$$) {
6844
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 0, this, function($data$jscomp$171_data_byte$jscomp$9_start$jscomp$29$$) {
6788
6845
  this.cr = $data$jscomp$171_data_byte$jscomp$9_start$jscomp$29$$;
6789
6846
  $dbg_log$$module$src$log$$("Write command: " + $h$$module$src$lib$$($data$jscomp$171_data_byte$jscomp$9_start$jscomp$29$$, 2) + " newpg=" + (this.cr >> 6) + " txcr=" + $h$$module$src$lib$$(this.txcr, 2), 1048576);
6790
6847
  this.cr & 1 || ($data$jscomp$171_data_byte$jscomp$9_start$jscomp$29$$ & 24 && 0 === this.rcnt && this.do_interrupt(64), $data$jscomp$171_data_byte$jscomp$9_start$jscomp$29$$ & 4 && ($data$jscomp$171_data_byte$jscomp$9_start$jscomp$29$$ = this.tpsr << 8, $data$jscomp$171_data_byte$jscomp$9_start$jscomp$29$$ = this.memory.subarray($data$jscomp$171_data_byte$jscomp$9_start$jscomp$29$$, $data$jscomp$171_data_byte$jscomp$9_start$jscomp$29$$ + this.tcnt), this.mac_address_in_state && ($data$jscomp$171_data_byte$jscomp$9_start$jscomp$29$$ =
6791
6848
  new Uint8Array($data$jscomp$171_data_byte$jscomp$9_start$jscomp$29$$), $translate_mac_address$$module$src$ne2k$$($data$jscomp$171_data_byte$jscomp$9_start$jscomp$29$$, this.mac_address_in_state, this.mac)), this.bus.send("net" + this.id + "-send", $data$jscomp$171_data_byte$jscomp$9_start$jscomp$29$$), this.bus.send("eth-transmit-end", [$data$jscomp$171_data_byte$jscomp$9_start$jscomp$29$$.length]), this.cr &= -5, this.do_interrupt(2), $dbg_log$$module$src$log$$("Command: Transfer. length=" +
6792
6849
  $h$$module$src$lib$$($data$jscomp$171_data_byte$jscomp$9_start$jscomp$29$$.byteLength), 1048576)));
6793
6850
  });
6794
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 13, this, function() {
6851
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 13, this, function() {
6795
6852
  var $pg$$ = this.get_page();
6796
6853
  if (1 === $pg$$) {
6797
6854
  return $dbg_log$$module$src$log$$("Read mar5", 1048576), this.mar[5];
@@ -6799,7 +6856,7 @@ function $Ne2k$$module$src$ne2k$$($cpu$jscomp$17$$, $bus$jscomp$19_i$jscomp$78_i
6799
6856
  $dbg_log$$module$src$log$$("Read counter0 pg=" + $pg$$, 1048576);
6800
6857
  return 0;
6801
6858
  });
6802
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 14, this, function() {
6859
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 14, this, function() {
6803
6860
  var $pg$jscomp$1$$ = this.get_page();
6804
6861
  if (1 === $pg$jscomp$1$$) {
6805
6862
  return $dbg_log$$module$src$log$$("Read mar6", 1048576), this.mar[6];
@@ -6810,7 +6867,7 @@ function $Ne2k$$module$src$ne2k$$($cpu$jscomp$17$$, $bus$jscomp$19_i$jscomp$78_i
6810
6867
  $dbg_log$$module$src$log$$("Read16 counter1 pg=" + this.get_page(), 1048576);
6811
6868
  return 0;
6812
6869
  });
6813
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 15, this, function() {
6870
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 15, this, function() {
6814
6871
  var $pg$jscomp$2$$ = this.get_page();
6815
6872
  if (1 === $pg$jscomp$2$$) {
6816
6873
  return $dbg_log$$module$src$log$$("Read mar7", 1048576), this.mar[7];
@@ -6818,17 +6875,17 @@ function $Ne2k$$module$src$ne2k$$($cpu$jscomp$17$$, $bus$jscomp$19_i$jscomp$78_i
6818
6875
  $dbg_log$$module$src$log$$("Read counter2 pg=" + $pg$jscomp$2$$, 1048576);
6819
6876
  return 0;
6820
6877
  });
6821
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 31, this, function() {
6878
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 31, this, function() {
6822
6879
  this.get_page();
6823
6880
  $dbg_log$$module$src$log$$("Read reset", 1048576);
6824
6881
  this.do_interrupt(128);
6825
6882
  return 0;
6826
6883
  });
6827
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 31, this, function($data_byte$jscomp$10$$) {
6884
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 31, this, function($data_byte$jscomp$10$$) {
6828
6885
  this.get_page();
6829
6886
  $dbg_log$$module$src$log$$("Write reset: " + $h$$module$src$lib$$($data_byte$jscomp$10$$, 2), 1048576);
6830
6887
  });
6831
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 1, this, function() {
6888
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 1, this, function() {
6832
6889
  var $pg$jscomp$5$$ = this.get_page();
6833
6890
  if (0 === $pg$jscomp$5$$) {
6834
6891
  return this.pstart;
@@ -6843,12 +6900,12 @@ function $Ne2k$$module$src$ne2k$$($cpu$jscomp$17$$, $bus$jscomp$19_i$jscomp$78_i
6843
6900
  $dbg_assert$$module$src$log$$(!1);
6844
6901
  return 0;
6845
6902
  });
6846
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 1, this, function($data_byte$jscomp$11$$) {
6903
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 1, this, function($data_byte$jscomp$11$$) {
6847
6904
  var $pg$jscomp$6$$ = this.get_page();
6848
6905
  0 === $pg$jscomp$6$$ ? ($dbg_log$$module$src$log$$("start page: " + $h$$module$src$lib$$($data_byte$jscomp$11$$, 2), 1048576), this.pstart = $data_byte$jscomp$11$$) : 1 === $pg$jscomp$6$$ ? ($dbg_log$$module$src$log$$("mac[0] = " + $h$$module$src$lib$$($data_byte$jscomp$11$$), 1048576), this.mac[0] = $data_byte$jscomp$11$$) : 3 === $pg$jscomp$6$$ ? $dbg_log$$module$src$log$$("Unimplemented: Write pg3/01 (9346CR): " + $h$$module$src$lib$$($data_byte$jscomp$11$$), 1048576) : ($dbg_log$$module$src$log$$("Write pg" +
6849
6906
  $pg$jscomp$6$$ + "/01: " + $h$$module$src$lib$$($data_byte$jscomp$11$$), 1048576), $dbg_assert$$module$src$log$$(!1));
6850
6907
  });
6851
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 2, this, function() {
6908
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 2, this, function() {
6852
6909
  var $pg$jscomp$7$$ = this.get_page();
6853
6910
  if (0 === $pg$jscomp$7$$) {
6854
6911
  return this.pstop;
@@ -6863,12 +6920,12 @@ function $Ne2k$$module$src$ne2k$$($cpu$jscomp$17$$, $bus$jscomp$19_i$jscomp$78_i
6863
6920
  $dbg_assert$$module$src$log$$(!1);
6864
6921
  return 0;
6865
6922
  });
6866
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 2, this, function($data_byte$jscomp$12$$) {
6923
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 2, this, function($data_byte$jscomp$12$$) {
6867
6924
  var $pg$jscomp$8$$ = this.get_page();
6868
6925
  0 === $pg$jscomp$8$$ ? ($dbg_log$$module$src$log$$("stop page: " + $h$$module$src$lib$$($data_byte$jscomp$12$$, 2), 1048576), $data_byte$jscomp$12$$ > this.memory.length >> 8 && ($data_byte$jscomp$12$$ = this.memory.length >> 8, $dbg_log$$module$src$log$$("XXX: Adjusting stop page to " + $h$$module$src$lib$$($data_byte$jscomp$12$$), 1048576)), this.pstop = $data_byte$jscomp$12$$) : 1 === $pg$jscomp$8$$ ? ($dbg_log$$module$src$log$$("mac[1] = " + $h$$module$src$lib$$($data_byte$jscomp$12$$), 1048576),
6869
6926
  this.mac[1] = $data_byte$jscomp$12$$) : ($dbg_log$$module$src$log$$("Write pg" + $pg$jscomp$8$$ + "/02: " + $h$$module$src$lib$$($data_byte$jscomp$12$$), 1048576), $dbg_assert$$module$src$log$$(!1));
6870
6927
  });
6871
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 7, this, function() {
6928
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 7, this, function() {
6872
6929
  var $pg$jscomp$9$$ = this.get_page();
6873
6930
  if (0 === $pg$jscomp$9$$) {
6874
6931
  return $dbg_log$$module$src$log$$("Read isr: " + $h$$module$src$lib$$(this.isr, 2), 1048576), this.isr;
@@ -6879,19 +6936,19 @@ function $Ne2k$$module$src$ne2k$$($cpu$jscomp$17$$, $bus$jscomp$19_i$jscomp$78_i
6879
6936
  $dbg_assert$$module$src$log$$(!1);
6880
6937
  return 0;
6881
6938
  });
6882
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 7, this, function($data_byte$jscomp$13$$) {
6939
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 7, this, function($data_byte$jscomp$13$$) {
6883
6940
  var $pg$jscomp$10$$ = this.get_page();
6884
6941
  0 === $pg$jscomp$10$$ ? ($dbg_log$$module$src$log$$("Write isr: " + $h$$module$src$lib$$($data_byte$jscomp$13$$, 2), 1048576), this.isr &= ~$data_byte$jscomp$13$$, this.update_irq()) : 1 === $pg$jscomp$10$$ ? ($dbg_log$$module$src$log$$("Write curpg: " + $h$$module$src$lib$$($data_byte$jscomp$13$$, 2), 1048576), this.curpg = $data_byte$jscomp$13$$) : $dbg_assert$$module$src$log$$(!1);
6885
6942
  });
6886
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 13, this, function($data_byte$jscomp$14$$) {
6943
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 13, this, function($data_byte$jscomp$14$$) {
6887
6944
  var $pg$jscomp$11$$ = this.get_page();
6888
6945
  0 === $pg$jscomp$11$$ ? (this.txcr = $data_byte$jscomp$14$$, $dbg_log$$module$src$log$$("Write tx config: " + $h$$module$src$lib$$($data_byte$jscomp$14$$, 2), 1048576)) : $dbg_log$$module$src$log$$("Unimplemented: Write pg" + $pg$jscomp$11$$ + "/0d " + $h$$module$src$lib$$($data_byte$jscomp$14$$, 2), 1048576);
6889
6946
  });
6890
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 14, this, function($data_byte$jscomp$15$$) {
6947
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 14, this, function($data_byte$jscomp$15$$) {
6891
6948
  var $pg$jscomp$12$$ = this.get_page();
6892
6949
  0 === $pg$jscomp$12$$ ? ($dbg_log$$module$src$log$$("Write data configuration: " + $h$$module$src$lib$$($data_byte$jscomp$15$$, 2), 1048576), this.dcfg = $data_byte$jscomp$15$$) : $dbg_log$$module$src$log$$("Unimplemented: Write pg" + $pg$jscomp$12$$ + "/0e " + $h$$module$src$lib$$($data_byte$jscomp$15$$, 2), 1048576);
6893
6950
  });
6894
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 10, this, function() {
6951
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 10, this, function() {
6895
6952
  var $pg$jscomp$13$$ = this.get_page();
6896
6953
  if (0 === $pg$jscomp$13$$) {
6897
6954
  return $dbg_log$$module$src$log$$("Read pg0/0a", 1048576), 80;
@@ -6902,11 +6959,11 @@ function $Ne2k$$module$src$ne2k$$($cpu$jscomp$17$$, $bus$jscomp$19_i$jscomp$78_i
6902
6959
  $dbg_assert$$module$src$log$$(!1, "TODO");
6903
6960
  return 0;
6904
6961
  });
6905
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 10, this, function($data_byte$jscomp$16$$) {
6962
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 10, this, function($data_byte$jscomp$16$$) {
6906
6963
  var $pg$jscomp$14$$ = this.get_page();
6907
6964
  0 === $pg$jscomp$14$$ ? ($dbg_log$$module$src$log$$("Write remote byte count low: " + $h$$module$src$lib$$($data_byte$jscomp$16$$, 2), 1048576), this.rcnt = this.rcnt & 65280 | $data_byte$jscomp$16$$ & 255) : $dbg_log$$module$src$log$$("Unimplemented: Write pg" + $pg$jscomp$14$$ + "/0a " + $h$$module$src$lib$$($data_byte$jscomp$16$$, 2), 1048576);
6908
6965
  });
6909
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 11, this, function() {
6966
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 11, this, function() {
6910
6967
  var $pg$jscomp$15$$ = this.get_page();
6911
6968
  if (0 === $pg$jscomp$15$$) {
6912
6969
  return $dbg_log$$module$src$log$$("Read pg0/0b", 1048576), 67;
@@ -6917,11 +6974,11 @@ function $Ne2k$$module$src$ne2k$$($cpu$jscomp$17$$, $bus$jscomp$19_i$jscomp$78_i
6917
6974
  $dbg_assert$$module$src$log$$(!1, "TODO");
6918
6975
  return 0;
6919
6976
  });
6920
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 11, this, function($data_byte$jscomp$17$$) {
6977
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 11, this, function($data_byte$jscomp$17$$) {
6921
6978
  var $pg$jscomp$16$$ = this.get_page();
6922
6979
  0 === $pg$jscomp$16$$ ? ($dbg_log$$module$src$log$$("Write remote byte count high: " + $h$$module$src$lib$$($data_byte$jscomp$17$$, 2), 1048576), this.rcnt = this.rcnt & 255 | $data_byte$jscomp$17$$ << 8 & 65280) : $dbg_log$$module$src$log$$("Unimplemented: Write pg" + $pg$jscomp$16$$ + "/0b " + $h$$module$src$lib$$($data_byte$jscomp$17$$, 2), 1048576);
6923
6980
  });
6924
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 8, this, function() {
6981
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 8, this, function() {
6925
6982
  var $pg$jscomp$17$$ = this.get_page();
6926
6983
  if (0 === $pg$jscomp$17$$) {
6927
6984
  return $dbg_log$$module$src$log$$("Read remote start address low", 1048576), this.rsar & 255;
@@ -6933,11 +6990,11 @@ function $Ne2k$$module$src$ne2k$$($cpu$jscomp$17$$, $bus$jscomp$19_i$jscomp$78_i
6933
6990
  $dbg_assert$$module$src$log$$(!1);
6934
6991
  return 0;
6935
6992
  });
6936
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 8, this, function($data_byte$jscomp$18$$) {
6993
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 8, this, function($data_byte$jscomp$18$$) {
6937
6994
  var $pg$jscomp$18$$ = this.get_page();
6938
6995
  0 === $pg$jscomp$18$$ ? ($dbg_log$$module$src$log$$("Write remote start address low: " + $h$$module$src$lib$$($data_byte$jscomp$18$$, 2), 1048576), this.rsar = this.rsar & 65280 | $data_byte$jscomp$18$$ & 255) : $dbg_log$$module$src$log$$("Unimplemented: Write pg" + $pg$jscomp$18$$ + "/08 " + $h$$module$src$lib$$($data_byte$jscomp$18$$, 2), 1048576);
6939
6996
  });
6940
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 9, this, function() {
6997
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 9, this, function() {
6941
6998
  var $pg$jscomp$19$$ = this.get_page();
6942
6999
  if (0 === $pg$jscomp$19$$) {
6943
7000
  return $dbg_log$$module$src$log$$("Read remote start address high", 1048576), this.rsar >> 8 & 255;
@@ -6949,15 +7006,15 @@ function $Ne2k$$module$src$ne2k$$($cpu$jscomp$17$$, $bus$jscomp$19_i$jscomp$78_i
6949
7006
  $dbg_assert$$module$src$log$$(!1);
6950
7007
  return 0;
6951
7008
  });
6952
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 9, this, function($data_byte$jscomp$19$$) {
7009
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 9, this, function($data_byte$jscomp$19$$) {
6953
7010
  var $pg$jscomp$20$$ = this.get_page();
6954
7011
  0 === $pg$jscomp$20$$ ? ($dbg_log$$module$src$log$$("Write remote start address low: " + $h$$module$src$lib$$($data_byte$jscomp$19$$, 2), 1048576), this.rsar = this.rsar & 255 | $data_byte$jscomp$19$$ << 8 & 65280) : $dbg_log$$module$src$log$$("Unimplemented: Write pg" + $pg$jscomp$20$$ + "/09 " + $h$$module$src$lib$$($data_byte$jscomp$19$$, 2), 1048576);
6955
7012
  });
6956
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 15, this, function($data_byte$jscomp$20$$) {
7013
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 15, this, function($data_byte$jscomp$20$$) {
6957
7014
  var $pg$jscomp$21$$ = this.get_page();
6958
7015
  0 === $pg$jscomp$21$$ ? ($dbg_log$$module$src$log$$("Write interrupt mask register: " + $h$$module$src$lib$$($data_byte$jscomp$20$$, 2) + " isr=" + $h$$module$src$lib$$(this.isr, 2), 1048576), this.imr = $data_byte$jscomp$20$$, this.update_irq()) : $dbg_log$$module$src$log$$("Unimplemented: Write pg" + $pg$jscomp$21$$ + "/0f " + $h$$module$src$lib$$($data_byte$jscomp$20$$, 2), 1048576);
6959
7016
  });
6960
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 3, this, function() {
7017
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 3, this, function() {
6961
7018
  var $pg$jscomp$22$$ = this.get_page();
6962
7019
  if (0 === $pg$jscomp$22$$) {
6963
7020
  return $dbg_log$$module$src$log$$("Read boundary: " + $h$$module$src$lib$$(this.boundary, 2), 1048576), this.boundary;
@@ -6968,11 +7025,11 @@ function $Ne2k$$module$src$ne2k$$($cpu$jscomp$17$$, $bus$jscomp$19_i$jscomp$78_i
6968
7025
  3 === $pg$jscomp$22$$ ? $dbg_log$$module$src$log$$("Unimplemented: Read pg3/03 (CONFIG0)", 1048576) : ($dbg_log$$module$src$log$$("Read pg" + $pg$jscomp$22$$ + "/03", 1048576), $dbg_assert$$module$src$log$$(!1));
6969
7026
  return 0;
6970
7027
  });
6971
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 3, this, function($data_byte$jscomp$21$$) {
7028
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 3, this, function($data_byte$jscomp$21$$) {
6972
7029
  var $pg$jscomp$23$$ = this.get_page();
6973
7030
  0 === $pg$jscomp$23$$ ? ($dbg_log$$module$src$log$$("Write boundary: " + $h$$module$src$lib$$($data_byte$jscomp$21$$, 2), 1048576), this.boundary = $data_byte$jscomp$21$$) : 1 === $pg$jscomp$23$$ ? ($dbg_log$$module$src$log$$("mac[2] = " + $h$$module$src$lib$$($data_byte$jscomp$21$$), 1048576), this.mac[2] = $data_byte$jscomp$21$$) : ($dbg_log$$module$src$log$$("Write pg" + $pg$jscomp$23$$ + "/03: " + $h$$module$src$lib$$($data_byte$jscomp$21$$), 1048576), $dbg_assert$$module$src$log$$(!1));
6974
7031
  });
6975
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 4, this, function() {
7032
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 4, this, function() {
6976
7033
  var $pg$jscomp$24$$ = this.get_page();
6977
7034
  if (0 === $pg$jscomp$24$$) {
6978
7035
  return this.tsr;
@@ -6984,11 +7041,11 @@ function $Ne2k$$module$src$ne2k$$($cpu$jscomp$17$$, $bus$jscomp$19_i$jscomp$78_i
6984
7041
  $dbg_assert$$module$src$log$$(!1);
6985
7042
  return 0;
6986
7043
  });
6987
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 4, this, function($data_byte$jscomp$22$$) {
7044
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 4, this, function($data_byte$jscomp$22$$) {
6988
7045
  var $pg$jscomp$25$$ = this.get_page();
6989
7046
  0 === $pg$jscomp$25$$ ? ($dbg_log$$module$src$log$$("Write tpsr: " + $h$$module$src$lib$$($data_byte$jscomp$22$$, 2), 1048576), this.tpsr = $data_byte$jscomp$22$$) : 1 === $pg$jscomp$25$$ ? ($dbg_log$$module$src$log$$("mac[3] = " + $h$$module$src$lib$$($data_byte$jscomp$22$$), 1048576), this.mac[3] = $data_byte$jscomp$22$$) : ($dbg_log$$module$src$log$$("Write pg" + $pg$jscomp$25$$ + "/04: " + $h$$module$src$lib$$($data_byte$jscomp$22$$), 1048576), $dbg_assert$$module$src$log$$(!1));
6990
7047
  });
6991
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 5, this, function() {
7048
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 5, this, function() {
6992
7049
  var $pg$jscomp$26$$ = this.get_page();
6993
7050
  if (0 === $pg$jscomp$26$$) {
6994
7051
  return $dbg_log$$module$src$log$$("Unimplemented: Read pg0/05 (NCR: Number of Collisions Register)", 1048576), 0;
@@ -6999,12 +7056,12 @@ function $Ne2k$$module$src$ne2k$$($cpu$jscomp$17$$, $bus$jscomp$19_i$jscomp$78_i
6999
7056
  3 === $pg$jscomp$26$$ ? $dbg_log$$module$src$log$$("Unimplemented: Read pg3/05 (CONFIG2)", 1048576) : ($dbg_log$$module$src$log$$("Read pg" + $pg$jscomp$26$$ + "/05", 1048576), $dbg_assert$$module$src$log$$(!1));
7000
7057
  return 0;
7001
7058
  });
7002
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 5, this, function($data_byte$jscomp$23$$) {
7059
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 5, this, function($data_byte$jscomp$23$$) {
7003
7060
  var $pg$jscomp$27$$ = this.get_page();
7004
7061
  0 === $pg$jscomp$27$$ ? ($dbg_log$$module$src$log$$("Write tcnt low: " + $h$$module$src$lib$$($data_byte$jscomp$23$$, 2), 1048576), this.tcnt = this.tcnt & -256 | $data_byte$jscomp$23$$) : 1 === $pg$jscomp$27$$ ? ($dbg_log$$module$src$log$$("mac[4] = " + $h$$module$src$lib$$($data_byte$jscomp$23$$), 1048576), this.mac[4] = $data_byte$jscomp$23$$) : 3 === $pg$jscomp$27$$ ? $dbg_log$$module$src$log$$("Unimplemented: Write pg3/05 (CONFIG2): " + $h$$module$src$lib$$($data_byte$jscomp$23$$), 1048576) :
7005
7062
  ($dbg_log$$module$src$log$$("Write pg" + $pg$jscomp$27$$ + "/05: " + $h$$module$src$lib$$($data_byte$jscomp$23$$), 1048576), $dbg_assert$$module$src$log$$(!1));
7006
7063
  });
7007
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 6, this, function() {
7064
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 6, this, function() {
7008
7065
  var $pg$jscomp$28$$ = this.get_page();
7009
7066
  if (0 === $pg$jscomp$28$$) {
7010
7067
  return $dbg_assert$$module$src$log$$(!1, "TODO"), 0;
@@ -7015,12 +7072,12 @@ function $Ne2k$$module$src$ne2k$$($cpu$jscomp$17$$, $bus$jscomp$19_i$jscomp$78_i
7015
7072
  3 === $pg$jscomp$28$$ ? $dbg_log$$module$src$log$$("Unimplemented: Read pg3/06 (CONFIG3)", 1048576) : ($dbg_log$$module$src$log$$("Read pg" + $pg$jscomp$28$$ + "/06", 1048576), $dbg_assert$$module$src$log$$(!1));
7016
7073
  return 0;
7017
7074
  });
7018
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 6, this, function($data_byte$jscomp$24$$) {
7075
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 6, this, function($data_byte$jscomp$24$$) {
7019
7076
  var $pg$jscomp$29$$ = this.get_page();
7020
7077
  0 === $pg$jscomp$29$$ ? ($dbg_log$$module$src$log$$("Write tcnt high: " + $h$$module$src$lib$$($data_byte$jscomp$24$$, 2), 1048576), this.tcnt = this.tcnt & 255 | $data_byte$jscomp$24$$ << 8) : 1 === $pg$jscomp$29$$ ? ($dbg_log$$module$src$log$$("mac[5] = " + $h$$module$src$lib$$($data_byte$jscomp$24$$), 1048576), this.mac[5] = $data_byte$jscomp$24$$) : 3 === $pg$jscomp$29$$ ? $dbg_log$$module$src$log$$("Unimplemented: Write pg3/06 (CONFIG3): " + $h$$module$src$lib$$($data_byte$jscomp$24$$),
7021
7078
  1048576) : ($dbg_log$$module$src$log$$("Write pg" + $pg$jscomp$29$$ + "/06: " + $h$$module$src$lib$$($data_byte$jscomp$24$$), 1048576), $dbg_assert$$module$src$log$$(!1));
7022
7079
  });
7023
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 12, this, function() {
7080
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 12, this, function() {
7024
7081
  var $pg$jscomp$30$$ = this.get_page();
7025
7082
  if (0 === $pg$jscomp$30$$) {
7026
7083
  return 9;
@@ -7032,12 +7089,12 @@ function $Ne2k$$module$src$ne2k$$($cpu$jscomp$17$$, $bus$jscomp$19_i$jscomp$78_i
7032
7089
  $dbg_assert$$module$src$log$$(!1);
7033
7090
  return 0;
7034
7091
  });
7035
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 12, this, function($data_byte$jscomp$25$$) {
7092
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 12, this, function($data_byte$jscomp$25$$) {
7036
7093
  var $pg$jscomp$31$$ = this.get_page();
7037
7094
  0 === $pg$jscomp$31$$ ? ($dbg_log$$module$src$log$$("RX configuration reg write: " + $h$$module$src$lib$$($data_byte$jscomp$25$$, 2), 1048576), this.rxcr = $data_byte$jscomp$25$$) : $dbg_log$$module$src$log$$("Unimplemented: Write pg" + $pg$jscomp$31$$ + "/0c: " + $h$$module$src$lib$$($data_byte$jscomp$25$$), 1048576);
7038
7095
  });
7039
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 16, this, this.data_port_read8, this.data_port_read16, this.data_port_read32);
7040
- $bus$jscomp$19_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 16, this, this.data_port_write16, this.data_port_write16, this.data_port_write32);
7096
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_read(this.port | 16, this, this.data_port_read8, this.data_port_read16, this.data_port_read32);
7097
+ $bus$jscomp$21_i$jscomp$78_io$jscomp$3$$.register_write(this.port | 16, this, this.data_port_write16, this.data_port_write16, this.data_port_write32);
7041
7098
  $cpu$jscomp$17$$.devices.pci.register_device(this);
7042
7099
  }
7043
7100
  $Ne2k$$module$src$ne2k$$.prototype.get_state = function() {
@@ -7139,16 +7196,16 @@ $Ne2k$$module$src$ne2k$$.prototype.receive = function($data$jscomp$175$$) {
7139
7196
  $Ne2k$$module$src$ne2k$$.prototype.get_page = function() {
7140
7197
  return this.cr >> 6 & 3;
7141
7198
  };
7142
- function $VirtioConsole$$module$src$virtio_console$$($cpu$jscomp$18$$, $bus$jscomp$20_queues$$) {
7143
- this.bus = $bus$jscomp$20_queues$$;
7199
+ function $VirtioConsole$$module$src$virtio_console$$($cpu$jscomp$18$$, $bus$jscomp$22_queues$$) {
7200
+ this.bus = $bus$jscomp$22_queues$$;
7144
7201
  this.rows = 25;
7145
7202
  this.cols = 80;
7146
7203
  this.ports = 4;
7147
- $bus$jscomp$20_queues$$ = [{size_supported:16, notify_offset:0, }, {size_supported:16, notify_offset:1, }, {size_supported:16, notify_offset:2, }, {size_supported:16, notify_offset:3, }, ];
7204
+ $bus$jscomp$22_queues$$ = [{size_supported:16, notify_offset:0, }, {size_supported:16, notify_offset:1, }, {size_supported:16, notify_offset:2, }, {size_supported:16, notify_offset:3, }, ];
7148
7205
  for (let $i$jscomp$79$$ = 1; $i$jscomp$79$$ < this.ports; ++$i$jscomp$79$$) {
7149
- $bus$jscomp$20_queues$$.push({size_supported:16, notify_offset:0}), $bus$jscomp$20_queues$$.push({size_supported:8, notify_offset:1});
7206
+ $bus$jscomp$22_queues$$.push({size_supported:16, notify_offset:0}), $bus$jscomp$22_queues$$.push({size_supported:8, notify_offset:1});
7150
7207
  }
7151
- this.virtio = new $VirtIO$$module$src$virtio$$($cpu$jscomp$18$$, {name:"virtio-console", pci_id:96, device_id:4163, subsystem_device_id:3, common:{initial_port:47104, queues:$bus$jscomp$20_queues$$, features:[0, 1, 32, ], on_driver_ok:() => {
7208
+ this.virtio = new $VirtIO$$module$src$virtio$$($cpu$jscomp$18$$, {name:"virtio-console", pci_id:96, device_id:4163, subsystem_device_id:3, common:{initial_port:47104, queues:$bus$jscomp$22_queues$$, features:[0, 1, 32, ], on_driver_ok:() => {
7152
7209
  }, }, notification:{initial_port:47360, single_handler:!1, handlers:[() => {
7153
7210
  }, $queue_id$jscomp$1$$ => {
7154
7211
  const $queue$$ = this.virtio.queues[$queue_id$jscomp$1$$], $port$jscomp$4$$ = 3 < $queue_id$jscomp$1$$ ? $queue_id$jscomp$1$$ - 3 >> 1 : 0;
@@ -7261,9 +7318,9 @@ $VirtioConsole$$module$src$virtio_console$$.prototype.Ack = function($queue_id$j
7261
7318
  this.virtio.queues[$queue_id$jscomp$6$$].push_reply($bufchain$jscomp$7$$);
7262
7319
  this.virtio.queues[$queue_id$jscomp$6$$].flush_replies();
7263
7320
  };
7264
- function $PS2$$module$src$ps2$$($cpu$jscomp$19$$, $bus$jscomp$21$$) {
7321
+ function $PS2$$module$src$ps2$$($cpu$jscomp$19$$, $bus$jscomp$23$$) {
7265
7322
  this.cpu = $cpu$jscomp$19$$;
7266
- this.bus = $bus$jscomp$21$$;
7323
+ this.bus = $bus$jscomp$23$$;
7267
7324
  this.reset();
7268
7325
  this.bus.register("keyboard-code", function($code$jscomp$7$$) {
7269
7326
  this.kbd_send_code($code$jscomp$7$$);
@@ -8220,22 +8277,22 @@ const $ATA_CMD_NAME$$module$src$ide$$ = {[8]:"DEVICE RESET", [144]:"EXECUTE DEVI
8220
8277
  [36]:"READ SECTORS EXT", [64]:"READ VERIFY SECTORS", [245]:"SECURITY FREEZE LOCK", [239]:"SET FEATURES", [249]:"SET MAX", [198]:"SET MULTIPLE MODE", [224]:"STANDBY IMMEDIATE", [202]:"WRITE DMA", [53]:"WRITE DMA EXT", [57]:"WRITE MULTIPLE", [197]:"WRITE MULTIPLE EXT", [48]:"WRITE SECTORS", [52]:"WRITE SECTORS EXT", [16]:"<UNKNOWN 10h>", [240]:"<VENDOR-SPECIFIC F0h>", }, $ATAPI_CMD$$module$src$ide$$ = {[70]:{name:"GET CONFIGURATION", flags:0}, [74]:{name:"GET EVENT STATUS NOTIFICATION", flags:0}, [18]:{name:"INQUIRY",
8221
8278
  flags:0}, [189]:{name:"MECHANISM STATUS", flags:0}, [26]:{name:"MODE SENSE (6)", flags:0}, [90]:{name:"MODE SENSE (10)", flags:0}, [69]:{name:"PAUSE", flags:1}, [30]:{name:"PREVENT ALLOW MEDIUM REMOVAL", flags:0}, [40]:{name:"READ (10)", flags:1}, [168]:{name:"READ (12)", flags:1}, [37]:{name:"READ CAPACITY", flags:1}, [190]:{name:"READ CD", flags:1}, [81]:{name:"READ DISK INFORMATION", flags:1}, [66]:{name:"READ SUBCHANNEL", flags:1}, [67]:{name:"READ TOC PMA ATIP", flags:1}, [82]:{name:"READ TRACK INFORMATION",
8222
8279
  flags:1}, [3]:{name:"REQUEST SENSE", flags:0}, [27]:{name:"START STOP UNIT", flags:0}, [0]:{name:"TEST UNIT READY", flags:1}, };
8223
- function $IDEController$$module$src$ide$$($cpu$jscomp$21$$, $bus$jscomp$22_has_primary$$, $command_base0_ide_config$$) {
8280
+ function $IDEController$$module$src$ide$$($cpu$jscomp$21$$, $bus$jscomp$24_has_primary$$, $command_base0_ide_config$$) {
8224
8281
  this.cpu = $cpu$jscomp$21$$;
8225
- this.bus = $bus$jscomp$22_has_primary$$;
8282
+ this.bus = $bus$jscomp$24_has_primary$$;
8226
8283
  this.secondary = this.primary = void 0;
8227
- $bus$jscomp$22_has_primary$$ = $command_base0_ide_config$$ && $command_base0_ide_config$$[0][0];
8284
+ $bus$jscomp$24_has_primary$$ = $command_base0_ide_config$$ && $command_base0_ide_config$$[0][0];
8228
8285
  const $has_secondary$$ = $command_base0_ide_config$$ && $command_base0_ide_config$$[1][0];
8229
- if ($bus$jscomp$22_has_primary$$ || $has_secondary$$) {
8230
- $bus$jscomp$22_has_primary$$ && (this.primary = new $IDEChannel$$module$src$ide$$(this, 0, $command_base0_ide_config$$[0], 496, 1014, 14));
8286
+ if ($bus$jscomp$24_has_primary$$ || $has_secondary$$) {
8287
+ $bus$jscomp$24_has_primary$$ && (this.primary = new $IDEChannel$$module$src$ide$$(this, 0, $command_base0_ide_config$$[0], 496, 1014, 14));
8231
8288
  $has_secondary$$ && (this.secondary = new $IDEChannel$$module$src$ide$$(this, 1, $command_base0_ide_config$$[1], 368, 886, 15));
8232
- $command_base0_ide_config$$ = $bus$jscomp$22_has_primary$$ ? this.primary.command_base : 0;
8233
- const $control_base0$$ = $bus$jscomp$22_has_primary$$ ? this.primary.control_base : 0, $command_base1$$ = $has_secondary$$ ? this.secondary.command_base : 0, $control_base1$$ = $has_secondary$$ ? this.secondary.control_base : 0;
8289
+ $command_base0_ide_config$$ = $bus$jscomp$24_has_primary$$ ? this.primary.command_base : 0;
8290
+ const $control_base0$$ = $bus$jscomp$24_has_primary$$ ? this.primary.control_base : 0, $command_base1$$ = $has_secondary$$ ? this.secondary.command_base : 0, $control_base1$$ = $has_secondary$$ ? this.secondary.control_base : 0;
8234
8291
  this.name = "ide";
8235
8292
  this.pci_id = 240;
8236
8293
  this.pci_space = [134, 128, 16, 112, 5, 0, 160, 2, 0, 128, 1, 1, 0, 0, 0, 0, $command_base0_ide_config$$ & 255 | 1, $command_base0_ide_config$$ >> 8, 0, 0, $control_base0$$ & 255 | 1, $control_base0$$ >> 8, 0, 0, $command_base1$$ & 255 | 1, $command_base1$$ >> 8, 0, 0, $control_base1$$ & 255 | 1, $control_base1$$ >> 8, 0, 0, 1, 180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 16, 212, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
8237
8294
  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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ];
8238
- this.pci_bars = [$bus$jscomp$22_has_primary$$ ? {size:8} : void 0, $bus$jscomp$22_has_primary$$ ? {size:1} : void 0, $has_secondary$$ ? {size:8} : void 0, $has_secondary$$ ? {size:1} : void 0, {size:16}];
8295
+ this.pci_bars = [$bus$jscomp$24_has_primary$$ ? {size:8} : void 0, $bus$jscomp$24_has_primary$$ ? {size:1} : void 0, $has_secondary$$ ? {size:8} : void 0, $has_secondary$$ ? {size:1} : void 0, {size:16}];
8239
8296
  $cpu$jscomp$21$$.devices.pci.register_device(this);
8240
8297
  }
8241
8298
  Object.seal(this);
@@ -9145,19 +9202,19 @@ $IDEInterface$$module$src$ide$$.prototype.set_state = function($state$jscomp$49$
9145
9202
  this.drive_connected = this.is_atapi || this.buffer;
9146
9203
  this.medium_changed = !1;
9147
9204
  };
9148
- function $VirtioNet$$module$src$virtio_net$$($cpu$jscomp$23$$, $bus$jscomp$23_queues$jscomp$1$$, $i$jscomp$85_preserve_mac_from_state_image$jscomp$1$$, $mtu$jscomp$1$$ = 1500) {
9149
- this.bus = $bus$jscomp$23_queues$jscomp$1$$;
9205
+ function $VirtioNet$$module$src$virtio_net$$($cpu$jscomp$23$$, $bus$jscomp$25_queues$jscomp$1$$, $i$jscomp$85_preserve_mac_from_state_image$jscomp$1$$, $mtu$jscomp$1$$ = 1500) {
9206
+ this.bus = $bus$jscomp$25_queues$jscomp$1$$;
9150
9207
  this.id = $cpu$jscomp$23$$.devices.net ? 1 : 0;
9151
9208
  this.status = this.pairs = 1;
9152
9209
  this.preserve_mac_from_state_image = $i$jscomp$85_preserve_mac_from_state_image$jscomp$1$$;
9153
9210
  this.mac = new Uint8Array([0, 34, 21, 255 * Math.random() | 0, 255 * Math.random() | 0, 255 * Math.random() | 0, ]);
9154
9211
  this.bus.send("net" + this.id + "-mac", $format_mac$$module$src$ne2k$$(this.mac));
9155
- $bus$jscomp$23_queues$jscomp$1$$ = [];
9212
+ $bus$jscomp$25_queues$jscomp$1$$ = [];
9156
9213
  for ($i$jscomp$85_preserve_mac_from_state_image$jscomp$1$$ = 0; $i$jscomp$85_preserve_mac_from_state_image$jscomp$1$$ < this.pairs; ++$i$jscomp$85_preserve_mac_from_state_image$jscomp$1$$) {
9157
- $bus$jscomp$23_queues$jscomp$1$$.push({size_supported:1024, notify_offset:0}), $bus$jscomp$23_queues$jscomp$1$$.push({size_supported:1024, notify_offset:1});
9214
+ $bus$jscomp$25_queues$jscomp$1$$.push({size_supported:1024, notify_offset:0}), $bus$jscomp$25_queues$jscomp$1$$.push({size_supported:1024, notify_offset:1});
9158
9215
  }
9159
- $bus$jscomp$23_queues$jscomp$1$$.push({size_supported:16, notify_offset:2, });
9160
- this.virtio = new $VirtIO$$module$src$virtio$$($cpu$jscomp$23$$, {name:"virtio-net", pci_id:80, device_id:4161, subsystem_device_id:1, common:{initial_port:51200, queues:$bus$jscomp$23_queues$jscomp$1$$, features:[5, 16, 22, 3, 17, 23, 32, ], on_driver_ok:() => {
9216
+ $bus$jscomp$25_queues$jscomp$1$$.push({size_supported:16, notify_offset:2, });
9217
+ this.virtio = new $VirtIO$$module$src$virtio$$($cpu$jscomp$23$$, {name:"virtio-net", pci_id:80, device_id:4161, subsystem_device_id:1, common:{initial_port:51200, queues:$bus$jscomp$25_queues$jscomp$1$$, features:[5, 16, 22, 3, 17, 23, 32, ], on_driver_ok:() => {
9161
9218
  }, }, notification:{initial_port:51456, single_handler:!1, handlers:[() => {
9162
9219
  }, $queue_id$jscomp$8$$ => {
9163
9220
  const $queue$jscomp$4$$ = this.virtio.queues[$queue_id$jscomp$8$$];
@@ -9237,9 +9294,9 @@ $VirtioNet$$module$src$virtio_net$$.prototype.Ack = function($queue_id$jscomp$11
9237
9294
  this.virtio.queues[$queue_id$jscomp$11$$].flush_replies();
9238
9295
  };
9239
9296
  const $VGA_HOST_MEMORY_SPACE_START$$module$src$vga$$ = Uint32Array.from([655360, 655360, 720896, 753664, ]), $VGA_HOST_MEMORY_SPACE_SIZE$$module$src$vga$$ = Uint32Array.from([131072, 65536, 32768, 32768, ]);
9240
- function $VGAScreen$$module$src$vga$$($cpu$jscomp$24$$, $bus$jscomp$24_io$jscomp$4$$, $screen$jscomp$3_vga_offset$$, $vga_memory_size$$) {
9297
+ function $VGAScreen$$module$src$vga$$($cpu$jscomp$24$$, $bus$jscomp$26_io$jscomp$4$$, $screen$jscomp$3_vga_offset$$, $vga_memory_size$$) {
9241
9298
  this.cpu = $cpu$jscomp$24$$;
9242
- this.bus = $bus$jscomp$24_io$jscomp$4$$;
9299
+ this.bus = $bus$jscomp$26_io$jscomp$4$$;
9243
9300
  this.screen = $screen$jscomp$3_vga_offset$$;
9244
9301
  this.vga_memory_size = $vga_memory_size$$;
9245
9302
  this.cursor_address = 0;
@@ -9283,45 +9340,45 @@ function $VGAScreen$$module$src$vga$$($cpu$jscomp$24$$, $bus$jscomp$24_io$jscomp
9283
9340
  this.max_scan_line = this.color_dont_care = this.color_compare = this.miscellaneous_graphics_register = this.planar_setreset_enable = this.planar_setreset = 0;
9284
9341
  this.port_3DA_value = this.miscellaneous_output_register = 255;
9285
9342
  this.font_page_ab_enabled = !1;
9286
- $bus$jscomp$24_io$jscomp$4$$ = $cpu$jscomp$24$$.io;
9287
- $bus$jscomp$24_io$jscomp$4$$.register_write(960, this, this.port3C0_write);
9288
- $bus$jscomp$24_io$jscomp$4$$.register_read(960, this, this.port3C0_read, this.port3C0_read16);
9289
- $bus$jscomp$24_io$jscomp$4$$.register_read(961, this, this.port3C1_read);
9290
- $bus$jscomp$24_io$jscomp$4$$.register_write(962, this, this.port3C2_write);
9291
- $bus$jscomp$24_io$jscomp$4$$.register_write_consecutive(964, this, this.port3C4_write, this.port3C5_write);
9292
- $bus$jscomp$24_io$jscomp$4$$.register_read(964, this, this.port3C4_read);
9293
- $bus$jscomp$24_io$jscomp$4$$.register_read(965, this, this.port3C5_read);
9294
- $bus$jscomp$24_io$jscomp$4$$.register_write_consecutive(974, this, this.port3CE_write, this.port3CF_write);
9295
- $bus$jscomp$24_io$jscomp$4$$.register_read(974, this, this.port3CE_read);
9296
- $bus$jscomp$24_io$jscomp$4$$.register_read(975, this, this.port3CF_read);
9297
- $bus$jscomp$24_io$jscomp$4$$.register_read(966, this, this.port3C6_read);
9298
- $bus$jscomp$24_io$jscomp$4$$.register_write(966, this, this.port3C6_write);
9299
- $bus$jscomp$24_io$jscomp$4$$.register_write(967, this, this.port3C7_write);
9300
- $bus$jscomp$24_io$jscomp$4$$.register_read(967, this, this.port3C7_read);
9301
- $bus$jscomp$24_io$jscomp$4$$.register_write(968, this, this.port3C8_write);
9302
- $bus$jscomp$24_io$jscomp$4$$.register_read(968, this, this.port3C8_read);
9303
- $bus$jscomp$24_io$jscomp$4$$.register_write(969, this, this.port3C9_write);
9304
- $bus$jscomp$24_io$jscomp$4$$.register_read(969, this, this.port3C9_read);
9305
- $bus$jscomp$24_io$jscomp$4$$.register_read(972, this, this.port3CC_read);
9306
- $bus$jscomp$24_io$jscomp$4$$.register_write(980, this, this.port3D4_write, this.port3D4_write16);
9307
- $bus$jscomp$24_io$jscomp$4$$.register_write(981, this, this.port3D5_write, this.port3D5_write16);
9308
- $bus$jscomp$24_io$jscomp$4$$.register_read(980, this, this.port3D4_read);
9309
- $bus$jscomp$24_io$jscomp$4$$.register_read(981, this, this.port3D5_read, this.port3D5_read16);
9310
- $bus$jscomp$24_io$jscomp$4$$.register_write(948, this, this.port3D4_write, this.port3D4_write16);
9311
- $bus$jscomp$24_io$jscomp$4$$.register_write(949, this, this.port3D5_write, this.port3D5_write16);
9312
- $bus$jscomp$24_io$jscomp$4$$.register_read(948, this, this.port3D4_read);
9313
- $bus$jscomp$24_io$jscomp$4$$.register_read(949, this, this.port3D5_read, this.port3D5_read16);
9314
- $bus$jscomp$24_io$jscomp$4$$.register_read(970, this, function() {
9343
+ $bus$jscomp$26_io$jscomp$4$$ = $cpu$jscomp$24$$.io;
9344
+ $bus$jscomp$26_io$jscomp$4$$.register_write(960, this, this.port3C0_write);
9345
+ $bus$jscomp$26_io$jscomp$4$$.register_read(960, this, this.port3C0_read, this.port3C0_read16);
9346
+ $bus$jscomp$26_io$jscomp$4$$.register_read(961, this, this.port3C1_read);
9347
+ $bus$jscomp$26_io$jscomp$4$$.register_write(962, this, this.port3C2_write);
9348
+ $bus$jscomp$26_io$jscomp$4$$.register_write_consecutive(964, this, this.port3C4_write, this.port3C5_write);
9349
+ $bus$jscomp$26_io$jscomp$4$$.register_read(964, this, this.port3C4_read);
9350
+ $bus$jscomp$26_io$jscomp$4$$.register_read(965, this, this.port3C5_read);
9351
+ $bus$jscomp$26_io$jscomp$4$$.register_write_consecutive(974, this, this.port3CE_write, this.port3CF_write);
9352
+ $bus$jscomp$26_io$jscomp$4$$.register_read(974, this, this.port3CE_read);
9353
+ $bus$jscomp$26_io$jscomp$4$$.register_read(975, this, this.port3CF_read);
9354
+ $bus$jscomp$26_io$jscomp$4$$.register_read(966, this, this.port3C6_read);
9355
+ $bus$jscomp$26_io$jscomp$4$$.register_write(966, this, this.port3C6_write);
9356
+ $bus$jscomp$26_io$jscomp$4$$.register_write(967, this, this.port3C7_write);
9357
+ $bus$jscomp$26_io$jscomp$4$$.register_read(967, this, this.port3C7_read);
9358
+ $bus$jscomp$26_io$jscomp$4$$.register_write(968, this, this.port3C8_write);
9359
+ $bus$jscomp$26_io$jscomp$4$$.register_read(968, this, this.port3C8_read);
9360
+ $bus$jscomp$26_io$jscomp$4$$.register_write(969, this, this.port3C9_write);
9361
+ $bus$jscomp$26_io$jscomp$4$$.register_read(969, this, this.port3C9_read);
9362
+ $bus$jscomp$26_io$jscomp$4$$.register_read(972, this, this.port3CC_read);
9363
+ $bus$jscomp$26_io$jscomp$4$$.register_write(980, this, this.port3D4_write, this.port3D4_write16);
9364
+ $bus$jscomp$26_io$jscomp$4$$.register_write(981, this, this.port3D5_write, this.port3D5_write16);
9365
+ $bus$jscomp$26_io$jscomp$4$$.register_read(980, this, this.port3D4_read);
9366
+ $bus$jscomp$26_io$jscomp$4$$.register_read(981, this, this.port3D5_read, this.port3D5_read16);
9367
+ $bus$jscomp$26_io$jscomp$4$$.register_write(948, this, this.port3D4_write, this.port3D4_write16);
9368
+ $bus$jscomp$26_io$jscomp$4$$.register_write(949, this, this.port3D5_write, this.port3D5_write16);
9369
+ $bus$jscomp$26_io$jscomp$4$$.register_read(948, this, this.port3D4_read);
9370
+ $bus$jscomp$26_io$jscomp$4$$.register_read(949, this, this.port3D5_read, this.port3D5_read16);
9371
+ $bus$jscomp$26_io$jscomp$4$$.register_read(970, this, function() {
9315
9372
  $dbg_log$$module$src$log$$("3CA read", 256);
9316
9373
  return 0;
9317
9374
  });
9318
- $bus$jscomp$24_io$jscomp$4$$.register_read(986, this, this.port3DA_read);
9319
- $bus$jscomp$24_io$jscomp$4$$.register_read(954, this, this.port3DA_read);
9375
+ $bus$jscomp$26_io$jscomp$4$$.register_read(986, this, this.port3DA_read);
9376
+ $bus$jscomp$26_io$jscomp$4$$.register_read(954, this, this.port3DA_read);
9320
9377
  this.dispi_index = -1;
9321
9378
  this.dispi_enable_value = 0;
9322
- $bus$jscomp$24_io$jscomp$4$$.register_write(462, this, void 0, this.port1CE_write);
9323
- $bus$jscomp$24_io$jscomp$4$$.register_write(463, this, void 0, this.port1CF_write);
9324
- $bus$jscomp$24_io$jscomp$4$$.register_read(463, this, void 0, this.port1CF_read);
9379
+ $bus$jscomp$26_io$jscomp$4$$.register_write(462, this, void 0, this.port1CE_write);
9380
+ $bus$jscomp$26_io$jscomp$4$$.register_write(463, this, void 0, this.port1CF_write);
9381
+ $bus$jscomp$26_io$jscomp$4$$.register_read(463, this, void 0, this.port1CF_read);
9325
9382
  $screen$jscomp$3_vga_offset$$ = $cpu$jscomp$24$$.svga_allocate_memory(this.vga_memory_size) >>> 0;
9326
9383
  this.svga_memory = $view$$module$src$lib$$(Uint8Array, $cpu$jscomp$24$$.wasm_memory, $screen$jscomp$3_vga_offset$$, this.vga_memory_size);
9327
9384
  this.diff_addr_min = this.vga_memory_size;
@@ -9335,7 +9392,7 @@ function $VGAScreen$$module$src$vga$$($cpu$jscomp$24$$, $bus$jscomp$24_io$jscomp
9335
9392
  this.plane2 = new Uint8Array(this.vga_memory.buffer, 131072, 65536);
9336
9393
  this.plane3 = new Uint8Array(this.vga_memory.buffer, 196608, 65536);
9337
9394
  this.pixel_buffer = new Uint8Array(524288);
9338
- $bus$jscomp$24_io$jscomp$4$$.mmap_register(655360, 131072, $addr$jscomp$30$$ => this.vga_memory_read($addr$jscomp$30$$), ($addr$jscomp$31$$, $value$jscomp$168$$) => this.vga_memory_write($addr$jscomp$31$$, $value$jscomp$168$$), );
9395
+ $bus$jscomp$26_io$jscomp$4$$.mmap_register(655360, 131072, $addr$jscomp$30$$ => this.vga_memory_read($addr$jscomp$30$$), ($addr$jscomp$31$$, $value$jscomp$168$$) => this.vga_memory_write($addr$jscomp$31$$, $value$jscomp$168$$), );
9339
9396
  $cpu$jscomp$24$$.devices.pci.register_device(this);
9340
9397
  }
9341
9398
  $VGAScreen$$module$src$vga$$.prototype.get_state = function() {
@@ -9578,16 +9635,16 @@ $VGAScreen$$module$src$vga$$.prototype.text_mode_redraw = function() {
9578
9635
  for (let $row$jscomp$7$$ = 0; $row$jscomp$7$$ < this.max_rows; $row$jscomp$7$$++) {
9579
9636
  $row$jscomp$7$$ === $split_screen_row$$ && ($addr$jscomp$35$$ = 0);
9580
9637
  for (let $col$jscomp$4$$ = 0; $col$jscomp$4$$ < this.max_cols; $col$jscomp$4$$++) {
9581
- const $chr$jscomp$11$$ = this.vga_memory[$addr$jscomp$35$$], $color$jscomp$2$$ = this.vga_memory[$addr$jscomp$35$$ | 1], $flags$jscomp$13$$ = ($blink_enabled$$ && $color$jscomp$2$$ & 128 ? $FLAG_BLINKING$jscomp$1$$ : 0) | (!this.font_page_ab_enabled || $color$jscomp$2$$ & 8 ? 0 : $FLAG_FONT_PAGE_B$jscomp$1$$);
9582
- this.bus.send("screen-put-char", [$row$jscomp$7$$, $col$jscomp$4$$, $chr$jscomp$11$$]);
9583
- this.screen.put_char($row$jscomp$7$$, $col$jscomp$4$$, $chr$jscomp$11$$, $flags$jscomp$13$$, this.vga256_palette[this.dac_mask & this.dac_map[$color$jscomp$2$$ >> 4 & $bg_color_mask$$]], this.vga256_palette[this.dac_mask & this.dac_map[$color$jscomp$2$$ & $fg_color_mask$$]]);
9638
+ const $chr$jscomp$12$$ = this.vga_memory[$addr$jscomp$35$$], $color$jscomp$2$$ = this.vga_memory[$addr$jscomp$35$$ | 1], $flags$jscomp$13$$ = ($blink_enabled$$ && $color$jscomp$2$$ & 128 ? $FLAG_BLINKING$jscomp$1$$ : 0) | (!this.font_page_ab_enabled || $color$jscomp$2$$ & 8 ? 0 : $FLAG_FONT_PAGE_B$jscomp$1$$);
9639
+ this.bus.send("screen-put-char", [$row$jscomp$7$$, $col$jscomp$4$$, $chr$jscomp$12$$]);
9640
+ this.screen.put_char($row$jscomp$7$$, $col$jscomp$4$$, $chr$jscomp$12$$, $flags$jscomp$13$$, this.vga256_palette[this.dac_mask & this.dac_map[$color$jscomp$2$$ >> 4 & $bg_color_mask$$]], this.vga256_palette[this.dac_mask & this.dac_map[$color$jscomp$2$$ & $fg_color_mask$$]]);
9584
9641
  $addr$jscomp$35$$ += 2;
9585
9642
  }
9586
9643
  $addr$jscomp$35$$ += $row_offset$$;
9587
9644
  }
9588
9645
  };
9589
- $VGAScreen$$module$src$vga$$.prototype.vga_memory_write_text_mode = function($addr$jscomp$36_flags$jscomp$14$$, $chr$jscomp$12_value$jscomp$171$$) {
9590
- this.vga_memory[$addr$jscomp$36_flags$jscomp$14$$] = $chr$jscomp$12_value$jscomp$171$$;
9646
+ $VGAScreen$$module$src$vga$$.prototype.vga_memory_write_text_mode = function($addr$jscomp$36_flags$jscomp$14$$, $chr$jscomp$13_value$jscomp$171$$) {
9647
+ this.vga_memory[$addr$jscomp$36_flags$jscomp$14$$] = $chr$jscomp$13_value$jscomp$171$$;
9591
9648
  var $col$jscomp$5_max_cols$$ = Math.max(this.max_cols, 2 * this.offset_register);
9592
9649
  let $row$jscomp$8$$;
9593
9650
  if ($addr$jscomp$36_flags$jscomp$14$$ >> 1 >= this.start_address) {
@@ -9599,13 +9656,13 @@ $VGAScreen$$module$src$vga$$.prototype.vga_memory_write_text_mode = function($ad
9599
9656
  }
9600
9657
  $dbg_assert$$module$src$log$$(0 <= $row$jscomp$8$$ && 0 <= $col$jscomp$5_max_cols$$);
9601
9658
  if (!($col$jscomp$5_max_cols$$ >= this.max_cols || $row$jscomp$8$$ >= this.max_rows)) {
9602
- $addr$jscomp$36_flags$jscomp$14$$ & 1 ? ($color$jscomp$3_memory_start_memory_start$jscomp$1$$ = $chr$jscomp$12_value$jscomp$171$$, $chr$jscomp$12_value$jscomp$171$$ = this.vga_memory[$addr$jscomp$36_flags$jscomp$14$$ & -2]) : $color$jscomp$3_memory_start_memory_start$jscomp$1$$ = this.vga_memory[$addr$jscomp$36_flags$jscomp$14$$ | 1];
9659
+ $addr$jscomp$36_flags$jscomp$14$$ & 1 ? ($color$jscomp$3_memory_start_memory_start$jscomp$1$$ = $chr$jscomp$13_value$jscomp$171$$, $chr$jscomp$13_value$jscomp$171$$ = this.vga_memory[$addr$jscomp$36_flags$jscomp$14$$ & -2]) : $color$jscomp$3_memory_start_memory_start$jscomp$1$$ = this.vga_memory[$addr$jscomp$36_flags$jscomp$14$$ | 1];
9603
9660
  var $bg_color_mask$jscomp$1_blink_enabled$jscomp$1$$ = this.attribute_mode & 8;
9604
9661
  $addr$jscomp$36_flags$jscomp$14$$ = ($bg_color_mask$jscomp$1_blink_enabled$jscomp$1$$ && $color$jscomp$3_memory_start_memory_start$jscomp$1$$ & 128 ? this.screen.FLAG_BLINKING : 0) | (!this.font_page_ab_enabled || $color$jscomp$3_memory_start_memory_start$jscomp$1$$ & 8 ? 0 : this.screen.FLAG_FONT_PAGE_B);
9605
9662
  var $fg_color_mask$jscomp$1$$ = this.font_page_ab_enabled ? 7 : 15;
9606
9663
  $bg_color_mask$jscomp$1_blink_enabled$jscomp$1$$ = $bg_color_mask$jscomp$1_blink_enabled$jscomp$1$$ ? 7 : 15;
9607
- this.bus.send("screen-put-char", [$row$jscomp$8$$, $col$jscomp$5_max_cols$$, $chr$jscomp$12_value$jscomp$171$$]);
9608
- this.screen.put_char($row$jscomp$8$$, $col$jscomp$5_max_cols$$, $chr$jscomp$12_value$jscomp$171$$, $addr$jscomp$36_flags$jscomp$14$$, this.vga256_palette[this.dac_mask & this.dac_map[$color$jscomp$3_memory_start_memory_start$jscomp$1$$ >> 4 & $bg_color_mask$jscomp$1_blink_enabled$jscomp$1$$]], this.vga256_palette[this.dac_mask & this.dac_map[$color$jscomp$3_memory_start_memory_start$jscomp$1$$ & $fg_color_mask$jscomp$1$$]]);
9664
+ this.bus.send("screen-put-char", [$row$jscomp$8$$, $col$jscomp$5_max_cols$$, $chr$jscomp$13_value$jscomp$171$$]);
9665
+ this.screen.put_char($row$jscomp$8$$, $col$jscomp$5_max_cols$$, $chr$jscomp$13_value$jscomp$171$$, $addr$jscomp$36_flags$jscomp$14$$, this.vga256_palette[this.dac_mask & this.dac_map[$color$jscomp$3_memory_start_memory_start$jscomp$1$$ >> 4 & $bg_color_mask$jscomp$1_blink_enabled$jscomp$1$$]], this.vga256_palette[this.dac_mask & this.dac_map[$color$jscomp$3_memory_start_memory_start$jscomp$1$$ & $fg_color_mask$jscomp$1$$]]);
9609
9666
  }
9610
9667
  };
9611
9668
  $VGAScreen$$module$src$vga$$.prototype.update_cursor = function() {
@@ -10364,8 +10421,8 @@ $VGAScreen$$module$src$vga$$.prototype.set_font_page = function() {
10364
10421
  this.complete_redraw();
10365
10422
  };
10366
10423
  const $STAT_NAMES$$module$src$virtio_balloon$$ = "SWAP_IN SWAP_OUT MAJFLT MINFLT MEMFREE MEMTOT AVAIL CACHES HTLB_PGALLOC HTLB_PGFAIL".split(" ");
10367
- function $VirtioBalloon$$module$src$virtio_balloon$$($cpu$jscomp$25$$, $bus$jscomp$25$$) {
10368
- this.bus = $bus$jscomp$25$$;
10424
+ function $VirtioBalloon$$module$src$virtio_balloon$$($cpu$jscomp$25$$, $bus$jscomp$27$$) {
10425
+ this.bus = $bus$jscomp$27$$;
10369
10426
  this.zeroed = this.fp_cmd = this.actual = this.num_pages = 0;
10370
10427
  this.virtio = new $VirtIO$$module$src$virtio$$($cpu$jscomp$25$$, {name:"virtio-balloon", pci_id:88, device_id:4165, subsystem_device_id:5, common:{initial_port:55296, queues:[{size_supported:32, notify_offset:0}, {size_supported:32, notify_offset:0}, {size_supported:2, notify_offset:1}, {size_supported:64, notify_offset:2}, ], features:[1, 3, 32, ], on_driver_ok:() => {
10371
10428
  $dbg_log$$module$src$log$$("Balloon setup", 2048);
@@ -10543,7 +10600,7 @@ function $load_kernel$$module$src$kernel$$($data8$jscomp$inline_162_mem8$$, $bzi
10543
10600
  }
10544
10601
  }
10545
10602
  }
10546
- function $CPU$$module$src$cpu$$($bus$jscomp$26$$, $memory$jscomp$1_wm$$, $stop_idling$$) {
10603
+ function $CPU$$module$src$cpu$$($bus$jscomp$28$$, $memory$jscomp$1_wm$$, $stop_idling$$) {
10547
10604
  this.stop_idling = $stop_idling$$;
10548
10605
  this.wm = $memory$jscomp$1_wm$$;
10549
10606
  this.wasm_patch();
@@ -10622,7 +10679,7 @@ function $CPU$$module$src$cpu$$($bus$jscomp$26$$, $memory$jscomp$1_wm$$, $stop_i
10622
10679
  this.fw_pointer = 0;
10623
10680
  this.option_roms = [];
10624
10681
  this.io = void 0;
10625
- this.bus = $bus$jscomp$26$$;
10682
+ this.bus = $bus$jscomp$28$$;
10626
10683
  this.set_tsc(0, 0);
10627
10684
  this.seen_code = {};
10628
10685
  this.seen_code_uncompiled = {};
@@ -11728,7 +11785,7 @@ $VirtIO$$module$src$virtio$$.prototype.init_capabilities = function($cap_len$jsc
11728
11785
  $cap_next$$ = $bar_offset_cap_ptr_port$jscomp$10$$ + $cap_len$jscomp$1_capabilities$jscomp$1_write$$;
11729
11786
  $dbg_assert$$module$src$log$$(256 >= $cap_next$$, "VirtIO device<" + this.name + "> can't fit all capabilities into 256byte configspace");
11730
11787
  $dbg_assert$$module$src$log$$(0 <= $cap$jscomp$2$$.bar && 6 > $cap$jscomp$2$$.bar, "VirtIO device<" + this.name + "> capability invalid bar number");
11731
- var $bar_size_shim_read8_on_16$$ = $cap$jscomp$2$$.struct.reduce(($bytes$jscomp$6$$, $field$$) => $bytes$jscomp$6$$ + $field$$.bytes, 0);
11788
+ var $bar_size_shim_read8_on_16$$ = $cap$jscomp$2$$.struct.reduce(($bytes$jscomp$7$$, $field$$) => $bytes$jscomp$7$$ + $field$$.bytes, 0);
11732
11789
  $bar_size_shim_read8_on_16$$ += $cap$jscomp$2$$.offset;
11733
11790
  $bar_size_shim_read8_on_16$$ = 16 > $bar_size_shim_read8_on_16$$ ? 16 : 1 << $int_log2$$module$src$lib$$($bar_size_shim_read8_on_16$$ - 1) + 1;
11734
11791
  $dbg_assert$$module$src$log$$(0 === ($cap$jscomp$2$$.port & $bar_size_shim_read8_on_16$$ - 1), "VirtIO device<" + this.name + "> capability port should be aligned to pci bar size");
@@ -12125,9 +12182,9 @@ function $init_virtio$$module$lib$9p$$($cpu$jscomp$29$$, $configspace_taglen$$,
12125
12182
  }, }))), }, });
12126
12183
  return $virtio$jscomp$1$$;
12127
12184
  }
12128
- function $Virtio9p$$module$lib$9p$$($filesystem$jscomp$2$$, $cpu$jscomp$30$$, $bus$jscomp$27$$) {
12185
+ function $Virtio9p$$module$lib$9p$$($filesystem$jscomp$2$$, $cpu$jscomp$30$$, $bus$jscomp$29$$) {
12129
12186
  this.fs = $filesystem$jscomp$2$$;
12130
- this.bus = $bus$jscomp$27$$;
12187
+ this.bus = $bus$jscomp$29$$;
12131
12188
  this.configspace_tagname = [104, 111, 115, 116, 57, 112];
12132
12189
  this.configspace_taglen = this.configspace_tagname.length;
12133
12190
  this.virtio = $init_virtio$$module$lib$9p$$($cpu$jscomp$30$$, this.configspace_taglen, this.configspace_tagname, this.ReceiveRequest.bind(this));