]> granicus.if.org Git - nethack/commitdiff
use faster method to write characters to VGA in msdos port
authornhmall <nhmall@nethack.org>
Fri, 13 Sep 2019 04:38:04 +0000 (00:38 -0400)
committernhmall <nhmall@nethack.org>
Fri, 13 Sep 2019 04:38:04 +0000 (00:38 -0400)
chasonr's comments in github pull request #220:
It was necessary, when updating the MS-DOS port for 3.6, to revise the
screen-clearing and character-drawing functions, because the background
color is no longer zero. But the 3.6.1 method is rather slow, using
write mode 2 and a lot more calls to outportb.

outportb is expensive when running under a virtual machine, the typical
use case for the MS-DOS port these days, because it traps to the
hypervisor rather than actually writing to hardware.

This change restores the speed of the 3.4.3 version. The adapter is left
in write mode 0. Clearing is accomplished by writing zero to planes where
the background color has a zero bit, and 0xFF where the background color
has a one bit. Characters are drawn by writing 0x00, 0xFF, the font data,
or the inverse of the font data, as appropriate, to each plane.

When testing, be sure to use OPTIONS=videomode:vga, because autodetect
will go to VESA mode if it can.

closes #220

doc/fixes36.3

index 734272ffa397046bda2fb4ca786a0027aec19ad4..f00cc3e29eb48547ba2f9088ae62cfa59d90e553 100644 (file)
@@ -294,6 +294,7 @@ curses+'perm_invent': since persistent inventory is narrow, strip off "a",
 NetHack Community Patches (or Variation) Included
 -------------------------------------------------
 add a couple of engraving suggestions in pull request #79
+chasonr's faster method to write characters to msdos VGA in pull request #220
 
 
 Code Cleanup and Reorganization