Eliminate spurious video mode change (triggered by Mode X detection code)

This commit is contained in:
Jeff Parsons 2015-12-01 20:37:43 -08:00
commit 2ec761eeda
4 changed files with 2243 additions and 2172 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -179,15 +179,15 @@ Keyboard.ASCII = {
};
/**
* Browser keyCodes we must pay particular attention to. For the most part, these are
* non-alphanumeric or function keys, some which may require special treatment (eg,
* preventDefault() if returning false on the initial keyDown event is insufficient).
* Browser keyCodes we must pay particular attention to. For the most part, these are non-alphanumeric
* or function keys, some which may require special treatment (eg, preventDefault() if returning false on
* the initial keyDown event is insufficient).
*
* keyCodes for most common ASCII keys can simply use the appropriate ASCII code above.
*
* Most of these represent non-ASCII keys (eg, the LEFT arrow key), yet for some reason,
* browsers defined them using ASCII codes (eg, the LEFT arrow key uses the ASCII code
* for '%' or 37). This conflict is discussed further in the definition of CLICKCODE below.
* Most of these represent non-ASCII keys (eg, the LEFT arrow key), yet for some reason, browsers defined
* them using ASCII codes (eg, the LEFT arrow key uses the ASCII code for '%' or 37). This conflict is
* discussed further in the definition of CLICKCODE below.
*
* @enum {number}
*/

View file

@ -6856,11 +6856,13 @@ Video.prototype.outCRTCData = function(card, port, bOut, addrFrom)
*
* The second part of the check is required to promptly detect a switch to "Mode X"; if we assume
* that anyone switching to "Mode X" will first switch to mode 0x13, then it's a given that they
* must reprogram the VDISP_END register, and that they will change it from 0x8F to 0xDF. However,
* I'm not going to make the test that restrictive, to help catch other mode variations (but at the
* expense of triggering potentially unnecessary calls to checkMode()).
* must reprogram the VDISP_END register, and that they will probably change it from 0x8F to 0xDF.
*
* Originally, I wasn't going to check specifically for 0xDF, to help catch other "Mode X" variations,
* but if I don't, then some spurious mode changes are triggered (eg, when Windows 1.0 switches from
* CGA graphics mode 0x06 to an EGA graphics mode).
*/
if (card.regCRTIndx == Card.CRTC.MAX_SCAN.INDX && card.regCRTPrev != Card.CRTC.MAX_SCAN.INDX-1 || card.regCRTIndx == Card.CRTC.EGA.VDISP_END) {
if (card.regCRTIndx == Card.CRTC.MAX_SCAN.INDX && card.regCRTPrev != Card.CRTC.MAX_SCAN.INDX-1 || card.regCRTIndx == Card.CRTC.EGA.VDISP_END && bOut == 0xDF) {
this.checkMode(true);
}
this.checkCursor();