Some minor changes to make it easier to load a machine in the Node environment

This commit is contained in:
Jeff Parsons 2016-12-27 22:05:59 -08:00 committed by Jeff Parsons
commit d930b31c53
38 changed files with 4216 additions and 3743 deletions

View file

@ -2,11 +2,8 @@
/**
* @fileoverview Implements the PCx86 command-line interface
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @version 1.0
* @copyright © Jeff Parsons 2012-2016
* @suppress {missingProperties}
* Created 2012-Sep-04
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
*
@ -218,7 +215,7 @@ function loadMachine(sFile)
*
* TODO: I've since removed the comments from my sample "ibm5150.json" file, so we could
* try to reinstate this code; however, there are still hex constants, which I find *much*
* preferable to the decimal equivalents. JSON's restrictions continue to infuriate me.
* preferable to the decimal equivalents. JSON's restrictions continue to irritate me.
*
* var machine = require(lib + "../bin/" +sFile);
*/

View file

@ -371,13 +371,13 @@ Computer.prototype.setMachineParms = function(parmsMachine)
Computer.prototype.getMachineParm = function(sParm, parmsComponent)
{
/*
* When checking parmsURL, the check is allowed be a bit looser, because URL parameters are
* When using getURLParm(), the check is allowed be a bit looser, because URL parameters are
* user-supplied, whereas most other parameters are developer-supplied. Granted, a developer
* may also be sloppy and neglect to use correct case (eg, 'automount' instead of 'autoMount'),
* but there are limits to my paranoia.
*/
var sParmLC = sParm.toLowerCase();
var value = Component.parmsURL[sParm] || Component.parmsURL[sParmLC];
var value = web.getURLParm(sParm) || web.getURLParm(sParmLC);
if (value === undefined && this.parmsMachine) {
value = this.parmsMachine[sParm];

View file

@ -161,7 +161,7 @@ function Video(parmsVideo, canvas, context, textarea, container)
* that's apparently been added to Chrome. Sigh.
*/
var fSmoothing = parmsVideo['smoothing'];
var sSmoothing = Component.parmsURL['smoothing'];
var sSmoothing = web.getURLParm('smoothing');
if (sSmoothing) fSmoothing = (sSmoothing == "true");
if (fSmoothing != null) {
for (i = 0; i < asWebPrefixes.length; i++) {
@ -7303,7 +7303,7 @@ Video.init = function()
* until we figure out a better UI. And note that we use our web.onPageEvent() helper function to make
* sure we don't trample any other 'onresize' handler(s) attached to the window object.
*/
var aspect = +(parmsVideo['aspect'] || Component.parmsURL['aspect']);
var aspect = +(parmsVideo['aspect'] || web.getURLParm('aspect'));
/*
* No 'aspect' parameter yields NaN, which is falsey, and anything else must satisfy my arbitrary
* constraints of 0.3 <= aspect <= 3.33, to prevent any useless (or worse, browser-blowing) results.