home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / assemblr / library / ansi / nnansi / nnansi_d.asm < prev    next >
Assembly Source File  |  1990-10-12  |  9KB  |  275 lines

  1. ;---- nnansi_d.asm -----------------
  2. ; Definitions for the New New ANSI driver, NNANSI.SYS.
  3.  
  4. ; This version is for EGA/VGA only! Not for CGA or MGA or Hercules
  5. ; By Tom Almy
  6.  
  7. TRUE    equ    1
  8. FALSE    equ    0
  9.  
  10. ;*************************************************************
  11. ;*****************                         *******************
  12. ;*****************  User Definable Options *******************
  13. ;*****************                         *******************
  14. ;*************************************************************
  15.  
  16.  
  17. ; Define both of these TRUE is display type is unknown.
  18. ; Otherwise define FALSE what your display isn't.
  19. ; Note: If display is neither VGA nor EGA, then this driver won't work, 
  20. ;       but the driver will work if you define both of these FALSE. 
  21. ;    This is useful for VGA systems that want the 43 line mode to
  22. ;    display 50 lines.
  23.  
  24. VGA    equ    TRUE    ; define TRUE for VGA, defining as FALSE eliminates
  25.             ; 50 line mode code. (43 line mode will run with 50
  26.             ; lines like older nansi and nnansi drivers
  27. EGA    equ    TRUE    ; define TRUE for EGA for best results on EGA.
  28.             ; defining as FALSE eliminates 43 line cursor fix code
  29.  
  30.  
  31. ; Define one of the following true if you have the appropriate
  32. ; display card. Otherwise leave them all FALSE.
  33.  
  34. VEGA    equ    FALSE    ; Configure for Video-Seven FastWrite VGA, or
  35.             ; compatible (such as Tatung VGA (not VGA-16))
  36. PARADISE equ    FALSE    ; Paradise VGA (or EGA)
  37. STBVGA  equ    FALSE    ; STB VGA Extra
  38. TVGA16    equ    FALSE    ; Tatung VGA-16
  39. EGAWIZ  equ    FALSE    ; EGA Wizard Deluxe
  40. ATT600  equ    FALSE    ; AT&T VDC600 (untested)
  41.  
  42. ; Define the following TRUE if you have an 8088/6 (PC XT or clone), or might 
  43. ; want to use the driver with an 8088/6. Define as FALSE for 
  44. ; processors >=80186 for best performance and smallest size.
  45.  
  46. cheap_pc    equ    FALSE    ; no fancy instructions if true
  47.  
  48. ; The following options specify certain feature options. These options 
  49. ; take space if turned on, but improve performance and/or add features.
  50.  
  51. key_redef    equ    FALSE    ; keyboard redefinition allowed if true
  52.     ; If you don't use key redefinition, set at FALSE, since some Trojan 
  53.     ; Horse programs take advantage of this. Also it takes space.
  54. init_buf_size    equ    256    ; size of keyboard redefinition buffer 
  55.     ; and parameter buffer when key_redef TRUE. You may want to change 
  56.     ; the size, if you use this feature. Don't make it <100.
  57. quick_char    equ    TRUE ; quick graphic characters in modes 10 and 12
  58.     ; quick_char should be "TRUE" unless 
  59.     ; you have an incompatible display card.
  60.     ; And I don't know of any that are.
  61. fast29        equ    TRUE    ; 15 % faster operation (overall)
  62.     ;  of int29 calls (costs 100 bytes)
  63. bios_write_tty    equ    TRUE    ; take over BIOS write_tty if true
  64.     ; NOTE: if bios_write_tty is true, the color rendition of text may 
  65.     ; change, but performance will improve and ANSI control codes can 
  66.     ; be used.
  67. gbackground    equ    TRUE    ; generate non-black graphic backgrounds
  68.     ; This option may cause problems for software not expectings its
  69.     ; existance. Also you must specify quick_char to use gbackground.
  70.  
  71. ; The following options affect initial state. They do not affect the 
  72. ; size of the driver.
  73.  
  74. initgc        equ    TRUE    ; graphics cursor initially on if true
  75. initfast    equ    TRUE    ; initially fast mode if true
  76.     ; note- you may have to clear the display (CLS command) before 
  77.     ; running some programs, or just before leaving "shell escapes" in
  78.     ; some programs.  But it's typically worth the effort.
  79.     ; You can disable/enable it with a simple control sequence anyway.
  80.  
  81. page
  82.  
  83. ; display specific definitions follow. You will need to add to these to 
  84. ; configure for unsupported displays. Other than that, no user definable
  85. ; options follow.
  86.  
  87. IFE    VEGA+PARADISE+STBVGA+TVGA16+EGAWIZ+ATT600 ; default generic graphics.
  88. gmode_test macro isgraphic
  89.     ; This macro is to jump if display is in an EGA/VGA 16 color 
  90.     ; "compatible" mode -- this means one which is a simple extension
  91.     ; (more rows and/or columns) than modes 10h or 12h. At minimum
  92.     ; modes 10h and 12h themselves qualify.
  93.     ; No registers may be altered.
  94.     ; Byte location "cs:video_mode" is a copy of byte 40:49H.
  95.     cmp    cs:video_mode, 10h    ; 640x350, 16 color mode
  96.     je    isgraphic
  97.     cmp    cs:video_mode, 12h    ; 640x480, 16 color VGA mode
  98.     je    isgraphic
  99. endm
  100. gmode_code macro
  101.     ; this macro is used to tell if display is in graphics
  102.     ; mode by looking at the byte 40:49H, which is in
  103.     ; register AL at the start of the macro.
  104.     ; It is to set location cs:gmode_flag non-zero if in a graphics mode.
  105.     ; No registers may be altered.
  106.     ; *NOTE* users of Paradise and possibly other VGA
  107.     ; cards will need to modifify this routine because
  108.     ; Paradise extended character modes set this byte to
  109.     ; to the value of the mode you selected.  Nicer cards
  110.     ; (Genoa and VEGA, that I know of) leave this byte at
  111.     ; "3" and all works fine!
  112.     mov    cs:gmode_flag,0        ; assume character mode (zero flag)
  113.     cmp    al, 4
  114.     jb    not_graphics        ; modes =>4 are assumed to be graphic
  115.     mov    cs:gmode_flag,al    ; non-zero value
  116. not_graphics:
  117. endm
  118. ENDIF
  119.  
  120. IF PARADISE
  121. gmode_test macro isgraphic
  122.     cmp    cs:video_mode, 10h    ; 640x350, 16 color mode
  123.     je    isgraphic
  124.     cmp    cs:video_mode, 12h    ; 640x480, 16 color VGA mode
  125.     je    isgraphic
  126.     cmp    cs:video_mode, 58h    ; 800x600, 16 color
  127.     je    isgraphic
  128. endm
  129. gmode_code macro
  130.     mov    cs:gmode_flag,0        ; assume character mode (zero flag)
  131.     cmp    al, 4
  132.     jb    not_graphics        ; modes =>4 are assumed to be graphic
  133.     cmp    al, 54h            ; modes 54 and 55 are text!
  134.     je    not_graphics
  135.     cmp    al, 55h
  136.     je    not_graphics
  137.     mov    cs:gmode_flag,al    ; non-zero value
  138. not_graphics:
  139. endm
  140. ENDIF
  141.  
  142. IF ATT600
  143. gmode_test macro isgraphic
  144.     cmp    cs:video_mode, 10h    ; 640x350, 16 color mode
  145.     je    isgraphic
  146.     cmp    cs:video_mode, 12h    ; 640x480, 16 color VGA mode
  147.     je    isgraphic
  148.     cmp    cs:video_mode, 47h    ; 800x600, 16 color
  149.     je    isgraphic
  150. endm
  151. gmode_code macro
  152.     mov    cs:gmode_flag,0        ; assume character mode (zero flag)
  153.     cmp    al, 4
  154.     jb    not_graphics        ; modes >=4 are assumed to be graphic
  155.     cmp    al, 54h            ; modes 54 and 55 are text!
  156.     je    not_graphics
  157.     cmp    al, 55h
  158.     je    not_graphics
  159.     mov    cs:gmode_flag,al    ; non-zero value
  160. not_graphics:
  161. endm
  162. ENDIF
  163.  
  164. IF STBVGA
  165. gmode_test macro isgraphic
  166.     cmp    cs:video_mode, 10h    ; 640x350, 16 color mode
  167.     je    isgraphic
  168.     cmp    cs:video_mode, 12h    ; 640x480, 16 color VGA mode
  169.     je    isgraphic
  170. endm
  171. gmode_code macro
  172.     mov    cs:gmode_flag,0        ; assume character mode (zero flag)
  173.     cmp    al, 4
  174.     jb    not_graphics        ; modes >=4 are assumed to be graphic
  175.     cmp    al, 22h            ; modes 22 and 23 are text!
  176.     je    not_graphics
  177.     cmp    al, 23h
  178.     je    not_graphics
  179.     mov    cs:gmode_flag,al    ; non-zero value
  180. not_graphics:
  181. endm
  182. ENDIF
  183.  
  184. IF TVGA16
  185. gmode_test macro isgraphic
  186.     cmp    cs:video_mode, 10h    ; 640x350, 16 color mode
  187.     je    isgraphic
  188.     cmp    cs:video_mode, 12h    ; 640x480, 16 color VGA mode
  189.     je    isgraphic
  190. endm
  191. gmode_code macro
  192.     mov    cs:gmode_flag,0        ; assume character mode (zero flag)
  193.     cmp    al, 4
  194.     jb    not_graphics        ; modes >=4 are assumed to be graphic
  195.     cmp    al, 56h            ; modes 56 and 57 are text!
  196.     jb    not_graphics
  197.     cmp    al, 57h
  198.     jb    not_graphics
  199.     mov    cs:gmode_flag,al    ; non-zero value
  200. not_graphics:
  201. endm
  202. ENDIF
  203.  
  204.  
  205. IF    VEGA
  206. gmode_test macro isgraphic
  207.     cmp    cs:video_mode, 10h    ; 640x350, 16 color mode
  208.     je    isgraphic
  209.     cmp    cs:video_mode, 12h    ; 640x480, 16 color VGA mode
  210.     je    isgraphic
  211.     cmp    cs:video_mode, 14h    ; 752x410
  212.     je    isgraphic
  213.     cmp    cs:video_mode, 15h    ; 720x540
  214.     je    isgraphic
  215.     cmp    cs:video_mode, 16h    ; 800x600
  216.     je    isgraphic
  217. endm
  218. gmode_code macro
  219.     mov    cs:gmode_flag,0        ; assume character mode (zero flag)
  220.     cmp    al, 4
  221.     jb    not_graphics        ; modes >=4 are assumed to be graphic
  222.     mov    cs:gmode_flag,al    ; non-zero value
  223. not_graphics:
  224. endm
  225. ENDIF
  226.  
  227.  
  228. IF    EGAWIZ
  229. gmode_test macro isgraphic
  230.     cmp    cs:video_mode, 10h    ; 640x350, 16 color mode
  231.     je    isgraphic
  232.     cmp    cs:video_mode, 12h    ; 640x480, 16 color VGA mode
  233.     je    isgraphic
  234.     cmp    cs:video_mode, 26h    ; 640x480, 60 line
  235.     je    isgraphic
  236.     cmp    cs:video_mode, 70h    ; 740x396
  237.     je    isgraphic
  238.     cmp    cs:video_mode, 71h    ; 800x600
  239.     je    isgraphic
  240. endm
  241. gmode_code macro
  242.     mov    cs:gmode_flag,0        ; assume character mode (zero flag)
  243.     cmp    al, 4
  244.     jb    not_graphics        ; modes >=4 are assumed to be graphic
  245.     cmp    al, 22h            ; 22-24 are nongraphic
  246.     jb    is_graphics
  247.     cmp    al, 24h
  248.     jbe    not_graphics
  249.     cmp    al, 32h            ; 32-34 are nongraphic
  250.     jb    is_graphics
  251.     cmp    al, 34h
  252.     jbe    not_graphics
  253.     cmp    al, 38h            ; 38 is nongraphic
  254.     je    not_graphics
  255. is_graphics:
  256.     mov    cs:gmode_flag,al    ; non-zero value
  257. not_graphics:
  258. endm
  259. ENDIF
  260. page
  261. ; some remaining declarations
  262.  
  263. IF key_redef
  264. buf_size    equ    init_buf_size    ; size of parameter/redef buffer
  265. ELSE
  266. buf_size    equ    20        ; size of parameter/redef buffer 
  267. ENDIF
  268.  
  269.  
  270. IF    cheap_pc
  271.     .8086
  272. ELSE
  273.     .286c
  274. ENDIF
  275.