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 / M2808025.ASM < prev    next >
Assembly Source File  |  1992-02-04  |  6KB  |  134 lines

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