Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

Commit

Permalink
Merge branch 'next-release'
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffpar committed Aug 16, 2016
2 parents 9863ee2 + 111f28e commit 1d221cb
Show file tree
Hide file tree
Showing 12 changed files with 719 additions and 497 deletions.
6 changes: 4 additions & 2 deletions devices/pc8080/machine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ PC8080 Machine Configurations
The following 8080-based machines are currently available:

* [8080 Exerciser](exerciser/)
* [Space Invaders (1978)](invaders/)
* [DEC VT100 Terminal](vt100/)
* [Space Invaders (1978)](invaders/) (with [Debugger](invaders/debugger/))
* [DEC VT100 Terminal](vt100/) (with [Debugger](vt100/debugger/))

And check out the [Dual VT100 Terminals](vt100/dual/) for a demo of two PCjs machines communicating over a *virtual* serial connection.
5 changes: 2 additions & 3 deletions devices/pc8080/machine/vt100/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ layout: page
title: DEC VT100 Terminal
permalink: /devices/pc8080/machine/vt100/
machines:
- type: pc8080
id: vt100
debugger: true
- id: vt100
type: pc8080
---

DEC VT100 Terminal
Expand Down
34 changes: 32 additions & 2 deletions devices/pc8080/machine/vt100/debugger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: page
title: DEC VT100 Terminal with Debugger
permalink: /devices/pc8080/machine/vt100/debugger/
machines:
- type: pc8080
id: vt100
- id: vt100
type: pc8080
debugger: true
---

Expand Down Expand Up @@ -51,6 +51,36 @@ keys. The following keys have special meaning inside SET-UP Mode.
- SHIFT-S: Save SET-UP Features
- SHIFT-R: Restore SET-UP Features

### SET-UP B Options

#### Block 1

- 1---: Smooth scroll
- -1--: Auto-Repeat
- --1-: Light Screen Background
- ---1: Block Cursor

#### Block 2

- 1---: Margin Bell
- -1--: Key-click
- --1-: ANSI
- ---1: Auto-XON/XOFF

#### Block 3

- 1---: UK Pound Symbol
- -1--: Wrap-Around
- --1-: New Line
- ---1: Interlace

#### Block 4

- 1---: Even Parity
- -1--: Parity Enable
- --1-: 8 Data Bits
- ---1: 50Hz Power

VT100 Memory Usage
------------------

Expand Down
2 changes: 1 addition & 1 deletion devices/pc8080/machine/vt100/debugger/machine.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<keyboard id="keyboard" model="VT100">
<control type="button" binding="setup" padleft="8px">SET-UP</control>
</keyboard>
<serial id="serial0" adapter="0">
<serial id="serialPort" adapter="0" binding="print">
<control type="button" binding="test" value="HELLO WORLD!\r\n" padleft="8px">TEST RECEIVER</control>
</serial>
<panel ref="/devices/pc8080/panel/wide.xml"/>
Expand Down
27 changes: 27 additions & 0 deletions devices/pc8080/machine/vt100/dual/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
layout: page
title: Dual VT100 Terminals
permalink: /devices/pc8080/machine/vt100/dual/
machines:
- id: vt100a
type: pc8080
config: /devices/pc8080/machine/vt100/machine.xml
connection: serialPort=vt100b.serialPort
- id: vt100b
type: pc8080
config: /devices/pc8080/machine/vt100/machine.xml
connection: serialPort=vt100a.serialPort
---

Dual VT100 Terminals
--------------------

This is a test of two [VT100 Terminals](../) whose serial ports are *virtually* connected, so anything you type in the first
terminal should appear on the screen of the second, and vice versa. Click or tap on the screen of the desired terminal before
you begin typing.

If either terminal becomes LOCKED, press the SET-UP key (mapped to your F9 function key) twice to unlock it.

{% include machine.html id="vt100a" %}

{% include machine.html id="vt100b" %}
2 changes: 1 addition & 1 deletion devices/pc8080/machine/vt100/machine.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<keyboard id="keyboard" model="VT100">
<control type="button" binding="setup" padleft="8px" padbottom="8px">SET-UP</control>
</keyboard>
<serial id="serial0" adapter="0">
<serial id="serialPort" adapter="0">
<control type="button" binding="test" value="HELLO WORLD!\r\n" padleft="8px" padbottom="8px">TEST RECEIVER</control>
</serial>
</machine>
84 changes: 45 additions & 39 deletions modules/pc8080/lib/chipset.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,16 @@ ChipSet.SI1978 = {
*/
ChipSet.VT100 = {
MODEL: 100.0,
FLAGS_BUFFER: {
FLAGS: {
PORT: 0x42, // read-only
XMIT: 0x01, // PUSART transmit buffer empty if SET
UART_XMIT: 0x01, // PUSART transmit buffer empty if SET
NO_AVO: 0x02, // AVO present if CLEAR
NO_GFX: 0x04, // VT125 graphics board present if CLEAR
OPTION: 0x08, // OPTION present if SET
NO_EVEN: 0x10, // EVEN FIELD active if CLEAR
NVR_DATA: 0x20, // NVR DATA if SET
NVR_CLK: 0x40, // NVR CLOCK if SET
KBD_XMIT: 0x80 // KBD XMIT BUFFER empty if SET
KBD_XMIT: 0x80 // KBD transmit buffer empty if SET
},
BRIGHTNESS: {
PORT: 0x42, // write-only
Expand Down Expand Up @@ -424,6 +424,7 @@ ChipSet.prototype.initBus = function(cmp, bus, cpu, dbg)
this.dbg = dbg;
this.cmp = cmp;
this.kbd = /** @type {Keyboard} */ (cmp.getMachineComponent("Keyboard"));
this.serial = /** @type {SerialPort} */ (cmp.getMachineComponent("SerialPort"));
this.video = /** @type {Video} */ (cmp.getMachineComponent("Video"));
bus.addPortInputTable(this, this.config.portsInput);
bus.addPortOutputTable(this, this.config.portsOutput);
Expand Down Expand Up @@ -474,7 +475,7 @@ ChipSet.SI1978.INIT = [
ChipSet.VT100.INIT = [
[
ChipSet.VT100.BRIGHTNESS.INIT,
ChipSet.VT100.FLAGS_BUFFER.NO_AVO | ChipSet.VT100.FLAGS_BUFFER.NO_GFX
ChipSet.VT100.FLAGS.NO_AVO | ChipSet.VT100.FLAGS.NO_GFX
],
[
ChipSet.VT100.DC011.INITCOLS,
Expand Down Expand Up @@ -531,7 +532,7 @@ ChipSet.prototype.save = function()
state.set(0, [this.bStatus0, this.bStatus1, this.bStatus2, this.wShiftData, this.bShiftCount, this.bSound1, this.bSound2]);
break;
case ChipSet.VT100.MODEL:
state.set(0, [this.bBrightness, this.bFlagsBuffer]);
state.set(0, [this.bBrightness, this.bFlags]);
state.set(1, [this.bDC011Cols, this.bDC011Rate]);
state.set(2, [this.bDC012Scroll, this.bDC012Blink, this.bDC012Reverse, this.bDC012Attr]);
state.set(3, [this.dNVRAddr, this.wNVRData, this.bNVRLatch, this.bNVROut, this.aNVRWords]);
Expand All @@ -555,31 +556,31 @@ ChipSet.prototype.restore = function(data)
if (data && (a = data[0]) && a.length) {
switch(this.config.MODEL) {
case ChipSet.SI1978.MODEL:
this.bStatus0 = a[0];
this.bStatus1 = a[1];
this.bStatus2 = a[2];
this.wShiftData = a[3];
this.bShiftCount = a[4];
this.bSound1 = a[5];
this.bSound2 = a[6];
this.bStatus0 = a[0];
this.bStatus1 = a[1];
this.bStatus2 = a[2];
this.wShiftData = a[3];
this.bShiftCount = a[4];
this.bSound1 = a[5];
this.bSound2 = a[6];
return true;
case ChipSet.VT100.MODEL:
this.bBrightness = a[0];
this.bFlagsBuffer = a[1];
this.bBrightness = a[0];
this.bFlags = a[1];
a = data[1];
this.bDC011Cols = a[0];
this.bDC011Rate = a[1];
this.bDC011Cols = a[0];
this.bDC011Rate = a[1];
a = data[2];
this.bDC012Scroll = a[0];
this.bDC012Blink = a[1];
this.bDC012Scroll = a[0];
this.bDC012Blink = a[1];
this.bDC012Reverse = a[2];
this.bDC012Attr = a[3];
this.bDC012Attr = a[3];
a = data[3];
this.dNVRAddr = a[0]; // 20-bit address
this.wNVRData = a[1]; // 14-bit word
this.bNVRLatch = a[2]; // 1 byte
this.bNVROut = a[3]; // 1 bit
this.aNVRWords = a[4]; // 100 14-bit words
this.dNVRAddr = a[0]; // 20-bit address
this.wNVRData = a[1]; // 14-bit word
this.bNVRLatch = a[2]; // 1 byte
this.bNVROut = a[3]; // 1 bit
this.aNVRWords = a[4]; // 100 14-bit words
return true;
}
}
Expand Down Expand Up @@ -883,36 +884,40 @@ ChipSet.prototype.doNVRCommand = function()
};

/**
* inVT100FlagsBuffer(port, addrFrom)
* inVT100Flags(port, addrFrom)
*
* @this {ChipSet}
* @param {number} port (0x42)
* @param {number} [addrFrom] (not defined if the Debugger is trying to read the specified port)
* @return {number} simulated port value
*/
ChipSet.prototype.inVT100FlagsBuffer = function(port, addrFrom)
ChipSet.prototype.inVT100Flags = function(port, addrFrom)
{
/*
* The NVR_CLK bit is driven by LBA7 (ie, bit 7 from Line Buffer Address generation); see the DC011 discussion above.
*/
var b = this.bFlagsBuffer;
b &= ~ChipSet.VT100.FLAGS_BUFFER.NVR_CLK;
var b = this.bFlags;
b &= ~ChipSet.VT100.FLAGS.NVR_CLK;
if (this.getVT100LBA(7)) {
b |= ChipSet.VT100.FLAGS_BUFFER.NVR_CLK;
if (b != this.bFlagsBuffer) {
b |= ChipSet.VT100.FLAGS.NVR_CLK;
if (b != this.bFlags) {
this.doNVRCommand();
}
}
b &= ~ChipSet.VT100.FLAGS_BUFFER.NVR_DATA;
b &= ~ChipSet.VT100.FLAGS.NVR_DATA;
if (this.bNVROut) {
b |= ChipSet.VT100.FLAGS_BUFFER.NVR_DATA;
b |= ChipSet.VT100.FLAGS.NVR_DATA;
}
b &= ~ChipSet.VT100.FLAGS_BUFFER.KBD_XMIT;
if (this.kbd && !this.kbd.checkBusy()) {
b |= ChipSet.VT100.FLAGS_BUFFER.KBD_XMIT;
b &= ~ChipSet.VT100.FLAGS.KBD_XMIT;
if (this.kbd && this.kbd.isTransmitterReady()) {
b |= ChipSet.VT100.FLAGS.KBD_XMIT;
}
this.bFlagsBuffer = b;
this.printMessageIO(port, null, addrFrom, "FLAGS.BUFFER", b);
b &= ~ChipSet.VT100.FLAGS.UART_XMIT;
if (this.serial && this.serial.isTransmitterReady()) {
b |= ChipSet.VT100.FLAGS.UART_XMIT;
}
this.bFlags = b;
this.printMessageIO(port, null, addrFrom, "FLAGS", b);
return b;
};

Expand Down Expand Up @@ -967,6 +972,7 @@ ChipSet.prototype.outVT100DC012 = function(port, b, addrFrom)
break;
case 0x1:
this.bDC012Scroll = (this.bDC012Scroll & ~0xC) | (bOpt << 2);
if (this.video) this.video.updateScrollOffset(this.bDC012Scroll);
break;
case 0x2:
switch(bOpt) {
Expand Down Expand Up @@ -1013,7 +1019,7 @@ ChipSet.prototype.outVT100DC011 = function(port, b, addrFrom)
this.bDC011Cols = b;
if (this.video) {
var nCols = (this.bDC011Cols == ChipSet.VT100.DC011.COLS132? 132 : 80);
var nRows = (nCols > 80 && (this.bFlagsBuffer & ChipSet.VT100.FLAGS_BUFFER.NO_AVO)? 14 : 24);
var nRows = (nCols > 80 && (this.bFlags & ChipSet.VT100.FLAGS.NO_AVO)? 14 : 24);
this.video.updateDimensions(nCols, nRows);
}
}
Expand All @@ -1039,7 +1045,7 @@ ChipSet.SI1978.portsOutput = {
};

ChipSet.VT100.portsInput = {
0x42: ChipSet.prototype.inVT100FlagsBuffer
0x42: ChipSet.prototype.inVT100Flags
};

ChipSet.VT100.portsOutput = {
Expand Down
12 changes: 6 additions & 6 deletions modules/pc8080/lib/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -870,17 +870,17 @@ Keyboard.prototype.checkSoftKeysToRelease = function()
};

/**
* checkBusy()
* isTransmitterReady()
*
* Called whenever a ChipSet circuit needs the keyboard's UART status.
* Currently, we have no busy conditions (our virtual keyboard is infinitely fast).
* Called whenever a ChipSet circuit needs the Keyboard UART's transmitter status.
* Currently, we have no busy conditions (our virtual keyboard transmitter is infinitely fast).
*
* @this {Keyboard}
* @return {boolean}
* @return {boolean} (true if ready, false if not)
*/
Keyboard.prototype.checkBusy = function()
Keyboard.prototype.isTransmitterReady = function()
{
return false;
return true;
};

/**
Expand Down
Loading

0 comments on commit 1d221cb

Please sign in to comment.