home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / DEVPAC31.LZH / INCDIR / VDILIB.S < prev    next >
Text File  |  1993-05-11  |  9KB  |  617 lines

  1.  
  2. * VDI Library Copyright (C) HiSoft 1988
  3.  
  4. * 31.5.88    vqt_extent fixed
  5. * 25.10.89    v_rfbox fixed
  6. * 30.3.93    Speedo/FontGDOS functions added
  7.  
  8. * macro to jump to a given VDI routine
  9. govdi    macro    vdi_number
  10.     IFNE    (\1)<128
  11.     moveq    #\1,d0
  12.     ELSEIF
  13.     move.w    #\1,d0
  14.     ENDC
  15.     bra    CALL_VDI
  16.     endm
  17.  
  18. DEFV    macro    name
  19.     MODULE    \1
  20.     SECTION    TEXT
  21.     XREF    CALL_VDI,LOW_VDI
  22.     XREF    contrl,contrl1,contrl3,contrl6
  23.     XREF    intin,ptsin,intout,ptsout
  24.     XREF    vdi_params,current_handle
  25.     endm
  26.  
  27. EXPORT    macro    name
  28. \1    XDEF    \1
  29.     endm
  30.  
  31. docont    macro    contrl1,contrl3
  32.     IFEQ    \1
  33.     clr.w    contrl1
  34.     ELSEIF
  35.     move.w    #\1,contrl1
  36.     ENDC
  37.     IFEQ    \2
  38.     clr.w    contrl3
  39.     ELSEIF
  40.     move.w    #\2,contrl3
  41.     ENDC
  42.     endm
  43.  
  44.     DEFV    Workstations
  45.  
  46.     EXPORT    v_opnwk
  47.     moveq    #1,d0
  48. v_opall    docont    0,11
  49.     bsr    LOW_VDI
  50.     move.w    contrl6,current_handle
  51.     rts
  52.  
  53.     EXPORT    v_clswk
  54.     docont    0,0
  55.     govdi    2
  56.  
  57.     EXPORT    v_opnvwk
  58.     moveq    #100,d0
  59.     move.w    current_handle,contrl6
  60.     bra.s    v_opall
  61.  
  62.     EXPORT    v_clsvwk
  63.     docont    0,0
  64.     govdi    101
  65.  
  66.     EXPORT    v_clrwk
  67.     moveq    #3,d0
  68. v_zeroz    docont    0,0
  69.     bra    CALL_VDI
  70.  
  71.     EXPORT    v_updwk
  72.     moveq    #4,d0
  73.     bra.s    v_zeroz
  74.  
  75.     EXPORT    vst_load_fonts
  76.     moveq    #119,d0
  77. vfont_all
  78.     docont    0,1
  79.     clr.w    intin
  80.     bsr    CALL_VDI
  81.     move.w    intout,d0
  82.     rts
  83.  
  84.     EXPORT    vst_unload_fonts
  85.     moveq    #120,d0
  86.     bra.s    vfont_all
  87.  
  88.     EXPORT    vs_clip
  89.     docont    2,1
  90.     govdi    129
  91.  
  92.     DEFV    OutputFunctions
  93.  
  94.     EXPORT    v_pline
  95.     moveq    #6,d0
  96. v_pall    clr.w    contrl3
  97.     bra    CALL_VDI
  98.  
  99.     EXPORT    v_pmarker
  100.     moveq    #7,d0
  101.     bra.s    v_pall
  102.  
  103.     EXPORT    v_fillarea
  104.     moveq    #9,d0
  105.     bra.s    v_pall
  106.  
  107.     EXPORT    v_gtext
  108.     moveq    #0,d0
  109.     moveq    #0,d1
  110.     lea    intin,a1
  111. .copy    move.b    (a0)+,d1        convert C string into words
  112.     beq.s    .end
  113.     move.w    d1,(a1)+
  114.     addq.b    #1,d0
  115.     bpl.s    .copy
  116. .end    move.w    d0,contrl3
  117.     move.w    #1,contrl1
  118.     govdi    8
  119.  
  120.     EXPORT    v_contourfill
  121.     docont    1,1
  122.     govdi    103
  123.  
  124.     EXPORT    vr_recfl
  125.     docont    2,0
  126.     govdi    114
  127.  
  128.     EXPORT    v_pieslice
  129.     moveq    #3,d0
  130.     bra.s    gdp_arcpie
  131.  
  132.     EXPORT    v_arc
  133.     moveq    #2,d0
  134. gdp_arcpie
  135.     docont    4,2
  136.     clr.l    ptsin+4
  137.     clr.l    ptsin+8
  138.     clr.w    ptsin+14
  139.     bra    gdp_all
  140.  
  141.     EXPORT    v_bar
  142.     docont    2,0
  143.     moveq    #1,d0
  144.     bra.s    gdp_all    
  145.  
  146.     EXPORT    v_circle
  147.     docont    3,0
  148.     moveq    #4,d0
  149.     clr.l    ptsin+4
  150.     clr.w    ptsin+10
  151.     bra.s    gdp_all
  152.  
  153.     EXPORT    v_ellarc
  154.     docont    2,2
  155.     moveq    #6,d0
  156.     bra.s    gdp_all
  157.  
  158.     EXPORT    v_ellpie
  159.     docont    2,2
  160.     moveq    #7,d0
  161.     bra.s    gdp_all
  162.  
  163.     EXPORT    v_ellipse
  164.     docont    2,0
  165.     moveq    #5,d0
  166.     bra.s    gdp_all
  167.  
  168.     EXPORT    v_rbox
  169.     moveq    #8,d0
  170. gdp_box    docont    2,0
  171. gdp_all    move.w    d0,contrl+10
  172.     govdi    11
  173.  
  174.     EXPORT    v_rfbox
  175.     moveq    #9,d0
  176.     bra.s    gdp_box
  177.  
  178.     EXPORT    v_justified
  179.     moveq    #2,d0
  180.     moveq    #0,d1
  181.     lea    intin+4,a1
  182. .copy    move.b    (a0)+,d1        convert C string into words
  183.     beq.s    .end
  184.     move.w    d1,(a1)+
  185.     addq.b    #1,d0
  186.     bpl.s    .copy
  187. .end    move.w    d0,contrl3
  188.     move.w    #2,contrl1
  189.     moveq    #10,d0
  190.     bra.s    gdp_all
  191.  
  192.  
  193.     DEFV    AttributeFunctions
  194.  
  195.     EXPORT    vswr_mode
  196.     docont    0,1
  197.     govdi    32
  198.  
  199.     EXPORT    vs_color
  200.     docont    0,4
  201.     govdi    14
  202.  
  203.     EXPORT    vsl_type
  204.     docont    0,1
  205.     govdi    15
  206.  
  207.     EXPORT    vsl_udsty
  208.     docont    0,1
  209.     govdi    113
  210.  
  211.     EXPORT    vsl_width
  212.     docont    1,0
  213.     clr.w    ptsin+2
  214.     govdi    16
  215.  
  216.     EXPORT    vsl_color
  217.     docont    0,1
  218.     govdi    17
  219.  
  220.     EXPORT    vsl_ends
  221.     docont    0,2
  222.     govdi    108
  223.  
  224.     EXPORT    vsm_type
  225.     docont    0,1
  226.     govdi    18
  227.  
  228.     EXPORT    vsm_height
  229.     docont    1,0
  230.     clr.w    ptsin
  231.     govdi    19
  232.  
  233.     EXPORT    vsm_color
  234.     docont    0,1
  235.     govdi    20
  236.  
  237.     EXPORT    vst_height
  238.     docont    1,0
  239.     clr.w    ptsin
  240.     govdi    12
  241.  
  242.     EXPORT    vst_point
  243.     docont    0,1
  244.     govdi    107
  245.  
  246.     EXPORT    vst_rotation
  247.     docont    0,1
  248.     govdi    13
  249.  
  250.     EXPORT    vst_font
  251.     docont    0,1
  252.     govdi    21
  253.  
  254.     EXPORT    vst_color
  255.     docont    0,1
  256.     govdi    22
  257.  
  258.     EXPORT    vst_effects
  259.     docont    0,1
  260.     govdi    106
  261.  
  262.     EXPORT    vst_alignment
  263.     docont    0,2
  264.     govdi    39
  265.  
  266.     EXPORT    vsf_interior
  267.     docont    0,1
  268.     govdi    23
  269.  
  270.     EXPORT    vsf_style
  271.     docont    0,1
  272.     govdi    24
  273.  
  274.     EXPORT    vsf_color
  275.     docont    0,1
  276.     govdi    25
  277.  
  278.     EXPORT    vsf_perimeter
  279.     docont    0,1
  280.     govdi    104
  281.  
  282.     EXPORT    vsf_updat
  283.     clr.w    contrl1
  284.     govdi    112
  285.  
  286.     DEFV    RastorOps
  287.  
  288.     EXPORT    vro_cpyfm
  289.     docont    4,1
  290.     govdi    109
  291.  
  292.     EXPORT    vrt_cpyfm
  293.     docont    4,3
  294.     govdi    121
  295.  
  296.     EXPORT    vr_trnfm
  297.     docont    0,0
  298.     govdi    110
  299.  
  300.     EXPORT    v_get_pixel
  301.     docont    1,0
  302.     govdi    105
  303.  
  304.  
  305.     DEFV    InputFunctions
  306.  
  307.     EXPORT    vex_timv
  308.     docont    0,0
  309.     govdi    118
  310.  
  311.     EXPORT    v_show_c
  312.     docont    0,1
  313.     govdi    122
  314.  
  315.     EXPORT    v_hide_c
  316.     docont    0,0
  317.     govdi    123
  318.  
  319.     EXPORT    vq_mouse
  320.     docont    0,0
  321.     govdi    124
  322.  
  323.     EXPORT    vex_butv
  324.     docont    0,0
  325.     govdi    125
  326.  
  327.     EXPORT    vex_motv
  328.     docont    0,0
  329.     govdi    126
  330.  
  331.     EXPORT    vex_curv
  332.     docont    0,0
  333.     govdi    127
  334.  
  335.     EXPORT    vq_key_s
  336.     docont    0,0
  337.     govdi    128
  338.  
  339.     DEFV    InquireFunctions
  340.  
  341.     EXPORT    vq_extnd
  342.     docont    0,1
  343.     govdi    102
  344.  
  345.     EXPORT    vq_color
  346.     docont    0,2
  347.     govdi    26
  348.  
  349.     EXPORT    vql_attributes
  350.     docont    0,0
  351.     govdi    35
  352.  
  353.     EXPORT    vqm_attributes
  354.     docont    0,0
  355.     govdi    36
  356.  
  357.     EXPORT    vqf_attributes
  358.     docont    0,0
  359.     govdi    37
  360.  
  361.     EXPORT    vqt_attributes
  362.     docont    0,0
  363.     govdi    38
  364.  
  365.     EXPORT    vqt_extent
  366.     moveq    #0,d0
  367.     moveq    #0,d1
  368.     lea    intin,a1
  369. .copy    move.b    (a0)+,d1        convert C string into words
  370.     beq.s    .end
  371.     move.w    d1,(a1)+
  372.     addq.b    #1,d0
  373.     bpl.s    .copy
  374. .end    move.w    d0,contrl3
  375.     clr.w    contrl1
  376.     govdi    116
  377.  
  378.     EXPORT    vqt_width
  379.     docont    0,1
  380.     govdi    117
  381.  
  382.     EXPORT    vqt_name
  383.     docont    0,1
  384.     govdi    130
  385.  
  386.     EXPORT    vqt_fontinfo
  387.     docont    0,0
  388.     govdi    131
  389.  
  390.     DEFV    Bezier
  391.  
  392.     EXPORT    v_bez_on
  393.     docont    1,0
  394. dov_bez    move.w    #13,contrl+10
  395.     govdi    11
  396.     
  397.     EXPORT    v_bez_off
  398.     docont    0,0
  399.     bra.s    dov_bez
  400.     
  401.     EXPORT    v_set_app_buff
  402.     docont    0,3
  403.     govdi    $FFFF
  404.     
  405.     EXPORT    v_bez
  406.     move.w    d0,contrl+2
  407.     addq.w    #1,d0
  408.     lsr.w    #1,d0
  409.     move.w    d0,contrl+6
  410.     move.w    #13,contrl+10
  411.     govdi    6
  412.  
  413.     EXPORT    v_bez_fill
  414.     move.w    d0,contrl+2
  415.     addq.w    #1,d0
  416.     lsr.w    #1,d0
  417.     move.w    d0,contrl+6
  418.     move.w    #13,contrl+10
  419.     govdi    9
  420.  
  421.     EXPORT    v_bez_qual
  422.     docont    0,3
  423.     move.w    #99,contrl+10
  424.     govdi    5
  425.     
  426.  
  427.  
  428.     DEFV    SpeedoOutput
  429.  
  430.     EXPORT    v_ftext
  431.     moveq    #0,d1
  432.     moveq    #0,d0
  433.     lea    intin,a1
  434. .copy    move.b    (a0)+,d1        convert C string into words
  435.     beq.s    .end
  436.     move.w    d1,(a1)+
  437.     addq.b    #1,d0
  438.     bpl.s    .copy
  439. .end    move.w    d0,contrl3
  440.     move.w    #1,contrl1
  441.     govdi    241
  442.  
  443.     EXPORT    v_ftext_offset
  444.     moveq    #0,d1
  445.     moveq    #0,d0
  446.     lea    intin,a1
  447. .copy    move.b    (a0)+,d1        convert C string into words
  448.     beq.s    .end
  449.     move.w    d1,(a1)+
  450.     addq.b    #1,d0
  451.     bpl.s    .copy
  452. .end    move.w    d0,contrl3
  453.     addq.w    #1,d0
  454.     move.w    d0,contrl1
  455.     govdi    242
  456.  
  457.     DEFV    SpeedoInquire
  458.  
  459.     EXPORT    vqt_fontheader
  460.     docont    0,1
  461.     govdi    232
  462.     
  463.     EXPORT    vqt_trackkern
  464.     docont    0,0
  465.     govdi    234
  466.     
  467.     EXPORT    vqt_pairkern
  468.     docont    0,2
  469.     govdi    235
  470.     
  471.     EXPORT    vqt_f_extent
  472.     moveq    #0,d0
  473.     moveq    #0,d1
  474.     lea    intin,a1
  475. .copy    move.b    (a0)+,d1        convert C string into words
  476.     beq.s    .end
  477.     move.w    d1,(a1)+
  478.     addq.b    #1,d0
  479.     bpl.s    .copy
  480. .end    move.w    d0,contrl3
  481.     clr.w    contrl1
  482.     govdi    240
  483.  
  484.     EXPORT    vqt_get_table
  485.     docont    0,0
  486.     govdi    254
  487.     
  488.     EXPORT    vqt_cachesize
  489.     docont    0,1
  490.     govdi    255
  491.  
  492.     EXPORT    vqt_advance
  493.     docont    0,1
  494.     govdi    247
  495.  
  496.     EXPORT    vqt_devinfo
  497.     docont    0,1
  498.     govdi    248
  499.  
  500.  
  501.     DEFV    SpeedoAttributes
  502.     EXPORT    vst_charmap
  503.     docont    0,1
  504.     govdi    236
  505.  
  506.     EXPORT    vst_kern
  507.     docont    0,2
  508.     govdi    237
  509.  
  510.     EXPORT    vst_error
  511.     docont    0,3
  512.     govdi    245
  513.     
  514.     EXPORT    vst_arbpt
  515.     move.w    #0,contrl+2
  516.     govdi    246
  517.  
  518.     EXPORT    vst_scratch
  519.     docont    0,1
  520.     govdi    244
  521.     
  522.     EXPORT    vst_setsize
  523.     move.w    #0,contrl+2
  524.     govdi    252
  525.  
  526.     EXPORT    vst_skew
  527.     docont    0,1
  528.     govdi    253
  529.     
  530.     
  531.     DEFV    SpeedoControl    
  532.     
  533.     EXPORT    v_getbitmap_info
  534.     docont    0,1
  535.     govdi    239
  536.  
  537.     EXPORT    v_getoutline
  538.     docont    0,6
  539.     govdi    243
  540.  
  541.     EXPORT    v_savecache
  542.     moveq    #249,d0
  543.     moveq    #0,d2
  544.     lea    intin,a1
  545. v_dostrcopy
  546.     moveq    #0,d1
  547.     move.b    (a0)+,d1        convert C string into words
  548.     beq.s    .end
  549.     move.w    d1,(a1)+
  550.     addq.b    #1,d2
  551.     bpl.s    .copy
  552. .end    move.w    d2,contrl3
  553.     move.w    #0,contrl1
  554.     bra    CALL_VDI
  555.  
  556.     EXPORT    v_loadcache
  557.     move.w    #250,d0
  558.     moveq    #1,d2
  559.     lea    intin+2,a1
  560.     bra    v_dostrcopy
  561.  
  562.     EXPORT    v_flushcache
  563.     docont    0,0
  564.     govdi    251
  565.     
  566.     
  567. * the actual calling of the VDI
  568.     MODULE    LowLevelVDI
  569.     XDEF    CALL_VDI,LOW_VDI
  570.     XDEF    contrl,contrl1,contrl3,contrl6
  571.     XDEF    intin,intout,ptsin,ptsout
  572.     XDEF    current_handle,vdi_params
  573.  
  574.     SECTION    TEXT
  575. * call a VDI routine
  576. * in:    d0.w=VDI function number
  577. * out    none
  578. * uses    d0-d2/a0-a2
  579. * uses the current handle
  580. CALL_VDI
  581.     move.w    current_handle,contrl6
  582. LOW_VDI    move.w    d0,contrl            store the op code
  583.     move.l    #vdi_params,d1
  584.     move.w    #115,d0            function number
  585.     trap    #2
  586.     rts
  587.  
  588.     SECTION    DATA
  589. * this is a table of pointers to all the VDI arrays
  590. vdi_params    dc.l    contrl,intin,ptsin,intout,ptsout
  591.  
  592.     SECTION    BSS
  593. * these don't need initialising so can go in the BSS section
  594.  
  595. current_handle    ds.w    1        used by all VDI calls
  596.  
  597. contrl    ds.w    1
  598. contrl1    ds.w    1
  599. contrl2    ds.w    1
  600. contrl3    ds.w    1
  601. contrl4    ds.w    1
  602. contrl5    ds.w    1
  603. contrl6    ds.w    1
  604. contrl7    ds.w    1
  605. contrl8    ds.w    1
  606. contrl9    ds.w    1
  607. contrl10    ds.w    1
  608. contrl11    ds.w    1
  609.  
  610. intin    ds.w    128        min 30
  611. intout    ds.w    128        min 45
  612. ptsin    ds.w    128        min 30
  613. ptsout    ds.w    128        min 12
  614.  
  615.  
  616. *********** END OF VDI *****************
  617.