From 2a66ce54ad83f897ce8722fd1a16207459b037dd Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 13 Sep 2019 00:38:04 -0400 Subject: [PATCH] use faster method to write characters to VGA in msdos port 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/fixes36.3 b/doc/fixes36.3 index 734272ffa..f00cc3e29 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -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