•  Back 
  •  VDI 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  %About 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The ATARI Compendium
Author      : Scott Sanders / JAY Software
Version     : 1.25 (20/6/2003)
Subject     : Documentation
Nodes       : 1117
Index Size  : 32614
HCP-Version : 6
Compiled on : Atari
@charset    : UTF-8
@lang       : en
@default    : 
@help       : %About
@options    : +g -i -t4 +y +z
@width      : 100
View Ref-File
                    VDI  Function Calling Procedure


The GEM VDI is accessed through a 68x00 TRAP #2 statement. Prior to the
TRAP, register d0 should contain the magic number 0x73 and register d1
should contain a pointer to VDI parameter block. An example binding is as
follows:

                  .text
        _vdi:
                  move.l          #_VDIpb,d1
                  move.l          #$73,d0
                  trap            #2
                  rts

The VDI parameter block is an array of 5 pointers which each point to
a specialized array of WORD values which contain input parameters and
function return values. Different versions of the VDI support different
size arrays. The following code contains the 'worst case' sizes for these
arrays. Many newer versions of the VDI support larger array sizes. You can
inquire what the maximum array size that VDI supports by examining the
work_out array after a v_opnvwk() or v_opnwk(). Larger array sizes allow
more points to be passed at a time for drawing functions and longer
strings to be passed for text functions. The definition of the VDI
parameter block follows:

                  .data

        _contrl:  ds.w            12
        _intin:   ds.w            128
        _ptsin:   ds.w            256
        _intout:  ds.w            128
        _ptsout:  ds.w            256

        _VDIpb:   dc.l            _contrl, _intin, _ptsin
                  dc.l            _intout, _ptsout

                  .end

The contrl array contains the opcode and number of parameters being
passed the function as follows:

             contrl[x]   Contents

                0        Function Opcode

                1        Number of Input Vertices in ptsin

                2        Number of Output Vertices in ptsout

                3        Number of Parameters in intin

                4        Number of Output Values in intout

                5        Function Sub-Opcode

                6        Workstation Handle

               7-11      Function Specific

contrl[0], contrl[1], contrl[3], contrl[5] (when necessary), and
contrl[6] must be filled in by the application. contrl[2] and contrl[4]
are filled in by the VDI on exit. contrl[7-11] are rarely used, however
some functions do rely on them for function-specific parameters.

For specific information on bindings, see the VDI Function Reference.