v86 0.5.120 → 0.5.121
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 +2 -2
- package/build/libv86-debug.mjs +1 -1
- package/build/libv86.js +1 -1
- package/build/libv86.mjs +1 -1
- package/package.json +1 -1
package/build/libv86-debug.js
CHANGED
|
@@ -8258,10 +8258,10 @@ $FloppyController$$module$src$floppy$$.prototype.port3F2_read = function() {
|
|
|
8258
8258
|
return this.dor;
|
|
8259
8259
|
};
|
|
8260
8260
|
$FloppyController$$module$src$floppy$$.prototype.port3F2_write = function($value$jscomp$172$$) {
|
|
8261
|
-
4
|
|
8261
|
+
!(this.dor & 4) && $value$jscomp$172$$ & 4 && (this.status_reg0 = 192, $value$jscomp$172$$ & 8 && this.cpu.device_raise_irq(6));
|
|
8262
8262
|
$dbg_log$$module$src$log$$("start motors: " + $h$$module$src$lib$$($value$jscomp$172$$ >> 4), 8192);
|
|
8263
8263
|
$dbg_log$$module$src$log$$("enable dma/irq: " + !!($value$jscomp$172$$ & 8), 8192);
|
|
8264
|
-
$dbg_log$$module$src$log$$("reset fdc: " +
|
|
8264
|
+
$dbg_log$$module$src$log$$("reset fdc: " + !($value$jscomp$172$$ & 4), 8192);
|
|
8265
8265
|
$dbg_log$$module$src$log$$("drive select: " + ($value$jscomp$172$$ & 3), 8192);
|
|
8266
8266
|
0 !== ($value$jscomp$172$$ & 3) && $dbg_log$$module$src$log$$("guest: fdb not implemented", 8192);
|
|
8267
8267
|
$dbg_log$$module$src$log$$("DOR = " + $h$$module$src$lib$$($value$jscomp$172$$), 8192);
|
package/build/libv86-debug.mjs
CHANGED
|
@@ -456,7 +456,7 @@ this.number_of_cylinders=a[18]};V.prototype.port3F0_read=function(){C("3F0 read"
|
|
|
456
456
|
C("3F5 read, empty",8192);return 255};V.prototype.port3F4_write=function(a){C("3F4/data rate write: "+m(a),8192);a&128&&(C("dsr reset",8192),this.status_reg0=192,this.cpu.device_raise_irq(6))};V.prototype.port3F5_write=function(a){C("3F5 write "+m(a),8192);if(0<this.bytes_expecting){if(this.receiving_command[this.receiving_index++]=a,this.bytes_expecting--,0===this.bytes_expecting){a="3F5 command received: ";for(var b=0;b<this.receiving_index;b++)a+=m(this.receiving_command[b])+" ";C(a,8192);this.next_command.call(this,
|
|
457
457
|
this.receiving_command)}}else{switch(a){case 3:this.next_command=this.fix_drive_data;this.bytes_expecting=2;break;case 19:this.next_command=this.configure;this.bytes_expecting=3;break;case 4:this.next_command=this.check_drive_status;this.bytes_expecting=1;break;case 5:case 69:case 197:this.next_command=function(c){this.do_sector(!0,c)};this.bytes_expecting=8;break;case 6:case 70:case 198:case 230:this.next_command=function(c){this.do_sector(!1,c)};this.bytes_expecting=8;break;case 7:this.next_command=
|
|
458
458
|
this.calibrate;this.bytes_expecting=1;break;case 8:this.check_interrupt_status();break;case 74:this.next_command=this.read_sector_id;this.bytes_expecting=1;break;case 15:this.bytes_expecting=2;this.next_command=this.seek;break;case 14:case 16:C(14===a?"dump registers":"determine controller version",8192);this.status_reg0=128;this.response_data[0]=this.status_reg0;this.response_index=0;this.response_length=1;this.bytes_expecting=0;break;default:k(!1,"Unimplemented floppy command call "+m(a))}this.receiving_index=
|
|
459
|
-
0}};V.prototype.port3F2_read=function(){C("read 3F2: DOR",8192);return this.dor};V.prototype.port3F2_write=function(a){
|
|
459
|
+
0}};V.prototype.port3F2_read=function(){C("read 3F2: DOR",8192);return this.dor};V.prototype.port3F2_write=function(a){!(this.dor&4)&&a&4&&(this.status_reg0=192,a&8&&this.cpu.device_raise_irq(6));C("start motors: "+m(a>>4),8192);C("enable dma/irq: "+!!(a&8),8192);C("reset fdc: "+!(a&4),8192);C("drive select: "+(a&3),8192);0!==(a&3)&&C("guest: fdb not implemented",8192);C("DOR = "+m(a),8192);this.dor=a};V.prototype.check_drive_status=function(){C("check drive status",8192);this.status_reg1=this.fda_image?
|
|
460
460
|
0:5;this.response_index=0;this.response_length=1;this.response_data[0]=0};V.prototype.seek=function(a){C("seek",8192);if(0!==(a[0]&3))C("seek on fdb",8192);else{var b=a[1];a=a[0]>>2&1;b!==this.last_cylinder&&(this.dir=0);this.status_reg1=this.fda_image?0:5;this.status_reg0=32;this.last_cylinder=b;this.last_head=a}this.raise_irq()};V.prototype.calibrate=function(a){C("floppy calibrate",8192);this.seek([a[0],0])};V.prototype.check_interrupt_status=function(){C("floppy check interrupt status",8192);
|
|
461
461
|
this.response_index=0;this.response_length=2;this.response_data[0]=this.status_reg0;this.response_data[1]=this.last_cylinder};V.prototype.do_sector=function(a,b){var c=b[2],d=b[1],e=b[3],f=128<<b[4],h=b[5]-b[3]+1,l=((c+this.number_of_heads*d)*this.sectors_per_track+e-1)*f;C("Floppy "+(a?"Write":"Read"),8192);C("from "+m(l)+" length "+m(h*f),8192);C(d+" / "+c+" / "+e,8192);b[4]||C("FDC: sector count is zero, use data length instead",8192);this.fda_image?(this.status_reg1=0,a?this.dma.do_write(this.fda_image,
|
|
462
462
|
l,h*f,2,this.done.bind(this,b,d,c,e)):this.dma.do_read(this.fda_image,l,h*f,2,this.done.bind(this,b,d,c,e))):this.status_reg1=5};V.prototype.done=function(a,b,c,d,e){e?C("XXX: Unhandled floppy error",8192):(d++,d>this.sectors_per_track&&(d=1,c++,c>=this.number_of_heads&&(c=0,b++)),b!==this.last_cylinder&&(this.dir=0),this.status_reg0=32,this.last_cylinder=b,this.last_head=c,this.last_sector=d,this.response_index=0,this.response_length=7,this.response_data[0]=c<<2|32,this.response_data[1]=0,this.response_data[2]=
|
package/build/libv86.js
CHANGED
|
@@ -445,7 +445,7 @@ V.prototype.set_state=function(a){this.bytes_expecting=a[0];this.receiving_comma
|
|
|
445
445
|
V.prototype.port3F4_read=function(){var a=128;this.response_index<this.response_length&&(a|=80);0===(this.dor&8)&&(a|=32);return a};V.prototype.port3F7_read=function(){return this.dir};V.prototype.port3F5_read=function(){return this.response_index<this.response_length?(this.cpu.device_lower_irq(6),this.response_data[this.response_index++]):255};V.prototype.port3F4_write=function(a){z(a);a&128&&(this.status_reg0=192,this.cpu.device_raise_irq(6))};
|
|
446
446
|
V.prototype.port3F5_write=function(a){ra("3F5 write "+z(a),8192);if(0<this.bytes_expecting)this.receiving_command[this.receiving_index++]=a,this.bytes_expecting--,0===this.bytes_expecting&&this.next_command.call(this,this.receiving_command);else{switch(a){case 3:this.next_command=this.fix_drive_data;this.bytes_expecting=2;break;case 19:this.next_command=this.configure;this.bytes_expecting=3;break;case 4:this.next_command=this.check_drive_status;this.bytes_expecting=1;break;case 5:case 69:case 197:this.next_command=
|
|
447
447
|
function(b){this.do_sector(!0,b)};this.bytes_expecting=8;break;case 6:case 70:case 198:case 230:this.next_command=function(b){this.do_sector(!1,b)};this.bytes_expecting=8;break;case 7:this.next_command=this.calibrate;this.bytes_expecting=1;break;case 8:this.check_interrupt_status();break;case 74:this.next_command=this.read_sector_id;this.bytes_expecting=1;break;case 15:this.bytes_expecting=2;this.next_command=this.seek;break;case 14:case 16:this.status_reg0=128;this.response_data[0]=this.status_reg0;
|
|
448
|
-
this.response_index=0;this.response_length=1;this.bytes_expecting=0;break;default:sa(!1,"Unimplemented floppy command call "+z(a))}this.receiving_index=0}};V.prototype.port3F2_read=function(){return this.dor};V.prototype.port3F2_write=function(a){
|
|
448
|
+
this.response_index=0;this.response_length=1;this.bytes_expecting=0;break;default:sa(!1,"Unimplemented floppy command call "+z(a))}this.receiving_index=0}};V.prototype.port3F2_read=function(){return this.dor};V.prototype.port3F2_write=function(a){!(this.dor&4)&&a&4&&(this.status_reg0=192,a&8&&this.cpu.device_raise_irq(6));z(a>>4);z(a);this.dor=a};V.prototype.check_drive_status=function(){this.status_reg1=this.fda_image?0:5;this.response_index=0;this.response_length=1;this.response_data[0]=0};
|
|
449
449
|
V.prototype.seek=function(a){if(0===(a[0]&3)){var b=a[1];a=a[0]>>2&1;b!==this.last_cylinder&&(this.dir=0);this.status_reg1=this.fda_image?0:5;this.status_reg0=32;this.last_cylinder=b;this.last_head=a}this.raise_irq()};V.prototype.calibrate=function(a){this.seek([a[0],0])};V.prototype.check_interrupt_status=function(){this.response_index=0;this.response_length=2;this.response_data[0]=this.status_reg0;this.response_data[1]=this.last_cylinder};
|
|
450
450
|
V.prototype.do_sector=function(a,b){var c=b[2],d=b[1],e=b[3],f=128<<b[4],g=b[5]-b[3]+1,h=((c+this.number_of_heads*d)*this.sectors_per_track+e-1)*f;z(h);z(g*f);this.fda_image?(this.status_reg1=0,a?this.dma.do_write(this.fda_image,h,g*f,2,this.done.bind(this,b,d,c,e)):this.dma.do_read(this.fda_image,h,g*f,2,this.done.bind(this,b,d,c,e))):this.status_reg1=5};
|
|
451
451
|
V.prototype.done=function(a,b,c,d,e){e||(d++,d>this.sectors_per_track&&(d=1,c++,c>=this.number_of_heads&&(c=0,b++)),b!==this.last_cylinder&&(this.dir=0),this.status_reg0=32,this.last_cylinder=b,this.last_head=c,this.last_sector=d,this.response_index=0,this.response_length=7,this.response_data[0]=c<<2|32,this.response_data[1]=0,this.response_data[2]=0,this.response_data[3]=b,this.response_data[4]=c,this.response_data[5]=d,this.response_data[6]=a[4],this.raise_irq())};
|
package/build/libv86.mjs
CHANGED
|
@@ -399,7 +399,7 @@ a[0];this.receiving_command=a[1];this.receiving_index=a[2];this.next_command=a[3
|
|
|
399
399
|
128;this.response_index<this.response_length&&(a|=80);0===(this.dor&8)&&(a|=32);return a};V.prototype.port3F7_read=function(){return this.dir};V.prototype.port3F5_read=function(){return this.response_index<this.response_length?(this.cpu.device_lower_irq(6),this.response_data[this.response_index++]):255};V.prototype.port3F4_write=function(a){z(a);a&128&&(this.status_reg0=192,this.cpu.device_raise_irq(6))};V.prototype.port3F5_write=function(a){ra("3F5 write "+z(a),8192);if(0<this.bytes_expecting)this.receiving_command[this.receiving_index++]=
|
|
400
400
|
a,this.bytes_expecting--,0===this.bytes_expecting&&this.next_command.call(this,this.receiving_command);else{switch(a){case 3:this.next_command=this.fix_drive_data;this.bytes_expecting=2;break;case 19:this.next_command=this.configure;this.bytes_expecting=3;break;case 4:this.next_command=this.check_drive_status;this.bytes_expecting=1;break;case 5:case 69:case 197:this.next_command=function(b){this.do_sector(!0,b)};this.bytes_expecting=8;break;case 6:case 70:case 198:case 230:this.next_command=function(b){this.do_sector(!1,
|
|
401
401
|
b)};this.bytes_expecting=8;break;case 7:this.next_command=this.calibrate;this.bytes_expecting=1;break;case 8:this.check_interrupt_status();break;case 74:this.next_command=this.read_sector_id;this.bytes_expecting=1;break;case 15:this.bytes_expecting=2;this.next_command=this.seek;break;case 14:case 16:this.status_reg0=128;this.response_data[0]=this.status_reg0;this.response_index=0;this.response_length=1;this.bytes_expecting=0;break;default:sa(!1,"Unimplemented floppy command call "+z(a))}this.receiving_index=
|
|
402
|
-
0}};V.prototype.port3F2_read=function(){return this.dor};V.prototype.port3F2_write=function(a){
|
|
402
|
+
0}};V.prototype.port3F2_read=function(){return this.dor};V.prototype.port3F2_write=function(a){!(this.dor&4)&&a&4&&(this.status_reg0=192,a&8&&this.cpu.device_raise_irq(6));z(a>>4);z(a);this.dor=a};V.prototype.check_drive_status=function(){this.status_reg1=this.fda_image?0:5;this.response_index=0;this.response_length=1;this.response_data[0]=0};V.prototype.seek=function(a){if(0===(a[0]&3)){var b=a[1];a=a[0]>>2&1;b!==this.last_cylinder&&(this.dir=0);this.status_reg1=this.fda_image?0:5;this.status_reg0=
|
|
403
403
|
32;this.last_cylinder=b;this.last_head=a}this.raise_irq()};V.prototype.calibrate=function(a){this.seek([a[0],0])};V.prototype.check_interrupt_status=function(){this.response_index=0;this.response_length=2;this.response_data[0]=this.status_reg0;this.response_data[1]=this.last_cylinder};V.prototype.do_sector=function(a,b){var c=b[2],d=b[1],e=b[3],f=128<<b[4],g=b[5]-b[3]+1,h=((c+this.number_of_heads*d)*this.sectors_per_track+e-1)*f;z(h);z(g*f);this.fda_image?(this.status_reg1=0,a?this.dma.do_write(this.fda_image,
|
|
404
404
|
h,g*f,2,this.done.bind(this,b,d,c,e)):this.dma.do_read(this.fda_image,h,g*f,2,this.done.bind(this,b,d,c,e))):this.status_reg1=5};V.prototype.done=function(a,b,c,d,e){e||(d++,d>this.sectors_per_track&&(d=1,c++,c>=this.number_of_heads&&(c=0,b++)),b!==this.last_cylinder&&(this.dir=0),this.status_reg0=32,this.last_cylinder=b,this.last_head=c,this.last_sector=d,this.response_index=0,this.response_length=7,this.response_data[0]=c<<2|32,this.response_data[1]=0,this.response_data[2]=0,this.response_data[3]=
|
|
405
405
|
b,this.response_data[4]=c,this.response_data[5]=d,this.response_data[6]=a[4],this.raise_irq())};V.prototype.fix_drive_data=function(a){a.slice(0,this.bytes_expecting)};V.prototype.configure=function(a){a.slice(0,this.bytes_expecting)};V.prototype.read_sector_id=function(){this.response_index=0;this.response_length=7;this.response_data[0]=0;this.response_data[1]=0;this.response_data[2]=0;this.response_data[3]=0;this.response_data[4]=0;this.response_data[5]=0;this.response_data[6]=0;this.raise_irq()};
|