Minor visible buffer fix for text modes on newer (EGA/VGA) cards

This commit is contained in:
Jeff Parsons 2015-11-20 10:42:30 -08:00
commit 1dd50c68d3
3 changed files with 5 additions and 3 deletions

View file

@ -9,7 +9,6 @@
<rom id="romBIOS" addr="0xf0000" size="0x10000" alias="0xff0000" file="/devices/pc/bios/5170/1984-01-10.json"/>
<video ref="/devices/pc/video/ibm/ega/ibm-ega-128kb-autolockfs.xml"/>
<keyboard ref="/devices/pc/keyboard/keyboard-minimal.xml"/>
<panel ref="/devices/pc/panel/wide.xml"/>
<fdc ref="/disks/pc/library.xml" pos="right" automount='{A: {name: "MS-DOS 4.00 (Disk 1)", path: "/disks/pc/dos/microsoft/4.00/MSDOS400-DISK1.json"}}'/>
<chipset id="chipset" model="5170" floppies="[1200,1200]"/>
<serial id="com1" adapter="1"/>

View file

@ -9,7 +9,6 @@
<rom id="romBIOS" addr="0xf0000" size="0x10000" alias="0xff0000" file="/devices/pc/bios/5170/1984-01-10.json"/>
<video ref="/devices/pc/video/ibm/ega/ibm-ega-128kb-autolockfs.xml"/>
<keyboard ref="/devices/pc/keyboard/keyboard-minimal.xml"/>
<panel ref="/devices/pc/panel/wide.xml"/>
<fdc ref="/disks/pc/library.xml" pos="right" automount='{A: {name: "MS-DOS 4.01 (Disk 1)", path: "/disks/pc/dos/microsoft/4.01/MSDOS401-DISK1.json"}}'/>
<chipset id="chipset" model="5170" floppies="[1200,1200]"/>
<serial id="com1" adapter="1"/>

View file

@ -5406,10 +5406,14 @@ Video.prototype.updateScreen = function(fForce)
* cbScreen was computed (but without any CGA-related padding considerations).
*
* TODO: I'm taking a lot of shortcuts in this calculation (eg, relying on nFont to detect text modes,
* ignoring MODE_CTRL.BYTE_MODE, etc); generalize this someday.
* ignoring MODE_CTRL.BYTE_MODE, etc); generalize this someday. In addition, dividing the total number of
* cells by nCellsPerWord yields total WORDS, not BYTES, so we need to double cbScreen -- EXCEPT that the
* notion of cell has a slightly different meaning for EGA and VGA-specific modes. nCellsPerWord should
* not be overloaded like that.
*/
this.nColsLogical = card.regCRTData[Card.CRTC.EGA.OFFSET] << (this.nFont? 1 : (card.regCRTData[Card.CRTC.EGA.UNDERLINE.INDX] & Card.CRTC.EGA.UNDERLINE.DWORD)? 3 : 4);
cbScreen = ((this.nColsLogical * (this.nRows-1) + this.nCols) / this.nCellsPerWord)|0;
if (this.nMode <= Video.MODE.MDA_80X25) cbScreen <<= 1;
}
if (addrScreen + cbScreen > addrScreenLimit) {