diff --git a/disks/pc/dos/microsoft/4.00/machine.xml b/disks/pc/dos/microsoft/4.00/machine.xml
index 9d3a1d12d..025429c56 100644
--- a/disks/pc/dos/microsoft/4.00/machine.xml
+++ b/disks/pc/dos/microsoft/4.00/machine.xml
@@ -9,7 +9,6 @@
-
diff --git a/disks/pc/dos/microsoft/4.01/machine.xml b/disks/pc/dos/microsoft/4.01/machine.xml
index 843e5e3f6..203ff6d33 100644
--- a/disks/pc/dos/microsoft/4.01/machine.xml
+++ b/disks/pc/dos/microsoft/4.01/machine.xml
@@ -9,7 +9,6 @@
-
diff --git a/modules/pcjs/lib/video.js b/modules/pcjs/lib/video.js
index da20600a2..00b627a34 100644
--- a/modules/pcjs/lib/video.js
+++ b/modules/pcjs/lib/video.js
@@ -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) {