home *** CD-ROM | disk | FTP | other *** search
/ Dave Lowe: Devpac ST / Lowe_DevpacST.img / VDILIB.S < prev   
Encoding:
Text File  |  1988-06-02  |  6.0 KB  |  439 lines

  1.  
  2. * VDI Library Copyright (C) HiSoft 1988
  3.  
  4. * 31.5.88    vqt_extent fixed
  5.  
  6. * macro to jump to a given VDI routine
  7. govdi    macro    vdi_number
  8.     IFNE    (\1)<128
  9.     moveq    #\1,d0
  10.     ELSEIF
  11.     move.w    #\1,d0
  12.     ENDC
  13.     bra    CALL_VDI
  14.     endm
  15.  
  16. DEFV    macro    name
  17.     MODULE    \1
  18.     SECTION    TEXT
  19.     XREF    CALL_VDI,LOW_VDI
  20.     XREF    contrl,contrl1,contrl3,contrl6
  21.     XREF    intin,ptsin,intout,ptsout
  22.     XREF    vdi_params,current_handle
  23.     endm
  24.  
  25. EXPORT    macro    name
  26. \1    XDEF    \1
  27.     endm
  28.  
  29. docont    macro    contrl1,contrl3
  30.     IFEQ    \1
  31.     clr.w    contrl1
  32.     ELSEIF
  33.     move.w    #\1,contrl1
  34.     ENDC
  35.     IFEQ    \2
  36.     clr.w    contrl3
  37.     ELSEIF
  38.     move.w    #\2,contrl3
  39.     ENDC
  40.     endm
  41.  
  42.     DEFV    Workstations
  43.  
  44.     EXPORT    v_opnwk
  45.     moveq    #1,d0
  46. v_opall    docont    0,11
  47.     bsr    LOW_VDI
  48.     move.w    contrl6,current_handle
  49.     rts
  50.  
  51.     EXPORT    v_clswk
  52.     docont    0,0
  53.     govdi    2
  54.  
  55.     EXPORT    v_opnvwk
  56.     moveq    #100,d0
  57.     move.w    current_handle,contrl6
  58.     bra.s    v_opall
  59.  
  60.     EXPORT    v_clsvwk
  61.     docont    0,0
  62.     govdi    101
  63.  
  64.     EXPORT    v_clrwk
  65.     moveq    #3,d0
  66. v_zeroz    docont    0,0
  67.     bra    CALL_VDI
  68.  
  69.     EXPORT    v_updwk
  70.     moveq    #4,d0
  71.     bra.s    v_zeroz
  72.  
  73.     EXPORT    vst_load_fonts
  74.     moveq    #119,d0
  75. vfont_all
  76.     docont    0,1
  77.     clr.w    intin
  78.     bsr    CALL_VDI
  79.     move.w    intout,d0
  80.     rts
  81.  
  82.     EXPORT    vst_unload_fonts
  83.     moveq    #120,d0
  84.     bra.s    vfont_all
  85.  
  86.     EXPORT    vs_clip
  87.     docont    2,1
  88.     govdi    129
  89.  
  90.     DEFV    OutputFunctions
  91.  
  92.     EXPORT    v_pline
  93.     moveq    #6,d0
  94. v_pall    clr.w    contrl3
  95.     bra    CALL_VDI
  96.  
  97.     EXPORT    v_pmarker
  98.     moveq    #7,d0
  99.     bra.s    v_pall
  100.  
  101.     EXPORT    v_fillarea
  102.     moveq    #9,d0
  103.     bra.s    v_pall
  104.  
  105.     EXPORT    v_gtext
  106.     moveq    #0,d0
  107.     moveq    #0,d1
  108.     lea    intin,a1
  109. .copy    move.b    (a0)+,d1        convert C string into words
  110.     beq.s    .end
  111.     move.w    d1,(a1)+
  112.     addq.b    #1,d0
  113.     bpl.s    .copy
  114. .end    move.w    d0,contrl3
  115.     move.w    #1,contrl1
  116.     govdi    8
  117.  
  118.     EXPORT    v_contourfill
  119.     docont    1,1
  120.     govdi    103
  121.  
  122.     EXPORT    vr_recfl
  123.     docont    2,0
  124.     govdi    114
  125.  
  126.     EXPORT    v_pieslice
  127.     moveq    #3,d0
  128.     bra.s    gdp_arcpie
  129.  
  130.     EXPORT    v_arc
  131.     moveq    #2,d0
  132. gdp_arcpie
  133.     docont    4,2
  134.     clr.l    ptsin+4
  135.     clr.l    ptsin+8
  136.     clr.w    ptsin+14
  137.     bra    gdp_all
  138.  
  139.     EXPORT    v_bar
  140.     docont    2,0
  141.     moveq    #1,d0
  142.     bra.s    gdp_all    
  143.  
  144.     EXPORT    v_circle
  145.     docont    3,0
  146.     moveq    #4,d0
  147.     clr.l    ptsin+4
  148.     clr.w    ptsin+10
  149.     bra.s    gdp_all
  150.  
  151.     EXPORT    v_ellarc
  152.     docont    2,2
  153.     moveq    #6,d0
  154.     bra.s    gdp_all
  155.  
  156.     EXPORT    v_ellpie
  157.     docont    2,2
  158.     moveq    #7,d0
  159.     bra.s    gdp_all
  160.  
  161.     EXPORT    v_ellipse
  162.     docont    2,0
  163.     moveq    #5,d0
  164.     bra.s    gdp_all
  165.  
  166.     EXPORT    v_rbox
  167.     moveq    #8,d0
  168. gdp_box    docont    2,0
  169. gdp_all    move.w    d0,contrl+10
  170.     govdi    11
  171.  
  172.     EXPORT    v_rfbox
  173.     moveq    #8,d0
  174.     bra.s    gdp_box
  175.  
  176.     EXPORT    v_justified
  177.     moveq    #2,d0
  178.     moveq    #0,d1
  179.     lea    intin+4,a1
  180. .copy    move.b    (a0)+,d1        convert C string into words
  181.     beq.s    .end
  182.     move.w    d1,(a1)+
  183.     addq.b    #1,d0
  184.     bpl.s    .copy
  185. .end    move.w    d0,contrl3
  186.     move.w    #2,contrl1
  187.     moveq    #10,d0
  188.     bra.s    gdp_all
  189.  
  190.  
  191.     DEFV    AttributeFunctions
  192.  
  193.     EXPORT    vswr_mode
  194.     docont    0,1
  195.     govdi    32
  196.  
  197.     EXPORT    vs_color
  198.     docont    0,4
  199.     govdi    14
  200.  
  201.     EXPORT    vsl_type
  202.     docont    0,1
  203.     govdi    15
  204.  
  205.     EXPORT    vsl_udsty
  206.     docont    0,1
  207.     govdi    113
  208.  
  209.     EXPORT    vsl_width
  210.     docont    1,0
  211.     clr.w    ptsin+2
  212.     govdi    16
  213.  
  214.     EXPORT    vsl_color
  215.     docont    0,1
  216.     govdi    17
  217.  
  218.     EXPORT    vsl_ends
  219.     docont    0,2
  220.     govdi    108
  221.  
  222.     EXPORT    vsm_type
  223.     docont    0,1
  224.     govdi    18
  225.  
  226.     EXPORT    vsm_height
  227.     docont    1,0
  228.     clr.w    ptsin
  229.     govdi    19
  230.  
  231.     EXPORT    vsm_color
  232.     docont    0,1
  233.     govdi    20
  234.  
  235.     EXPORT    vst_height
  236.     docont    1,0
  237.     clr.w    ptsin
  238.     govdi    12
  239.  
  240.     EXPORT    vst_point
  241.     docont    0,1
  242.     govdi    107
  243.  
  244.     EXPORT    vst_rotation
  245.     docont    0,1
  246.     govdi    13
  247.  
  248.     EXPORT    vst_font
  249.     docont    0,1
  250.     govdi    21
  251.  
  252.     EXPORT    vst_color
  253.     docont    0,1
  254.     govdi    22
  255.  
  256.     EXPORT    vst_effects
  257.     docont    0,1
  258.     govdi    106
  259.  
  260.     EXPORT    vst_alignment
  261.     docont    0,2
  262.     govdi    39
  263.  
  264.     EXPORT    vsf_interior
  265.     docont    0,1
  266.     govdi    23
  267.  
  268.     EXPORT    vsf_style
  269.     docont    0,1
  270.     govdi    24
  271.  
  272.     EXPORT    vsf_color
  273.     docont    0,1
  274.     govdi    25
  275.  
  276.     EXPORT    vsf_perimeter
  277.     docont    0,1
  278.     govdi    104
  279.  
  280.     EXPORT    vsf_updat
  281.     clr.w    contrl1
  282.     govdi    112
  283.  
  284.     DEFV    RastorOps
  285.  
  286.     EXPORT    vro_cpyfm
  287.     docont    4,1
  288.     govdi    109
  289.  
  290.     EXPORT    vrt_cpyfm
  291.     docont    4,3
  292.     govdi    121
  293.  
  294.     EXPORT    vr_trnfm
  295.     docont    0,0
  296.     govdi    110
  297.  
  298.     EXPORT    v_get_pixel
  299.     docont    1,0
  300.     govdi    105
  301.  
  302.  
  303.     DEFV    InputFunctions
  304.  
  305.     EXPORT    vex_timv
  306.     docont    0,0
  307.     govdi    118
  308.  
  309.     EXPORT    v_show_c
  310.     docont    0,1
  311.     govdi    122
  312.  
  313.     EXPORT    v_hide_c
  314.     docont    0,0
  315.     govdi    123
  316.  
  317.     EXPORT    vq_mouse
  318.     docont    0,0
  319.     govdi    124
  320.  
  321.     EXPORT    vex_butv
  322.     docont    0,0
  323.     govdi    125
  324.  
  325.     EXPORT    vex_motv
  326.     docont    0,0
  327.     govdi    126
  328.  
  329.     EXPORT    vex_curv
  330.     docont    0,0
  331.     govdi    127
  332.  
  333.     EXPORT    vq_key_s
  334.     docont    0,0
  335.     govdi    128
  336.  
  337.     DEFV    InquireFunctions
  338.  
  339.     EXPORT    vq_extnd
  340.     docont    0,1
  341.     govdi    102
  342.  
  343.     EXPORT    vq_color
  344.     docont    0,2
  345.     govdi    26
  346.  
  347.     EXPORT    vql_attributes
  348.     docont    0,0
  349.     govdi    35
  350.  
  351.     EXPORT    vqm_attributes
  352.     docont    0,0
  353.     govdi    36
  354.  
  355.     EXPORT    vqf_attributes
  356.     docont    0,0
  357.     govdi    37
  358.  
  359.     EXPORT    vqt_attributes
  360.     docont    0,0
  361.     govdi    38
  362.  
  363.     EXPORT    vqt_extent
  364.     moveq    #0,d0
  365.     moveq    #0,d1
  366.     lea    intin,a1
  367. .copy    move.b    (a0)+,d1        convert C string into words
  368.     beq.s    .end
  369.     move.w    d1,(a1)+
  370.     addq.b    #1,d0
  371.     bpl.s    .copy
  372. .end    move.w    d0,contrl3
  373.     clr.w    contrl1
  374.     govdi    116
  375.  
  376.     EXPORT    vqt_width
  377.     docont    0,1
  378.     govdi    117
  379.  
  380.     EXPORT    vqt_name
  381.     docont    0,1
  382.     govdi    130
  383.  
  384.     EXPORT    vqt_fontinfo
  385.     docont    0,0
  386.     govdi    131
  387.  
  388.  
  389. * the actual calling of the VDI
  390.     MODULE    LowLevelVDI
  391.     XDEF    CALL_VDI,LOW_VDI
  392.     XDEF    contrl,contrl1,contrl3,contrl6
  393.     XDEF    intin,intout,ptsin,ptsout
  394.     XDEF    current_handle,vdi_params
  395.  
  396.     SECTION    TEXT
  397. * call a VDI routine
  398. * in:    d0.w=VDI function number
  399. * out    none
  400. * uses    d0-d2/a0-a2
  401. * uses the current handle
  402. CALL_VDI
  403.     move.w    current_handle,contrl6
  404. LOW_VDI    move.w    d0,contrl            store the op code
  405.     move.l    #vdi_params,d1
  406.     move.w    #115,d0            function number
  407.     trap    #2
  408.     rts
  409.  
  410.     SECTION    DATA
  411. * this is a table of pointers to all the VDI arrays
  412. vdi_params    dc.l    contrl,intin,ptsin,intout,ptsout
  413.  
  414.     SECTION    BSS
  415. * these don't need initialising so can go in the BSS section
  416.  
  417. current_handle    ds.w    1        used by all VDI calls
  418.  
  419. contrl    ds.w    1
  420. contrl1    ds.w    1
  421. contrl2    ds.w    1
  422. contrl3    ds.w    1
  423. contrl4    ds.w    1
  424. contrl5    ds.w    1
  425. contrl6    ds.w    1
  426. contrl7    ds.w    1
  427. contrl8    ds.w    1
  428. contrl9    ds.w    1
  429. contrl10    ds.w    1
  430. contrl11    ds.w    1
  431.  
  432. intin    ds.w    128        min 30
  433. intout    ds.w    128        min 45
  434. ptsin    ds.w    128        min 30
  435. ptsout    ds.w    128        min 12
  436.  
  437.  
  438. *********** END OF VDI *****************
  439.