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