Fixed machine array demos, by permitting machine IDs with hyphenated numeric suffixes to use a machine state file created with an unhyphenated machine ID, and added a demo of Windows 1.0 (the "Premiere Edition")

This commit is contained in:
Jeff Parsons 2017-06-23 14:00:27 -07:00 committed by Jeff Parsons
commit 503cda40f7
27 changed files with 99 additions and 57 deletions

View file

@ -645,15 +645,17 @@ class Computer extends Component {
if (!data) {
/*
* This is a hack that makes it possible for a machine whose ID has been
* supplemented with a suffix (a single letter or digit) to find object IDs
* in states created from a machine without the suffix.
* supplemented with a hyphenated numeric suffix to find object IDs in states
* created from a machine without such a suffix.
*
* For example, if a state file was created from a machine with ID "ibm5160"
* but the current machine is "ibm5160a", this attempts a second lookup with
* but the current machine is "ibm5160-1", this attempts a second lookup with
* "ibm5160", enabling us to find objects that match the original machine ID
* (eg, "ibm5160.romEGA").
*
* See /devices/pcx86/machine/5160/ega/640kb/array/ for examples of this.
*/
data = stateComputer.get(component.id.replace(/[a-z0-9]\./i, '.'));
data = stateComputer.get(component.id.replace(/-[0-9]+\./i, '.'));
}
}