home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / m / mxxdrv10.zip / M10_SCR.ZIP / VGATOOLS / VPTABLE.ASM < prev   
Assembly Source File  |  1992-02-04  |  6KB  |  136 lines

  1.  
  2. ; VGA Video Parameters Table Entry definition.
  3. ; Template created by Morozov I.V.
  4.  
  5. ; Actual parameters below are for the following video mode:
  6. ; 80 x 25 characters on screen in 09x16 character matrix
  7. ; for 28.322 MHz Master Clock (H.freq = 31.470 KHz; V.freq = 70.1 Hz)
  8. ; (default VGA text standard (modes 02-03h, VP table element No.18h)
  9.  
  10.  
  11. ; Changeable parameters definitions:
  12. ; (change values here to alter corresponding video parameters)
  13. ;
  14. ;  Dimensions:
  15.     CHAR_HEIGHT = 16    ;character height
  16.     CHAR_WIDTH  = 09    ;character width (should be 8 or 9 only)
  17.     COLMS       = 80    ;screen text columns
  18.     ROWS        = 25    ;screen text rows
  19. ;
  20. ;  Misc Output register parameters:
  21.                         ;horizontal resolution used:  350  400  480  reserved
  22.     VSYNCPOL  = 0       ;V. Sync Polarity             1    0    1    0
  23.     HSYNCPOL  = 1       ;H. Sync Polarity             0    1    1    0
  24.     CLOCKSEL  = 01b     ;Master Clock Select;  00 - 25MHz, 01 - 28MHz, 10 - ext
  25.  
  26. ;  CRTC register values (no recalculations into register values necessary!):
  27.     HT   = 100          ;H. Total
  28.     HDE  = 79           ;H. Displ.  End
  29.     HBS  = 80           ;H. Blank   Start
  30.     HBE  = 98           ;H. Blank   End
  31.     HRS  = 85           ;H. Retrace Start
  32.     HRE  = 97           ;H. Retrace End
  33.     VT   = 449          ;V. Total
  34.     VDE  = 399          ;V. Displ.  End
  35.     VBS  = 406          ;V. Blank   Start
  36.     VBE  = 441          ;V. Blank   End
  37.     VRS  = 412          ;V. Retrace Start
  38.     VRE  = 414          ;V. Retrace End
  39.     SSL  = 1024-1       ;Start screen split Line (Line Compare)
  40.  
  41.  
  42.  
  43. VP_DATA         segment
  44.                 org     100h            ;to create .COM file
  45. VP_Table_org    label   near
  46.  
  47.  
  48. ; Used literal definitions:
  49. ;
  50.         _4bits =  00001111b
  51.         _5bits =  00011111b
  52.         _7bits =  01111111b
  53.         _8bits =  11111111b
  54.         bit0   =   00000001b
  55.         bit1   =   00000010b
  56.         bit2   =   00000100b
  57.         bit3   =   00001000b
  58.         bit4   =   00010000b
  59.         bit5   =   00100000b
  60.         bit6   =   01000000b
  61.         bit7   =   10000000b
  62.         bit8   =  100000000b
  63.         bit9   = 1000000000b
  64.  
  65.  
  66. ; Actual video parameter table element data starts here:
  67. ;
  68. ;    colms, rows, scan lines, buffer size:
  69.   db    COLMS
  70.   db    ROWS - 1
  71.   db    CHAR_HEIGHT
  72.   dw    COLMS*ROWS*2+256
  73. ;
  74. ;    Sequencer Regs:
  75.   db    00h  OR  (00000001b XOR (CHAR_WIDTH AND 00000001b))
  76.   db    03h, 00h, 02h
  77. ;
  78. ;    Misc Out Reg:
  79.   db    00100011b                    OR    \
  80.         (VSYNCPOL SHL 7)             OR    \
  81.         (HSYNCPOL SHL 6)             OR    \
  82.         (CLOCKSEL SHL 2)
  83. ;
  84. ;   CRTC registers:                             REG  meaning:
  85.   db    HT-05                                   ;00: H. Total - 05
  86.   db    HDE                                     ;01: H. Disp. End
  87.   db    HBS                                     ;02: Start H. Blank
  88.   db    00000000b OR (HBE AND _5bits)           ;03: CR, DES & End H. Blank
  89.   db    HRS                                     ;04: Start H. Retrace
  90.   db    ((HBE AND bit5) SHL 2)       OR    \    ;05: End H. Blnk overflow
  91.         00000000b                    OR    \    ;    H. Retrace Delay (skew)
  92.         (HRE AND _5bits)                        ;    H. Retrace End
  93.   db    (VT-02) AND _8bits                      ;06: V. Total - 02
  94.   db    ((VRS AND bit9) SHR 2)       OR    \    ;07: Overflows
  95.         ((VDE AND bit9) SHR 3)       OR    \
  96.         (((VT-02) AND bit9) SHR 4)   OR    \
  97.         ((SSL AND bit8) SHR 4)       OR    \
  98.         ((VBS AND bit8) SHR 5)       OR    \
  99.         ((VRS AND bit8) SHR 6)       OR    \
  100.         ((VDE AND bit8) SHR 7)       OR    \
  101.         (((VT-02) AND bit8) SHR 8)
  102.   db    00000000b                               ;08: Preset Row Scan
  103.   db    00000000b                    OR    \    ;09: 200-to-400 conversion
  104.         ((SSL AND bit9) SHR 3)       OR    \    ;    Split Line overfl.
  105.         ((VBS AND bit9) SHR 4)       OR    \    ;    V. Blnk Start overfl
  106.         CHAR_HEIGHT - 1                         ;    scan lines / char (-1)
  107.   db    CHAR_HEIGHT - 3                         ;0A: Curs. Start
  108.   db    CHAR_HEIGHT - 1                         ;0B: Curs. End
  109.   dw    0000h                                   ;0C+0D: Buffer start
  110.   dw    0000h                                   ;0E+0F: Cursor loc
  111.   db    VRS AND _8bits                          ;10: Start V. Retrace
  112.   db    10000000b                    OR    \    ;11: Flags (modes) ???
  113.         (VRE AND _4bits)                        ;    V. Retrace End
  114.   db    VDE AND _8bits                          ;12: V. Displ. End
  115.   db    COLMS/2                                 ;13: Next log. Line offset (wrd)
  116.   db    00000000b                    OR    \    ;14: Count by 4 & Dword modes
  117.         ((32-1) AND _5bits)                     ;    Underline Loc
  118.   db    VBS AND _8bits                          ;15: Start V. Blank
  119.   db    VBE AND _8bits                          ;16: End V. Blank
  120.   db    10100011b                               ;17: Mode Control
  121.   db    SSL AND _8bits                          ;18: Line Compare (Scr Split)
  122. ;
  123. ;       Attr. Controller registers:
  124.   db      00h, 01h, 02h, 03h, 04h, 05h, 14h, 07h          ;Attr 00-07 regs
  125.   db      38h, 39h, 3Ah, 3Bh, 3Ch, 3Dh, 3Eh, 3Fh          ;Attr 08-0F regs
  126.   db      08h                           OR  \             ;Attr 10-13 regs
  127.           (((CHAR_WIDTH AND 00000001b)) SHL 2)
  128.   db      00h, 0Fh
  129.   db      00h  OR  ((CHAR_WIDTH AND 00000001b) SHL 3)
  130.  
  131. ;       Graphics Controller registers:
  132.   db      00h, 00h, 00h, 00h, 00h, 10h, 0Eh, 00h, 0FFh    ;Grph 00-08 regs
  133.  
  134.  
  135. VP_DATA         ends
  136.                 end     VP_Table_org