PDP-11 console output works (first baby step)

This commit is contained in:
Jeff 2016-10-04 15:24:22 -07:00 committed by Jeff Parsons
commit ebfcd5133b
11 changed files with 388 additions and 403 deletions

View file

@ -210,7 +210,7 @@ BusPDP11.IOController = {
}
if (b >= 0) {
if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) {
this.dbg.printMessage(afn[5] + ".readByte(" + this.dbg.toStrBase(addr) + "): " + this.dbg.toStrBase(b), true);
this.dbg.printMessage(afn[5] + ".readByte(" + this.dbg.toStrBase(addr) + "): " + this.dbg.toStrBase(b), true, true);
}
return b;
}
@ -275,7 +275,7 @@ BusPDP11.IOController = {
}
if (fWrite) {
if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) {
this.dbg.printMessage(afn[5] + ".writeByte(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(b) + ")", true);
this.dbg.printMessage(afn[5] + ".writeByte(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(b) + ")", true, true);
}
return;
}
@ -308,7 +308,7 @@ BusPDP11.IOController = {
}
if (w >= 0) {
if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) {
this.dbg.printMessage(afn[5] + ".readWord(" + this.dbg.toStrBase(addr) + "): " + this.dbg.toStrBase(w), true);
this.dbg.printMessage(afn[5] + ".readWord(" + this.dbg.toStrBase(addr) + "): " + this.dbg.toStrBase(w), true, true);
}
return w;
}
@ -345,7 +345,7 @@ BusPDP11.IOController = {
}
if (fWrite) {
if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) {
this.dbg.printMessage(afn[5] + ".writeWord(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(w) + ")", true);
this.dbg.printMessage(afn[5] + ".writeWord(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(w) + ")", true, true);
}
return;
}

View file

@ -1167,7 +1167,7 @@ if (DEBUGGER) {
if (this.nDisableMessages) return;
if (fAddress) {
sMessage += " at " + this.toStrAddr(this.newAddr(this.cpu.getPC()));
sMessage += " @" + this.toStrAddr(this.newAddr(this.cpu.getPC()));
}
if (this.bitsMessage & MessagesPDP11.BUFFER) {

View file

@ -456,7 +456,11 @@ var PDP11 = {
READY: 0x80, // Transmitter Ready (read-only)
INT_ENABLE: 0x40, // Transmitter Interrupt Enable (read-write)
MAINT: 0x04, // Maintenance (read-write)
BREAK: 0x01 // BREAK (read-write)
BREAK: 0x01, // BREAK (read-write)
DELAY: 8
},
XBUF: {
DELAY: 100
}
},
KW11: { // KW11-L LINE TIME CLOCK

View file

@ -344,7 +344,7 @@ SerialPortPDP11.prototype.writeXCSR = function(data, addr)
*/
if ((this.tty.xcsr & (PDP11.DL11.XCSR.READY | PDP11.DL11.XCSR.INT_ENABLE)) == PDP11.DL11.XCSR.READY && (data & PDP11.DL11.XCSR.INT_ENABLE)) {
var device = this;
this.cpu.interrupt(PDP11.DL11.DELAY, PDP11.DL11.PRI, PDP11.DL11.VEC, function() {
this.cpu.interrupt(PDP11.DL11.XCSR.DELAY, PDP11.DL11.PRI, PDP11.DL11.VEC, function() {
device.tty.xcsr |= PDP11.DL11.XCSR.READY;
return !!(device.tty.xcsr & PDP11.DL11.XCSR.INT_ENABLE);
});
@ -376,39 +376,16 @@ SerialPortPDP11.prototype.readXBUF = function(addr)
*/
SerialPortPDP11.prototype.writeXBUF = function(data, addr)
{
// data &= 0x7f;
// if (data) {
// switch (data) {
// case 0:
// case 0xD: /*015*/
// /*
// if (document.forms.console.line.value.length > 9000) {
// document.forms.console.line.value = document.forms.console.line.value.substring(document.forms.console.line.value.length - 8192);
// }
// */
// break;
// case 0x8: /*010*/
// /*
// if (!tty.del) {
// document.forms.console.line.value = document.forms.console.line.value.substring(0, document.forms.console.line.value.length - 1);
// }
// */
// break;
// default:
// /*
// document.forms.console.line.value += String.fromCharCode(data);
// if (data == 0x0A) {
// document.forms.console.line.scrollTop = document.forms.console.line.scrollHeight;
// }
// */
// }
// tty.del = 0;
// }
// tty.xcsr &= ~0x80; /*0200*/
// cpu.interrupt(100, 4, 0x34, /*064*/ function() {
// tty.xcsr |= 0x80; /*0200*/
// return !!(tty.xcsr & 0x40); /*0100*/
// });
data &= 0x7f;
if (data) {
var serial = this;
this.transmitByte(data);
this.tty.xcsr &= ~PDP11.DL11.XCSR.READY;
this.cpu.interrupt(PDP11.DL11.XBUF.DELAY, PDP11.DL11.PRI, PDP11.DL11.VEC, function() {
serial.tty.xcsr |= PDP11.DL11.XCSR.READY;
return !!(serial.tty.xcsr & PDP11.DL11.XCSR.INT_ENABLE);
});
}
};
/**
@ -513,7 +490,7 @@ SerialPortPDP11.prototype.powerDown = function(fSave, fShutdown)
SerialPortPDP11.prototype.reset = function()
{
this.tty.rcsr = 0;
this.tty.xcsr = 0x80; /*0200*/
this.tty.xcsr = 0x80;
this.initState();
};

View file

@ -1027,7 +1027,7 @@ Component.prototype = {
printMessage: function(sMessage, bitsMessage, fAddress) {
if (DEBUGGER && this.dbg) {
if (bitsMessage === true || this.messageEnabled(bitsMessage | 0)) {
this.dbg.message(sMessage, fAddress || bitsMessage === true);
this.dbg.message(sMessage, fAddress);
}
}
},