Make component/script names match XML device names (specifically, serial and parallel, which used to be serialport and parallelport)

This commit is contained in:
Jeff Parsons 2016-12-29 13:21:22 -08:00 committed by Jeff Parsons
commit ded8f15e86
22 changed files with 913 additions and 925 deletions

View file

@ -31,6 +31,6 @@ PC8080 is comprised of the following non-shared components, as listed in [packag
* [ram.js](/modules/pc8080/lib/ram.js)
* [keyboard.js](/modules/pc8080/lib/keyboard.js)
* [video.js](/modules/pc8080/lib/video.js)
* [serialport.js](/modules/pc8080/lib/serialport.js)
* [serial.js](/modules/pc8080/lib/serial.js)
* [debugger.js](/modules/pc8080/lib/debugger.js)
* [computer.js](/modules/pc8080/lib/computer.js)

View file

@ -62,8 +62,8 @@ At the time of this writing, the recommended order is:
* [pcx86/ram.js](lib/ram.js)
* [pcx86/keyboard.js](lib/keyboard.js)
* [pcx86/video.js](lib/video.js)
* [pcx86/parallelport.js](lib/parallelport.js)
* [pcx86/serialport.js](lib/serialport.js)
* [pcx86/parallel.js](lib/parallel.js)
* [pcx86/serial.js](lib/serial.js)
* [pcx86/mouse.js](lib/mouse.js)
* [pcx86/disk.js](lib/disk.js)
* [pcx86/fdc.js](lib/fdc.js)

View file

@ -78,7 +78,7 @@
"model": "deskpro386",
"sound": false
},
"serialport": {
"serial": {
"id": "com2",
"adapter": 2,
"binding": "console"

View file

@ -35,7 +35,7 @@ if (NODE) {
var State = require("../../shared/lib/state");
var PCX86 = require("./defines");
var Messages = require("./messages");
var SerialPort = require("./serialport");
var SerialPort = require("./serial");
}
/**

View file

@ -33,7 +33,7 @@ PDPjs is currently comprised of the following PDP-11 components, as listed in [p
* [rk11.js](/modules/pdp11/lib/rk11.js)
* [rl11.js](/modules/pdp11/lib/rl11.js)
* [rom.js](/modules/pdp11/lib/rom.js)
* [serialport.js](/modules/pdp11/lib/serialport.js)
* [serial.js](/modules/pdp11/lib/serial.js)
Since this module was written in 2016, it seemed appropriate to start adopting some of the more useful features of
[ECMAScript](http://www.ecma-international.org/ecma-262/6.0/index.html) 2015 (aka ES6), including:

View file

@ -210,20 +210,6 @@ function initMachine(xml)
var component = aComponents[iComponent], sDeviceName = component.name;
/*
* TODO: Should I change the component names serialport and parallelport to serial and parallel?
*
* The XML device names are currently serial and parallel. I'm tempted to rev the XML device names
* (eg, to serialport and parallelport) and leave the component names (and corresponding script filenames)
* alone, but until then, we must manually remap these component names to their XML device names.
*
* I actually prefer camelCase and XML device names serialPort and parallelPort (not to mention chipSet),
* but that would require changing the script filenames (eg, to serialPort.js and parallelPort.js), since
* our list of component names is derived from the list of script filenames in package.json.
*/
if (sDeviceName == "serialport") sDeviceName = "serial";
if (sDeviceName == "parallelport") sDeviceName = "parallel";
var aDevices = machine[sDeviceName], iDevice;
if (aDevices) {