home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols200 / vol259 / gsx03.lbr / ART2DVSP.AQ6 / ART2DVSP.A86
Text File  |  1986-03-22  |  21KB  |  811 lines

  1.  
  2. ;**************************************************************************
  3. ;*                DEVICE SPECIFIC ROUTINES              *
  4. ;*                                      *   
  5. ;*        These routines and equates are device dependant.      *
  6. ;*                                      *
  7. ;*                                      *
  8. ;*                                      *
  9. ;**************************************************************************
  10. ;Hist
  11. ;Name    Date    Modification
  12. dseg
  13. copyright        db    'GSX-86 V1.3          29 Dec  83'
  14.             db    'IBM ARTIST 2 Color screen driver'
  15.             db    'Serial No.     XXXX-0000-654321'
  16.             db    'Digital Research, Inc.      '
  17. cseg
  18. ;
  19.     public    init_lut
  20.     public    load_lut
  21.     public    clearmem
  22.     public    check_escape
  23.     public    escfn0,escfn1,escfn2,escfn3
  24.     public    escfn4,escfn5,escfn6,escfn7
  25.     public    escfn8,escfn9,escf10,escf11
  26.     public    escf12,escf13,escf14,escf15
  27.     public    escf16,escf17,escf18,escf19
  28.     public    concat
  29.     public    valuator,choice,get_char
  30.     public    plyfill_rot
  31.     public    abline,draw_char
  32.     public    next_address
  33.     public    enable_cross,move_cross,clip_cross,get_loc_key
  34.     public    device_table ,    size_table
  35.     public    gcurx,gcury
  36.     public    y1,y2,x1,x2
  37.     public    lstlin
  38.     public    arstl2
  39.     public    color_map_table
  40. ;
  41.     extrn    entry:near        ;the place to jump to if this module
  42.                     ;is linked in first
  43. ;
  44. ;integer array indexing equates
  45.     W_1    equ    word ptr 0
  46.     W_2    equ    word ptr 2
  47.     W_3    equ    word ptr 4
  48.     W_4    equ    word ptr 6
  49.     W_5    equ    word ptr 8
  50.     W_6    equ    word ptr 10
  51.     W_7    equ    word ptr 12
  52.     W_8    equ    word ptr 14
  53.     W_9    equ    word ptr 16
  54.     W_10    equ    word ptr 18
  55. ;
  56. false        equ    0
  57. true        equ    not false
  58. EJECT
  59. ;****************************************************************
  60. ;        screen coordinate equates            *
  61. ;   these must be changed to the values for specific machines    *
  62. ;****************************************************************
  63. ;
  64. nec_status    equ    2e0h            ;Nec 7220 status port
  65. nec_param    equ    2e0h            ;Nec 7220 parameter port
  66. nec_command    equ    2e1h            ;Nec 7220 command port
  67. nec_data    equ    2e1h            ;Nec 7220 data port
  68. xresmx        equ    639            ;X - Maximum resolution.
  69. yresmx        equ    239            ;Y - Maximum resolution.
  70. xsize        equ    320            ;size of pixel in microns
  71. ysize        equ    640            ;
  72. num_planes    equ    4            ;number of graphics planes 1-4
  73. num_colors    equ    16            ;number of simultaneous colors
  74. graph_plane    equ    0                 ;start of graphics segment
  75. plane_size    equ    2            ;size of plane in 16k word increments
  76. words_line    equ    40            ;used to compute addresses
  77. chars_line    equ    80            ;number of characters per line
  78. lines_page    equ    24            ;lines per alpha screen
  79. last_escape    equ    19            ;last escape function id
  80. last_dri_escape equ    19            ;last dri defined escape
  81. mouse        equ    true            ;mouse driver to be included
  82. ;
  83. ;****************************************************************
  84. ;            device dependant equates            *
  85. ;   these may not require change by the oem                    *
  86. ;****************************************************************
  87. ;
  88. curwtx        equ    16            ;1/2 width of cross hair
  89. curwty        equ    8            ;1/2 height of cross hair
  90. cur_mot_max_x    equ    16            ;how far cursor moves fast in x
  91. cur_mot_max_y    equ    8            ;how far cursor moves fast in y
  92. cur_mot_min_x    equ    1            ;how far cursor moves slow in x
  93. cur_mot_min_y    equ    1            ;how far cursor moves slow in y
  94. val_inc_big    equ    10            ;maximum valuator increment
  95. val_inc_small    equ    1            ;minimum valuator increment
  96. ;
  97. ;***************************************************************
  98. ;Nec 7220 standard equates
  99. ; device independent equates NOT TO BE MODIFIED
  100. ;***************************************************************
  101. ;
  102. ;7220 commands equates
  103. ;
  104. reset    equ    00h
  105. sync    equ    0eh        ;sync parameters (display enabled)
  106. stop    equ    0ch
  107. vsyncm    equ    6fh        ;vertical sync mode (master)
  108. vsyncs    equ    6eh
  109. cchar    equ    4bh
  110. start    equ    6bh
  111. zoom    equ    46h
  112. curs    equ    49h
  113. pram    equ    70h
  114. pitch    equ    47h
  115. wdat    equ    20h
  116. gmask    equ    4ah
  117. figs    equ    4ch
  118. figd    equ    6ch
  119. gchrd    equ    68h
  120. rdat    equ    0a0h    
  121. curd    equ    0e0h
  122. lprd    equ    0c0h
  123. dmar    equ    0a4h
  124. dmaw    equ    24h
  125. ;
  126. ;7220 init parameter bytes
  127. ;
  128. mixed    equ    00h        ;mixed alpha and graphics mode
  129. graph    equ    02h        ;graphic only mode
  130. interl    equ    09h        ;interlaced mode
  131. nonint    equ    00h        ;noninterlaced mode
  132. refrsh    equ    04h        ;refresh enabled
  133. norefr    equ    00h        ;refresh disabled
  134. glitch    equ    00h        ;drawing during full display
  135. noglit    equ    10h        ;drawing during retrace only
  136. ;
  137. ;7220 status bits equates
  138. ;
  139. drdy    equ    00000001b    ;data ready status
  140. fifofu    equ    00000010b    ;fifo full status
  141. fifoem    equ    00000100b    ;fifo empty status
  142. drinpr    equ    00001000b    ;drawing in progress
  143. dmaexe    equ    00010000b    ;dma execute
  144. vsyact    equ    00100000b    ;vertical sync active
  145. hsyact    equ    01000000b    ;horizontal sync active
  146. lgtpen    equ    10000000b    ;light pen detect
  147. ;
  148. ;****************************************************************
  149. ;        IBM STANDARD ROM BIOS CALLS            *
  150. ;****************************************************************
  151. SCREEN    equ    10H        ;interrupts to use for rom routine I/O
  152. KEYBD    equ    16H
  153. rev_vid_on    equ    70h        ;turn on reverse video bits
  154. rev_vid_off    equ    07h        ;turn off reverse video bits 
  155. ;
  156. read_cur_pos    equ    3            ;bios rom calls for char I/O
  157. set_cur_pos    equ    2
  158. read_char    equ    8
  159. write_char    equ    9
  160. get_character    equ    0            ;keyboard read
  161. ;
  162. eject
  163.     jmp    entry        ;if we come in from here, go to real entry
  164. ;************************************************************************
  165. ;* init_lut                                 *
  166. ;*    initialize the hardware/software color lookup table         *
  167. ;*                                    *
  168. ;*    this moves the default table to the realized color table    *
  169. ;*    If the machine has a hardware video lookup table         *
  170. ;*    it should be initialized here.                    * 
  171. ;************************************************************************
  172. init_lut:
  173.     push    ds
  174.     pop    es
  175.     mov    di,offset requested_color_table
  176.     mov    cx,48
  177.     mov    ax,0
  178.     rep    stosw        ;clear out the table
  179.     mov    di,offset realized_color_table
  180.     mov    si,offset default_color_table
  181.     mov    cx,48
  182.     rep    movsw        ;store defaults in this table    
  183.     ret
  184. ;************************************************************************
  185. ;* load_lut                                 *
  186. ;*             loads lookup table                                     *
  187. ;*        si contains address of request_color_table entry    *
  188. ;*        ax contains color index requested            *
  189. ;*        Orriginal data in request_color_table            *
  190. ;*                                    *
  191. ;*        If a display has a hardware video lookup table         *
  192. ;*        the selected index should be mapped to the req value    *
  193. ;************************************************************************
  194. load_lut:
  195.     ret
  196. ;****************************************    
  197. ;escape func 2
  198. ; Enter Graphics Mode 
  199. ;****************************************    
  200. escfn2:     
  201.     call    escfn8            ; 
  202.     call    escfn9            ;home and erase the screen
  203.     call    rotate_font        ; init the font table
  204.     mov    al,reset        ; reset the controller
  205.     call    write_command
  206.     mov    al,vsyncm        ; put NEC 7220 in master mode
  207.     call    write_command
  208.     mov    al,reset        ; now init the controller
  209.     call    write_command
  210.     mov    bx,offset sync_parms    ; init the sync parameters
  211.     call    write_parameter_block
  212.     mov    al,pitch
  213.     call    write_command
  214.     mov    al,words_line        ; set the pitch to 1024 pixels
  215.     call    write_parameter
  216.     mov    al,zoom
  217.     call    write_command
  218.     mov    al,0
  219.     call    write_parameter        ; set the zoom to X1
  220.     mov    al,cchar        ; set the cursor characteristics
  221.     call    write_command
  222.     mov    bx,offset cchar_parms
  223.     call    write_parameter_block
  224.      mov    al,pram            ; load the parameter ram
  225.     call    write_command
  226.     mov    bx,offset pram_parms
  227.     call    write_parameter_block    ; Set the start address of the ram
  228.     call    clearmem
  229.     mov    al,start
  230.     call    write_command        ; start the NEC 7220
  231. if mouse
  232.     mov    bl,1
  233.     call    mouse_function        ;initialize the mouse
  234. endif
  235.     ret
  236. ;
  237. ;****************************************    
  238. ;escape func 3
  239. ; Exit Graphics Mode
  240. ;****************************************    
  241. escfn3:                 ; 
  242.     call    escfn8            ;home
  243.     call    escfn9            ;clear to end of screen
  244. if mouse
  245.     mov    bl,2
  246.     call    mouse_function
  247. endif
  248.     ret
  249. ;
  250. ;****************************************    
  251. ;escape func 4
  252. ; Cursor Up
  253. ;****************************************    
  254. escfn4:
  255.     mov    ah,read_cur_pos
  256.     int    screen
  257.     cmp    dh,0            ;is cursor at top of screen
  258.     jz    escfn4done        ;if so, then done
  259.     dec    dh
  260.     mov    ah,set_cur_pos
  261.     int    screen
  262. escfn4done:
  263.     ret
  264. ;
  265. ;****************************************    
  266. ;escape func 5
  267. ; Cursor Down
  268. ;****************************************    
  269. escfn5:
  270.     mov    ah,read_cur_pos
  271.     int    screen
  272.     cmp    dh,lines_page        ;is cursor at bottom of screen?
  273.     jz    escfn5done        ;if so, done
  274.     inc    dh
  275.     mov    ah,set_cur_pos
  276.     int    screen
  277. escfn5done:
  278.     ret
  279. ;
  280. ;****************************************    
  281. ;escape func 6
  282. ; Cursor Right
  283. ;****************************************    
  284. escfn6:
  285.     mov    ah,read_cur_pos
  286.     int    screen
  287.     cmp    dl,chars_line        ;is cursor at edge of screen?
  288.     jz    escfn6done        ;if so, done
  289.     inc    dl
  290.     mov    ah,set_cur_pos
  291.     int    screen
  292. escfn6done:
  293.     ret
  294. ;
  295. ;****************************************    
  296. ;escape func 7
  297. ; Cursor Left
  298. ;****************************************    
  299. escfn7:
  300.     mov    ah,read_cur_pos
  301.     int    screen
  302.     cmp    dl,0            ;is cursor at edge of screen?
  303.     jz    escfn7done        ;if so, done
  304.     dec    dl
  305.     mov    ah,set_cur_pos
  306.     int    screen
  307. escfn7done:
  308.     ret
  309. ;
  310. ;****************************************    
  311. ;escape func 8
  312. ; Home Cursor
  313. ;****************************************    
  314. escfn8:
  315.     mov    dx,0
  316.     mov    ah,set_cur_pos
  317.     int    screen            ; move cursor home
  318.     ret
  319. ;
  320. ;****************************************    
  321. ;escape func 9
  322. ; Erase to end of screen
  323. ;****************************************    
  324. escfn9:
  325.     mov    ah,read_cur_pos     ;get current cursor position
  326.     int    screen
  327.     push    dx            ;save it 
  328.     xor    cx,cx
  329.     mov    cl,dl            ;compute number of spaces to write
  330.     neg    cl
  331.     add    cl,chars_line        ;wrap cl around bytes_line
  332.     xor    ax,ax
  333.     mov    al,dh            ;add bytes_line * number of columns
  334.     neg    al
  335.     add    al,lines_page
  336.     dec    al            ;don't count the line we're on
  337.     mov    bl,chars_line
  338.     mul    bl            ;bl=number of lines * bytes_line
  339.     add    cx,ax
  340.     dec    cx            ;that last spot causes scroll
  341.     mov    bx,rev_vid_off        ;page zero and reverse off
  342.     mov    ah,write_char
  343.     mov    al,20h
  344.     int    screen            ;write cx spaces out
  345.     pop    dx            ;get original cursor position
  346.     mov    ah,set_cur_pos
  347.     int    screen            ;restore cursor position
  348.     ret
  349. ;
  350. ;****************************************    
  351. ;escape func 10
  352. ; Erase to end of line
  353. ;****************************************    
  354. escf10:
  355.     mov    ah,read_cur_pos     ;get current cursor position
  356.     int    screen
  357.     push    dx            ;save it 
  358.     xor    cx,cx
  359.     mov    cl,dl            ;compute number of spaces to write
  360.     neg    cl
  361.     add    cl,chars_line
  362.     mov    bx,rev_vid_off        ;page zero and everything to black
  363.     mov    al,20h
  364.     mov    ah,write_char
  365.     int    screen            ;write cx spaces out
  366.     pop    dx
  367.     mov    ah,set_cur_pos
  368.     int    screen            ;restore cursor position
  369.     ret
  370. ;
  371. ;****************************************    
  372. ;escape func 11
  373. ; Move Cursor to x,y
  374. ;****************************************    
  375. escf11:
  376.     les    di,intin
  377.     mov    ax, es:[di]            ; get the row number (1-24)
  378.     mov    dh,al
  379.     dec    dh                ; make zero relative
  380.     mov    ax, es: W_2[di]         ; get the column number (1-80)
  381.     mov    dl,al
  382.     dec    dl                ; zero relative
  383.     mov    ah,set_cur_pos
  384.     mov    bx,0                ;page zero
  385.     int    screen
  386.     ret
  387. ;
  388. ;****************************************    
  389. ;escape func 12
  390. ; Output text
  391. ;****************************************    
  392. escf12:
  393.     les    di,contrl
  394.     mov    cx, es: W_4[di]     ; get string length.
  395.     and    cx, cx            ; test if 0 count
  396.     jz    esc12_done
  397.     les    di,intin
  398. esc120:
  399.     mov    al, es:[di]    ; load character to be output.    
  400.     push    es
  401.     push    di
  402.     push    cx
  403.     mov    cx,1
  404.     xor    bx,bx
  405.     mov    bl,attribute
  406.     mov    ah,write_char
  407.     int    screen
  408.     call    escfn6
  409.     pop    cx
  410.     pop    di 
  411.     pop    es
  412.     inc    di
  413.     inc    di
  414.     loop    esc120
  415. esc12_done:
  416.     ret
  417. ;****************************************    
  418. ;escape func 13     
  419. ; Reverse video on
  420. ;****************************************    
  421. escf13:
  422.     mov    attribute,rev_vid_on
  423.     ret
  424. ;
  425. ;****************************************    
  426. ;escape func 14
  427. ; Reverse video off
  428. ;****************************************    
  429. escf14:
  430.     mov    attribute,rev_vid_off
  431.     ret
  432. ;
  433. ;****************************************    
  434. ;escape func 15
  435. ; Return Current Cursor Address 
  436. ;****************************************    
  437. escf15:
  438.     les    di,intout
  439.     mov    ah,read_cur_pos
  440.     int    screen
  441.     xor    ax,ax            ;zero high byte
  442.     mov    al,dh
  443.     inc    al            ;make one relative
  444.     mov    es:[di],ax        ;return row address
  445.     mov    al,dl
  446.     inc    al
  447.     mov    es:W_2[di],ax        ;return column address
  448.     ret
  449. EJECT
  450. ;
  451. ;************************************************************************
  452. ;*get_loc_key                                *
  453. ;*    Get Locator key                         *
  454. ;*        Entry  none                        *
  455. ;*        Exit                            *
  456. ;*            al=0 nothing happened                *
  457. ;*                                    *
  458. ;*            al=1 button press                *
  459. ;*                ah = character information        *
  460. ;*                                    *
  461. ;*            al=2 coordinate information            *
  462. ;*                bx = delta x                *
  463. ;*                cx = delta y                *
  464. ;*                                    *
  465. ;*                                    *
  466. ;************************************************************************
  467. get_loc_key:
  468. if mouse
  469.     mov    bl,3
  470.     call    mouse_function
  471.     and    al,al
  472.     jz    get_loc_mouse
  473.     ret 
  474. get_loc_mouse:
  475. endif             
  476.     mov    ah,1
  477.     int    KEYBD            ;see if ros has character
  478.     jz    get_loc_key_none
  479.     xor    ah,ah
  480.     int    KEYBD
  481.     mov    si,offset loc_tbl
  482.     mov    cx,10            ;search table for locator key
  483. loc_key_search:
  484.     cmp    ax,[si]
  485.     jz    found_loc_key
  486.     add    si,6
  487.     loop    loc_key_search
  488.     mov    ah,al
  489.     mov    al,1            ;not a locator key so return status
  490.     ret
  491. found_loc_key:
  492.     add    si,2
  493.     mov    bx,[si]     ;get delta x value
  494.     add    si,2
  495.     mov    cx,[si]
  496.     mov    al,2
  497.     ret
  498. get_loc_key_none:
  499.     xor    al,al
  500.     ret
  501. include mouse.a86
  502. EJECT
  503. ;************************************************************************
  504. ;*valuator                                *
  505. ;*    Get valuator increment                        *
  506. ;*        Exit                            *
  507. ;*            al=0 nothing happened                *
  508. ;*                                    *
  509. ;*            al=1 button press                *
  510. ;*                ah = character information        *
  511. ;*                                    *
  512. ;*            al=2 coordinate information            *
  513. ;*                bx = delta value            *
  514. ;*                                    *
  515. ;************************************************************************
  516. valuator:
  517.     mov    ah,1
  518.     int    KEYBD            ;see if ros has character
  519.     jz    get_val_none
  520.     xor    ah,ah
  521.     int    KEYBD
  522.     mov    si,offset val_tbl
  523.     mov    cx,4            ;search table for locator key
  524. val_key_search:
  525.     cmp    ax,[si]
  526.     jz    found_val_key
  527.     add    si,4
  528.     loop    val_key_search
  529.     mov    ah,al
  530.     mov    al,1            ;not a locator key so return status
  531.     ret
  532. found_val_key:
  533.     add    si,2
  534.     mov    bx,[si]     ;get delta x value
  535.     mov    al,2
  536.     ret
  537. get_val_none:
  538.     xor    ax,ax
  539.     ret
  540. EJECT
  541. ;
  542. ;************************************************************************
  543. ;*  Get choice for choice input                     *
  544. ;*        Entry  none                        *
  545. ;*                                    *
  546. ;*        Exit                            *
  547. ;*            al=0 nothing happened                *
  548. ;*                                    *
  549. ;*            al=1 choice value                *
  550. ;*                bx = choice number 1 to max choice keys *
  551. ;*                                    *
  552. ;*            al=2 button press                *
  553. ;*                ah = character                *
  554. ;*                                    *
  555. ;************************************************************************
  556. choice:
  557.     mov    ah,1
  558.     int    KEYBD            ; see if ros has character
  559.     jz    choice_none
  560.     xor    ah,ah
  561.     int    KEYBD
  562.     mov    bl,ah            ; swap byte choice runs from 3b00-4400
  563.     mov    bh,al
  564.     sub    bx,3bh
  565.     jc    choice_key        ; make it zero based if <0 then reject
  566.     cmp    bx,10            ; test if too large
  567.     jnc    choice_none
  568.     inc    bx            ; make 1-10
  569.     mov    al,1            ; bx = choice number
  570.     xor    ah,ah
  571.     ret
  572. choice_key:
  573.     mov    ah,al
  574.     mov    al,2
  575.     ret
  576. choice_none:
  577.     xor    al,al
  578.     ret
  579. ;
  580. ;****************************************
  581. ;* clearmem                *
  582. ;*        clears graphics memory    *
  583. ;*        uses ax,cx            *
  584. ;*    stores zeros in graphics plane    *
  585. ;****************************************
  586. clearmem:
  587.     mov    cx,num_planes    ; set the outer loop count up
  588.     mov    al,stop
  589.     call    write_command    ; turn off the 7220 while clearing memory
  590. clearmem_out_loop:
  591.     mov    al,curs        ; set the drawing cursor to the start address
  592.     call    write_command
  593.     mov    ax,graph_plane
  594.     call    write_parameter
  595.     mov    al,ah
  596.     call    write_parameter
  597.     mov    al,cl
  598.     dec    al        ; go from highest to lowest plane
  599.     call    write_parameter
  600.     mov    al,gmask    ; set up the mask to solid
  601.     call    write_command
  602.     mov    al,0ffh
  603.     call    write_parameter
  604.     call    write_parameter
  605.     push    cx            ;save the plane count
  606.     mov    cx,plane_size        ;get the number of 16k blocks
  607. clearmem_in_loop:
  608.     mov    al,figs            ;set the drawing count up
  609.     call    write_command
  610.     mov    al,2            ;top to bottom
  611.     call    write_parameter
  612.     mov    al,0ffh
  613.     call    write_parameter        ;16k words
  614.     mov    al,03fh
  615.     call    write_parameter
  616.     mov    al,wdat+2        ;set the writeing mode to set to 0
  617.     call    write_command
  618.     mov    al,0ffh
  619.     call    write_parameter
  620.     call    write_parameter
  621.     loop    clearmem_in_loop
  622.     pop    cx
  623.     loop    clearmem_out_loop
  624.     mov    al,start
  625.     call    write_command        ;start the 7220 again
  626.     ret
  627. ;
  628.  
  629. ;**************************************************************************
  630. ;write_command
  631. ;        writes a command byte to the NEC 7220 controller
  632. ;
  633. ;    Entry  reg al contains byte to be written
  634. ;    Uses   dx,al
  635. ;**************************************************************************
  636. write_command:
  637.     push    dx
  638.     push    ax
  639. write_command_loop:
  640.     mov    dx,nec_status
  641.     in    al,dx
  642.     and    al,fifofu        ;test if fifo is full
  643.     nop
  644.     nop
  645.     jnz    write_command_loop
  646.     mov    dx,nec_command
  647.     pop    ax
  648.     out    dx,al
  649.     pop    dx
  650.     ret
  651. ;**************************************************************************
  652. ;write_parameter
  653. ;        writes a parameter byte to the NEC 7220 controller
  654. ;
  655. ;    Entry  reg al contains byte to be written
  656. ;    Uses   dx,al
  657. ;**************************************************************************
  658. write_parameter:
  659.     push    dx
  660.     push    ax
  661. write_parameter_loop:
  662.     mov    dx,nec_status
  663.     in    al,dx
  664.     and    al,fifofu        ;test if fifo is full
  665.     nop
  666.     nop
  667.     jnz    write_parameter_loop
  668.     mov    dx,nec_param
  669.     pop    ax
  670.     out    dx,al
  671.     pop    dx
  672.     ret
  673. EJECT
  674. ;
  675. include COLNECRE.A86
  676. dseg
  677. ;***************************************************************************
  678. ;*                                       *
  679. ;*                Data Area                   *
  680. ;*             contains data for escape functions            *
  681. ;*        and the values returned on open_workstation           *
  682. ;*                                       *
  683. ;*                                       *
  684. ;*                                       *
  685. ;***************************************************************************
  686. ;
  687.     extrn    font:byte
  688.     extrn    contrl:dword 
  689.     extrn    intin:dword 
  690.     extrn    ptsin:dword 
  691.     extrn    intout:dword 
  692.     extrn    ptsout:dword 
  693.     extrn    realized_color_table:word
  694.     extrn    requested_color_table:word
  695. ;color map table
  696. ;used to map color indecies to physical bitplane values
  697. color_map_table        db    00000000b    ;black
  698.             db    00000101b    ;red
  699.             db    00001100b    ;green
  700.             db    00000110b    ;blue
  701.             db    00001110b    ;cyan
  702.             db    00001101b    ;yellow
  703.             db    00000111b    ;magenta
  704.             db    00001111b    ;white
  705.             db    00000100b    ;grey
  706.             db    00000001b    ;light red
  707.             db    00001000b    ;light green
  708.             db    00000010b    ;light blue
  709.             db    00001010b    ;light cyan
  710.             db    00001001b    ;light yellow
  711.             db    00000011b    ;light magenta
  712.             db    00001011b    ;light white
  713. ;
  714. ;default color table
  715. ;
  716. default_color_table    dw    0000,0000,0000    ;index 0
  717.             dw    1000,0000,0000
  718.             dw    0000,1000,0000
  719.             dw    0000,0000,1000
  720.             dw    0000,1000,1000
  721.             dw    1000,1000,0000
  722.             dw    1000,0000,1000
  723.             dw    1000,1000,1000
  724.             dw    0000,0000,0000    ;index 8
  725.             dw    1000,0000,0000
  726.             dw    0000,1000,0000
  727.             dw    0000,0000,1000
  728.             dw    0000,1000,1000
  729.             dw    1000,1000,0000
  730.             dw    1000,0000,1000
  731.             dw    1000,1000,1000
  732. ;
  733. mode_save    db    0
  734. ;pram_parms    parameter ram bytes
  735. pram_parms    db    8    ;byte count
  736.         db    0    ;low start address 1
  737.         db    0    ;high start address 1
  738.         db    000h    ;low line count 240
  739.         db    00fh    ;high line count
  740.         db    0
  741.         db    0
  742.         db    0
  743.         db    0
  744. ;sync_parms    sync parameter bytes
  745. sync_parms    db    8    ;8 bytes
  746.         db    graph+nonint+refrsh+noglit
  747.         db    38    ;n-2 words per line
  748.         db    61h    ;horizontal sync-1/vertical sync
  749.         db    14h    ;horizontal front porch-1/vertical sync
  750.         db    9    ;horizontal back porch
  751.         db    3h    ;vertical front porch
  752.         db    0f0h    ;active lines per field low
  753.         db    38h    ;vertical back porch and active lines high
  754. ;
  755. ;cchar_parms    cursor characteristic bytes
  756. cchar_parms    db    3    ;three bytes to send
  757.         db    0    ;n-1 lines per row
  758.         db    40h    ;magic for the 7220
  759.         db    0    ;cursor height
  760. attribute       db    07h        ;text attributes
  761. ;
  762. ;loc_tbl
  763. ;    table of words for locator keys
  764. ;        format
  765. ;            word = key code
  766. ;            word = delta x
  767. ;            word = delta y
  768. loc_tbl dw    4d00h    ;right arrow un shifted
  769.     dw    cur_mot_max_x
  770.     dw    0
  771.     dw    4d36h    ;right arrow shifted
  772.     dw    cur_mot_min_x
  773.     dw    0
  774.     dw    4b00h    ;left arrow unshifted
  775.     dw    0-cur_mot_max_x
  776.     dw    0
  777.     dw    4b34h    ;left arrow shifted
  778.     dw    0-cur_mot_min_x
  779.     dw    0
  780.     dw    4800h    ;up arrow unshifted
  781.     dw    0
  782.     dw    cur_mot_max_y
  783.     dw    4838H    ;up arrow shifted
  784.     dw    0
  785.     dw    cur_mot_min_y
  786.     dw    5000h    ;down arrow unshifted
  787.     dw    0
  788.     dw    0-cur_mot_max_y
  789.     dw    5032h    ;down arrow shifted
  790.     dw    0
  791.     dw    0-cur_mot_min_y
  792.     dw    4700h    ;home un shifted
  793.     dw    0-xresmx
  794.     dw    0-yresmx
  795.     dw    4737h    ;home shifted
  796.     dw    0-xresmx
  797.     dw    0-yresmx
  798. ;
  799. ;val_tbl
  800. ;    decoding of valuator input
  801. ;
  802. val_tbl dw    4800h    ;up arrow unshifted
  803.     dw    val_inc_big
  804.     dw    4838H    ;up arrow shifted
  805.     dw    val_inc_small
  806.     dw    5000h    ;down arrow unshifted
  807.     dw    0-val_inc_big
  808.     dw    5032h    ;down arrow shifted
  809.     dw    0-val_inc_small
  810.