v86 0.5.329 → 0.5.333
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/libv86-debug.js +7 -5
- package/build/libv86-debug.mjs +7 -5
- package/build/libv86.js +3 -3
- package/build/libv86.mjs +6 -6
- package/build/v86-debug.wasm +0 -0
- package/build/v86-fallback.wasm +0 -0
- package/build/v86.wasm +0 -0
- package/package.json +1 -1
package/build/libv86-debug.js
CHANGED
|
@@ -6257,8 +6257,7 @@ $v86$$module$src$main$$.prototype.destroy = function() {
|
|
|
6257
6257
|
this.unregister_yield();
|
|
6258
6258
|
};
|
|
6259
6259
|
$v86$$module$src$main$$.prototype.restart = function() {
|
|
6260
|
-
this.cpu.
|
|
6261
|
-
this.cpu.load_bios();
|
|
6260
|
+
this.cpu.reboot_internal();
|
|
6262
6261
|
};
|
|
6263
6262
|
$v86$$module$src$main$$.prototype.init = function($settings$jscomp$1$$) {
|
|
6264
6263
|
this.cpu.init($settings$jscomp$1$$, this.bus);
|
|
@@ -8453,9 +8452,12 @@ function $IDEChannel$$module$src$ide$$($controller_cpu$jscomp$22$$, $bus_master_
|
|
|
8453
8452
|
if ($select_slave$$ && this.current_interface === this.master || !$select_slave$$ && this.current_interface === this.slave) {
|
|
8454
8453
|
$select_slave$$ ? ($dbg_log$$module$src$log$$(`${this.current_interface.name}: select slave device (${this.channel_nr ? "secondary" : "primary"})`, 32768), this.current_interface = this.slave) : ($dbg_log$$module$src$log$$(`${this.current_interface.name}: select master device (${this.channel_nr ? "secondary" : "primary"})`, 32768), this.current_interface = this.master);
|
|
8455
8454
|
}
|
|
8456
|
-
this.
|
|
8457
|
-
this.
|
|
8458
|
-
this.
|
|
8455
|
+
this.master.device_reg = $data$jscomp$192$$;
|
|
8456
|
+
this.slave.device_reg = $data$jscomp$192$$;
|
|
8457
|
+
this.master.is_lba = $data$jscomp$192$$ >> 6 & 1;
|
|
8458
|
+
this.slave.is_lba = $data$jscomp$192$$ >> 6 & 1;
|
|
8459
|
+
this.master.head = $data$jscomp$192$$ & 15;
|
|
8460
|
+
this.slave.head = $data$jscomp$192$$ & 15;
|
|
8459
8461
|
});
|
|
8460
8462
|
$controller_cpu$jscomp$22$$.io.register_write(this.command_base | 7, this, function($data$jscomp$193$$) {
|
|
8461
8463
|
this.current_interface.status_reg &= -34;
|
package/build/libv86-debug.mjs
CHANGED
|
@@ -6256,8 +6256,7 @@ $v86$$module$src$main$$.prototype.destroy = function() {
|
|
|
6256
6256
|
this.unregister_yield();
|
|
6257
6257
|
};
|
|
6258
6258
|
$v86$$module$src$main$$.prototype.restart = function() {
|
|
6259
|
-
this.cpu.
|
|
6260
|
-
this.cpu.load_bios();
|
|
6259
|
+
this.cpu.reboot_internal();
|
|
6261
6260
|
};
|
|
6262
6261
|
$v86$$module$src$main$$.prototype.init = function($settings$jscomp$1$$) {
|
|
6263
6262
|
this.cpu.init($settings$jscomp$1$$, this.bus);
|
|
@@ -8452,9 +8451,12 @@ function $IDEChannel$$module$src$ide$$($controller_cpu$jscomp$22$$, $bus_master_
|
|
|
8452
8451
|
if ($select_slave$$ && this.current_interface === this.master || !$select_slave$$ && this.current_interface === this.slave) {
|
|
8453
8452
|
$select_slave$$ ? ($dbg_log$$module$src$log$$(`${this.current_interface.name}: select slave device (${this.channel_nr ? "secondary" : "primary"})`, 32768), this.current_interface = this.slave) : ($dbg_log$$module$src$log$$(`${this.current_interface.name}: select master device (${this.channel_nr ? "secondary" : "primary"})`, 32768), this.current_interface = this.master);
|
|
8454
8453
|
}
|
|
8455
|
-
this.
|
|
8456
|
-
this.
|
|
8457
|
-
this.
|
|
8454
|
+
this.master.device_reg = $data$jscomp$192$$;
|
|
8455
|
+
this.slave.device_reg = $data$jscomp$192$$;
|
|
8456
|
+
this.master.is_lba = $data$jscomp$192$$ >> 6 & 1;
|
|
8457
|
+
this.slave.is_lba = $data$jscomp$192$$ >> 6 & 1;
|
|
8458
|
+
this.master.head = $data$jscomp$192$$ & 15;
|
|
8459
|
+
this.slave.head = $data$jscomp$192$$ & 15;
|
|
8458
8460
|
});
|
|
8459
8461
|
$controller_cpu$jscomp$22$$.io.register_write(this.command_base | 7, this, function($data$jscomp$193$$) {
|
|
8460
8462
|
this.current_interface.status_reg &= -34;
|
package/build/libv86.js
CHANGED
|
@@ -347,7 +347,7 @@ N.prototype.get_instruction_stats=function(){var a=this.v86.cpu;var b="";var c="
|
|
|
347
347
|
d=0;const e={};for(let g=0;g<c.length;g++){const h=c[g];var f=void 0;if(h.includes("/")){d++;const [l,m]=h.split("/");f=e[l]/e[m]}else f=e[h]=a.wm.exports.profiler_stat_get(g-d),f=1E8<=f?Math.round(f/1E6)+"m":1E5<=f?Math.round(f/1E3)+"k":f;b+=h+"="+f+"\n"}b+="\n";c=a.wm.exports.get_valid_tlb_entries_count();d=a.wm.exports.get_valid_global_tlb_entries_count();b=b+("TLB_ENTRIES="+c+" ("+d+" global, "+(c-d)+" non-global)\nWASM_TABLE_FREE=")+(a.wm.exports.jit_get_wasm_table_index_free_list_count()+"\n");
|
|
348
348
|
b+="JIT_CACHE_SIZE="+a.wm.exports.jit_get_cache_size()+"\n";b+="FLAT_SEGMENTS="+a.wm.exports.has_flat_segmentation()+"\n";b+="wasm memory size: "+(a.wasm_memory.buffer.byteLength>>20)+"m\n";b=b+"Config:\nJIT_DISABLED="+(a.wm.exports.get_jit_config(0)+"\n");b+="MAX_PAGES="+a.wm.exports.get_jit_config(1)+"\n";b+="JIT_USE_LOOP_SAFETY="+!!a.wm.exports.get_jit_config(2)+"\n";b+="MAX_EXTRA_BASIC_BLOCKS="+a.wm.exports.get_jit_config(3)+"\n";a=[fb(a,!1,!1,!1,!1),fb(a,!0,!1,!1,!1),fb(a,!1,!0,!1,!1),fb(a,!1,
|
|
349
349
|
!1,!0,!1),fb(a,!1,!1,!1,!0)].join("\n\n");return b+a};function xc(a){this.message=a||"File not found"}xc.prototype=Error.prototype;"undefined"!==typeof module&&"undefined"!==typeof module.exports?module.exports.V86=N:"undefined"!==typeof window?window.V86=N:"function"===typeof importScripts&&(self.V86=N);function F(a,b){this.stopping=this.running=!1;this.idle=!0;this.tick_counter=0;this.worker=null;this.cpu=new O(a,b,()=>{this.idle&&this.next_tick(0)});this.bus=a;this.register_yield()}F.prototype.run=function(){this.stopping=!1;this.running||(this.running=!0,this.bus.send("emulator-started"));this.next_tick(0)};F.prototype.do_tick=function(){if(this.stopping||!this.running)this.stopping=this.running=!1,this.bus.send("emulator-stopped");else{this.idle=!1;var a=this.cpu.main_loop();this.next_tick(a)}};
|
|
350
|
-
F.prototype.next_tick=function(a){const b=++this.tick_counter;this.idle=!0;this.yield(a,b)};F.prototype.yield_callback=function(a){a===this.tick_counter&&this.do_tick()};F.prototype.stop=function(){this.running&&(this.stopping=!0)};F.prototype.destroy=function(){this.unregister_yield()};F.prototype.restart=function(){this.cpu.
|
|
350
|
+
F.prototype.next_tick=function(a){const b=++this.tick_counter;this.idle=!0;this.yield(a,b)};F.prototype.yield_callback=function(a){a===this.tick_counter&&this.do_tick()};F.prototype.stop=function(){this.running&&(this.stopping=!0)};F.prototype.destroy=function(){this.unregister_yield()};F.prototype.restart=function(){this.cpu.reboot_internal()};F.prototype.init=function(a){this.cpu.init(a,this.bus);this.bus.send("emulator-ready")};
|
|
351
351
|
if("undefined"!==typeof process)F.prototype.yield=function(a,b){1>a?global.setImmediate(c=>this.yield_callback(c),b):setTimeout(c=>this.yield_callback(c),a,b)},F.prototype.register_yield=function(){},F.prototype.unregister_yield=function(){};else if(globalThis.scheduler&&"function"===typeof globalThis.scheduler.postTask&&location.href.includes("use-scheduling-api"))F.prototype.yield=function(a,b){a=Math.max(0,a);globalThis.scheduler.postTask(()=>this.yield_callback(b),{delay:a})},F.prototype.register_yield=
|
|
352
352
|
function(){},F.prototype.unregister_yield=function(){};else if("undefined"!==typeof Worker){function a(){let b;globalThis.onmessage=function(c){const d=c.data.t;b=b&&clearTimeout(b);1>d?postMessage(c.data.tick):b=setTimeout(()=>postMessage(c.data.tick),d)}}F.prototype.register_yield=function(){const b=URL.createObjectURL(new Blob(["("+a.toString()+")()"],{type:"text/javascript"}));this.worker=new Worker(b);this.worker.onmessage=c=>this.yield_callback(c.data);URL.revokeObjectURL(b)};F.prototype.yield=
|
|
353
353
|
function(b,c){this.worker.postMessage({t:b,tick:c})};F.prototype.unregister_yield=function(){this.worker&&this.worker.terminate();this.worker=null}}else F.prototype.yield=function(a){setTimeout(()=>{this.do_tick()},a)},F.prototype.register_yield=function(){},F.prototype.unregister_yield=function(){};
|
|
@@ -478,8 +478,8 @@ function(){return this.current_interface.read_data(2)},function(){return this.cu
|
|
|
478
478
|
255});a.io.register_read(this.command_base|5,this,function(){return this.current_interface.lba_high_reg&255});a.io.register_read(this.command_base|6,this,function(){return this.current_interface.device_reg&255});a.io.register_read(this.command_base|7,this,function(){const g=this.read_status();this.cpu.device_lower_irq(this.irq);return g});a.io.register_write(this.command_base|0,this,function(g){this.current_interface.write_data_port8(g)},function(g){this.current_interface.write_data_port16(g)},function(g){this.current_interface.write_data_port32(g)});
|
|
479
479
|
a.io.register_write(this.command_base|1,this,function(g){this.master.features_reg=(this.master.features_reg<<8|g)&65535;this.slave.features_reg=(this.slave.features_reg<<8|g)&65535});a.io.register_write(this.command_base|2,this,function(g){this.master.sector_count_reg=(this.master.sector_count_reg<<8|g)&65535;this.slave.sector_count_reg=(this.slave.sector_count_reg<<8|g)&65535});a.io.register_write(this.command_base|3,this,function(g){this.master.lba_low_reg=(this.master.lba_low_reg<<8|g)&65535;this.slave.lba_low_reg=
|
|
480
480
|
(this.slave.lba_low_reg<<8|g)&65535});a.io.register_write(this.command_base|4,this,function(g){this.master.lba_mid_reg=(this.master.lba_mid_reg<<8|g)&65535;this.slave.lba_mid_reg=(this.slave.lba_mid_reg<<8|g)&65535});a.io.register_write(this.command_base|5,this,function(g){this.master.lba_high_reg=(this.master.lba_high_reg<<8|g)&65535;this.slave.lba_high_reg=(this.slave.lba_high_reg<<8|g)&65535});a.io.register_write(this.command_base|6,this,function(g){const h=g&16;if(h&&this.current_interface===
|
|
481
|
-
this.master||!h&&this.current_interface===this.slave)this.current_interface=h?this.slave:this.master;this.
|
|
482
|
-
b=46080+8*b;a.io.register_read(b|0,this,this.dma_read_command8,void 0,this.dma_read_command);a.io.register_write(b|0,this,this.dma_write_command8,void 0,this.dma_write_command);a.io.register_read(b|2,this,this.dma_read_status);a.io.register_write(b|2,this,this.dma_write_status);a.io.register_read(b|4,this,void 0,void 0,this.dma_read_addr);a.io.register_write(b|4,this,void 0,void 0,this.dma_set_addr)}
|
|
481
|
+
this.master||!h&&this.current_interface===this.slave)this.current_interface=h?this.slave:this.master;this.master.device_reg=g;this.slave.device_reg=g;this.master.is_lba=g>>6&1;this.slave.is_lba=g>>6&1;this.master.head=g&15;this.slave.head=g&15});a.io.register_write(this.command_base|7,this,function(g){this.current_interface.status_reg&=-34;this.current_interface.ata_command(g);this.cpu.device_lower_irq(this.irq)});a.io.register_read(this.control_base|0,this,this.read_status);a.io.register_write(this.control_base|
|
|
482
|
+
0,this,this.write_control);b=46080+8*b;a.io.register_read(b|0,this,this.dma_read_command8,void 0,this.dma_read_command);a.io.register_write(b|0,this,this.dma_write_command8,void 0,this.dma_write_command);a.io.register_read(b|2,this,this.dma_read_status);a.io.register_write(b|2,this,this.dma_write_status);a.io.register_read(b|4,this,void 0,void 0,this.dma_read_addr);a.io.register_write(b|4,this,void 0,void 0,this.dma_set_addr)}
|
|
483
483
|
Vc.prototype.read_status=function(){return this.current_interface.drive_connected?this.current_interface.status_reg:0};Vc.prototype.write_control=function(a){a&4&&(this.cpu.device_lower_irq(this.irq),this.master.device_reset(),this.slave.device_reset());this.device_control_reg=a};Vc.prototype.dma_read_addr=function(){return this.prdt_addr};Vc.prototype.dma_set_addr=function(a){this.prdt_addr=a};Vc.prototype.dma_read_status=function(){return this.dma_status};
|
|
484
484
|
Vc.prototype.dma_write_status=function(a){this.dma_status&=~(a&6)};Vc.prototype.dma_read_command=function(){return this.dma_read_command8()|this.dma_read_status()<<16};Vc.prototype.dma_read_command8=function(){return this.dma_command};Vc.prototype.dma_write_command=function(a){this.dma_write_command8(a&255);this.dma_write_status(a>>16&255)};
|
|
485
485
|
Vc.prototype.dma_write_command8=function(a){const b=this.dma_command;this.dma_command=a&9;if((b&1)!==(a&1))if(0===(a&1))this.dma_status&=-2;else switch(this.dma_status|=1,this.current_interface.current_command){case 200:case 37:this.current_interface.do_ata_read_sectors_dma();break;case 202:case 53:this.current_interface.do_ata_write_sectors_dma();break;case 160:this.current_interface.do_atapi_dma();break;default:y(this.current_interface.current_command),this.dma_status&=-2,this.dma_status|=2,this.push_irq()}};
|
package/build/libv86.mjs
CHANGED
|
@@ -309,8 +309,8 @@ d=0;const e={};for(let g=0;g<c.length;g++){const h=c[g];var f=void 0;if(h.includ
|
|
|
309
309
|
b+="JIT_CACHE_SIZE="+a.wm.exports.jit_get_cache_size()+"\n";b+="FLAT_SEGMENTS="+a.wm.exports.has_flat_segmentation()+"\n";b+="wasm memory size: "+(a.wasm_memory.buffer.byteLength>>20)+"m\n";b=b+"Config:\nJIT_DISABLED="+(a.wm.exports.get_jit_config(0)+"\n");b+="MAX_PAGES="+a.wm.exports.get_jit_config(1)+"\n";b+="JIT_USE_LOOP_SAFETY="+!!a.wm.exports.get_jit_config(2)+"\n";b+="MAX_EXTRA_BASIC_BLOCKS="+a.wm.exports.get_jit_config(3)+"\n";a=[fb(a,!1,!1,!1,!1),fb(a,!0,!1,!1,!1),fb(a,!1,!0,!1,!1),fb(a,!1,
|
|
310
310
|
!1,!0,!1),fb(a,!1,!1,!1,!0)].join("\n\n");return b+a};function xc(a){this.message=a||"File not found"}xc.prototype=Error.prototype;"undefined"!==typeof module&&"undefined"!==typeof module.exports?module.exports.V86=N:"undefined"!==typeof window?window.V86=N:"function"===typeof importScripts&&(self.V86=N);function F(a,b){this.stopping=this.running=!1;this.idle=!0;this.tick_counter=0;this.worker=null;this.cpu=new O(a,b,()=>{this.idle&&this.next_tick(0)});this.bus=a;this.register_yield()}F.prototype.run=
|
|
311
311
|
function(){this.stopping=!1;this.running||(this.running=!0,this.bus.send("emulator-started"));this.next_tick(0)};F.prototype.do_tick=function(){if(this.stopping||!this.running)this.stopping=this.running=!1,this.bus.send("emulator-stopped");else{this.idle=!1;var a=this.cpu.main_loop();this.next_tick(a)}};F.prototype.next_tick=function(a){const b=++this.tick_counter;this.idle=!0;this.yield(a,b)};F.prototype.yield_callback=function(a){a===this.tick_counter&&this.do_tick()};F.prototype.stop=function(){this.running&&
|
|
312
|
-
(this.stopping=!0)};F.prototype.destroy=function(){this.unregister_yield()};F.prototype.restart=function(){this.cpu.
|
|
313
|
-
|
|
312
|
+
(this.stopping=!0)};F.prototype.destroy=function(){this.unregister_yield()};F.prototype.restart=function(){this.cpu.reboot_internal()};F.prototype.init=function(a){this.cpu.init(a,this.bus);this.bus.send("emulator-ready")};if("undefined"!==typeof process)F.prototype.yield=function(a,b){1>a?global.setImmediate(c=>this.yield_callback(c),b):setTimeout(c=>this.yield_callback(c),a,b)},F.prototype.register_yield=function(){},F.prototype.unregister_yield=function(){};else if(globalThis.scheduler&&"function"===
|
|
313
|
+
typeof globalThis.scheduler.postTask&&location.href.includes("use-scheduling-api"))F.prototype.yield=function(a,b){a=Math.max(0,a);globalThis.scheduler.postTask(()=>this.yield_callback(b),{delay:a})},F.prototype.register_yield=function(){},F.prototype.unregister_yield=function(){};else if("undefined"!==typeof Worker){function a(){let b;globalThis.onmessage=function(c){const d=c.data.t;b=b&&clearTimeout(b);1>d?postMessage(c.data.tick):b=setTimeout(()=>postMessage(c.data.tick),d)}}F.prototype.register_yield=
|
|
314
314
|
function(){const b=URL.createObjectURL(new Blob(["("+a.toString()+")()"],{type:"text/javascript"}));this.worker=new Worker(b);this.worker.onmessage=c=>this.yield_callback(c.data);URL.revokeObjectURL(b)};F.prototype.yield=function(b,c){this.worker.postMessage({t:b,tick:c})};F.prototype.unregister_yield=function(){this.worker&&this.worker.terminate();this.worker=null}}else F.prototype.yield=function(a){setTimeout(()=>{this.do_tick()},a)},F.prototype.register_yield=function(){},F.prototype.unregister_yield=
|
|
315
315
|
function(){};F.prototype.save_state=function(){for(var a=[],b=cb(this.cpu,a),c=[],d=0,e=0;e<a.length;e++){var f=a[e].byteLength;c[e]={offset:d,length:f};d+=f;d=d+3&-4}e=JSON.stringify({buffer_infos:c,state:b});e=(new TextEncoder).encode(e);b=16+e.length;b=b+3&-4;f=b+d;d=new ArrayBuffer(f);var g=new Int32Array(d,0,4);(new Uint8Array(d,16,e.length)).set(e);b=new Uint8Array(d,b);g[0]=-2039052682;g[1]=6;g[2]=f;g[3]=e.length;for(e=0;e<a.length;e++)b.set(a[e],c[e].offset);return d};F.prototype.restore_state=
|
|
316
316
|
function(a){return eb(this.cpu,a)};if("object"===typeof performance&&performance.now)F.microtick=performance.now.bind(performance);else if("function"===typeof require){const {performance:a}=require("perf_hooks");F.microtick=a.now.bind(a)}else F.microtick="object"===typeof process&&process.hrtime?function(){var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:Date.now;function yc(a){this.cpu=a;var b=a.io;a.devices.pci.register_device({pci_id:56,pci_space:[134,128,19,113,7,0,128,2,8,0,128,6,0,0,128,0,0,
|
|
@@ -426,10 +426,10 @@ function(){return this.current_interface.read_data(2)},function(){return this.cu
|
|
|
426
426
|
255});a.io.register_read(this.command_base|5,this,function(){return this.current_interface.lba_high_reg&255});a.io.register_read(this.command_base|6,this,function(){return this.current_interface.device_reg&255});a.io.register_read(this.command_base|7,this,function(){const g=this.read_status();this.cpu.device_lower_irq(this.irq);return g});a.io.register_write(this.command_base|0,this,function(g){this.current_interface.write_data_port8(g)},function(g){this.current_interface.write_data_port16(g)},function(g){this.current_interface.write_data_port32(g)});
|
|
427
427
|
a.io.register_write(this.command_base|1,this,function(g){this.master.features_reg=(this.master.features_reg<<8|g)&65535;this.slave.features_reg=(this.slave.features_reg<<8|g)&65535});a.io.register_write(this.command_base|2,this,function(g){this.master.sector_count_reg=(this.master.sector_count_reg<<8|g)&65535;this.slave.sector_count_reg=(this.slave.sector_count_reg<<8|g)&65535});a.io.register_write(this.command_base|3,this,function(g){this.master.lba_low_reg=(this.master.lba_low_reg<<8|g)&65535;this.slave.lba_low_reg=
|
|
428
428
|
(this.slave.lba_low_reg<<8|g)&65535});a.io.register_write(this.command_base|4,this,function(g){this.master.lba_mid_reg=(this.master.lba_mid_reg<<8|g)&65535;this.slave.lba_mid_reg=(this.slave.lba_mid_reg<<8|g)&65535});a.io.register_write(this.command_base|5,this,function(g){this.master.lba_high_reg=(this.master.lba_high_reg<<8|g)&65535;this.slave.lba_high_reg=(this.slave.lba_high_reg<<8|g)&65535});a.io.register_write(this.command_base|6,this,function(g){const h=g&16;if(h&&this.current_interface===
|
|
429
|
-
this.master||!h&&this.current_interface===this.slave)this.current_interface=h?this.slave:this.master;this.
|
|
430
|
-
b=46080+8*b;a.io.register_read(b|0,this,this.dma_read_command8,void 0,this.dma_read_command);a.io.register_write(b|0,this,this.dma_write_command8,void 0,this.dma_write_command);a.io.register_read(b|2,this,this.dma_read_status);a.io.register_write(b|2,this,this.dma_write_status);a.io.register_read(b|4,this,void 0,void 0,this.dma_read_addr);a.io.register_write(b|4,this,void 0,void 0,this.dma_set_addr)}Vc.prototype.read_status=function(){return this.current_interface.drive_connected?
|
|
431
|
-
0};Vc.prototype.write_control=function(a){a&4&&(this.cpu.device_lower_irq(this.irq),this.master.device_reset(),this.slave.device_reset());this.device_control_reg=a};Vc.prototype.dma_read_addr=function(){return this.prdt_addr};Vc.prototype.dma_set_addr=function(a){this.prdt_addr=a};Vc.prototype.dma_read_status=function(){return this.dma_status};Vc.prototype.dma_write_status=function(a){this.dma_status&=~(a&6)};Vc.prototype.dma_read_command=function(){return this.dma_read_command8()|
|
|
432
|
-
16};Vc.prototype.dma_read_command8=function(){return this.dma_command};Vc.prototype.dma_write_command=function(a){this.dma_write_command8(a&255);this.dma_write_status(a>>16&255)};Vc.prototype.dma_write_command8=function(a){const b=this.dma_command;this.dma_command=a&9;if((b&1)!==(a&1))if(0===(a&1))this.dma_status&=-2;else switch(this.dma_status|=1,this.current_interface.current_command){case 200:case 37:this.current_interface.do_ata_read_sectors_dma();break;case 202:case 53:this.current_interface.do_ata_write_sectors_dma();
|
|
429
|
+
this.master||!h&&this.current_interface===this.slave)this.current_interface=h?this.slave:this.master;this.master.device_reg=g;this.slave.device_reg=g;this.master.is_lba=g>>6&1;this.slave.is_lba=g>>6&1;this.master.head=g&15;this.slave.head=g&15});a.io.register_write(this.command_base|7,this,function(g){this.current_interface.status_reg&=-34;this.current_interface.ata_command(g);this.cpu.device_lower_irq(this.irq)});a.io.register_read(this.control_base|0,this,this.read_status);a.io.register_write(this.control_base|
|
|
430
|
+
0,this,this.write_control);b=46080+8*b;a.io.register_read(b|0,this,this.dma_read_command8,void 0,this.dma_read_command);a.io.register_write(b|0,this,this.dma_write_command8,void 0,this.dma_write_command);a.io.register_read(b|2,this,this.dma_read_status);a.io.register_write(b|2,this,this.dma_write_status);a.io.register_read(b|4,this,void 0,void 0,this.dma_read_addr);a.io.register_write(b|4,this,void 0,void 0,this.dma_set_addr)}Vc.prototype.read_status=function(){return this.current_interface.drive_connected?
|
|
431
|
+
this.current_interface.status_reg:0};Vc.prototype.write_control=function(a){a&4&&(this.cpu.device_lower_irq(this.irq),this.master.device_reset(),this.slave.device_reset());this.device_control_reg=a};Vc.prototype.dma_read_addr=function(){return this.prdt_addr};Vc.prototype.dma_set_addr=function(a){this.prdt_addr=a};Vc.prototype.dma_read_status=function(){return this.dma_status};Vc.prototype.dma_write_status=function(a){this.dma_status&=~(a&6)};Vc.prototype.dma_read_command=function(){return this.dma_read_command8()|
|
|
432
|
+
this.dma_read_status()<<16};Vc.prototype.dma_read_command8=function(){return this.dma_command};Vc.prototype.dma_write_command=function(a){this.dma_write_command8(a&255);this.dma_write_status(a>>16&255)};Vc.prototype.dma_write_command8=function(a){const b=this.dma_command;this.dma_command=a&9;if((b&1)!==(a&1))if(0===(a&1))this.dma_status&=-2;else switch(this.dma_status|=1,this.current_interface.current_command){case 200:case 37:this.current_interface.do_ata_read_sectors_dma();break;case 202:case 53:this.current_interface.do_ata_write_sectors_dma();
|
|
433
433
|
break;case 160:this.current_interface.do_atapi_dma();break;default:y(this.current_interface.current_command),this.dma_status&=-2,this.dma_status|=2,this.push_irq()}};Vc.prototype.push_irq=function(){0===(this.device_control_reg&2)&&(this.dma_status|=4,this.cpu.device_raise_irq(this.irq))};Vc.prototype.get_state=function(){var a=[];a[0]=this.master;a[1]=this.slave;a[2]=this.command_base;a[3]=this.irq;a[5]=this.control_base;a[7]=this.name;a[8]=this.device_control_reg;a[9]=this.prdt_addr;a[10]=this.dma_status;
|
|
434
434
|
a[11]=this.current_interface===this.master;a[12]=this.dma_command;return a};Vc.prototype.set_state=function(a){this.master.set_state(a[0]);this.slave.set_state(a[1]);this.command_base=a[2];this.irq=a[3];this.control_base=a[5];this.name=a[7];this.device_control_reg=a[8];this.prdt_addr=a[9];this.dma_status=a[10];this.current_interface=a[11]?this.master:this.slave;this.dma_command=a[12]};function W(a,b,c,d){this.channel=a;this.name=a.name+"."+b;this.bus=a.bus;this.channel_nr=a.channel_nr;this.interface_nr=
|
|
435
435
|
b;this.cpu=a.cpu;this.buffer=null;this.drive_connected=d||!!c;this.sector_size=d?2048:512;this.is_atapi=d;this.sector_count=0;this.head_count=this.is_atapi?1:0;this.device_reg=this.head=this.lba_high_reg=this.lba_mid_reg=this.features_reg=this.lba_low_reg=this.sector_count_reg=this.is_lba=this.cylinder_count=this.sectors_per_track=0;this.status_reg=80;this.sectors_per_drq=128;this.data_pointer=this.error_reg=0;this.data=new Uint8Array(65536);this.data16=new Uint16Array(this.data.buffer);this.data32=
|
package/build/v86-debug.wasm
CHANGED
|
Binary file
|
package/build/v86-fallback.wasm
CHANGED
|
Binary file
|
package/build/v86.wasm
CHANGED
|
Binary file
|