home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / assemblr / library / ansi / nnansi / nnansi.doc < prev    next >
Text File  |  1990-10-12  |  27KB  |  719 lines

  1.         NNANSI.SYS -- Enhanced MS-DOS ANSI Console Driver
  2.                       For EGA/VGA Displays
  3.  
  4. Documentation for version 8/90.
  5.  
  6. Note: MS-DOS is a trademark of Microsoft Corporation, and PC/XT,
  7. PC/AT, and PS/2 are trademarks of IBM Corporation.
  8.  
  9.  
  10. *********INTRODUCTION
  11.  
  12. NNANSI.SYS (version 8/90) is an improved version of NANSI.SYS
  13. (version 2.2), by Daniel Kegel, which is in turn such an
  14. improvement over ANSI.SYS that *no one* should be without one of
  15. these.
  16.  
  17. If you are using ANSI.SYS, be aware that either of these drivers
  18. will offer greatly improved performance and functionality over
  19. your current driver. Current users of NANSI.SYS with EGA or VGA
  20. displays (and other enhanced ANSI.SYS drivers) will notice still
  21. greater performance and functionality in NNANSI.SYS.
  22.  
  23. Even if you don't use an ANSI.SYS driver, you will the
  24. performance benefits. (Note that there will be no performance
  25. benefits for programs that write directly to the display).
  26.  
  27.  
  28. A short list of improvements of NANSI.SYS (version 3.0) over
  29. ANSI.SYS: 
  30.  
  31. 1. Intrinsic 43 or 50 line support.
  32.  
  33. 2. Some additional text mode escape sequences: Insert Lines,
  34.         Delete Lines, Insert Characters, Delete Characters.
  35.  
  36. 3. Greater to *much* greater performance.
  37.  
  38. 4. Supports higher resolutions, both text and graphic modes.
  39.  
  40. 5. Graphic mode cursor
  41.  
  42.  
  43. A short list of improvements of NNANSI.SYS (version 8/90) over
  44. NANSI.SYS:
  45.  
  46. 1. Additional escape sequences: erase to start/end of display,
  47.         insert/delete lines in graphic modes, added Set Graphic
  48.         Rendition codes (and working reverse video).
  49.  
  50. 2. Graphic cursor support is better, and can be disabled.
  51.  
  52. 3. Intrinsic support for both 43 and 50 line modes on a VGA.
  53.  
  54. 4. Faster text mode performance; *much* faster scrolling
  55.         (when in "fast mode").
  56.  
  57. 5. Much faster performance in 640x350 (or greater) 16 color
  58.         graphic modes. Every ANSI control sequence (except
  59.         insert/delete characters and blink) work in these modes
  60.         as well.
  61.  
  62. 6. Readily configured for enhanced graphic and text modes of
  63.         various display cards. Support for several popular cards
  64.         are provided.
  65.  
  66. 7. Blink in 16 color graphics modes will exclusive-OR characters.
  67.  
  68.  
  69. On the other hand, NANSI works with CGA, MDA, or Hercules
  70. displays, and is smaller.
  71.  
  72.  
  73. **********************LICENSE REQUIREMENTS
  74.  
  75. Daniel Kegel is the author of NANSI.SYS, of which this is a
  76. derived work. I, Tom Almy, think enough of his efforts and
  77. programming skills that I used NANSI.SYS as a base for
  78. NNANSI.SYS (version 2.2 came with sources and free distribution
  79. for personal or educational use, but prohibits commercial use).
  80. I have an agreement with Mr.  Kegel to license NNANSI.SYS in
  81. accordance with his newest NANSI.SYS license arrangement:
  82.  
  83. "If you use this program for education or at home, you are
  84. encouraged to send a US$10 donation to the author.  If you use
  85. it for business purposes, you are required to purchase a
  86. right-to-use license by sending US$10 to the author."
  87.  
  88. Send contributions/user fees to:
  89.  
  90.         Daniel Kegel
  91.         221 Fairview Ave.
  92.         South Pasadena, CA  91030
  93.  
  94. You can also reach him at his internet address:
  95.  
  96. dank@moc.jpl.nasa.gov
  97.  
  98.  
  99. Everyone wins with this arrangement!
  100.  
  101. * Commercial users can now legally use NNANSI.SYS
  102.  
  103. * Personal users can show their gratitude.
  104.  
  105. * Daniel Kegel can make a little money for his efforts.
  106.  
  107. * I won't feel guilty for "ripping off" his work.
  108.  
  109.  
  110. I place no restrictions on my modifications to NANSI.SYS. I
  111. neither request nor will I accept any contributions for my work
  112. on this program. I made these modifications as part of an effort
  113. to understand the workings of DOS device drivers and the EGA/VGA
  114. display. 
  115.  
  116. On the other hand, I do like to hear from users, satisfied or
  117. (even) not satisfied. Please, if you have problems, check the
  118. PROBLEMS section of this document before contacting me.
  119.  
  120. My address is:
  121.  
  122.         toma@tekgvs.labs.tek.com        (Internet)
  123.  
  124. or
  125.  
  126.         Tom Almy
  127.         17830 SW Shasta Trail
  128.         Tualatin, OR 97062
  129.  
  130. if you must use the postal service. Enclose a stamped, self-
  131. addressed envelope if you desire a reply.
  132.  
  133.  
  134.  
  135. *********DISTRIBUTED FILES
  136.  
  137. The distribution has the following files:
  138.  
  139.         nnansi.sys      - Driver, with compilation options set as shown
  140.                         - in the source file nnansi_d.asm
  141.         gcon.bat        - turns graphic cursor on
  142.         gcoff.bat       - turns graphic cursor off
  143.         fast.bat        - turns fast mode on
  144.         slow.bat        - turns fast mode off
  145.     25.bat        - set 80x25 text mode
  146.     43.bat        - set 80x43 text mode
  147.     50.bat        - set 80x50 text mode (VGA only)
  148.         nnansi.doc      - this file
  149.         makefile        - for Don Kneller's NDMAKE
  150.         nnansi_d.asm    - definitions **** READ THIS ****
  151.         nnansi.asm      - device driver guts
  152.         nnansi_p.asm    - ANSI parameter grabber
  153.         nnansi_f.asm    - ANSI function handlers
  154.         nnansi_i.asm    - device driver init routine (must link last)
  155.  
  156.  
  157. *********INSTALLATION
  158.  
  159. NNANSI.SYS installs just like ANSI.SYS (or NANSI.SYS), it is a
  160. device driver that you specify in your CONFIG.SYS file:
  161.  
  162.         DEVICE=NNANSI.SYS
  163.  
  164. If you are using code pages, place this command before the 
  165. DEVICE=DISPLAY.SYS command, otherwise code pages will not work.
  166.  
  167. While the supplied compiled driver is suitable for most
  168. installations, you can get better results by customizing the
  169. driver for your display card. To do this you will need an
  170. assembler, such as Borland Turbo Assembler, a text editor, and
  171. (optionally) Don Kneller's NDMAKE program.
  172.  
  173. All options are specified in the file NNANSI_D.ASM. Edit that
  174. file and make changes as appropriate. These descriptions assume
  175. the initial default settings:
  176.  
  177. VGA     (TRUE)
  178.         If you have an EGA display, set this to FALSE. You might
  179.         also want to set this to FALSE if you have a VGA and are
  180.         used to the ESC [=43h sequence supplying 50 line mode.
  181.  
  182. EGA     (TRUE)
  183.         If you have a VGA, set this to FALSE.
  184.  
  185. VEGA, PARADISE, STBVGA...  (all FALSE)
  186.         Set only one of these TRUE to match your enhanced
  187.         EGA/VGA display card. If you have a card not on the list
  188.         and experience problems with either blotches in enhanced
  189.         text mode or poor performance (unsettable background
  190.         colors is a clue) in graphics modes CONTACT THE AUTHOR.
  191.  
  192. cheap_pc (TRUE)
  193.         Set to FALSE for "PC/AT" and "PS/2" class machines which
  194.     have 80186 or greater processors.
  195.  
  196. key_redef (FALSE)
  197.         Set to TRUE if you use key redefinition. There are
  198.         Trojan Horse programs that take advantage of this
  199.         feature, and most people don't use it anyway, so the
  200.         default is FALSE.
  201.  
  202. init_buffer_size (256)
  203.         Enlarge if you use key redefinition and don't have
  204.         enough room.
  205.  
  206. quick_char (TRUE)
  207.         Faster graphics display in 16 color modes, at cost of
  208.     much extra code since this involves added display
  209.     routines. Must be TRUE if non-BLACK graphic background
  210.     colors are desired.
  211.  
  212. fast29  (TRUE)
  213.         Makes int29 display calls (used by DOS) 15% faster at a
  214.         cost of 100 bytes.
  215.  
  216. bios_write_tty (TRUE)
  217.         The write tty BIOS call is taken over. It will now
  218.         perform faster and understand ANSI escape sequences.
  219.         This could confuse some programs. In that case, set this
  220.         option to FALSE.
  221.  
  222. gbackground (TRUE)
  223.         Enables setting of non-black background color in 16
  224.         color graphic modes (except 640x200). If set to TRUE, 
  225.     quick_char must also be set to TRUE. If this feature is
  226.     not desired, it is possible (depending on the system) to
  227.     get greater performance by defining both gbackground and
  228.     quick_char FALSE. This will also save quite a bit of
  229.     code. Experiment and see for yourself.
  230.  
  231. initgc  (TRUE)
  232.         Graphic mode cursor is initially on. Not a big deal
  233.         since you can turn it on/off with a control sequence.
  234.  
  235. initfast (TRUE)
  236.         Fast scroll mode is initially on. This also means that
  237.         multiple page support is initially off. Not a big deal
  238.         since you can turn it on/off with a control sequence,
  239.         and there are other work-arounds as well.
  240.  
  241. You can then either use the supplied makefile to generate a new
  242. nnansi.sys or assemble manually as shown (Borland tools
  243. illustrated): 
  244.  
  245. tasm /m5 nnansi                 (Use /m5 for version 2.0 or later)
  246. tasm /m5 nnansi_f
  247. tasm /m5 nnansi_p
  248. tasm /m5 nnansi_i
  249. tlink nnansi+nnansi_f+nnansi_p+nnansi_i,nnansi.sys/m/t
  250.  
  251. With the Microsoft assembler, you will need to use the exe2bin
  252. program to convert the linker generated exe file into a binary
  253. image file, which you then have to rename to NNANSI.SYS.
  254.  
  255.  
  256. **************HOW MUCH PERFORMANCE IMPROVEMENT IS THERE?
  257.  
  258. I have performed considerable testing on a 25Mhz 80386 machine
  259. with a Video 7 (Headland) Fastwrite VGA display controller (and
  260. its BIOS), under both DOS 3.3 and 4.0. Your results will 
  261. probably vary, and BIOS performance without NNANSI.SYS will also
  262. improve if the EGA/VGA BIOS is copied to RAM as supported by
  263. some vendors and also posible with QEMM or 386/MAX on 80386 based
  264. systems.
  265.  
  266. When using ANSI.SYS rather than no driver at all, there is
  267. roughly a 2.3x degradation in performance if no scrolling
  268. occurs. Scrolling performance improves 44% when DOS 4.0 ANSI
  269. driver is used, but remains unchanged with the DOS 3.3 driver.
  270.  
  271. Compared to no driver, NANSI.SYS (3.0) is 3x to 3.5x faster when
  272. no scrolling occurs, and is roughly 45x faster when going
  273. through DOS in RAW mode. It is roughly 2x faster scrolling.
  274.  
  275. Compared to the no driver or other ANSI drivers, NNANSI.SYS is
  276. 4x faster in BIOS TTY write calls. Compared to NANSI.SYS it is
  277. 2x faster in INT29 calls, 73% faster in DOS calls, but there is
  278. no speedup in RAW mode. When fast mode is used, scrolling is 15x
  279. to 25x faster.
  280.  
  281. This means that text mode programs that take advantage of RAW
  282. mode and buffering can display 100 times faster with NNANSI (and
  283. without scrolling, NANSI) over ANSI.SYS. It works out to about
  284. 420,000 characters per second with my fast machine.
  285.  
  286. NNANSI.SYS also has speedups for 16 color graphic modes. With
  287. the graphic cursor turned on, the TTY BIOS call is about 10%
  288. slower than the standard BIOS call (which doesn't display a
  289. cursor), but other output calls are 2.5x to 3.5x faster than
  290. that of NANSI.SYS. Turning the graphics cursor off roughly
  291. doubles the writing speed of all modes but RAW.
  292.  
  293.  
  294.  
  295. **************FAST MODE
  296.  
  297. To get maximum speed, NNANSI has what I call Fast Mode. In text
  298. mode, there is more display memory than there are character on
  299. the display. Normally, the BIOS supports display "pages" that you
  300. can switch among. Changing the display page changes the region
  301. of the display memory that is sent to the display. Fast Mode
  302. uses the same technique (changing the starting location of the
  303. viewable memory region) to scroll the display upwards. 
  304.  
  305. Programs that make use of multiple display pages and scroll the
  306. display require that fast mode be turned off. Many debugging
  307. programs do this, to maintain separate debugging and application
  308. displays. Some of the programs will still work in fast mode if
  309. they have a "swap screens" option ("-ds" for Turbo Debugger, for
  310. instance).
  311.  
  312. A number of programs that directly access the display don't work
  313. if starting address has changed. These programs may not work
  314. properly in fast mode (or in display pages other than the
  315. first). NNANSI.SYS tries its best to work with these programs by
  316. resetting the display start location if any program does the get
  317. display mode or scroll/clear display BIOS calls. These calls are
  318. typically done by offending applications when they start. As
  319. long as the display never scrolls under NNANSI.SYS control
  320. everything will work fine. A typical problem occurs in
  321. potentially offending programs that have DOS or "shell escape"
  322. commands. If the DOS sub-shell (invocation of COMMAND.COM)
  323. causes the display to scroll, then upon exiting the sub-shell
  324. the display will be ruined. The solution to this problem (other
  325. than leaving fast mode) is to clear the screen just before
  326. exiting the sub-shell.
  327.  
  328. Some offending programs can be "fixed" by invoking them from a
  329. batch file (or alias if you use MKS Toolkit, 4DOS, ANARKEY...)
  330. which first clears the screen. Or you can use a batch file which
  331. turns off fast mode, then turn fast mode back on again after
  332. program execution. Example:
  333.  
  334. echo ^[[=98l
  335. offendingpgm %1 %2 %3 %4 %5
  336. echo ^[[=98h
  337.  
  338. Where "^[" is the escape (code 27) character.
  339.  
  340. Batch programs have been provided to enable and disable fast mode.
  341.  
  342.  
  343. ******************WRITING PROGRAMS FOR BEST PERFORMANCE
  344.  
  345.  
  346. To get best performance in programs you write, you must put the
  347. display in RAW mode, and buffer output.
  348.  
  349. In assembler, you can set raw mode with the following sequence
  350. (adapt this for other languages):
  351.  
  352.         mov     ax,4400h        ; get device status
  353.         mov     bx, 1           ; of device 1 (standard output)
  354.         int     21h
  355.         xor     dh, dh          ; clear upper byte
  356.         mov     saved_state, dx ; save it for later
  357.         mov     ax, 4401h       ; set new status
  358.         or      dl, 20h         ; with raw bit set
  359.         int     21h
  360.  
  361. Reset raw mode before terminating the application:
  362.  
  363.         mov     ax, 4401h       ; set status to original values
  364.         mov     bx, 1
  365.         mov     dx, saved_state
  366.         int     21h
  367.  
  368. There is a fixed amount of overhead (and it is high) for each
  369. DOS call. Therefore you should buffer up write requests into a
  370. single call. With the C language, you can use the setvbuf() call
  371. to set a large buffer size.
  372.  
  373. Even if you don't follow this advice, you will get a major
  374. performance improvement over ANSI.SYS (or no device driver at
  375. all). 
  376.  
  377. Programs using RAW mode and buffering easily beat the
  378. performance of the supposedly high speed console drivers
  379. supplied in Turbo C and Microsoft C. And by using ANSI control
  380. sequences your programs can be made portable to other systems!
  381.  
  382.  
  383. *****************TYPICAL PROBLEMS
  384.  
  385. SYSTEM CRASHES UPON BOOTING, OR DISPLAY BADLY CORRUPTED EVEN IN
  386. STANDARD 80x25 TEXT MODE.
  387.  
  388. You have compiled NNANSI.SYS with cheap_pc set to FALSE on an
  389. 8088 based system, or you are trying to use NNANSI.SYS on a CGA,
  390. MDA, or Hercules Graphics equipped system (it will never work in
  391. this case).
  392.  
  393.  
  394. ON A VGA, SETTING 43 LINE MODE GIVES 43 LINES, WHEN IT GAVE 50
  395. WITH AN OLDER VERSION OF NNANSI.SYS OR WITH NANSI.SYS
  396.  
  397. This is correct. There is now a new setting for 50 line mode. If
  398. you require that 43 line mode give 50 lines, recompile the
  399. system with VGA set to FALSE.
  400.  
  401.  
  402. ON A VGA, SETTING 50 LINE MODE CAUSES VERY STRANGE BEHAVIOR
  403.  
  404. Two possibilities. Your display adapter is really an EGA, or you
  405. have compiled NNANSI.SYS with VGA set to FALSE. In the latter
  406. case, you can get 50 line mode by setting 43 line mode, while in
  407. the former case you can't get 50 line mode at all.
  408.  
  409.  
  410. ON A VGA, AFTER LEAVING 43/50 LINE MODE THE CURSOR IS IN THE
  411. MIDDLE OF THE CHARACTER BLOCK
  412.  
  413. Recompile the driver with EGA set to FALSE.
  414.  
  415.  
  416. ON AN EGA, THE CURSOR DISAPPEARS IN 43 LINE MODE WHEN RUNNING
  417. SOME APPLICATIONS
  418.  
  419. There is nothing you can do, as this is caused by an error in
  420. the design of the EGA BIOS.
  421.  
  422.  
  423. IN 43/50 LINE MODE, THE DOS CLS COMMAND ONLY CLEARS THE FIRST 25
  424. LINES OF THE DISPLAY
  425.  
  426. I bet you are running DOS 4.0! The COMMAND.COM program in this
  427. version does not recognize NNANSI.SYS and clears the screen
  428. itself. Unfortunately it assumes that you are in 25 line mode.
  429. There are four fixes: 1) Patch COMMAND.COM (good luck), 2) write
  430. a batch file program which echoes the ANSI clearscreen sequence
  431. to the display, 3) Switch to DOS 3.3, 4) Get a COMMAND.COM
  432. replacement. I recommend the (share-ware) 4DOS from JP Software.
  433.  
  434.  
  435. DISPLAY SHOWS UGLY BLOCKS AT THE START AND END OF EACH LINE IN
  436. EXTENDED (GREATER THAN 80X25) TEXT MODES
  437.  
  438. Your display controller sets the display mode byte in the BIOS
  439. to some value other than "3". You can either set the byte (at
  440. location 40:49h) back to 3 after setting the display mode, or
  441. configure NNANSI.SYS to know about these special modes. This
  442. problem is typical for Paradise cards, and their clones. There
  443. may already be a proper configuration for your display in
  444. NNANSI_D.ASM. 
  445.  
  446.  
  447. DISPLAY IS NOTICEABLY SLOWER WRITING OR CANNOT SWITCH BACKGROUND
  448. COLORS IN EXTENDED (GREATER THAN 640x480, OR 640x350 EGA)
  449. GRAPHIC MODES
  450.  
  451. You will need to configure NNANSI.SYS for your display card.
  452. Look for a proper configuration in NNANSI_D.ASM.
  453.  
  454.  
  455. DISPLAY GOES BLANK WHEN STARTING AN APPLICATION. DISPLAY SHIFTED
  456. PARTLY OFF SCREEN WHEN STARTING AN APPLICATION. DISPLAY
  457. DISAPPEARS DURING EXECUTION OF A APPLICATION.
  458.  
  459. First try clearing the screen before execution. If that doesn't
  460. work, leave fast mode (see preceding section on FAST MODE).
  461.  
  462.  
  463. FUNNY BLOTCHES OCCASIONALLY APPEAR AT VARIOUS POINTS IN A
  464. GRAPHIC APPLICATION
  465.  
  466. This is the graphics cursor. You can disable it either by
  467. reconfiguring the driver, or by sending the control sequence to
  468. disable the graphics cursor. A batch file has been provided for
  469. this purpose.
  470.  
  471.  
  472. TEXT DISPLAY IS MESSED UP, POSSIBLY CHANGING COLORS IN UNUSUAL
  473. PLACES. 
  474.  
  475. This has been observed with programs using the BIOS for writing
  476. to the display, and not expecting the ANSI translation (or the
  477. conversion of the TAB character into spaces instead of a special
  478. graphic). The solution is to compile NNANSI.SYS with
  479. bios_write_tty set to FALSE.
  480.  
  481.  
  482. *****************NNANSI COMMAND SEQUENCES
  483.  
  484. Command sequences start with the escape character (code 27,
  485. referred to in this section as ESC). NNANSI buffers up the
  486. sequence until it has a command to execute. If the sequence is
  487. not a valid command, the entire sequence is passed to the display.
  488.  
  489. All command sequences have the following format:
  490.  
  491.    ESC [ param1; param2; ...; paramN cmdchar
  492.  
  493. where
  494.        ESC     is the escape character
  495.        [       is the left bracket character.
  496.        param   are ascii decimal numbers or quoted strings.
  497.        cmdchar is the command character
  498.  
  499. No spaces are allowed within the command.
  500.  
  501. Omitted parameters default to "1", with the exception of the ED
  502. (erase in display) command. For example, both ESC[1;1H and ESC[H
  503. send the cursor to the home position (1,1), which is the upper
  504. left.
  505.  
  506. Quoted strings may use either single or double quote characters
  507. as delimiters. Each character inside the quoted string is
  508. converted to a numeric parameter. Quoted strings are only useful
  509. for the questionable Keyboard Key Reassignment command.
  510.  
  511.  
  512.  
  513.                    CURSOR POSITIONING COMMANDS
  514.  
  515. NAME    DESCRIPTION             COMMAND
  516. CUP     cursor position         ESC[y;xH
  517. HVP     cursor position         ESC[y;xf
  518.  
  519.         Either of these set the cursor position. CUP should be
  520.         used since HVP has other connotations not implemented in
  521.         NNANSI.SYS (or ANSI.SYS). The origin (in the upper left
  522.         corner) is x=1, y=1.
  523.  
  524. CUU     cursor up               ESC[nA
  525. CUD     cursor down             ESC[nB
  526.         n = # of lines to move. You cannot move beyond the edge
  527.         of the display.
  528.  
  529. CUF     cursor forward          ESC[nC
  530. CUB     cursor backward         ESC[nD
  531.         n = # of columns to move. You cannot move beyond the
  532.         edge of the display.
  533.  
  534. DSR     Device Status Report    ESC[6n
  535.         Find out cursor position. The driver responds with a
  536.         cursor position report (CPR) of the form "ESC[y;xR"
  537.         followed by a carriage return, as if typed at the
  538.         keyboard. 
  539.  
  540. SCP     Save Cursor Position    ESC[s
  541. RCP     Restore Cursor Position ESC[u
  542.         Cannot be nested.
  543.  
  544.  
  545.  
  546.  
  547.                         EDITING COMMANDS
  548.  
  549. NAME    DESCRIPTION             COMMAND
  550. ED      Erase in Display        ESC[nJ
  551.         n=0 or missing: Erase to end of screen (not in ANSI.SYS)
  552.         n=1: erase to start of screen (not in ANSI.SYS)
  553.         n=2: erase entire screen, and home cursor
  554.         Note: there is a bug in ANSI.SYS that performs function
  555.         2 regardless of the value of n. This bug is not repeated
  556.         in NNANSI.SYS because of the extra functionality provided.
  557.  
  558. EL      Erase in Line           ESC[K
  559.         Erases from cursor to end of line
  560.  
  561. IL      Insert Lines            ESC[nL 
  562.         Inserts n blank lines at the line containing the cursor.
  563.         While the cursor line moves down, the cursor position is
  564.         unchanged. Not in ANSI.SYS. 
  565.  
  566. DL      Delete Lines            ESC[nM  
  567.         Deletes n lines, starting at the line containing the
  568.         cursor. The cursor is not moved. Not in ANSI.SYS
  569.         
  570. ICH     Insert Characters       ESC[n@  
  571.         Inserts n blank characters at cursor position. The
  572.         cursor does not move. Not in ANSI.SYS. Does not work in
  573.         graphic modes.
  574.  
  575. DCH     Delete Characters       ESC[nP  
  576.         Deletes n characters at the cursor. The cursor does not
  577.         move. Not in ANSI.SYS. Does not work in graphic modes.
  578.  
  579.  
  580.  
  581.  
  582.                   SET GRAPHIC RENDITION COMMAND
  583.  
  584. NAME    DESCRIPTION             COMMAND
  585. SGR     Set Graphics Rendition  ESC[n;n;...nm
  586.  
  587. The Set Graphics Rendition command is used to select foreground
  588. and background colors or attributes.  When you use multiple
  589. parameters, they are executed in sequence, and the effects are
  590. cumulative.  You can set all colors and attributes in any text
  591. mode.  In 16 color graphic modes with at least 350 vertical
  592. pixels you can set all colors and attributes except for blink.
  593. "Blink" becomes exclusive-OR character mode (very useful!).  You
  594. can set foreground colors, blink, and bold, only, in other 16 color
  595. modes.  Setting colors does not work correctly for other color
  596. modes -- make sure display is in the normal white on black mode
  597. before changing to these modes.
  598.  
  599. Code          Value
  600. 0               All attributes off (normal white on black)
  601. 1               Bold
  602. 2               Dim (not Bold)
  603. 4               Underscore (emulated via blue foreground)
  604. 5               Blink (or EXOR -- see above)
  605. 7               Reverse Video (improved implementation over ANSI)
  606. 8               Invisible (improved operation)
  607. 22              Cancel Bold
  608. 24              Cancel Underline (white foreground)
  609. 25              Cancel Blink
  610. 27              Normal, un-reversed video
  611. 30-37           foreground black/red/green/yellow/blue/magenta/cyan/white
  612. 40-47           background black/red/green/yellow/blue/magenta/cyan/white
  613.  
  614. Codes 2, 22, 24, 25, and 27 are not in ANSI.SYS.
  615.  
  616.  
  617.  
  618.                     SET DISPLAY MODE COMMAND
  619.  
  620. NAME    DESCRIPTION             COMMAND
  621. SM      Set Mode                ESC[=nh
  622.  
  623. The implementation allows using the RM command to do these
  624. actions, and the "=" character is optional. But cheating in this
  625. way is not a good idea.
  626.  
  627. The BIOS supports many video modes. The code given for the AL
  628. register to the BIOS set mode command is used as the parameter
  629. to this set mode command. That means that extended modes that
  630. are settable in this manner can use this command. Display cards
  631. that use other techniques to change display mode are left as an
  632. exercise to the user, but if you can get the card into an
  633. extended mode, NNANSI can used it (possibly with a configuration
  634. change, though).
  635.  
  636. In the graphic modes, the cursor can be simulated with a blob
  637. (the character produced with character code 22).
  638.  
  639. Mode Code       Value
  640.     0,1         text 40x25 16 color
  641.     2,3         text 80x25 16 color
  642.     4,5         graphics 320x200 4 color
  643.     6           graphics 640x200 Black & White
  644.     7           [see next section]
  645.     13          graphics 320x200 16 color, VGA only
  646.     14          graphics 640x200 16 color, VGA only
  647.     16          graphics 640x350 16 color, VGA only
  648.     17          graphics 640x480 Black & White, VGA only
  649.     18          graphics 640x480 16 color, VGA only
  650.     19          graphics 300x200 256 color, VGA only
  651.     43          43 line mode for mode 2 or 3 (Not in ANSI.SYS)
  652.     50          50 line mode for mode 2 or 3 (VGA only, not in
  653.                 ANSI.SYS)
  654.     98          [see next section]
  655.     99          [see next section]
  656.     n           When not in above list, sets mode n. (Not in
  657.                 ANSI.SYS) 
  658.  
  659.  
  660. The modes marked as VGA only are not supported by ANSI.SYS
  661. that comes with version 3.3 MS-DOS or earlier.
  662.  
  663. The 43 line and 50 line support reprograms the display to use
  664. smaller characters. Set mode 3 first, before using these modes.
  665. Set any other mode to leave 43/50 line mode.
  666.  
  667. Unlike earlier versions of NNANSI.SYS, and NANSI.SYS, setting 43
  668. line mode on a VGA will give 43 (not 50) lines. You must use the
  669. explicit 50 line mode command to get 50 lines on a VGA. If you
  670. would rather have compatibility with these other drivers,
  671. recompile the driver with VGA set to FALSE.
  672.  
  673.  
  674.  
  675.                      SET DISPLAY ATTRIBUTES
  676.  
  677. NAME    DESCRIPTION             COMMAND
  678. SM      Set Mode                ESC[?nh
  679. RM      Reset Mode              ESC[?nl
  680.  
  681. Valid attributes that can be set and reset:
  682.  
  683. 7       Cursor Wrap     When false, cursor sticks at end of
  684.                         line, rather than wrapping
  685.  
  686. 98      Fast Scroll     When true (fast mode) the starting
  687.                         display location is changed for fast
  688.                         scrolling, which can cause problems for
  689.                         some programs. When false, the starting
  690.                         location does not change and the
  691.                         multi-page support is enabled.
  692.  
  693. 99      Graphic cursor  When true the cursor is displayed in
  694.                         graphic modes.
  695.  
  696. Batch files are supplied to change attributes 98 and 99.
  697.  
  698.  
  699.  
  700.                   KEYBOARD REASSIGNMENT COMMAND
  701.  
  702. This command is absent by default. You must recompile to enable
  703. this command.
  704.         
  705. NAME    DESCRIPTION             COMMAND
  706. IBMKKR  Keyboard Key Reassign   ESC[param;param;...;param p
  707.  
  708. If no parameters are given, all keys are reset. This is not true
  709. for ANSI.SYS.
  710.  
  711. The first parameter is the key to reassign. IBM function keys
  712. take the first two parameters, where the first parameter is 0.
  713. The remaining parameters are the keystrokes to substitute. F11
  714. and F12 are not supported. Normally a string is used rather than
  715. numeric arguments.
  716.  
  717.  
  718. ******************************THE END****************************
  719.