v86 0.5.458 → 0.5.459
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/libv86-debug.js +12 -13
- package/build/libv86-debug.mjs +12 -13
- package/build/libv86.js +1 -1
- 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
|
@@ -1128,10 +1128,9 @@ $DMA$$module$src$dma$$.prototype.do_write = function($buffer$jscomp$26$$, $start
|
|
|
1128
1128
|
}));
|
|
1129
1129
|
};
|
|
1130
1130
|
$DMA$$module$src$dma$$.prototype.address_get_8bit = function($channel$jscomp$14$$) {
|
|
1131
|
-
var $addr$jscomp$2$$ = this.channel_addr[$channel$jscomp$14$$];
|
|
1132
|
-
5 <= $channel$jscomp$14$$ && ($addr$jscomp$2$$ <<= 1);
|
|
1133
|
-
$addr$jscomp$2$$ = $addr$jscomp$2$$
|
|
1134
|
-
return $addr$jscomp$2$$ |= this.channel_pagehi[$channel$jscomp$14$$] << 24;
|
|
1131
|
+
var $addr$jscomp$2$$ = this.channel_addr[$channel$jscomp$14$$], $page$$ = this.channel_page[$channel$jscomp$14$$];
|
|
1132
|
+
5 <= $channel$jscomp$14$$ && ($addr$jscomp$2$$ <<= 1, $page$$ &= 254);
|
|
1133
|
+
return $addr$jscomp$2$$ = $addr$jscomp$2$$ | $page$$ << 16 | this.channel_pagehi[$channel$jscomp$14$$] << 24;
|
|
1135
1134
|
};
|
|
1136
1135
|
$DMA$$module$src$dma$$.prototype.count_get_8bit = function($channel$jscomp$15$$) {
|
|
1137
1136
|
var $count$jscomp$40$$ = this.channel_count[$channel$jscomp$15$$] + 1;
|
|
@@ -11855,25 +11854,25 @@ $CPU$$module$src$cpu$$.prototype.set_state_ioapic = function($state$jscomp$63$$)
|
|
|
11855
11854
|
$CPU$$module$src$cpu$$.prototype.pack_memory = function() {
|
|
11856
11855
|
$dbg_assert$$module$src$log$$(0 === (this.mem8.length & 4095));
|
|
11857
11856
|
var $bitmap$jscomp$4_page_count$$ = this.mem8.length >> 12, $nonzero_pages_offset$jscomp$82_page_contents$$ = [];
|
|
11858
|
-
for ($packed_memory$jscomp$2_page$$ = 0; $packed_memory$jscomp$2_page$$ < $bitmap$jscomp$4_page_count$$; $packed_memory$jscomp$2_page$$++) {
|
|
11859
|
-
this.is_memory_zeroed($packed_memory$jscomp$2_page$$ << 12, 4096) || $nonzero_pages_offset$jscomp$82_page_contents$$.push($packed_memory$jscomp$2_page$$);
|
|
11857
|
+
for ($packed_memory$jscomp$2_page$jscomp$1$$ = 0; $packed_memory$jscomp$2_page$jscomp$1$$ < $bitmap$jscomp$4_page_count$$; $packed_memory$jscomp$2_page$jscomp$1$$++) {
|
|
11858
|
+
this.is_memory_zeroed($packed_memory$jscomp$2_page$jscomp$1$$ << 12, 4096) || $nonzero_pages_offset$jscomp$82_page_contents$$.push($packed_memory$jscomp$2_page$jscomp$1$$);
|
|
11860
11859
|
}
|
|
11861
11860
|
$bitmap$jscomp$4_page_count$$ = new $Bitmap$$module$src$lib$$($bitmap$jscomp$4_page_count$$);
|
|
11862
|
-
var $packed_memory$jscomp$2_page$$ = new Uint8Array($nonzero_pages_offset$jscomp$82_page_contents$$.length << 12);
|
|
11863
|
-
for (const [$i$jscomp$103$$, $page$jscomp$
|
|
11864
|
-
$bitmap$jscomp$4_page_count$$.set($page$jscomp$
|
|
11861
|
+
var $packed_memory$jscomp$2_page$jscomp$1$$ = new Uint8Array($nonzero_pages_offset$jscomp$82_page_contents$$.length << 12);
|
|
11862
|
+
for (const [$i$jscomp$103$$, $page$jscomp$2$$] of $nonzero_pages_offset$jscomp$82_page_contents$$.entries()) {
|
|
11863
|
+
$bitmap$jscomp$4_page_count$$.set($page$jscomp$2$$, 1), $nonzero_pages_offset$jscomp$82_page_contents$$ = $page$jscomp$2$$ << 12, $nonzero_pages_offset$jscomp$82_page_contents$$ = this.mem8.subarray($nonzero_pages_offset$jscomp$82_page_contents$$, $nonzero_pages_offset$jscomp$82_page_contents$$ + 4096), $packed_memory$jscomp$2_page$jscomp$1$$.set($nonzero_pages_offset$jscomp$82_page_contents$$, $i$jscomp$103$$ << 12);
|
|
11865
11864
|
}
|
|
11866
|
-
return {bitmap:$bitmap$jscomp$4_page_count$$, packed_memory:$packed_memory$jscomp$2_page$$};
|
|
11865
|
+
return {bitmap:$bitmap$jscomp$4_page_count$$, packed_memory:$packed_memory$jscomp$2_page$jscomp$1$$};
|
|
11867
11866
|
};
|
|
11868
11867
|
$CPU$$module$src$cpu$$.prototype.unpack_memory = function($bitmap$jscomp$5$$, $packed_memory$jscomp$3$$) {
|
|
11869
11868
|
this.zero_memory(0, this.memory_size[0]);
|
|
11870
11869
|
const $page_count$jscomp$1$$ = this.memory_size[0] >> 12;
|
|
11871
11870
|
let $packed_page$$ = 0;
|
|
11872
|
-
for (let $page$jscomp$
|
|
11873
|
-
if ($bitmap$jscomp$5$$.get($page$jscomp$
|
|
11871
|
+
for (let $page$jscomp$3$$ = 0; $page$jscomp$3$$ < $page_count$jscomp$1$$; $page$jscomp$3$$++) {
|
|
11872
|
+
if ($bitmap$jscomp$5$$.get($page$jscomp$3$$)) {
|
|
11874
11873
|
var $offset$jscomp$83_view$jscomp$34$$ = $packed_page$$ << 12;
|
|
11875
11874
|
$offset$jscomp$83_view$jscomp$34$$ = $packed_memory$jscomp$3$$.subarray($offset$jscomp$83_view$jscomp$34$$, $offset$jscomp$83_view$jscomp$34$$ + 4096);
|
|
11876
|
-
this.mem8.set($offset$jscomp$83_view$jscomp$34$$, $page$jscomp$
|
|
11875
|
+
this.mem8.set($offset$jscomp$83_view$jscomp$34$$, $page$jscomp$3$$ << 12);
|
|
11877
11876
|
$packed_page$$++;
|
|
11878
11877
|
}
|
|
11879
11878
|
}
|
package/build/libv86-debug.mjs
CHANGED
|
@@ -1127,10 +1127,9 @@ $DMA$$module$src$dma$$.prototype.do_write = function($buffer$jscomp$26$$, $start
|
|
|
1127
1127
|
}));
|
|
1128
1128
|
};
|
|
1129
1129
|
$DMA$$module$src$dma$$.prototype.address_get_8bit = function($channel$jscomp$14$$) {
|
|
1130
|
-
var $addr$jscomp$2$$ = this.channel_addr[$channel$jscomp$14$$];
|
|
1131
|
-
5 <= $channel$jscomp$14$$ && ($addr$jscomp$2$$ <<= 1);
|
|
1132
|
-
$addr$jscomp$2$$ = $addr$jscomp$2$$
|
|
1133
|
-
return $addr$jscomp$2$$ |= this.channel_pagehi[$channel$jscomp$14$$] << 24;
|
|
1130
|
+
var $addr$jscomp$2$$ = this.channel_addr[$channel$jscomp$14$$], $page$$ = this.channel_page[$channel$jscomp$14$$];
|
|
1131
|
+
5 <= $channel$jscomp$14$$ && ($addr$jscomp$2$$ <<= 1, $page$$ &= 254);
|
|
1132
|
+
return $addr$jscomp$2$$ = $addr$jscomp$2$$ | $page$$ << 16 | this.channel_pagehi[$channel$jscomp$14$$] << 24;
|
|
1134
1133
|
};
|
|
1135
1134
|
$DMA$$module$src$dma$$.prototype.count_get_8bit = function($channel$jscomp$15$$) {
|
|
1136
1135
|
var $count$jscomp$40$$ = this.channel_count[$channel$jscomp$15$$] + 1;
|
|
@@ -11854,25 +11853,25 @@ $CPU$$module$src$cpu$$.prototype.set_state_ioapic = function($state$jscomp$63$$)
|
|
|
11854
11853
|
$CPU$$module$src$cpu$$.prototype.pack_memory = function() {
|
|
11855
11854
|
$dbg_assert$$module$src$log$$(0 === (this.mem8.length & 4095));
|
|
11856
11855
|
var $bitmap$jscomp$4_page_count$$ = this.mem8.length >> 12, $nonzero_pages_offset$jscomp$82_page_contents$$ = [];
|
|
11857
|
-
for ($packed_memory$jscomp$2_page$$ = 0; $packed_memory$jscomp$2_page$$ < $bitmap$jscomp$4_page_count$$; $packed_memory$jscomp$2_page$$++) {
|
|
11858
|
-
this.is_memory_zeroed($packed_memory$jscomp$2_page$$ << 12, 4096) || $nonzero_pages_offset$jscomp$82_page_contents$$.push($packed_memory$jscomp$2_page$$);
|
|
11856
|
+
for ($packed_memory$jscomp$2_page$jscomp$1$$ = 0; $packed_memory$jscomp$2_page$jscomp$1$$ < $bitmap$jscomp$4_page_count$$; $packed_memory$jscomp$2_page$jscomp$1$$++) {
|
|
11857
|
+
this.is_memory_zeroed($packed_memory$jscomp$2_page$jscomp$1$$ << 12, 4096) || $nonzero_pages_offset$jscomp$82_page_contents$$.push($packed_memory$jscomp$2_page$jscomp$1$$);
|
|
11859
11858
|
}
|
|
11860
11859
|
$bitmap$jscomp$4_page_count$$ = new $Bitmap$$module$src$lib$$($bitmap$jscomp$4_page_count$$);
|
|
11861
|
-
var $packed_memory$jscomp$2_page$$ = new Uint8Array($nonzero_pages_offset$jscomp$82_page_contents$$.length << 12);
|
|
11862
|
-
for (const [$i$jscomp$103$$, $page$jscomp$
|
|
11863
|
-
$bitmap$jscomp$4_page_count$$.set($page$jscomp$
|
|
11860
|
+
var $packed_memory$jscomp$2_page$jscomp$1$$ = new Uint8Array($nonzero_pages_offset$jscomp$82_page_contents$$.length << 12);
|
|
11861
|
+
for (const [$i$jscomp$103$$, $page$jscomp$2$$] of $nonzero_pages_offset$jscomp$82_page_contents$$.entries()) {
|
|
11862
|
+
$bitmap$jscomp$4_page_count$$.set($page$jscomp$2$$, 1), $nonzero_pages_offset$jscomp$82_page_contents$$ = $page$jscomp$2$$ << 12, $nonzero_pages_offset$jscomp$82_page_contents$$ = this.mem8.subarray($nonzero_pages_offset$jscomp$82_page_contents$$, $nonzero_pages_offset$jscomp$82_page_contents$$ + 4096), $packed_memory$jscomp$2_page$jscomp$1$$.set($nonzero_pages_offset$jscomp$82_page_contents$$, $i$jscomp$103$$ << 12);
|
|
11864
11863
|
}
|
|
11865
|
-
return {bitmap:$bitmap$jscomp$4_page_count$$, packed_memory:$packed_memory$jscomp$2_page$$};
|
|
11864
|
+
return {bitmap:$bitmap$jscomp$4_page_count$$, packed_memory:$packed_memory$jscomp$2_page$jscomp$1$$};
|
|
11866
11865
|
};
|
|
11867
11866
|
$CPU$$module$src$cpu$$.prototype.unpack_memory = function($bitmap$jscomp$5$$, $packed_memory$jscomp$3$$) {
|
|
11868
11867
|
this.zero_memory(0, this.memory_size[0]);
|
|
11869
11868
|
const $page_count$jscomp$1$$ = this.memory_size[0] >> 12;
|
|
11870
11869
|
let $packed_page$$ = 0;
|
|
11871
|
-
for (let $page$jscomp$
|
|
11872
|
-
if ($bitmap$jscomp$5$$.get($page$jscomp$
|
|
11870
|
+
for (let $page$jscomp$3$$ = 0; $page$jscomp$3$$ < $page_count$jscomp$1$$; $page$jscomp$3$$++) {
|
|
11871
|
+
if ($bitmap$jscomp$5$$.get($page$jscomp$3$$)) {
|
|
11873
11872
|
var $offset$jscomp$83_view$jscomp$34$$ = $packed_page$$ << 12;
|
|
11874
11873
|
$offset$jscomp$83_view$jscomp$34$$ = $packed_memory$jscomp$3$$.subarray($offset$jscomp$83_view$jscomp$34$$, $offset$jscomp$83_view$jscomp$34$$ + 4096);
|
|
11875
|
-
this.mem8.set($offset$jscomp$83_view$jscomp$34$$, $page$jscomp$
|
|
11874
|
+
this.mem8.set($offset$jscomp$83_view$jscomp$34$$, $page$jscomp$3$$ << 12);
|
|
11876
11875
|
$packed_page$$++;
|
|
11877
11876
|
}
|
|
11878
11877
|
}
|
package/build/libv86.js
CHANGED
|
@@ -58,7 +58,7 @@ A.prototype.port_multimask_read=function(a){var b=0|this.channel_mask[a+0];b|=th
|
|
|
58
58
|
A.prototype.update_mask=function(a,b){if(this.channel_mask[a]!==b&&(this.channel_mask[a]=b,!b))for(b=0;b<this.unmask_listeners.length;b++)this.unmask_listeners[b].fn.call(this.unmask_listeners[b].this_value,a)};
|
|
59
59
|
A.prototype.do_read=function(a,b,c,d,e){var f=this.count_get_8bit(d),g=this.address_get_8bit(d);sa("to "+y(g)+" len "+y(f),16);c<f&&sa("DMA should read more than provided: "+y(c)+" "+y(f),16);if(b+f>a.byteLength)e(!0);else{var h=this.cpu;this.channel_addr[d]+=f;a.get(b,f,function(m){h.write_blob(m,g);e(!1)})}};
|
|
60
60
|
A.prototype.do_write=function(a,b,c,d,e){var f=this.channel_count[d]+1&65535,g=5<=d?2:1,h=f*g,m=this.address_get_8bit(d),l=!1,n=!1,p=this.channel_mode[d]&16;sa("to "+y(m)+" len "+y(h),16);c<h?(f=Math.floor(c/g),h=f*g,l=!0):c>h&&(n=!0);b+h>a.byteLength?e(!0):(this.channel_addr[d]+=f,this.channel_count[d]-=f,!l&&p&&(this.channel_addr[d]=this.channel_addr_init[d],this.channel_count[d]=this.channel_count_init[d]),a.set(b,this.cpu.mem8.subarray(m,m+h),()=>{n&&p?this.do_write(a,b+h,c-h,d,e):e(!1)}))};
|
|
61
|
-
A.prototype.address_get_8bit=function(a){var b=this.channel_addr[a];5<=a&&(b<<=1);b=b
|
|
61
|
+
A.prototype.address_get_8bit=function(a){var b=this.channel_addr[a],c=this.channel_page[a];5<=a&&(b<<=1,c&=254);return b=b|c<<16|this.channel_pagehi[a]<<24};A.prototype.count_get_8bit=function(a){var b=this.channel_count[a]+1;5<=a&&(b*=2);return b};A.prototype.flipflop_get=function(a,b,c){c||(this.lsb_msb_flipflop^=1);return this.lsb_msb_flipflop?a&-256|b:a&-65281|b<<8};A.prototype.flipflop_read=function(a){return(this.lsb_msb_flipflop^=1)?a&255:a>>8&255};function Ea(a){this.ports=[];this.cpu=a;for(var b=0;65536>b;b++)this.ports[b]=this.create_empty_entry();var c=a.memory_size[0];for(b=0;b<<17<c;b++)a.memory_map_read8[b]=a.memory_map_write8[b]=void 0,a.memory_map_read32[b]=a.memory_map_write32[b]=void 0;this.mmap_register(c,4294967296-c,function(d){y(d>>>0,8);return 255},function(d,e){y(d>>>0,8);y(e,2)},function(d){y(d>>>0,8);return-1},function(d,e){y(d>>>0,8);y(e>>>0,8)})}
|
|
62
62
|
Ea.prototype.create_empty_entry=function(){return{read8:this.empty_port_read8,read16:this.empty_port_read16,read32:this.empty_port_read32,write8:this.empty_port_write,write16:this.empty_port_write,write32:this.empty_port_write,device:void 0}};Ea.prototype.empty_port_read8=function(){return 255};Ea.prototype.empty_port_read16=function(){return 65535};Ea.prototype.empty_port_read32=function(){return-1};Ea.prototype.empty_port_write=function(){};
|
|
63
63
|
Ea.prototype.register_read=function(a,b,c,d,e){c&&(this.ports[a].read8=c);d&&(this.ports[a].read16=d);e&&(this.ports[a].read32=e);this.ports[a].device=b};Ea.prototype.register_write=function(a,b,c,d,e){c&&(this.ports[a].write8=c);d&&(this.ports[a].write16=d);e&&(this.ports[a].write32=e);this.ports[a].device=b};
|
|
64
64
|
Ea.prototype.register_read_consecutive=function(a,b,c,d,e,f){function g(){return c.call(this)|d.call(this)<<8}function h(){return e.call(this)|f.call(this)<<8}function m(){return c.call(this)|d.call(this)<<8|e.call(this)<<16|f.call(this)<<24}e&&f?(this.register_read(a,b,c,g,m),this.register_read(a+1,b,d),this.register_read(a+2,b,e,h),this.register_read(a+3,b,f)):(this.register_read(a,b,c,g),this.register_read(a+1,b,d))};
|
package/build/libv86.mjs
CHANGED
|
@@ -52,12 +52,12 @@ A.prototype.port_count_write=function(a,b){y(b);this.channel_count[a]=this.flipf
|
|
|
52
52
|
function(a){y(this.channel_addr[a]);return this.flipflop_read(this.channel_addr[a])};A.prototype.port_pagehi_write=function(a,b){y(b);this.channel_pagehi[a]=b};A.prototype.port_pagehi_read=function(a){return this.channel_pagehi[a]};A.prototype.port_page_write=function(a,b){y(b);this.channel_page[a]=b};A.prototype.port_page_read=function(a){return this.channel_page[a]};A.prototype.port_singlemask_write=function(a,b){this.update_mask((b&3)+a,b&4?1:0)};A.prototype.port_multimask_write=function(a,b){y(b);
|
|
53
53
|
for(var c=0;4>c;c++)this.update_mask(a+c,b&1<<c)};A.prototype.port_multimask_read=function(a){var b=0|this.channel_mask[a+0];b|=this.channel_mask[a+1]<<1;b|=this.channel_mask[a+2]<<2;b|=this.channel_mask[a+3]<<3;y(b);return b};A.prototype.port_mode_write=function(a,b){a=(b&3)+a;y(b);this.channel_mode[a]=b};A.prototype.portC_write=function(){this.lsb_msb_flipflop=0};A.prototype.on_unmask=function(a,b){this.unmask_listeners.push({fn:a,this_value:b})};A.prototype.update_mask=function(a,b){if(this.channel_mask[a]!==
|
|
54
54
|
b&&(this.channel_mask[a]=b,!b))for(b=0;b<this.unmask_listeners.length;b++)this.unmask_listeners[b].fn.call(this.unmask_listeners[b].this_value,a)};A.prototype.do_read=function(a,b,c,d,e){var f=this.count_get_8bit(d),g=this.address_get_8bit(d);sa("to "+y(g)+" len "+y(f),16);c<f&&sa("DMA should read more than provided: "+y(c)+" "+y(f),16);if(b+f>a.byteLength)e(!0);else{var h=this.cpu;this.channel_addr[d]+=f;a.get(b,f,function(m){h.write_blob(m,g);e(!1)})}};A.prototype.do_write=function(a,b,c,d,e){var f=
|
|
55
|
-
this.channel_count[d]+1&65535,g=5<=d?2:1,h=f*g,m=this.address_get_8bit(d),l=!1,n=!1,p=this.channel_mode[d]&16;sa("to "+y(m)+" len "+y(h),16);c<h?(f=Math.floor(c/g),h=f*g,l=!0):c>h&&(n=!0);b+h>a.byteLength?e(!0):(this.channel_addr[d]+=f,this.channel_count[d]-=f,!l&&p&&(this.channel_addr[d]=this.channel_addr_init[d],this.channel_count[d]=this.channel_count_init[d]),a.set(b,this.cpu.mem8.subarray(m,m+h),()=>{n&&p?this.do_write(a,b+h,c-h,d,e):e(!1)}))};A.prototype.address_get_8bit=function(a){var b=this.channel_addr[a]
|
|
56
|
-
5<=a&&(b<<=1);b=b
|
|
57
|
-
for(b=0;b<<17<c;b++)a.memory_map_read8[b]=a.memory_map_write8[b]=void 0,a.memory_map_read32[b]=a.memory_map_write32[b]=void 0;this.mmap_register(c,4294967296-c,function(d){y(d>>>0,8);return 255},function(d,e){y(d>>>0,8);y(e,2)},function(d){y(d>>>0,8);return-1},function(d,e){y(d>>>0,8);y(e>>>0,8)})}Ea.prototype.create_empty_entry=function(){return{read8:this.empty_port_read8,read16:this.empty_port_read16,read32:this.empty_port_read32,write8:this.empty_port_write,write16:this.empty_port_write,
|
|
58
|
-
device:void 0}};Ea.prototype.empty_port_read8=function(){return 255};Ea.prototype.empty_port_read16=function(){return 65535};Ea.prototype.empty_port_read32=function(){return-1};Ea.prototype.empty_port_write=function(){};Ea.prototype.register_read=function(a,b,c,d,e){c&&(this.ports[a].read8=c);d&&(this.ports[a].read16=d);e&&(this.ports[a].read32=e);this.ports[a].device=b};Ea.prototype.register_write=function(a,b,c,d,e){c&&(this.ports[a].write8=c);d&&(this.ports[a].write16=
|
|
59
|
-
e);this.ports[a].device=b};Ea.prototype.register_read_consecutive=function(a,b,c,d,e,f){function g(){return c.call(this)|d.call(this)<<8}function h(){return e.call(this)|f.call(this)<<8}function m(){return c.call(this)|d.call(this)<<8|e.call(this)<<16|f.call(this)<<24}e&&f?(this.register_read(a,b,c,g,m),this.register_read(a+1,b,d),this.register_read(a+2,b,e,h),this.register_read(a+3,b,f)):(this.register_read(a,b,c,g),this.register_read(a+1,b,d))};Ea.prototype.register_write_consecutive=
|
|
60
|
-
b,c,d,e,f){function g(l){c.call(this,l&255);d.call(this,l>>8&255)}function h(l){e.call(this,l&255);f.call(this,l>>8&255)}function m(l){c.call(this,l&255);d.call(this,l>>8&255);e.call(this,l>>16&255);f.call(this,l>>>24)}e&&f?(this.register_write(a,b,c,g,m),this.register_write(a+1,b,d),this.register_write(a+2,b,e,h),this.register_write(a+3,b,f)):(this.register_write(a,b,c,g),this.register_write(a+1,b,d))};Ea.prototype.mmap_read32_shim=function(a){var b=this.cpu.memory_map_read8[a>>>17];return b(a)|
|
|
55
|
+
this.channel_count[d]+1&65535,g=5<=d?2:1,h=f*g,m=this.address_get_8bit(d),l=!1,n=!1,p=this.channel_mode[d]&16;sa("to "+y(m)+" len "+y(h),16);c<h?(f=Math.floor(c/g),h=f*g,l=!0):c>h&&(n=!0);b+h>a.byteLength?e(!0):(this.channel_addr[d]+=f,this.channel_count[d]-=f,!l&&p&&(this.channel_addr[d]=this.channel_addr_init[d],this.channel_count[d]=this.channel_count_init[d]),a.set(b,this.cpu.mem8.subarray(m,m+h),()=>{n&&p?this.do_write(a,b+h,c-h,d,e):e(!1)}))};A.prototype.address_get_8bit=function(a){var b=this.channel_addr[a],
|
|
56
|
+
c=this.channel_page[a];5<=a&&(b<<=1,c&=254);return b=b|c<<16|this.channel_pagehi[a]<<24};A.prototype.count_get_8bit=function(a){var b=this.channel_count[a]+1;5<=a&&(b*=2);return b};A.prototype.flipflop_get=function(a,b,c){c||(this.lsb_msb_flipflop^=1);return this.lsb_msb_flipflop?a&-256|b:a&-65281|b<<8};A.prototype.flipflop_read=function(a){return(this.lsb_msb_flipflop^=1)?a&255:a>>8&255};function Ea(a){this.ports=[];this.cpu=a;for(var b=0;65536>b;b++)this.ports[b]=this.create_empty_entry();var c=
|
|
57
|
+
a.memory_size[0];for(b=0;b<<17<c;b++)a.memory_map_read8[b]=a.memory_map_write8[b]=void 0,a.memory_map_read32[b]=a.memory_map_write32[b]=void 0;this.mmap_register(c,4294967296-c,function(d){y(d>>>0,8);return 255},function(d,e){y(d>>>0,8);y(e,2)},function(d){y(d>>>0,8);return-1},function(d,e){y(d>>>0,8);y(e>>>0,8)})}Ea.prototype.create_empty_entry=function(){return{read8:this.empty_port_read8,read16:this.empty_port_read16,read32:this.empty_port_read32,write8:this.empty_port_write,write16:this.empty_port_write,
|
|
58
|
+
write32:this.empty_port_write,device:void 0}};Ea.prototype.empty_port_read8=function(){return 255};Ea.prototype.empty_port_read16=function(){return 65535};Ea.prototype.empty_port_read32=function(){return-1};Ea.prototype.empty_port_write=function(){};Ea.prototype.register_read=function(a,b,c,d,e){c&&(this.ports[a].read8=c);d&&(this.ports[a].read16=d);e&&(this.ports[a].read32=e);this.ports[a].device=b};Ea.prototype.register_write=function(a,b,c,d,e){c&&(this.ports[a].write8=c);d&&(this.ports[a].write16=
|
|
59
|
+
d);e&&(this.ports[a].write32=e);this.ports[a].device=b};Ea.prototype.register_read_consecutive=function(a,b,c,d,e,f){function g(){return c.call(this)|d.call(this)<<8}function h(){return e.call(this)|f.call(this)<<8}function m(){return c.call(this)|d.call(this)<<8|e.call(this)<<16|f.call(this)<<24}e&&f?(this.register_read(a,b,c,g,m),this.register_read(a+1,b,d),this.register_read(a+2,b,e,h),this.register_read(a+3,b,f)):(this.register_read(a,b,c,g),this.register_read(a+1,b,d))};Ea.prototype.register_write_consecutive=
|
|
60
|
+
function(a,b,c,d,e,f){function g(l){c.call(this,l&255);d.call(this,l>>8&255)}function h(l){e.call(this,l&255);f.call(this,l>>8&255)}function m(l){c.call(this,l&255);d.call(this,l>>8&255);e.call(this,l>>16&255);f.call(this,l>>>24)}e&&f?(this.register_write(a,b,c,g,m),this.register_write(a+1,b,d),this.register_write(a+2,b,e,h),this.register_write(a+3,b,f)):(this.register_write(a,b,c,g),this.register_write(a+1,b,d))};Ea.prototype.mmap_read32_shim=function(a){var b=this.cpu.memory_map_read8[a>>>17];return b(a)|
|
|
61
61
|
b(a+1)<<8|b(a+2)<<16|b(a+3)<<24};Ea.prototype.mmap_write32_shim=function(a,b){var c=this.cpu.memory_map_write8[a>>>17];c(a,b&255);c(a+1,b>>8&255);c(a+2,b>>16&255);c(a+3,b>>>24)};Ea.prototype.mmap_register=function(a,b,c,d,e,f){y(a>>>0,8);y(b,8);e||(e=this.mmap_read32_shim.bind(this));f||(f=this.mmap_write32_shim.bind(this));for(a>>>=17;0<b;a++)this.cpu.memory_map_read8[a]=c,this.cpu.memory_map_write8[a]=d,this.cpu.memory_map_read32[a]=e,this.cpu.memory_map_write32[a]=f,b-=131072};Ea.prototype.port_write8=
|
|
62
62
|
function(a,b){var c=this.ports[a];c.write8===this.empty_port_write&&(y(a,4),y(b,2),this.get_port_description(a));return c.write8.call(c.device,b)};Ea.prototype.port_write16=function(a,b){var c=this.ports[a];c.write16===this.empty_port_write&&(y(a,4),y(b,4),this.get_port_description(a));return c.write16.call(c.device,b)};Ea.prototype.port_write32=function(a,b){var c=this.ports[a];c.write32===this.empty_port_write&&(y(a,4),y(b>>>0,8),this.get_port_description(a));return c.write32.call(c.device,b)};
|
|
63
63
|
Ea.prototype.port_read8=function(a){var b=this.ports[a];b.read8===this.empty_port_read8&&(y(a,4),this.get_port_description(a));b=b.read8.call(b.device,a);(0>b||256<=b)&&y(a);return b};Ea.prototype.port_read16=function(a){var b=this.ports[a];b.read16===this.empty_port_read16&&(y(a,4),this.get_port_description(a));b=b.read16.call(b.device,a);(0>b||65536<=b)&&y(a);return b};Ea.prototype.port_read32=function(a){var b=this.ports[a];b.read32===this.empty_port_read32&&(y(a,4),this.get_port_description(a));
|
package/build/v86-debug.wasm
CHANGED
|
Binary file
|
package/build/v86-fallback.wasm
CHANGED
|
Binary file
|
package/build/v86.wasm
CHANGED
|
Binary file
|