When a 'state' file is passed as a URL parameter, that's supposed to override a machine's 'resume' setting, but if a 'state' file is passed as EITHER a computer parameter (the original XML-based method) OR as a machine parameter (a newer method that allows a web page to override certain XML settings), that is NOT supposed to override the 'resume' setting. This restores the ability of the DONKEY.BAS demo to BOTH define a state file AND allow the machine to be suspended and resumed. Additionally, a new-ish Video card property (offStartAddr), which was originally added for the EGA/VGA, was not properly initialized for other cards, so when we restored the display of a suspended machine with a CGA, nothing would be displayed, due to lots of NaN buffer address calculations.

This commit is contained in:
Jeff Parsons 2017-06-22 17:45:36 -07:00 • committed by Jeff Parsons
commit 0bd1be0df9
12 changed files with 1799 additions and 1779 deletions

View file

@ -7,7 +7,7 @@ redirect_from:
---
IBM PC with Color Graphics (CGA) Display
---
----------------------------------------
All our 64Kb configurations of the IBM PC Model 5150 w/CGA are located here, including:

View file

@ -2,7 +2,7 @@
<?xml-stylesheet type="text/xsl" href="/versions/pcx86/1.35.1/machine.xsl"?>
<machine id="ibm5150" type="pcx86" border="1" pos="center" background="default">
<name pos="center">IBM PC (Model 5150), CGA, 64K</name>
<computer id="pc-cga-64k" name="IBM PC"/>
<computer id="pc-cga-64k" name="IBM PC" resume="1"/>
<ram id="ramLow" addr="0x00000"/>
<rom id="romBASIC" addr="0xf6000" size="0x8000" file="/devices/pcx86/rom/5150/basic/BASIC100.json"/>
<rom id="romBIOS" addr="0xfe000" size="0x2000" file="/devices/pcx86/rom/5150/1981-04-24/PCBIOS-REV1.json"/>

View file

@ -2,7 +2,7 @@
<?xml-stylesheet type="text/xsl" href="/versions/pcx86/1.35.1/machine.xsl"?>
<machine id="ibm5150" type="pcx86" border="1" pos="center" background="default">
<name pos="center">IBM PC (Model 5150), CGA, 64K</name>
<computer id="pc-cga-64k" name="IBM PC"/>
<computer id="pc-cga-64k" name="IBM PC" resume="1"/>
<ram id="ramLow" addr="0x00000"/>
<rom id="romBASIC" addr="0xf6000" size="0x8000" file="/devices/pcx86/rom/5150/basic/BASIC100.json"/>
<rom id="romBIOS" addr="0xfe000" size="0x2000" file="/devices/pcx86/rom/5150/1981-04-24/PCBIOS-REV1.json"/>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -261,9 +261,12 @@ class Computer extends Component {
* OVERRIDES everything; it overrides any 'state' Computer parameter AND it disables resume of any saved state in
* localStorage (in other words, it prevents fAllowResume from being true, and forcing resume off).
*/
var fAllowResume;
var sState = this.getMachineParm('state') || (fAllowResume = true) && parmsComputer['state'];
var fAllowResume = false;
var sState = Web.getURLParm('state');
if (!sState) {
fAllowResume = true;
sState = this.getMachineParm('state', parmsComputer);
}
if (sState) {
sStatePath = this.sStatePath = sState;
if (!fAllowResume) {
@ -524,13 +527,14 @@ class Computer extends Component {
*/
this.stateFailSafe = new State(this, PCX86.APPVERSION, Computer.STATE_FAILSAFE);
if (this.stateFailSafe.load()) {
this.powerReport(stateComputer);
if (this.powerReport(stateComputer)) {
/*
* We already know resume is something other than RESUME_NONE, so we'll go ahead and bump it
* all the way to RESUME_PROMPT, so that the user will be prompted, and if the user declines to
* restore, the state will be removed.
*/
resume = Computer.RESUME_PROMPT;
}
/*
* To ensure that the set() below succeeds, we need to call unload(), otherwise it may fail
* with a "read only" error (eg, "TypeError: Cannot assign to read only property 'timestamp'").
@ -814,12 +818,17 @@ class Computer extends Component {
*
* @this {Computer}
* @param {State} stateComputer
* @return {boolean}
*/
powerReport(stateComputer)
{
if (!this.flags.unloading) {
if (Component.confirmUser("There may be a problem with your " + PCX86.APPNAME + " machine.\n\nTo help us diagnose it, click OK to send this " + PCX86.APPNAME + " machine state to http://" + SITEHOST + ".")) {
Web.sendReport(PCX86.APPNAME, PCX86.APPVERSION, this.url, this.getUserID(), ReportAPI.TYPE.BUG, stateComputer.toString());
}
return true;
}
return false;
}
/**

View file

@ -363,6 +363,7 @@ class Card {
this.regCRTData = data[5];
this.nCRTCRegs = Card.CRTC.TOTAL_REGS;
this.asCRTCRegs = DEBUGGER? Card.CRTC.REGS : [];
this.offStartAddr = ((this.regCRTData[Card.CRTC.START_ADDR_HI] << 8) + this.regCRTData[Card.CRTC.START_ADDR_LO])|0;
if (nCard >= Video.CARD.EGA) {
this.nCRTCRegs = Card.CRTC.EGA.TOTAL_REGS;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -46650,6 +46650,7 @@ class Card {
this.regCRTData = data[5];
this.nCRTCRegs = Card.CRTC.TOTAL_REGS;
this.asCRTCRegs = DEBUGGER? Card.CRTC.REGS : [];
this.offStartAddr = ((this.regCRTData[Card.CRTC.START_ADDR_HI] << 8) + this.regCRTData[Card.CRTC.START_ADDR_LO])|0;
if (nCard >= Video.CARD.EGA) {
this.nCRTCRegs = Card.CRTC.EGA.TOTAL_REGS;
@ -73937,9 +73938,12 @@ class Computer extends Component {
* OVERRIDES everything; it overrides any 'state' Computer parameter AND it disables resume of any saved state in
* localStorage (in other words, it prevents fAllowResume from being true, and forcing resume off).
*/
var fAllowResume;
var sState = this.getMachineParm('state') || (fAllowResume = true) && parmsComputer['state'];
var fAllowResume = false;
var sState = Web.getURLParm('state');
if (!sState) {
fAllowResume = true;
sState = this.getMachineParm('state', parmsComputer);
}
if (sState) {
sStatePath = this.sStatePath = sState;
if (!fAllowResume) {
@ -74200,13 +74204,14 @@ class Computer extends Component {
*/
this.stateFailSafe = new State(this, PCX86.APPVERSION, Computer.STATE_FAILSAFE);
if (this.stateFailSafe.load()) {
this.powerReport(stateComputer);
if (this.powerReport(stateComputer)) {
/*
* We already know resume is something other than RESUME_NONE, so we'll go ahead and bump it
* all the way to RESUME_PROMPT, so that the user will be prompted, and if the user declines to
* restore, the state will be removed.
*/
resume = Computer.RESUME_PROMPT;
}
/*
* To ensure that the set() below succeeds, we need to call unload(), otherwise it may fail
* with a "read only" error (eg, "TypeError: Cannot assign to read only property 'timestamp'").
@ -74490,12 +74495,17 @@ class Computer extends Component {
*
* @this {Computer}
* @param {State} stateComputer
* @return {boolean}
*/
powerReport(stateComputer)
{
if (!this.flags.unloading) {
if (Component.confirmUser("There may be a problem with your " + PCX86.APPNAME + " machine.\n\nTo help us diagnose it, click OK to send this " + PCX86.APPNAME + " machine state to http://" + SITEHOST + ".")) {
Web.sendReport(PCX86.APPNAME, PCX86.APPVERSION, this.url, this.getUserID(), ReportAPI.TYPE.BUG, stateComputer.toString());
}
return true;
}
return false;
}
/**

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long