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

  1. ;**************************************************************************
  2. ;*                DEVICE SPECIFIC ROUTINES              *
  3. ;*                                      *   
  4. ;*        These routines and equates are device dependant.      *
  5. ;*                                      *
  6. ;*                                      *
  7. ;*                                      *
  8. ;**************************************************************************
  9. ;Hist
  10. ;Name    Date    Modification
  11. ;DH    9/29/83 Added background color
  12. ;DH    9/29/83 Added choice possibility for character returned
  13. ;SR    11/1/83 uses rom calls to init screens
  14. ;DH    11/9/83 Added microsoft mouse option
  15. ;DH    12/28/83 removed microsoft mouse option(included in mouse.a86)
  16. dseg
  17.     copyright    db    'GSX-86 V1.3       28 Dec 83'
  18.             db    'IBM monochrome screen driver'
  19.             db    'Serial No. XXXX-0000-654321 '
  20.             db    'Digital Research, Inc.      '
  21. cseg
  22. ;
  23.     public    clearmem
  24.     public    check_escape
  25.     public    escfn0,escfn1,escfn2,escfn3
  26.     public    escfn4,escfn5,escfn6,escfn7
  27.     public    escfn8,escfn9,escf10,escf11
  28.     public    escf12,escf13,escf14,escf15
  29.     public    escf16,escf17,escf18,escf19
  30.     public    concat
  31.     public    valuator,choice,get_char
  32.     public    plyfill_rot
  33.     public    abline,draw_char
  34.     public    next_address
  35.     public    enable_cross,move_cross,clip_cross,get_loc_key
  36.     public    device_table ,    size_table
  37.     public    gcurx,gcury
  38.     public    y1,y2,x1,x2
  39.     public    lstlin
  40.     public    arstl2
  41. ;
  42.     extrn    entry:near        ;the place to jump to if this module
  43.                     ;is linked in first
  44. ;
  45. ;integer array indexing equates
  46.     W_1    equ    word ptr 0
  47.     W_2    equ    word ptr 2
  48.     W_3    equ    word ptr 4
  49.     W_4    equ    word ptr 6
  50.     W_5    equ    word ptr 8
  51.     W_6    equ    word ptr 10
  52.     W_7    equ    word ptr 12
  53.     W_8    equ    word ptr 14
  54.     W_9    equ    word ptr 16
  55.     W_10    equ    word ptr 18
  56. ;
  57. false        equ    0
  58. true        equ    not false
  59. val_inc_big    equ    10            ;maximum valuator increment
  60. val_inc_small    equ    1            ;minimum valuator increment
  61. EJECT
  62. ;****************************************************************
  63. ;        screen coordinate equates            *
  64. ;   these must be changed to the values for specific machines    *
  65. ;****************************************************************
  66. ;
  67. xresmx        equ    639            ;X - Maximum resolution.
  68. yresmx        equ    199            ;Y - Maximum resolution.
  69. xsize        equ    169            ;size of pixel in microns
  70. ysize        equ    400            ;
  71. graph_plane    equ    0b800h            ;start of graphics segment
  72. plane_size    equ    04000h            ;size of graphics memory
  73. msb_first    equ    true            ;set if msb is first out 
  74. byte_swap    equ    false            ;are bytes swapped
  75. multiseg    equ    true
  76. num_segs    equ    2            ;number of graphics segments
  77. bytes_line    equ    80            ;used to compute addresses
  78. chars_line    equ    80            ;number of characters per line
  79. lines_page    equ    25            ;lines per alpha screen
  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 or may not be necessary depending on hardware    *
  86. ;****************************************************************
  87. ;
  88. if multiseg
  89. next_line    equ    plane_size / num_segs    ;offset to get to next segment
  90. else
  91. next_line    equ    bytes_line
  92. endif
  93. neg_next_line    equ    0-next_line
  94. move_to_first    equ    0-plane_size+bytes_line
  95. move_to_last    equ    plane_size-bytes_line    ;from before first to last
  96. curwtx        equ    16            ;1/2 width of cross hair
  97. curwty        equ    8            ;1/2 height of cross hair
  98. cur_mot_max_x    equ    16            ;how far cursor moves fast in x
  99. cur_mot_max_y    equ    8            ;how far cursor moves fast in y
  100. cur_mot_min_x    equ    1            ;how far cursor moves slow in x
  101. cur_mot_min_y    equ    1            ;how far cursor moves slow in y
  102. ;
  103. ;****************************************************************
  104. ;        IBM STANDARD ROM BIOS CALLS            *
  105. ;****************************************************************
  106. SCREEN    equ    10H        ;interrupts to use for rom routine I/O
  107. KEYBD    equ    16H
  108. rev_vid_on    equ    70h        ;turn on reverse video bits
  109. rev_vid_off    equ    07h        ;turn off reverse video bits 
  110. ;
  111. read_cur_pos    equ    3            ;bios rom calls for char I/O
  112. set_cur_pos    equ    2
  113. read_char    equ    8
  114. write_char    equ    9
  115. set_palette    equ    0bh
  116. get_character    equ    0            ;keyboard read
  117. ;
  118. EJECT
  119. ;
  120.     jmp    entry        ;if we come in from here, go to real entry
  121. ;
  122. ;****************************************
  123. ;* clearmem                *
  124. ;*        clears graphics memory    *
  125. ;*        uses ax,cx,di        *
  126. ;*    stores zeros in graphics plane    *
  127. ;****************************************
  128. clearmem:
  129.     mov    ax,graph_plane        ; ld in graphics memory address
  130.     mov    es,ax
  131.     mov    cx,plane_size/2     ;number of bytes to zero
  132.     mov    al,bakcol
  133.     mov    ah,al
  134.     mov    di,0
  135.     rep    stosw            ; store plane_size zeros in graphmem
  136.     ret
  137. ;
  138. ;************************************************************************
  139. ;*            escape functions                *
  140. ;*     handle character I/O , alpha and graphics cursor        *
  141. ;*                                    *
  142. ;*    ENTRY                                *
  143. ;*        contrl    points to segment and offset of contrl        *
  144. ;*        intin    points to segment and offset of intin        *
  145. ;*        ptsin    points to segment and offset of ptsin        *
  146. ;*        intout    points to segment and offset of intout        *
  147. ;*        ptsout    points to segment and offset of ptsout        *
  148. ;*                                    *
  149. ;*                                    *
  150. ;************************************************************************
  151. ;
  152. ;****************************************
  153. ;check_escape                *
  154. ;    checks escape function called    *
  155. ;    against last_escape        *
  156. ;****************************************
  157. check_escape:
  158.     cmp    bx,last_dri_escape
  159.     jbe    its_ok
  160.     xor    bx,bx            ;do a nop if its not valid
  161. its_ok:
  162.     ret
  163. ;
  164. ;****************************************
  165. ;escape func 0
  166. ; Nop
  167. ;****************************************    
  168. escfn0:
  169.     ret
  170. ;
  171. ;****************************************    
  172. ;escape func 1
  173. ; Inquire Addressable Character Cells
  174. ;****************************************    
  175. escfn1:
  176.     les    di,intout
  177.     mov    es:W_1[di], lines_page    ; number of addressable rows. 
  178.     mov    es:W_2[di], chars_line    ; number of addressable columns.
  179.     ret
  180. ;****************************************    
  181. ;escape func 2
  182. ; Enter Graphics Mode 
  183. ;****************************************    
  184. escfn2:                 ; 
  185.     call    escfn8            ; home alpha cursor.
  186.     call    escfn9            ; clear alpha display.
  187.     push    ds
  188.     mov    ax,0
  189.     mov    ds,ax
  190.     mov    bx,410h
  191.     mov    al,[bx]         ;get current screen adapter
  192.     mov    mode_save,al        ;save it
  193.     and    al,0cfh
  194.     or    al,10h
  195.     mov    [bx],al         ;select color card
  196.     mov    ah,0
  197.     mov    al,6            ;hi-res graphics
  198.     int    screen
  199.     pop    ds
  200.     call    clearmem        ; clear graphics display
  201. ;    mov    si,offset crt_init_table_g
  202. ;    call    crt_init
  203. if mouse
  204.     mov    bl,1
  205.     call    mouse_function        ;initialize the mouse
  206. endif
  207.     ret
  208. ;
  209. ;****************************************    
  210. ;escape func 3
  211. ; Exit Graphics Mode
  212. ;****************************************    
  213. escfn3:                 ; 
  214.     mov    ax,graph_plane        ; ld in graphics memory address
  215.     mov    es,ax
  216.     mov    cx,plane_size/2     ;number of bytes to zero
  217.     xor    ax,ax
  218.     mov    di,0
  219.     rep    stosw            ; store plane_size zeros in graphmem
  220. ;    mov    si,offset crt_init_table_a
  221. ;    call    crt_init
  222.     push    ds
  223.     mov    ax,0
  224.     mov    ds,ax
  225.     mov    bx,410h
  226.     mov    al,mode_save        ;get screen adapter
  227.     mov    [bx],al         ;select default card
  228.     mov    ah,0
  229.     mov    al,3            ;alpha mode
  230.     int    screen
  231.     pop    ds
  232.     mov    attribute,rev_vid_off
  233.     call    escfn8            ;home
  234.     call    escfn9            ;clear to end of screen
  235. if mouse
  236.     mov    bl,2
  237.     call    mouse_function
  238. endif
  239.     ret
  240. ;
  241. ;*****************************************************************
  242. ;crt_init
  243. ;    initializes the display controller with data from table
  244. ;*****************************************************************
  245. crt_init:
  246.     mov    dx,03d4h        ;select port
  247.     mov    bl,0            ;select register
  248.     mov    cl,length crt_init_table_a
  249. crt_init_loop:
  250.     mov    al,bl
  251.     out    dx,al
  252.     inc    bx
  253.     inc    dx
  254.     lodsb
  255.     out    dx,al
  256.     dec    dx
  257.     loop    crt_init_loop
  258.     inc    dx
  259.     inc    dx
  260.     inc    dx
  261.     inc    dx
  262.     lodsb
  263.     out    dx,al
  264.     inc    dx
  265.     lodsb
  266.     out    dx,al
  267.     ret
  268. ;
  269. ;****************************************    
  270. ;escape func 4
  271. ; Cursor Up
  272. ;****************************************    
  273. escfn4:
  274.     mov    ah,read_cur_pos
  275.     int    screen
  276.     cmp    dh,0            ;is cursor at top of screen
  277.     jz    escfn4done        ;if so, then done
  278.     dec    dh
  279.     mov    ah,set_cur_pos
  280.     int    screen
  281. escfn4done:
  282.     ret
  283. ;
  284. ;****************************************    
  285. ;escape func 5
  286. ; Cursor Down
  287. ;****************************************    
  288. escfn5:
  289.     mov    ah,read_cur_pos
  290.     int    screen
  291.     cmp    dh,lines_page        ;is cursor at bottom of screen?
  292.     jz    escfn5done        ;if so, done
  293.     inc    dh
  294.     mov    ah,set_cur_pos
  295.     int    screen
  296. escfn5done:
  297.     ret
  298. ;
  299. ;****************************************    
  300. ;escape func 6
  301. ; Cursor Right
  302. ;****************************************    
  303. escfn6:
  304.     mov    ah,read_cur_pos
  305.     int    screen
  306.     cmp    dl,chars_line        ;is cursor at edge of screen?
  307.     jz    escfn6done        ;if so, done
  308.     inc    dl
  309.     mov    ah,set_cur_pos
  310.     int    screen
  311. escfn6done:
  312.     ret
  313. ;
  314. ;****************************************    
  315. ;escape func 7
  316. ; Cursor Left
  317. ;****************************************    
  318. escfn7:
  319.     mov    ah,read_cur_pos
  320.     int    screen
  321.     cmp    dl,0            ;is cursor at edge of screen?
  322.     jz    escfn7done        ;if so, done
  323.     dec    dl
  324.     mov    ah,set_cur_pos
  325.     int    screen
  326. escfn7done:
  327.     ret
  328. ;
  329. ;****************************************    
  330. ;escape func 8
  331. ; Home Cursor
  332. ;****************************************    
  333. escfn8:
  334.     mov    dx,0
  335.     mov    ah,set_cur_pos
  336.     int    screen            ; move cursor home
  337.     ret
  338. ;
  339. ;****************************************    
  340. ;escape func 9
  341. ; Erase to end of screen
  342. ;****************************************    
  343. escfn9:
  344.     mov    ah,read_cur_pos     ;get current cursor position
  345.     int    screen
  346.     push    dx            ;save it 
  347.     xor    cx,cx
  348.     mov    cl,dl            ;compute number of spaces to write
  349.     neg    cl
  350.     add    cl,bytes_line        ;wrap cl around bytes_line
  351.     xor    ax,ax
  352.     mov    al,dh            ;add bytes_line * number of columns
  353.     neg    al
  354.     add    al,lines_page
  355.     dec    al            ;don't count the line we're on
  356.     mov    bl,bytes_line
  357.     mul    bl            ;bl=number of lines * bytes_line
  358.     add    cx,ax
  359.     dec    cx            ;that last spot causes scroll
  360.     mov    bx,rev_vid_off        ;page zero and reverse off
  361.     mov    ah,write_char
  362.     mov    al,20h
  363.     int    screen            ;write cx spaces out
  364.     pop    dx            ;get original cursor position
  365.     mov    ah,set_cur_pos
  366.     int    screen            ;restore cursor position
  367.     ret
  368. ;
  369. ;****************************************    
  370. ;escape func 10
  371. ; Erase to end of line
  372. ;****************************************    
  373. escf10:
  374.     mov    ah,read_cur_pos     ;get current cursor position
  375.     int    screen
  376.     push    dx            ;save it 
  377.     xor    cx,cx
  378.     mov    cl,dl            ;compute number of spaces to write
  379.     neg    cl
  380.     add    cl,bytes_line
  381.     mov    bx,rev_vid_off        ;page zero and everything to black
  382.     mov    al,20h
  383.     mov    ah,write_char
  384.     int    screen            ;write cx spaces out
  385.     pop    dx
  386.     mov    ah,set_cur_pos
  387.     int    screen            ;restore cursor position
  388.     ret
  389. ;
  390. ;****************************************    
  391. ;escape func 11
  392. ; Move Cursor to x,y
  393. ;****************************************    
  394. escf11:
  395.     les    di,intin
  396.     mov    ax, es:[di]            ; get the row number (1-24)
  397.     mov    dh,al
  398.     dec    dh                ; make zero relative
  399.     mov    ax, es: W_2[di]         ; get the column number (1-80)
  400.     mov    dl,al
  401.     dec    dl                ; zero relative
  402.     mov    ah,set_cur_pos
  403.     mov    bx,0                ;page zero
  404.     int    screen
  405.     ret
  406. ;
  407. ;****************************************    
  408. ;escape func 12
  409. ; Output text
  410. ;****************************************    
  411. escf12:
  412.     les    di,contrl
  413.     mov    cx, es: W_4[di]     ; get string length.
  414.     and    cx, cx            ; test if 0 count
  415.     jz    esc12_done
  416.     les    di,intin
  417. esc120:
  418.     mov    al, es:[di]    ; load character to be output.    
  419.     push    es
  420.     push    di
  421.     push    cx
  422.     mov    cx,1
  423.     xor    bx,bx
  424.     mov    bl,attribute
  425.     mov    ah,write_char
  426.     int    screen
  427.     call    escfn6
  428.     pop    cx
  429.     pop    di 
  430.     pop    es
  431.     inc    di
  432.     inc    di
  433.     loop    esc120
  434. esc12_done:
  435.     ret
  436. ;****************************************    
  437. ;escape func 13     
  438. ; Reverse video on
  439. ;****************************************    
  440. escf13:
  441.     mov    attribute,rev_vid_on
  442.     ret
  443. ;
  444. ;****************************************    
  445. ;escape func 14
  446. ; Reverse video off
  447. ;****************************************    
  448. escf14:
  449.     mov    attribute,rev_vid_off
  450.     ret
  451. ;
  452. ;****************************************    
  453. ;escape func 15
  454. ; Return Current Cursor Address 
  455. ;****************************************    
  456. escf15:
  457.     les    di,intout
  458.     mov    ah,read_cur_pos
  459.     int    screen
  460.     xor    ax,ax            ;zero high byte
  461.     mov    al,dh
  462.     inc    al            ;make one relative
  463.     mov    es:[di],ax        ;return row address
  464.     mov    al,dl
  465.     inc    al
  466.     mov    es:W_2[di],ax        ;return column address
  467.     ret
  468. ;
  469. ;****************************************    
  470. ;escape func 16
  471. ; Return Tablet Status
  472. ;****************************************    
  473. escf16:
  474.     les    di,intout
  475. if mouse
  476.     mov    es:W_1[di],1        ;if mouse then return 1
  477. else
  478.     mov    es:W_1[di], 0        ;else return a 0
  479. endif
  480.     ret
  481. ;
  482. ;****************************************    
  483. ;escape func 17     NOT SUPPORTED
  484. ; Hard Copy
  485. ;****************************************    
  486. escf17:
  487.     ret
  488. ;
  489. ;****************************************    
  490. ;escape func 18
  491. ; Place graphic cross-hair cursor at x,y
  492. ;****************************************    
  493. escf18:
  494.     les    di,ptsin
  495.     mov    ax,es:[di]
  496.     mov    gcurx,ax
  497.     mov    ax,es:W_2[di]
  498.     mov    gcury,ax
  499.     call    enable_cross
  500.     ret                ;      locator is called before esc19.
  501. ;****************************************    
  502. ;escape func 19
  503. ; Remove cursor /Marker 
  504. ;****************************************    
  505. escf19:
  506.     call    enable_cross
  507. esc19d: ret
  508. EJECT
  509. ;****************************************************************
  510. ;CONCAT                             *    
  511. ;    ENTRY    Reg. BX - X-coordinate (dev. coord.)        *
  512. ;        Reg. AX - Y-coordinate (dev. coord.)        *
  513. ;                                *
  514. ;    EXIT    Reg. DI - Physical address            *
  515. ;        Reg. BL - Byte index                *    
  516. ;                                *
  517. ;    Reg. Used. AX, BX, CX, DX, DI                *
  518. ;                                *
  519. ;****************************************************************
  520. concat:
  521.     and    bx, 03ffh        ;mask off 10 lsb for x-coord.
  522.     mov    cx, yresmx        ;normalize y-coordinate
  523.     sub    cx, ax
  524.     mov    ax, cx
  525.     shr    ax,1
  526.     mov    dh,cl
  527.     mov    dl, bl            ;save low order byte of x-coord
  528.     and    dl, 07h         ;mask off data bit index.
  529.     mov    cl, 3            ;set count to 3
  530.     shr    bx, cl            ;shift out 3 lsb of x-coord.
  531.     mov    cl,bytes_line
  532.     mul    cl            ;brute force calculation
  533.                     ;use shift and add if possible
  534.     add    ax, bx            ;concatenate y and x coordinates in AX
  535.     and    dh,1
  536.     jz    concat1
  537.     add    ax,next_line        ;if odd address, then start at next_line
  538. concat1:mov    di, ax            ;di = memory address
  539.     xor    dh, dh
  540.     mov    bx, dx            ;bx = bit index into data byte
  541.     ret
  542. EJECT
  543. ;
  544. ;************************************************************************
  545. ;*get_loc_key                                *
  546. ;*    Get Locator key                         *
  547. ;*        Entry  none                        *
  548. ;*        Exit                            *
  549. ;*            al=0 nothing happened                *
  550. ;*                                    *
  551. ;*            al=1 button press                *
  552. ;*                ah = character information        *
  553. ;*                                    *
  554. ;*            al=2 coordinate information            *
  555. ;*                bx = delta x                *
  556. ;*                cx = delta y                *
  557. ;*                                    *
  558. ;*                                    *
  559. ;************************************************************************
  560. get_loc_key:
  561. if mouse
  562.     mov    bl,3
  563.     call    mouse_function
  564.     and    al,al
  565.     jz    get_loc_mouse
  566.     ret 
  567. get_loc_mouse:
  568. endif             
  569.     mov    ah,1
  570.     int    KEYBD            ;see if ros has character
  571.     jz    get_loc_key_none
  572.     xor    ah,ah
  573.     int    KEYBD
  574.     mov    si,offset loc_tbl
  575.     mov    cx,10            ;search table for locator key
  576. loc_key_search:
  577.     cmp    ax,[si]
  578.     jz    found_loc_key
  579.     add    si,6
  580.     loop    loc_key_search
  581.     mov    ah,al
  582.     mov    al,1            ;not a locator key so return status
  583.     ret
  584. found_loc_key:
  585.     add    si,2
  586.     mov    bx,[si]     ;get delta x value
  587.     add    si,2
  588.     mov    cx,[si]
  589.     mov    al,2
  590.     ret
  591. get_loc_key_none:
  592.     xor    al,al
  593.     ret
  594. include mouse.a86
  595. EJECT
  596. ;************************************************************************
  597. ;*valuator                                *
  598. ;*    Get valuator increment                        *
  599. ;*        Exit                            *
  600. ;*            al=0 nothing happened                *
  601. ;*                                    *
  602. ;*            al=1 button press                *
  603. ;*                ah = character information        *
  604. ;*                                    *
  605. ;*            al=2 coordinate information            *
  606. ;*                bx = delta value            *
  607. ;*                                    *
  608. ;************************************************************************
  609. valuator:
  610.     mov    ah,1
  611.     int    KEYBD            ;see if ros has character
  612.     jz    get_val_none
  613.     xor    ah,ah
  614.     int    KEYBD
  615.     mov    si,offset val_tbl
  616.     mov    cx,4            ;search table for locator key
  617. val_key_search:
  618.     cmp    ax,[si]
  619.     jz    found_val_key
  620.     add    si,4
  621.     loop    val_key_search
  622.     mov    ah,al
  623.     mov    al,1            ;not a locator key so return status
  624.     ret
  625. found_val_key:
  626.     add    si,2
  627.     mov    bx,[si]     ;get delta x value
  628.     mov    al,2
  629.     ret
  630. get_val_none:
  631.     xor    ax,ax
  632.     ret
  633. EJECT
  634. ;
  635. ;************************************************************************
  636. ;*  Get choice for choice input                     *
  637. ;*        Entry  none                        *
  638. ;*                                    *
  639. ;*        Exit                            *
  640. ;*            al=0 nothing happened                *
  641. ;*                                    *
  642. ;*            al=1 choice value                *
  643. ;*                bx = choice number 1 to max choice keys *
  644. ;*                                    *
  645. ;*            al=2 button press                *
  646. ;*                ah = character                *
  647. ;*                                    *
  648. ;************************************************************************
  649. choice:
  650.     mov    ah,1
  651.     int    KEYBD            ; see if ros has character
  652.     jz    choice_none
  653.     xor    ah,ah
  654.     int    KEYBD
  655.     mov    bl,ah            ; swap byte choice runs from 3b00-4400
  656.     mov    bh,al
  657.     sub    bx,3bh
  658.     jc    choice_key        ; make it zero based if <0 then reject
  659.     cmp    bx,10            ; test if too large
  660.     jnc    choice_none
  661.     inc    bx            ; make 1-10
  662.     mov    al,1            ; bx = choice number
  663.     xor    ah,ah
  664.     ret
  665. choice_key:
  666.     mov    ah,al
  667.     mov    al,2
  668.     ret
  669. choice_none:
  670.     xor    al,al
  671.     ret
  672. EJECT
  673. ;
  674. ;************************************************************************
  675. ;*get_char                                *
  676. ;*    Get character for string input                    *
  677. ;*        Entry  none                        *
  678. ;*                                    *
  679. ;*        Exit                            *
  680. ;*            al=0 nothing happened                *
  681. ;*                                    *
  682. ;*            al=1 button press                *
  683. ;*                bx = character information        *
  684. ;*                                    *
  685. ;************************************************************************
  686. get_char:
  687.     mov    ah,1
  688.     int    KEYBD            ; see if ros has character
  689.     jz    get_char_none
  690.     xor    ah,ah
  691.     int    KEYBD
  692.     mov    bl,al
  693.     xor    bh,bh
  694.     mov    al,1            ; return character in bx status in al
  695.     ret
  696. get_char_none:
  697.     xor    al,al
  698.     ret
  699. EJECT
  700. ;
  701. include monommre.a86
  702. dseg
  703. ;***************************************************************************
  704. ;*                                       *
  705. ;*                Data Area                   *
  706. ;*             contains data for escape functions            *
  707. ;*        and the values returned on open_workstation           *
  708. ;*                                       *
  709. ;*                                       *
  710. ;*                                       *
  711. ;***************************************************************************
  712. ;
  713.     extrn    txtclx:word    ;text color index
  714.     extrn    txtcol:byte    ;text writing mode
  715.     extrn    wrmode:word    ;writing mode
  716.     extrn    plncol:byte    ;polygon color index
  717.     extrn    bakcol:byte    ;back ground color
  718.     extrn    style:word    ;line style
  719.     extrn    contrl:dword 
  720.     extrn    intin:dword 
  721.     extrn    ptsin:dword 
  722.     extrn    intout:dword 
  723.     extrn    ptsout:dword 
  724. ;
  725. mode_save   db    0    ;save switch setting for default card
  726. ;
  727. crt_init_table_g   db    38h,28h,2bh,0ah,7fh,6h,64h,70h,2,1,0,0bh,0,0,0,0
  728.            db    1eh,3fh
  729. ;
  730. crt_init_table_a   db    71h,50h,5ah,0ah,1fh,6h,19h,1ch,2,7,6,7,0,0,0,0
  731.            db    29h,30h
  732. ;
  733. attribute       db    07h        ;text attributes
  734. ;
  735. ;loc_tbl
  736. ;    table of words for locator keys
  737. ;        format
  738. ;            word = key code
  739. ;            word = delta x
  740. ;            word = delta y
  741. loc_tbl dw    4d00h    ;right arrow un shifted
  742.     dw    cur_mot_max_x
  743.     dw    0
  744.     dw    4d36h    ;right arrow shifted
  745.     dw    cur_mot_min_x
  746.     dw    0
  747.     dw    4b00h    ;left arrow unshifted
  748.     dw    0-cur_mot_max_x
  749.     dw    0
  750.     dw    4b34h    ;left arrow shifted
  751.     dw    0-cur_mot_min_x
  752.     dw    0
  753.     dw    4800h    ;up arrow unshifted
  754.     dw    0
  755.     dw    cur_mot_max_y
  756.     dw    4838H    ;up arrow shifted
  757.     dw    0
  758.     dw    cur_mot_min_y
  759.     dw    5000h    ;down arrow unshifted
  760.     dw    0
  761.     dw    0-cur_mot_max_y
  762.     dw    5032h    ;down arrow shifted
  763.     dw    0
  764.     dw    0-cur_mot_min_y
  765.     dw    4700h    ;home un shifted
  766.     dw    0-xresmx
  767.     dw    0-yresmx
  768.     dw    4737h    ;home shifted
  769.     dw    0-xresmx
  770.     dw    0-yresmx
  771. ;
  772. ;val_tbl
  773. ;    decoding of valuator input
  774. ;
  775. val_tbl dw    4800h    ;up arrow unshifted
  776.     dw    val_inc_big
  777.     dw    4838H    ;up arrow shifted
  778.     dw    val_inc_small
  779.     dw    5000h    ;down arrow unshifted
  780.     dw    0-val_inc_big
  781.     dw    5032h    ;down arrow shifted
  782.     dw    0-val_inc_small
  783. ;
  784.