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 / M3610038.ASM < prev    next >
Assembly Source File  |  1992-05-25  |  6KB  |  131 lines

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