home *** CD-ROM | disk | FTP | other *** search
/ Mega CD-ROM 1 / megacd_rom_1.zip / megacd_rom_1 / SCREEN / NNANS591.ZIP / NNANSI.DOC < prev    next >
Text File  |  1991-06-13  |  35KB  |  903 lines

  1.         NNANSI.SYS -- Enhanced MS-DOS ANSI Console Driver
  2.                       For EGA/VGA Displays
  3.  
  4. Note: MS-DOS is a trademark of Microsoft Corporation.
  5. PC/XT, PC/AT, and PS/2 are trademarks of IBM Corporation.
  6. 4DOS is a trademark of J.P. Software.
  7. MKS Toolkit is a trademark of Mortice Kern Systems Inc.
  8. PROCOMM is a trademark of Datastorm Technologies, Inc.
  9. Typing Tutor IV is a trademark of Kriya Systems, Inc.
  10. Manufacturers' names are the trademarks of their respective manufacturers.
  11. That should take care of everyone.
  12.  
  13. Documentation for version 5/91.
  14.  
  15. This version of NNANSI.SYS contains the following improvements
  16. over NNANSI version 8/90.
  17.  
  18. 1. DOS 4.0 and 5.0 COMMAND.COM now knows about NNANSI so that the CLS
  19.         command will work properly in modes other than 40/80 x 25.
  20.     The DOS 4.0 MODE command will now allow changing the number
  21.     of lines to 43 (EGA/VGA) or 50 (VGA), and MODE will also
  22.     display the current line/column settings. 
  23.  
  24. 2. The commands to set 43 and/or 50 line modes will not erase the
  25.     display if already in 43 or 50 line modes. You must be in
  26.     display modes 0-3 for these commands to work properly. This 
  27.         allows putting the ANSI sequence for 40/50 line modes in the 
  28.     prompt string to force these modes after running applications.
  29.  
  30. 3. When in 40 column mode, you can select 43 or 50 lines in the same
  31.         manner as when in 80 column mode.
  32.  
  33. 4. The syntax for the set and reset mode commands is tightened up.
  34.     The = and ? characters in these commands are now significant,
  35.     while in former versions they were ignored. If you are
  36.     upgrading, replace your old fast, slow, gcon, and gcoff
  37.         batch files with the new ones in this distribution.
  38.  
  39. 5. ANSI bios write_tty can now be enabled/disabled at runtime.
  40.     Default is now disabled.
  41.  
  42. 6. Default for fast mode and graphics cursor are now both false.
  43.  
  44. 7. Additional display drivers, including TSENG 4000 based cards. 
  45.     VESA support.
  46.  
  47. 8. NNANSI will now work in CGA systems, and will also work in MDA or
  48.     dual display (MDA and CGA/EGA/VGA) systems when reassembled
  49.     for MDA support.
  50.  
  51. 9. Code for SGR (set graphics rendition) has been improved, and is
  52.     now more accurate.
  53.  
  54. *********INTRODUCTION
  55.  
  56. NNANSI.SYS (version 5/91) is an improved version of NANSI.SYS
  57. (version 2.2), by Daniel Kegel, which is in turn such an
  58. improvement over ANSI.SYS that *no one* should be without one of
  59. these.
  60.  
  61. If you are using ANSI.SYS, be aware that either of these drivers
  62. will offer greatly improved performance and functionality over
  63. your current driver. Current users of NANSI.SYS with EGA or VGA
  64. displays (and other enhanced ANSI.SYS drivers) will notice still
  65. greater performance and functionality in NNANSI.SYS.
  66.  
  67. Even if you don't use an ANSI.SYS driver, you will achieve major 
  68. performance benefits. (Note that there will be no performance
  69. benefits for programs that write directly to the display).
  70.  
  71.  
  72. A short list of improvements of NANSI.SYS (version 3.0) over
  73. ANSI.SYS: 
  74.  
  75. 1. Intrinsic 43 or 50 line support (MS-DOS 4.0 now has this).
  76.  
  77. 2. Some additional text mode escape sequences: Insert Lines,
  78.         Delete Lines, Insert Characters, Delete Characters.
  79.  
  80. 3. Greater to *much* greater performance.
  81.  
  82. 4. Supports higher resolutions, both text and graphic modes.
  83.  
  84. 5. Graphic mode cursor
  85.  
  86.  
  87. A short list of improvements of NNANSI.SYS (version 5/91) over
  88. NANSI.SYS:
  89.  
  90. 1. Additional escape sequences: erase to start/end of display,
  91.         insert/delete lines in graphic modes, added Set Graphic
  92.         Rendition codes (and properly working reverse video,
  93.     underline, and invisible modes).
  94.  
  95. 2. Graphic cursor support is better, and can be disabled.
  96.  
  97. 3. Intrinsic support for both 43 and 50 line modes on a VGA. The
  98.     prompt command can be used to maintain 43 or 50 line display
  99.     modes. 
  100.  
  101. 4. Faster text mode performance; *much* faster scrolling
  102.         (when in "fast mode").
  103.  
  104. 5. Much faster performance in 640x350 to 800x600 16 color
  105.         graphic modes. Every ANSI control sequence (except
  106.         insert/delete characters and blink) work in these modes
  107.         as well.
  108.  
  109. 6. Readily configured for enhanced graphic and text modes of
  110.         various display cards. Support for several popular cards
  111.         are provided.
  112.  
  113. 7. Blink in 16 color graphics modes (up to 800x600) will exclusive-OR
  114.     characters.
  115.  
  116. 8. Support for MS-DOS V4.0 and later MODE commands, and properly
  117.     clears the display in enhanced modes using command.com's CLS.
  118.  
  119.  
  120. On the other hand, NANSI is smaller, and works with MDA as distributed.
  121.  
  122.  
  123.  
  124. **********************LICENSE REQUIREMENTS
  125.  
  126. Daniel Kegel is the author of NANSI.SYS, of which this is a
  127. derived work. I, Tom Almy, think enough of his efforts and
  128. programming skills that I used NANSI.SYS as a base for
  129. NNANSI.SYS (version 2.2 came with sources and free distribution
  130. for personal or educational use, but prohibits commercial use).
  131. I have an agreement with Mr.  Kegel to license NNANSI.SYS in
  132. accordance with his newest NANSI.SYS license arrangement:
  133.  
  134. "If you use this program for education or at home, you are
  135. encouraged to send a US$10 donation to the author.  If you use
  136. it for business purposes, you are required to purchase a
  137. right-to-use license by sending US$10 to the author."
  138.  
  139. Send contributions/user fees to:
  140.  
  141.         Daniel Kegel
  142.         221 Fairview Ave.
  143.         South Pasadena, CA  91030
  144.  
  145. You can also reach him at his internet address:
  146.  
  147. dank@moc.jpl.nasa.gov
  148.  
  149.  
  150. Everyone wins with this arrangement!
  151.  
  152. * Commercial users can now legally use NNANSI.SYS
  153.  
  154. * Personal users can show their gratitude.
  155.  
  156. * Daniel Kegel can make a little money for his efforts.
  157.  
  158. * I won't feel guilty for "ripping off" his work.
  159.  
  160.  
  161. I place no restrictions on my modifications to NANSI.SYS. I
  162. neither request nor will I accept any contributions for my work
  163. on this program. I made these modifications as part of an effort
  164. to understand the workings of DOS device drivers and the EGA/VGA
  165. display. 
  166.  
  167. On the other hand, I do like to hear from users, satisfied or
  168. (even) not satisfied. 
  169.  
  170. >>>>Please, if you have problems, check the PROBLEMS section of this
  171. document before contacting me. Greater than 90% of the problem
  172. reports I receive are answered in this section.<<<<
  173.  
  174. My address is:
  175.  
  176.         toma@sail.labs.tek.com        (Internet)
  177.  
  178. or
  179.  
  180.         Tom Almy
  181.         17830 SW Shasta Trail
  182.         Tualatin, OR 97062
  183.  
  184. if you must use the postal service. Enclose a stamped, self-
  185. addressed envelope if you desire a reply.
  186.  
  187.  
  188.  
  189. *********DISTRIBUTED FILES
  190.  
  191. The distribution has the following files:
  192.  
  193.         nnansi.sys      - Driver, with compilation options set as shown
  194.                         - in the file CONFIG.INC
  195.         nnansi.doc      - this file
  196.         gcon.bat        - turns graphic cursor on
  197.         gcoff.bat       - turns graphic cursor off
  198.         fast.bat        - turns fast mode on
  199.         slow.bat        - turns fast mode off
  200.     biosw.bat    - turns ANSI bios write_tty on
  201.     nobiosw.bat    - turns ANSI bios write_tty off
  202.     25.bat        - set 80x25 text mode
  203.     43.bat        - set 80x43 text mode
  204.     50.bat        - set 80x50 text mode (VGA only)
  205.  
  206.     dtest.exe    - Performance testing program for ANSI drivers
  207.     stat.com    - Print out information about display status
  208.  
  209.         makefile        - for Don Kneller's NDMAKE
  210.         nnansi.asm      - The source file
  211.     config.inc    - Configuration selections (part of source)
  212.     drivers.inc    - Display specific macros (part of source)
  213.  
  214.  
  215.  
  216. *********INSTALLATION
  217.  
  218. NNANSI.SYS installs just like ANSI.SYS (or NANSI.SYS), it is a
  219. device driver that you specify in your CONFIG.SYS file:
  220.  
  221.         DEVICE=NNANSI.SYS
  222.  
  223. If you are using code pages, place this command before the 
  224. DEVICE=DISPLAY.SYS command, otherwise code pages will not work.
  225.  
  226. For optimum performance, run fast.bat and biosw.bat, but if
  227. applications have trouble with either of these, you will have to
  228. revert back to slower operating modes (read section "FAST MODE").
  229.  
  230. While the supplied compiled driver is suitable for most
  231. installations, you can get better results by customizing the driver
  232. for your display card. To do this you will need an assembler, such as
  233. Borland Turbo Assembler, a text editor, and (optionally) Don
  234. Kneller's NDMAKE program. I understand that Borland's MAKE will also
  235. work.
  236.  
  237. Some people have asked why I don't have command line options for
  238. the driver or a separate configuring program but require the user to
  239. use an assembler. The reasons:
  240.  
  241. 1. These make the driver larger and possibly slower than it needs to be.
  242.    If you insist on a full-featured display driver try FANSI-CONSOLE.
  243. 2. I feel that users who are sophisticated enough to be able to utilize
  244.    NNANSI either have an assembler or have access to one. This is not
  245.    a program for novices.  
  246. 3. I'm lazy. I'm not interested. I've got other things to do (which pay).
  247.  
  248. All options are specified in the file CONFIG.INC. Edit that
  249. file and make changes as appropriate. These descriptions assume
  250. the initial default settings:
  251.  
  252. VGA     (TRUE)
  253.         If you have an EGA display, set this to FALSE. You might
  254.         also want to set this to FALSE if you have a VGA and are
  255.         used to the ESC [=43h sequence supplying 50 line mode.
  256.  
  257. EGA     (TRUE)
  258.         If you have a VGA, set this to FALSE.
  259.  
  260. VESA    (FALSE)
  261.     Set TRUE if you have a VESA compatible display card BIOS.
  262.     You will also need to have a particular display specified
  263.     for best results. VESA has been successfully tested with
  264.     a Diamond Speedstar card (TSENG4000 set TRUE) and using
  265.     Diamond's VESA BIOS extension. Best results should be
  266.     obtainable for systems having a built-in VESA BIOS (do any
  267.     exist???).
  268.  
  269. VEGA, PARADISE, STBVGA...  (all FALSE)
  270.         Set only one of these TRUE to match your enhanced
  271.         EGA/VGA display card. If you have a card not on the list
  272.         and experience problems with either blotches in enhanced
  273.         text mode or poor performance (unsettable background
  274.         colors is a clue) in graphics modes CONTACT THE AUTHOR.
  275.  
  276. MONO    (FALSE)
  277.     Must be TRUE if you have a Monochrome Display Adapter (MDA)
  278.     or Hercules card either as your sole display or in addition
  279.     to a color display controller. If you don't, leave this FALSE
  280.     as it both hurts performance and enlarges the driver.
  281.  
  282. cheap_pc (TRUE)
  283.         Set to FALSE for "PC/AT" and "PS/2" class machines which
  284.     have 80186 or greater processors.
  285.  
  286. key_redef (FALSE)
  287.         Set to TRUE if you use key redefinition. There are
  288.         Trojan Horse programs that take advantage of this
  289.         feature, and most people don't use it anyway, so the
  290.         default is FALSE.
  291.  
  292. init_buffer_size (256)
  293.         Enlarge if you use key redefinition and don't have
  294.         enough room.
  295.  
  296. quick_char (TRUE)
  297.         Faster graphics display in 16 color modes, at cost of
  298.     much extra code since this involves added display
  299.     routines. Must be TRUE if gbackground is also TRUE.
  300.  
  301. fast29  (TRUE)
  302.         Makes int29 display calls (used by DOS) 15% faster at a
  303.         cost of about 100 bytes.
  304.  
  305. bios_write_tty (TRUE)
  306.         The write tty BIOS call is taken over. It will now
  307.         perform faster and understand ANSI escape sequences. This
  308.     latter feature can be a mixed blessing. This feature can be
  309.     disabled at runtime if it is assembled in.
  310.  
  311. gbackground (TRUE)
  312.         Enables setting of non-black background color in 16 color
  313.     graphic modes (640x350 to 800x600 resolutions). If set to
  314.     TRUE, quick_char must also be set to TRUE. If this feature is
  315.     not desired, it is possible (depending on the system) to get
  316.     greater performance by defining both gbackground and
  317.     quick_char FALSE. This will also save quite a bit of
  318.     code. Experiment and see for yourself.
  319.  
  320. dos4 (TRUE)
  321.         Under MS/PC DOS version 4.0 (and 5.0) allows command.com and
  322.     mode.com to recognize NNANSI as an ANSI driver. If you are
  323.     using older DOS versions, you can define this to be FALSE.
  324.  
  325. initgc  (FALSE)
  326.         Graphic mode cursor is initially off. You can turn it on/off
  327.     with a control sequence.
  328.  
  329. initfast (FALSE)
  330.         Fast scroll mode is initially off. This also means that
  331.         multiple page support is initially on. You can turn it on/off
  332.     with a control sequence, and there are other work-arounds as
  333.     well.
  334.  
  335. initbiosw (FALSE)
  336.     ANSI bios write_tty is initially off. You can turn it on/off
  337.     with a control sequence.
  338.  
  339.  
  340. You can then either use the supplied makefile to generate a new
  341. nnansi.sys or assemble manually as shown (Borland tools
  342. illustrated): 
  343.  
  344. tasm /m5 nnansi                 (Use /m5 for version 2.0 or later)
  345. tlink nnansi,nnansi.sys/m/t
  346.  
  347. With the Microsoft assembler, you will need to make some changes to
  348. the source to avoid the branch out of range errors, and you will need
  349. to use the exe2bin program to convert the linker generated exe file
  350. into a binary image file, which you then have to rename to
  351. NNANSI.SYS.
  352.  
  353.  
  354. **************HOW MUCH PERFORMANCE IMPROVEMENT IS THERE?
  355.  
  356. I have performed considerable testing on an EVEREX 25Mhz 80386
  357. machine with a Video 7 (Headland) Fastwrite VGA display controller
  358. (and its BIOS), under both DOS 3.3 and 4.0. Your results will
  359. probably vary, and BIOS performance without NNANSI.SYS will also
  360. improve if the EGA/VGA BIOS is copied to RAM as supported by some
  361. vendors and also possible with QEMM or 386/MAX on 80386 based systems.
  362.  
  363. Performance is proportional to roughly independent factors, writing
  364. speed and scrolling speed. Writing speed is the rate at which
  365. characters can be drawn on the display without the display scrolling.
  366. Scrolling speed is the rate at which the display can scroll (no
  367. new characters are drawn). Writing speed tends to be independent of
  368. display mode (except graphic modes are slower), while scrolling speed
  369. tends to be proportional to the number of character positions on the
  370. display (except for NNANSI fast mode, which is independent of screen
  371. size). 
  372.  
  373. When using ANSI.SYS rather than no driver at all, there is roughly a
  374. 2.3x degradation in performance for writing. Scrolling performance
  375. improves 44% when DOS 4.0 ANSI driver is used, but remains unchanged
  376. with the DOS 3.3 driver.
  377.  
  378. Compared to no driver, NANSI.SYS (3.0) is 3x to 3.5x faster for
  379. writing, and is roughly 45x faster when writing using DOS in RAW
  380. mode. It is roughly 2x faster scrolling.
  381.  
  382. Compared to the no driver or other ANSI drivers, NNANSI.SYS is 4x
  383. faster in BIOS TTY write calls. 
  384.  
  385. Compared to NANSI.SYS it is 2x faster in INT29 calls, 73% faster in
  386. DOS write calls, but there is no speedup in RAW mode. When fast mode
  387. is used, scrolling is 15x to 25x faster.
  388.  
  389. This means that text mode programs that take advantage of RAW
  390. mode and buffering can display 100 times faster with NNANSI (and
  391. without scrolling, NANSI) over ANSI.SYS. It works out to about
  392. 420,000 characters per second with my fast machine.
  393.  
  394. NNANSI.SYS also has speedups for 16 color graphic modes with
  395. resolutions between 640x350 and 800x600. With the graphic cursor
  396. turned on, the TTY BIOS call is about 10% slower than the standard
  397. BIOS call (which doesn't display a cursor), but other output calls
  398. are 2.5x to 3.5x faster than that of NANSI.SYS. Turning the graphics
  399. cursor off roughly doubles the writing speed of all modes but RAW.
  400.  
  401.  
  402.  
  403. **************FAST MODE  **READ THIS!!**
  404.  
  405. To get maximum speed, NNANSI has what I call Fast Mode. In text
  406. mode, there is more display memory than there are character on
  407. the display. Normally, the BIOS supports display "pages" that you
  408. can switch among. Changing the display page changes the region
  409. of the display memory that is sent to the display. Fast Mode
  410. uses the same technique (changing the starting location of the
  411. viewable memory region) to scroll the display upwards. 
  412.  
  413. Programs that make use of multiple display pages and scroll the
  414. display require that fast mode be turned off. Many debugging programs
  415. use two pages to maintain separate debugging and application
  416. displays. Some of the programs will still work in fast mode if they
  417. have a "swap screens" option ("-ds" for Borland Turbo Debugger, for
  418. instance).
  419.  
  420. A number of programs that directly access the display don't work if
  421. starting address has changed. These programs may not work properly in
  422. fast mode (or for that matter in display pages other than the first).
  423. NNANSI.SYS tries its best to work with these programs by resetting
  424. the display start location if any program does the "get display mode"
  425. or "scroll/clear display" BIOS calls. These calls are typically done
  426. by potentially offending applications when they start. As long as the
  427. display never scrolls under NNANSI.SYS control everything will work
  428. fine. A typical problem occurs in programs that have DOS or "shell
  429. escape" commands. If the DOS sub-shell (invocation of COMMAND.COM)
  430. causes the display to scroll, then upon exiting the sub-shell the
  431. display will be ruined. The solution to this problem (other than not
  432. using fast mode) is to clear the screen just before exiting the
  433. sub-shell.
  434.  
  435. Please note that Windows 3.0 in Enhanced Mode has problems with DOS
  436. applications running in a window using NNANSI's fast mode. You will
  437. need to run Windows with NNANSI in slow mode.
  438.  
  439. Some offending programs can be "fixed" by invoking them from a
  440. batch file (or alias if you use MKS Toolkit, 4DOS, ANARKEY...)
  441. which first clears the screen. Or you can use a batch file which
  442. turns off fast mode, then turn fast mode back on again after
  443. program execution. Example:
  444.  
  445. echo ^[[=98l
  446. offendingpgm %1 %2 %3 %4 %5
  447. echo ^[[=98h
  448.  
  449. Where "^[" is the escape (code 27) character.
  450.  
  451. Batch programs have been provided to enable (fast.bat) and disable
  452. (slow.bat) fast mode.
  453.  
  454.  
  455. NNANSI.SYS can also speed up programs that use BIOS calls for writing
  456. characters. NNANSI.SYS adds the ANSI features to such calls, which
  457. can cause problems with some applications. This feature is turned off
  458. by default, but can be enabled via an ANSI sequence or by executing
  459. the supplied batch file biosw.bat. The feature can be disabled with
  460. nobiosw.bat.
  461.  
  462.  
  463. ******************WRITING PROGRAMS FOR BEST PERFORMANCE
  464.  
  465.  
  466. To get best performance in programs you write, you must put the
  467. display in RAW mode, and buffer output.
  468.  
  469. In assembler, you can set raw mode with the following sequence
  470. (adapt this for other languages):
  471.  
  472.         mov     ax,4400h        ; get device status
  473.         mov     bx, 1           ; of device 1 (standard output)
  474.         int     21h
  475.         xor     dh, dh          ; clear upper byte
  476.         mov     saved_state, dx ; save it for later
  477.         mov     ax, 4401h       ; set new status
  478.         or      dl, 20h         ; with raw bit set
  479.         int     21h
  480.  
  481. Reset raw mode before terminating the application:
  482.  
  483.         mov     ax, 4401h       ; set status to original values
  484.         mov     bx, 1
  485.         mov     dx, saved_state
  486.         int     21h
  487.  
  488. There is a fixed amount of overhead (and it is high) for each
  489. DOS call. Therefore you should buffer up write requests into a
  490. single call. With the C language, you can use the setvbuf() call
  491. to set a large buffer size.
  492.  
  493. Even if you don't follow this advice, you will get a major
  494. performance improvement over ANSI.SYS (or no device driver at
  495. all). 
  496.  
  497. Programs using RAW mode and buffering easily beat the
  498. performance of the supposedly high speed console drivers
  499. supplied in Turbo C and Microsoft C. And by using ANSI control
  500. sequences your programs can be made portable to other systems!
  501.  
  502.  
  503. *****************TYPICAL PROBLEMS
  504.  
  505.  
  506. ALSO READ THE SECTION "FAST MODE"
  507.  
  508.  
  509. SYSTEM CRASHES UPON BOOTING, OR DISPLAY BADLY CORRUPTED EVEN IN
  510. STANDARD 80x25 TEXT MODE.
  511.  
  512. You have assembled NNANSI.SYS with cheap_pc set to FALSE on an 8088
  513. based system, or you are trying to use NNANSI.SYS on an MDA or
  514. Hercules Graphics equipped system without reassembling with MONO
  515. equal TRUE.
  516.  
  517.  
  518. ON A VGA, SETTING 43 LINE MODE GIVES 43 LINES, WHEN IT GAVE 50
  519. WITH AN OLDER VERSION OF NNANSI.SYS OR WITH NANSI.SYS
  520.  
  521. This is correct. There is now a new setting for 50 line mode. If
  522. you require that 43 line mode give 50 lines, recompile the
  523. system with VGA set to FALSE.
  524.  
  525.  
  526. I USED AN EARLIER VERSION OF NNANSI, AND NOW I FIND THAT NNANSI IS
  527. MUCH SLOWER THAN BEFORE
  528.  
  529. The defaults have changed. You now have to run FAST and BIOSW for
  530. fastest operation.
  531.  
  532.  
  533. I USED AN EARLIER VERSION OF NNANSI, AND NOW FIND MY DISPLAY 
  534. INEXPLICABLY CHANGING MODES
  535.  
  536. The commands for graphic cursor, fast mode, and line wrap are 
  537. more restrictive. Use the new batch files for fast, slow, gcon, and
  538. gcoff, and change any code of your own appropriately.
  539.  
  540.  
  541. ON A VGA, SETTING 50 LINE MODE CAUSES VERY STRANGE BEHAVIOR
  542.  
  543. Two possibilities. Your display adapter is really an EGA, or you
  544. have compiled NNANSI.SYS with VGA set to FALSE. In the latter
  545. case, you can get 50 line mode by setting 43 line mode, while in
  546. the former case you can't get 50 line mode at all.
  547.  
  548.  
  549. ON A VGA, AFTER LEAVING 43/50 LINE MODE THE CURSOR IS IN THE
  550. MIDDLE OF THE CHARACTER BLOCK
  551.  
  552. Recompile the driver with EGA set to FALSE.
  553.  
  554.  
  555. ON AN EGA, THE CURSOR DISAPPEARS IN 43 LINE MODE WHEN RUNNING
  556. SOME APPLICATIONS
  557.  
  558. There is nothing you can do, as this is caused by an error in
  559. the design of the EGA BIOS.
  560.  
  561.  
  562. IN 43/50 LINE MODE, THE DOS CLS COMMAND ONLY CLEARS THE FIRST 25
  563. LINES OF THE DISPLAY (DOS 4.0)
  564.  
  565. Reassemble with "dos4 EQU TRUE", as it is in the distribution NNANSI
  566. driver.
  567.  
  568.  
  569. DISPLAY SHOWS UGLY BLOCKS AT THE START AND END OF EACH LINE OR
  570. PERFORMANCE SLOWS GREATLY IN EXTENDED (GREATER THAN 80X25) TEXT MODES 
  571.  
  572. Your display controller sets the display mode byte in the BIOS to
  573. some value other than "3". You can either set the byte (at location
  574. 40:49h) back to 3 after setting the display mode, or configure
  575. NNANSI.SYS to know about these special modes. This problem is typical
  576. for most cards, it seems. There may already be a proper configuration
  577. for your display in CONFIG.INC. 
  578.  
  579.  
  580. DISPLAY IS NOTICEABLY SLOWER WRITING OR CANNOT SWITCH BACKGROUND
  581. COLORS IN EXTENDED (GREATER THAN 640x480, OR 640x350 EGA)
  582. GRAPHIC MODES
  583.  
  584. In 256 color modes or 1024x768 modes, the background color cannot be
  585. changed. In other modes, you will need to configure NNANSI.SYS for
  586. your display card.  Look for a proper configuration in CONFIG.INC.
  587.  
  588.  
  589. DISPLAY GOES BLANK WHEN STARTING AN APPLICATION. DISPLAY SHIFTED
  590. PARTLY OFF SCREEN WHEN STARTING AN APPLICATION. DISPLAY
  591. DISAPPEARS DURING EXECUTION OF A APPLICATION.
  592.  
  593. First try clearing the screen before execution. If that doesn't
  594. work, leave fast mode (see preceding section on FAST MODE).
  595.  
  596.  
  597. FUNNY BLOTCHES OCCASIONALLY APPEAR AT VARIOUS POINTS IN A
  598. GRAPHIC APPLICATION
  599.  
  600. This is the graphics cursor. You can disable it either by
  601. reconfiguring the driver, or by sending the control sequence to
  602. disable the graphics cursor. A batch file, GCOFF.BAT, has been 
  603. provided for this purpose.
  604.  
  605.  
  606. TEXT DISPLAY IS MESSED UP, POSSIBLY CHANGING COLORS IN UNUSUAL
  607. PLACES. 
  608.  
  609. This has been observed with programs using the BIOS for writing
  610. to the display, and not expecting the ANSI translation (or the
  611. conversion of the TAB character into spaces instead of a special
  612. graphic). Execute NOBIOSW.BAT to turn the ANSI translation off
  613. for these programs.  PROCOMM and Typing Tutor IV have this problem.
  614.  
  615.  
  616. CANNOT SET VESA STANDARD EXTENDED DISPLAY MODES
  617.  
  618. You must compile the driver with VESA defined as TRUE, and then
  619. must request a mode 128 less than that really desired.
  620.  
  621.  
  622. *****************NNANSI COMMAND SEQUENCES
  623.  
  624. Command sequences start with the escape character (code 27,
  625. referred to in this section as ESC). NNANSI buffers up the
  626. sequence until it has a command to execute. If the sequence is
  627. not a valid command, the entire sequence is passed to the display.
  628.  
  629. All command sequences have the following format:
  630.  
  631.    ESC [ param1; param2; ...; paramN cmdchar
  632.  
  633. where
  634.        ESC     is the escape character
  635.        [       is the left bracket character.
  636.        param   are ascii decimal numbers or quoted strings.
  637.        cmdchar is the command character
  638.  
  639. No spaces are allowed within the command.
  640.  
  641. Omitted parameters default to "1", with the exception of the ED
  642. (erase in display) command. For example, both ESC[1;1H and ESC[H
  643. send the cursor to the home position (1,1), which is the upper
  644. left.
  645.  
  646. Quoted strings may use either single or double quote characters
  647. as delimiters. Each character inside the quoted string is
  648. converted to a numeric parameter. Quoted strings are only useful
  649. for the questionable Keyboard Key Reassignment command.
  650.  
  651.  
  652.  
  653.                    CURSOR POSITIONING COMMANDS
  654.  
  655. NAME    DESCRIPTION             COMMAND
  656. CUP     cursor position         ESC[y;xH
  657. HVP     cursor position         ESC[y;xf
  658.  
  659.         Either of these set the cursor position. CUP should be
  660.         used since HVP has other connotations not implemented in
  661.         NNANSI.SYS (or ANSI.SYS). The origin (in the upper left
  662.         corner) is x=1, y=1.
  663.  
  664. CUU     cursor up               ESC[nA
  665. CUD     cursor down             ESC[nB
  666.         n = # of lines to move. You cannot move beyond the edge
  667.         of the display.
  668.  
  669. CUF     cursor forward          ESC[nC
  670. CUB     cursor backward         ESC[nD
  671.         n = # of columns to move. You cannot move beyond the
  672.         edge of the display.
  673.  
  674. DSR     Device Status Report    ESC[6n
  675.         Find out cursor position. The driver responds with a
  676.         cursor position report (CPR) of the form "ESC[y;xR"
  677.         followed by a carriage return, as if typed at the
  678.         keyboard. 
  679.  
  680. SCP     Save Cursor Position    ESC[s
  681. RCP     Restore Cursor Position ESC[u
  682.         Cannot be nested.
  683.  
  684.  
  685.  
  686.  
  687.                         EDITING COMMANDS
  688.  
  689. NAME    DESCRIPTION             COMMAND
  690. ED      Erase in Display        ESC[nJ
  691.         n=0 or missing: Erase to end of screen (not in ANSI.SYS)
  692.         n=1: erase to start of screen (not in ANSI.SYS)
  693.         n=2: erase entire screen, and home cursor
  694.         Note: there is a bug in ANSI.SYS that performs function
  695.         2 regardless of the value of n. This bug is not repeated
  696.         in NNANSI.SYS because of the extra functionality provided.
  697.     Everybody's "ANSI.SYS" homes the cursor, which the standard
  698.     does not call for, and NNANSI keeps up that tradition.
  699.  
  700. EL      Erase in Line           ESC[K
  701.         Erases from cursor to end of line
  702.  
  703. IL      Insert Lines            ESC[nL 
  704.         Inserts n blank lines at the line containing the cursor.
  705.         While the cursor line moves down, the cursor position is
  706.         unchanged. Not in ANSI.SYS. 
  707.  
  708. DL      Delete Lines            ESC[nM  
  709.         Deletes n lines, starting at the line containing the
  710.         cursor. The cursor is not moved. Not in ANSI.SYS
  711.         
  712. ICH     Insert Characters       ESC[n@  
  713.         Inserts n blank characters at cursor position. The
  714.         cursor does not move. Not in ANSI.SYS. Does not work in
  715.         graphic modes.
  716.  
  717. DCH     Delete Characters       ESC[nP  
  718.         Deletes n characters at the cursor. The cursor does not
  719.         move. Not in ANSI.SYS. Does not work in graphic modes.
  720.  
  721.  
  722.  
  723.  
  724.                   SET GRAPHIC RENDITION COMMAND
  725.  
  726. NAME    DESCRIPTION             COMMAND
  727. SGR     Set Graphics Rendition  ESC[n;n;...nm
  728.  
  729. The Set Graphics Rendition command is used to select foreground
  730. and background colors or attributes.  When you use multiple
  731. parameters, they are executed in sequence, and the effects are
  732. cumulative.  You can set all colors and attributes in any text
  733. mode.  In 16 color graphic modes between 640x350 and 800x600
  734. pixels you can set all colors and attributes except for blink.
  735. "Blink" becomes exclusive-OR character mode (very useful!).  You
  736. can set foreground colors, blink, and bold, only, in other 16 color
  737. modes.  Setting colors does not work correctly for other color
  738. modes -- make sure display is in the normal white on black mode
  739. before changing to these modes.
  740.  
  741. When a Monochrome Display Adapter (MDA) is used, foreground and
  742. background colors other than black and white should not be set. The
  743. MDA also ignores the underscore and bold attributes while in reverse
  744. video.
  745.  
  746.  
  747. Code          Value
  748. 0               All attributes off (normal white on black)
  749. 1               Bold
  750. 2               Dim (not Bold)
  751. 4               Underscore (emulated via blue foreground in CGA/EGA/VGA)
  752. 5               Blink (or EXOR -- see above)
  753. 7               Reverse Video (improved implementation over ANSI)
  754. 8               Invisible (improved operation -- foreground color
  755.         forced to background color, other attributes suppressed)
  756. 22              Cancel Bold
  757. 24              Cancel Underline (white foreground)
  758. 25              Cancel Blink
  759. 27              Cancel Reverse video
  760. 28        Cancel Invisible
  761. 30-37           foreground black/red/green/yellow/blue/magenta/cyan/white
  762. 40-47           background black/red/green/yellow/blue/magenta/cyan/white
  763.  
  764. Codes 2, 22, 24, 25, 27, and 28 are not in ANSI.SYS.
  765.  
  766.  
  767.  
  768.                     SET DISPLAY MODE COMMAND
  769.  
  770. NAME    DESCRIPTION             COMMAND
  771. SM      Set Mode                ESC[=nh
  772. RM      Reset Mode              ESC[=nl
  773.  
  774. The set and reset mode commands are identical in this context.
  775.  
  776. The BIOS supports many video modes. The code given for the AL
  777. register to the BIOS set mode command is used as the parameter to
  778. this set mode command. That means that extended modes that are
  779. settable in this manner can use this command. As an example, with the
  780. Diamond Speedstar, the command ESC[=34h will set 132 column by 44 row
  781. mode. Display cards that use other techniques to change display mode
  782. are left as an exercise to the user, but if you can get the card into
  783. an extended mode, NNANSI can used it (possibly with a configuration
  784. change, though).
  785.  
  786. VESA Display Cards: To set VESA modes, select a mode 128 less than the
  787. desired mode number. For instance, for 132x43 text mode, select mode
  788. 138 (rather than 266). 
  789.  
  790. Monochrome Display Adapter (MDA): These commands are ignored when the
  791. MDA is in use.
  792.  
  793. In the graphic modes, the cursor can be simulated with a blob
  794. (the character produced with character code 22).
  795.  
  796. Mode Code       Value
  797.     0,1         text 40x25 16 color
  798.     2,3         text 80x25 16 color
  799.     4,5         graphics 320x200 4 color
  800.     6           graphics 640x200 Black & White
  801.     7        cursor wrap (see SET DISPLAY ATTRIBUTES, below)
  802.     13          graphics 320x200 16 color, VGA only
  803.     14          graphics 640x200 16 color, VGA only
  804.     16          graphics 640x350 16 color, VGA only
  805.     17          graphics 640x480 Black & White, VGA only
  806.     18          graphics 640x480 16 color, VGA only
  807.     19          graphics 300x200 256 color, VGA only
  808.     43          43 line mode for modes 0-3 (Not in ANSI.SYS)
  809.     50          50 line mode for modes 0-3 (VGA only, not in
  810.                 ANSI.SYS)
  811.     n           When not in above list, sets mode n. (Not in
  812.                 ANSI.SYS) 
  813.  
  814.  
  815. The modes marked as VGA only are not supported by ANSI.SYS
  816. that comes with version 3.3 MS-DOS or earlier.
  817.  
  818. The 43 line and 50 line support reprograms the display to use smaller
  819. characters. You must be in mode 3 (80x25) or 1 (40x25) for this
  820. command to work. Set any other mode to leave 43/50 line mode.
  821.  
  822. Unlike earlier versions of NNANSI.SYS, and NANSI.SYS, setting 43 line
  823. mode on a VGA will give 43 (not 50) lines. You must use the explicit
  824. 50 line mode command to get 50 lines on a VGA. If you would rather
  825. have compatibility with these other, earlier drivers, recompile the
  826. driver with VGA set to FALSE.
  827.  
  828. You can have 43 line mode automatically selected at the DOS
  829. prompt by issuing this command:
  830.  
  831.     prompt $e[=43h$p$g
  832.  
  833. Under MS/PC DOS Version 4.0 (or later?), the number of lines can
  834. also be set using the MODE command. For instance, to set 43 line mode
  835. under DOS 4.0, issue the command:
  836.  
  837.     mode con lines=43
  838.  
  839.  
  840. Note that in older versions of NNANSI.SYS, and NANSI.SYS, the use of
  841. the = character in the command was optional, and a ? could be used
  842. instead. That is not true for this version.
  843.  
  844.  
  845.                      SET DISPLAY ATTRIBUTES
  846.  
  847. NAME    DESCRIPTION             COMMAND
  848. SM      Set Mode                ESC[?nh
  849. RM      Reset Mode              ESC[?nl
  850.  
  851. Valid attributes that can be set and reset:
  852.  
  853. 7       Cursor Wrap     When false, cursor sticks at end of
  854.                         line, rather than wrapping
  855.  
  856. 97    ANSI Bios    When true, calls of the bios write_tty
  857.                         function will be processed by NNANSI.SYS,
  858.             allowing processing of ANSI escape sequences.
  859.             When false, processing will not occur. Some
  860.             programs will not work properly if set to true.
  861.  
  862. 98      Fast Scroll     When true (fast mode) the starting
  863.                         display location is changed for fast
  864.                         scrolling, which can cause problems for
  865.                         some programs. When false, the starting
  866.                         location does not change and the
  867.                         multi-page support is enabled.
  868.  
  869. 99      Graphic cursor  When true the cursor is displayed in
  870.                         graphic modes. Some programs produce ghost
  871.             cursors when set to true.
  872.  
  873. Batch files are supplied to change attributes 97, 98, and 99.
  874.  
  875. Note that the Fast Scroll attribute does not apply to the Monochrome
  876. Display Adapter (MDA). Also note that in older versions of
  877. NNANSI.SYS, and NANSI.SYS, the use of the ? character in the command
  878. was optional, and an = could be used instead. That is not true for
  879. this version. Because some Microsoft documentation claims that the
  880. = character can be used for Cursor Wrap, NNANSI still supports that
  881. bug.
  882.  
  883.  
  884.  
  885.                   KEYBOARD REASSIGNMENT COMMAND
  886.  
  887. This command is absent by default. You must recompile to enable
  888. this command. Use of this feature is not recommended.
  889.         
  890. NAME    DESCRIPTION             COMMAND
  891. IBMKKR  Keyboard Key Reassign   ESC[param;param;...;param p
  892.  
  893. If no parameters are given, all keys are reset. This is not true
  894. for ANSI.SYS.
  895.  
  896. The first parameter is the key to reassign. IBM function keys
  897. take the first two parameters, where the first parameter is 0.
  898. The remaining parameters are the keystrokes to substitute. F11
  899. and F12 are not supported. Normally a string is used rather than
  900. numeric arguments.
  901.  
  902. ******************************THE END****************************
  903.