Home NVDI Programmer's Guide List of VDI functions Color Settings

2.5 Device Driver and Offscreen Bitmaps


2.5.1 OPEN WORKSTATION (VDI 1)

This function loads a device driver and opens a physical workstation. The driver is loaded according to ASSING.SYS and the device is initialized with parameters in the input array.

If the driver is able to open the device, the VDI returns a device handle in contrl[6]. A zero in contrl[6] indicates an error.

Important: The screen driver is opened by the AES after all programs in the AUTO folder have been executed. Therefore applications have to call OPEN VIRTUAL WORKSTATION (VDI 100).

Decl.:  void v_opnwk( WORD *work_in, WORD *handle, WORD *work_out );
Call:   v_opnwk( work_in, &handle, work_out );

Variable         Arguments           Meaning
Input:

contrl[0]        1                   v_opnwk
contrl[1]        0                   entries in ptsin
contrl[3]        11                  entries in intin
contrl[6]        0 or 1
intin[0..10]     work_in[0..10]

Output:

contrl[2]        6                   entries in ptsout
contrl[4]        45                  entries in intout
contrl[6]        handle
intout[0..44]    work_out[0..44]
ptsout[0..11]    work_out[45..56]

Meaning of work_in[0..10]:
work_in[0]: Device ID number. This value determines which
            device driver will be opened.

            1-10: Screen
            1:    current resolution
            2:    320*200,  16 colors
            3:    640*200,  4 colors
            4:    640*400,  monochrome
            6:    640*480,  16 colors  (TT)
            8:    1280*960, monochrome (TT)
            9:    320*480,  256 colors (TT)

            ab 11: Plotter
            ab 21: Printer
            ab 31: Metafile
            ab 41: Kamera
            ab 51: Tablet
            ab 61: Memory

work_in[1]: Line type
work_in[2]: Line color index
work_in[3]: Marker type
work_in[4]: Marker color index
work_in[5]: font id
work_in[6]: text color index
work_in[7]: fill interior style
work_in[8]: fill style index
work_in[9]: fill color index
work_in[10]:transformation flag 0: NDC , 2: RC

Meaning of work_out[0..56]:
work_out[0]:  Maximum addressable width (0 - xmax)
work_out[1]:  Maximum addressable height (0 - ymax)
work_out[2]:  Device Coordinate units fla
              0: Device capable of producing a precisely scaled
                 image (e.g. screen)
              1: Device not capable of producing a precisely scaled
                 image (e.g. film recorder)
work_out[3]:  Pixel width in microns
work_out[4]:  Pixel height in microns
work_out[5]:  Number of character heights (0: continous scaling)
work_out[6]:  Number of line types
work_out[7]:  Number of line widths (0: continous scaling)
work_out[8]:  Number of marker types
work_out[9]:  Number of marker heights (0: continous scaling)
work_out[10]: Number of accessible fonts
work_out[11]: Number of patterns
work_out[12]: Number of hatch styles
work_out[13]: Number of simultaneously displayed colors
              (e.g. 256 on an 8 bit screen)
work_out[14]: Number of GDPs
work_out[15] to work_out[24]:
              List of the supported GDPs. -1 indicates the end
              of the list.
work_out[25] to work_out[34]:
              List of attributes associated with each GDP:
              0: Line
              1: Marker
              2: Text
              3: Fill area
              4: no attributes
work_out[35]: Color capability flag
work_out[36]: Text rotation capability flag
work_out[37]: Fill area capability falg
work_out[38]: CELLARRAY flag
work_out[39]: Number of color levels (0: more than 32767)
work_out[40]: Number of locator devices available
              1: Keyboard
              2: Keyboard and mouse (or other devices)
work_out[41]: Number of valuator devices available
              1: Keyboard
              2: another device is available
work_out[42]: Number of choice devices available
              1: Function keys
              2: another button pad
work_out[43]: Number of string devices available
              1: Keyboard
work_out[44]: Device type
              0: Output only
              1: Input only
              2: Input and Output
              4: Metafile output
work_out[45]: minimum character width
work_out[46]: minimum character height
work_out[47]: maximum character width
work_out[48]: maximum character height
work_out[49]: minimum line with
work_out[50]: 0
work_out[51]: maximum line width
work_out[52]: 0
work_out[53]: minimum marker width
work_out[54]: minimum marker height
work_out[55]: maximum marker width
work_out[56]: maximum marker height

If you open a NVDI printer or IMG driver, you can set the page size and the GEMDOS output device. The Metafile driver ignores the page size (it should be 0) but it uses the device name.

Variable         Arguments           Meaning
Input:

contrl[0]        1                   v_opnwk
contrl[1]        0                   entries in ptsin
contrl[3]        16                  entries in intin
contrl[6]        0 or 1
intin[0..15]     work_in[0..15]

Output:
as described above

Meaning of work_in[11..15]:
work_in[11]:   page size
               #define  PAGE_DEFAULT   0     /* use default setting */
               #define  PAGE_A3        1     /* DIN A3 */
               #define  PAGE_A4        2     /* DIN A4 */
               #define  PAGE_A5        3     /* DIN A5 */
               #define  PAGE_B5        4     /* DIN B5 */

               #define  PAGE_LETTER    16    /* Letter size */
               #define  PAGE_HALF      17    /* Half size */
               #define  PAGE_LEGAL     18    /* Legal size */
               #define  PAGE_DOUBLE    19    /* Double size */
               #define  PAGE_BROAD     20    /* Broad sheet size */

work_in[12/13]: pointer to a GEMDOS file name (C string) or 0L
work_in[14]:    0, reserved
work_in[15]:    0, reserved

2.5.2 CLOSE WORKSTATION (VDI 2)

"CLOSE WORKSTATION" closes a physical workstation.

If you call v_clswk() for a printer driver and if you have not called v_updwk() or v_clear_disp_list() before, buffered commands will be executed and sent to the printer.

Decl.:  void v_clswk( WORD handle );
Call:   v_clswk( handle );

Variable         Arguments           Meaning
Input:

contrl[0]        2                   v_clswk
contrl[1]        0                   entries in ptsin
contrl[3]        0                   entries in intin
contrl[6]        handle

Output:

contrl[2]        0                   entries in ptsout
contrl[4]        0                   entries in intout

2.5.3 OPEN VIRTUAL SCREEN WORKSTATION (VDI 100)

"OPEN VIRTUAL SCREEN WORKSTATION" opens a virtual workstation on an already opened physical device (the screen). The attributes for each (virtual) workstation are maintained separately.

To open a virtual workstation you have call this function with the handle of the AES workstation which is returned by graf_handle:

  aes_handle = graf_handle(&gr_hwchar,&gr_hhchar,&gr_hwbox,&gr_hhbox);
  handle = aes_handle;

Decl.:  void v_opnvwk( WORD *work_in, WORD *handle, WORD *work_out );
Call:   v_opnvwk( work_in, &handle, work_out );

Variable         Arguments           Meaning
Input:

contrl[0]        100                 v_opnvwk
contrl[1]        0                   entries in ptsin
contrl[3]        11                  entries in intin
contrl[6]        handle              handle of the physical workstation
intin[0..10]     work_in[0..10]

Output:

contrl[2]        6                   entries in ptsout
contrl[4]        45                  entries in intout
contrl[6]        handle              handle of the virtual workstation
intout[0..44]    work_out[0..44]
ptsout[0..11]    work_out[45..56]

For a description of the input and output parameters see "OPEN WORKSTATION".

2.5.4 CLOSE VIRTUAL SCREEN WORKSTATION (VDI 101)

This function closes a virtual workstation.

Decl.:  void v_clsvwk( WORD handle );
Call:   v_clsvwk( handle );

Variable         Arguments           Meaning
Input:

contrl[0]        101                 v_clsvwk
contrl[1]        0                   entries in ptsin
contrl[3]        0                   entries in intin
contrl[6]        handle

Output:
contrl[2]        0                   entries in ptsout
contrl[4]        0                   entries in intout

2.5.5 CLEAR WORKSTATION (VDI 3)

This function erases the screen or - if the device is a printer or plotter - advances the page and clears the printing buffer.

Deklaration: void v_clrwk( WORD handle );
Call:        v_clrwk( handle);

Variable         Arguments           Meaning
Input:

contrl[0]        3                   v_clrwk
contrl[1]        0                   entries in ptsin
contrl[3]        0                   entries in intin
contrl[6]        handle

Output:

contrl[2]        0                   entries in ptsout
contrl[4]        0                   entries in intout

2.5.6 CLEAR DISPLAY LIST (VDI 5, Escape 22)

This function for printer or plotter drivers clears the printing buffer (and deletes all previos commands). In contrast to CLEAR WORKSTATION it does not advance the page. This function should be called if the user interrupts printing while your application generates the page.

Deklaration: void v_clear_disp_list( WORD handle );
Call:        v_clear_disp_list( handle);

Variable         Arguments           Meaning
Input:

contrl[0]        5                   v_escape
contrl[1]        0                   entries in ptsin
contrl[3]        0                   entries in intin
contrl[5]        22                  v_clear_disp_list
contrl[6]        handle

Output:

contrl[2]        0                   entries in ptsout
contrl[4]        0                   entries in intout

2.5.7 UPDATE WORKSTATION (VDI 4)

"UPDATE WORKSTATION" starts output on devices like printers or plotters, which buffer VDI commands in a display list and do not execute them immediately.

The screen driver executes VDI commands immediately and therefore you do not have to call "UPDATE WORKSTATION".

Decl.:  void v_updwk( WORD handle );
Call:   v_updwk( handle );

Variable         Arguments           Meaning
Input:

contrl[0]        4                   v_updwk
contrl[1]        0                   entries in ptsin
contrl[3]        0                   entries in intin
contrl[6]        handle

Output:

contrl[2]        0                   entries in ptsout
contrl[4]        0                   entries in intout

2.5.8 OPEN BITMAP (VDI 100, 1)

This function creates an offscreen bitmap on which can draw with VDI functions. You can pass a pointer to a bitmap or otherwise the VDI will allocate the memory for it. The pixel sizes will be used to scale vector fonts, so that the aspect ratio and the proportions will be correct.

If your redraw (of a window region) is very complex or time consuming and causes a flickering on the screen, you should use an offscreen bitmap to create an image and then you should copy it to the screen via vrt_cpyfm() or vro_cpyfm().

Decl.:  void v_opnbm( WORD *work_in, MFDB *bitmap, WORD *handle, WORD *work_out );
Call:   v_opnbm( work_in, &bitmap, &handle, work_out );

Variable         Arguments           Meaning
Input:

contrl[0]        100                 v_opnbm
contrl[1]        0                   entries in ptsin
contrl[3]        20                  entries in intin
contrl[5]        1                   v_opnbm
contrl[6]        handle              handle of the physical workstation
contrl[7..8]     bitmap              pointer to the MFDB of the bitmap
intin[0..19]     work_in[0..19]

Output:

contrl[2]        6                   entries in ptsout
contrl[4]        45                  entries in intout
contrl[6]        handle              handle of the bitmap
intout[0..44]    work_out[0..44]
ptsout[0..11]    work_out[45..56]

Meaning of work_in:
work_in[0..10]:   see v_opnwk()/v_opnvwk()
work_in[11]:      width -1 (e.g. 1279)
work_in[12]:      height -1 (e.g. 959)
work_in[13]:      pixel width in microns
work_in[14]:      pixel height in microns
work_in[15..19]:  must be 0 (!!) if you want to create a bitmap in
                  device specific format

Meaning of <bitmap>: <bitmap> is a pointer to a MFDB. If bitmap->fd_addr is zero, the VDI will allocate memory for the bitmap according to the width an height in work_on (and the bitmap will be erased).

To create a bitmap in device specific format, bitmap->fd_nplanes has to be zero or the number of planes of the screen (returned by vq_extnd() in work_out[4]). If bitmap->fd_nplanes is 1, the VDI creates a monochrome bitmap.

The structure members of the MFDB (fd_addr, fd_w, fd_h, fd_wdwidth, fd_stand, fd_nplanes) will be initialized by the VDI driver and returned to the calling application. If there is not enough memory for the bitmap, the MFDB will not be changed and a zero-handle will be returned.

If bitmap->fd_addr is a nonzero value, the VDI will use it as a poninter to a bitmap and if the bitmap is in standard format, it will be transformed to the device specific format. If v_opnbm() does not support the requested format of the bitmap (that means the number of colors, planes and the organisation), a zero-handle will indicate an error.

If the EdDI cookie has version number 1.1 or newer, v_opnbm() takes additional arguments in work_in[15..19] into account:

work_in[15..16]:  number of simultaneously displayable colors
work_in[17]:      number of planes
work_in[18]:      pixel format
work_in[19]:      bit order

For a more detailed description of the pixel format and bit order see vq_scrninfo().

2.5.9 CLOSE BITMAP (VDI 101, 1)

This function closes an offscreen bitmap. If the VDI has allocated the memory for the bitmap, this call frees the memory.

Decl.:  void v_clsbm( WORD handle );
Call:   v_clsbm( handle );

Variable         Arguments           Meaning
Input:

contrl[0]        101                 v_clsbm
contrl[1]        0                   entries in ptsin
contrl[3]        0                   entries in intin
contrl[5]        1                   v_clsbm()
contrl[6]        handle

Output:

contrl[2]        0                   entries in ptsout
contrl[4]        0                   entries in intout

2.5.10 EXTENDED INQUIRE FUNCTION (VDI 102)

This function either returns the output arguments of v_opnwk()/v_opnvwk() or additional device-specific information.

Decl.:  void vq_extnd( WORD handle, WORD flag, WORD *work_out );
Call:   vq_extnd( handle, owflag, work_out );

Variable         Arguments           Meaning
Input:

contrl[0]        102                 vq_extnd
contrl[1]        0                   entries in ptsin
contrl[3]        1                   entries in intin
contrl[6]        handle
intin[0]         flag                information type

Output:

contrl[2]        6                   entries in ptsout
contrl[4]        45                  entries in intout
intout[0..44]    work_out[0..44]
ptsout[0..11]    work_out[45..56]

Meaning of flag:
0: return v_opnwk()/v_opnvwk() values
1: return additional information

Meaning of work_out:
work_out[0]:  type of screen
              0: no screen
              1: separate alpha and graphic controllers and
                 separate video memory
              2: separate alpha and graphic controllers with
                 shared video memory
              3: common video an graphic controller with
                 separate video memory
              4: common alpha and graphic controller with
                 shared video memory
work_out[1]:  number of color levels (refers to the CLUT)
work_out[2]:  supported text effects
work_out[3]:  raster scaling flag
              0: scaling impossible
              1: scaling possible
work_out[4]:  number of planes
work_out[5]:  CLUT flag
              0: no CLUT
              1: CLUT or pseudo-CLUT (true color) exists
work_out[6]:  performance factor
work_out[7]:  contour fill capability (v_contourfill)
              0: not supported
              1: contour fill supported
work_out[8]:  text rotation ability
              0: none
              1: in steps of 90 degree only
              2: in steps of 1/10 degree
work_out[9]:  number of writing modes
work_out[10]: available input levels
              0: none
              1: request
              2: request and sample
work_out[11]: text alignment flag
              0: not available
              1: available
work_out[12]: inking capability flag
              0: device cannot ink
              1: device can ink
work_out[13]: rubberbanding capability flag
              0: no
              1: capable of rubberband lines
              2: capable of rubberband lines and rectangles
work_out[14]: maximum number of input vertices or -1 (unlimited)
work_out[15]: maximum number of intin arguments or -1 (no limit)
work_out[16]: number of mouse keys
work_out[17]: line types for wide lines
              0: no
              1: yes
work_out[18]: number fo writing modes for wide lines
work_out[19]: clipping flag
              0: clipping off
              1: clipping on
work_out[20]: 0: extend precision pixel size information is not available
              1: pixel size is in 1/10 microns
              2: pixel size is in 1/100 microns
              3: pixel size is in 1/1000 microns

work_out[21]: pixel width in 1/10, 1/100 or 1/1000 microns
work_out[22]: pixel height in 1/10, 1/100 or 1/1000 microns
work_out[23]: horizontal resolution in dpi
work_out[24]: vertical resolution in dpi
work_out[28]: bezier flag (bit 1)
              0: driver has not bezier capability
              1: driver has bezier capability

work_out[30]: raster flag (bit 0)
              0: no scaling
              1: vrt/vro_cpyfm() is capable of scaling bitmaps

work_out[40]: not imprintable left border in pixels (printers/plotters)
work_out[41]: not imprintable upper border in pixels (printers/plotters)
work_out[42]: not imprintable right border in pixels (printers/plotters)
work_out[43]: not imprintable lower border in pixels (printers/plotters)

work_out[44]: page size (printers etc.), see v_opnwk()/vs_page_size()

work_out[45..48]: clipping rectangle

Note: If work_out[20] contains a nonzero value, work_out[21..24] and work_out[40..43] will contain extended information about pixel size and not imprintable borders. Usually margins only are returned for printer drivers due to mechanical limitations of the printer. Applications should take the margins into account to center the document correctly and they should display the margins on screen.

The addressable raster size returned by v_opnwk() (work_in[0/1]) is the area that can be imprinted. That means the upper left corner (0,0) of the imprintable page has a distance of (work_out[40], work_out[41]) pixels from the upper left corner of the physical sheet of paper.

If a driver returns more precise pixel sizes, this information should be used to calculate the position of graphic objects for printing. In worst case using the values from v_opnwk() in work_out[3/4] can result in a positioning inaccuracy of 2 or 3 mm (for output on a DIN A4 page).

The original ATARI VDI does not return the clipping flag (work_out[19]), but it returns the clipping rectangle.

You should not use the bezier flag (work_out[28]) to determine if the driver is capable of generating bezier curves because some drivers have bezier support but do not return the bezier flag. We recommend to use v_bez_on()!

2.5.11 INQUIRE SCREEN INFORMATION (VDI 102, 1)

"INQUIRE SCREEN INFORMATION" returns extended information about the bitmap format of the device (the device-specific format).

Decl.:  void vq_scrninfo( WORD handle, WORD *work_out );
Call:   vq_scrninfo( handle, work_out );

Variable         Arguments           Meaning
Input:

contrl[0]        102                 vq_scrninfo
contrl[1]        0                   entries in ptsin
contrl[3]        1                   entries in intin
contrl[5]        1                   vq_scrninfo()
contrl[6]        handle
intin[0]         2                   erweiterte Informationen ausgeben

Output:

contrl[2]        0                   entries in ptsout
contrl[4]        272                 entries in intout
intout[0..272]   work_out[0..272]    erweiterte Informationen

Meaning of work_out:
work_out[0]:   pixel format
               0: interleaved planes, organized in words (ATARI)
               1: standard format (whole planes)
               2: packed pixels
               -1: unknown format; not accessible
work_out[1]:   CLUT flag
               0: no CLUT (e.g. TTM 194)
               1: hardware CLUT
               2: software CLUT (HiColor or TrueColor)
work_out[2]:   number of planes (bits) per pixel
work_out[3/4]: number of colors or 0L (more than 2*10^31 colors)
work_out[5]:   line width in bytes (since EdDI 1.1)
work_out[6/7]: address of the bitmap (since EdDI 1.1)
work_out[8]:   number of bits for red levels
work_out[9]:   number of bits for green levels
work_out[10]:  number of bits for blue levels
work_out[11]:  number of bits for alpha channel
work_out[12]:  number of bits for genlock
work_out[13]:  number of unused bits
work_out[14]:  bit order (since EdDI 1.1)

               2-256 colors:

               bit number| description
               ----------|-----------------------------------------------
                  0      | usual bit order

               32768 colors (16 planes):

               bit number| description
               ----------|-----------------------------------------------
                  0      | usual bit order: 1 bit overlay (or unused),
                         | 5 bits red, 5 bits green, 5 bits blue
                         | (xrrrrrgg-gggbbbbb)
                         |
                  1      | Falcon bit order: 5 bits red, 5 bits green,
                         | 1 bit overlay, 5 bits blue
                         | (rrrrrggg-ggxbbbbb)
                         |
                  7      | swapped bytes (intel order)
                         | e.g. Crazy Dots (gggbbbbb-xrrrrrgg)

               65536 colors (16 planes):

               bit number| description
               ----------|-----------------------------------------------
                  0      | usual bit order: 5 bits red, 6 bits green,
                         | 5 bits blue (rrrrrggg-gggbbbbb)
                         |
                  7      | swapped bytes (intel order)
                         | e.g. Crazy Dots 2 (gggbbbbb-rrrrrggg)

               16777216 colors (24 planes):

               bit number| description
               ----------|-----------------------------------------------
                  0      | usual bit order: 8 bits red, 8 bits green,
                         | 8 bits blue (rrrrrrrr-gggggggg-bbbbbbbb)
                         |
                  7      | swapped bytes (intel order)
                         | (bbbbbbbb-gggggggg-rrrrrrrr)

               16777216 colors (32 Planes):

               bit number| description
               ----------|-----------------------------------------------
                  0      | usual bit order, 8 bits overlay or unused,
                         | 8 bits red, 8 bits green, 8 bits blue
                         | (xxxxxxxx-rrrrrrrr-gggggggg-bbbbbbbb)
                         |
                  7      | swapped bytes (intel order)
                         | (bbbbbbbb-gggggggg-rrrrrrrr-xxxxxxxx)

If a hardware CLUT (intout[1] == 1) exists:
work_out[16-271]: pixel value of the corresponding VDI color index (0-255)

In case of HiColor, TrueColor...:
work_out[16..31]:    bit number of the pixel associated with the bit
                                                        number of the intensity level of red
work_out[32..47]:    bit number of the pixel associated with the bit
                                                        number of the intensity level of green
work_out[48..63]:    bit number of the pixel associated with the bit
                                                        number of the intensity level of blue
work_out[64..79]:    bit numbers for alpha channel
work_out[80..95]:    bit numbers for genlock
work_out[96..127]:   unused bits
work_out[128..271]:  reserved (0)
   Examples:
   ----------

   256 colors on the Falcon:

   work_out | value  | description
   ---------|--------|--------------------------------------------------
      0     |   0    | interleaved Planes, (words)
      1     |   1    | hardware CLUT
      2     |   8    | 8 bits per pixel
      3/4   | 256    | 256 simultaneously displayable colors
      5     | xxxx   | width of the bitmap in bytes (since EdDI 1.1)
      6/7   | xxxxL  | address of the bitmap (since EdDI 1.1)
      8     |   6    | CLUT has 6 bits for red intensity
      9     |   6    | CLUT has 6 bits for green intensity
     10     |   6    | CLUT has 6 bits for blue intensity
     11     |   0    | no alpha channel
     12     |   0    | no genlock
     13     |   0    | no unused bits
     14     |   1    | usual bit order (since EdDI 1.1)
            |        |
     16     |   0    | pixel value for VDI color index 0
     17     | 255    | pixel value for VDI color index 1
     18     |   2    | pixel value for VDI color index 2
     ...    | ...    |
    271     |  15    | pixel value for VDI color index 255

   HiColor on the Falcon:

   work_out | value  | description
   ---------|--------|---------------------------------------------------
      0     |   2    | packed pixels
      1     |   2    | HiColor (TrueColor:-) => pseudo CLUT
      2     |  16    | 16 bits per pixel
      3/4   | 32768  | 32768 colors
      5     | xxxx   | width of the bitmap in bytes (since EdDI 1.1)
      6/7   | xxxxL  | address of the bitmap (since EdDI 1.1)
      8     |   5    | 5 bits for red intensity
      9     |   5    | 5 bits for green intensity
     10     |   5    | 5 bits for blue intensity
     11     |   0    | no alpha channel
     12     |   1    | 1 bit for genlock (overlay)
     13     |   0    | no unused bits
     14     |   2    | Falcon bit order (rrrrrggg-ggxbbbbb ;since EdDI 1.1)
            |        |
     16     |  11    | bit 0 of the red intensity (least significant bit)
            |        | is bit 11 of the pixel
     17     |  12    | bit 1 of the red intensity ist bit 12 of the pixel
     18     |  13    | ...
     19     |  14    | ...
     20     |  15    | bit 4 of the red intensity (most significant bit)
            |        | is bit 15 of the pixel
     21..31 |  -1    | bits are not used
            |        |
            |        |
     32     |   6    | bit 0 of the green intensity (least significant bit)
            |        | is bit 6 of the pixel
     33     |   7    | bit 1 of the green intensity ist bit 7 of the pixel
     34     |   8    | ...
     35     |   9    | ...
     36     |  10    | bit 4 of the green intensity (most significant bit)
            |        | is bit 10 of the pixel
     37..37 |  -1    | bits are not used
            |        |
            |        |
     48     |   0    | bit 0 of the blue intensity (least significant bit)
            |        | is bit 0 of the pixel
     49     |   1    | bit 1 of the blue intensity is bit 1 of the pixel
     50     |   2    | ...
     51     |   3    | ...
     52     |   4    | bit 4 of the blue intensity (most significant bit)
            |        | is bit 4 of the pixel
     53..63 |  -1    | bits are not used
            |        |
            |        |
     64..79 |  -1    | no alpha channel
            |        |
            |        |
     80     |   5    | bit for genlock/overlay
     81..95 |  -1    | not used
            |        |
            |        |
     96..127|  -1    | no unused bits
            |        |

   HiColor on a VGA graphic card (e.g. Crazy Dots):

   work_out | Wert   | Meaning
   ---------|--------|---------------------------------------------------
      0     |   2    | packed pixels
      1     |   2    | HiColor => pseudo CLUT
      2     |  16    | 16 bits per pixel
      3/4   | 32768  | 32768 colors
      5     | xxxx   | width of the bitmap in bytes (since EdDI 1.1)
      6/7   | xxxxL  | address of the bitmap (since EdDI 1.1)
      8     |   5    | 5 bits for red intensity
      9     |   5    | 5 bits for green intensity
     10     |   5    | 5 bits for blue intensity
     11     |   0    | no alpha channel
     12     |   1    | no genlock/overlay
     13     |   0    | 1 unused bits
     14     |  129   | swapped bit order (gggbbbbb-xrrrrrgg; since EdDI 1.1)
            |        |
     16     |   2    | bit 0 of the red intensity (least significant bit)
            |        | is bit 2 of the pixel
     17     |   3    | bit 1 of the red intensity is bit 3 of the pixel
     18     |   4    | ...
     19     |   5    | ...
     20     |   6    | bit 4 of the red intensity (most significant bit)
            |        | is bit 6 of the pixel
     21..31 |  -1    | bits are not used
            |        |
            |        |
     32     |  13    | bit 0 of the green intensity (least significant bit)
            |        | is bit 13 of the pixel
     33     |  14    | bit 1 of the green intensity is bit 14 of the pixel
     34     |  15    | ...
     35     |   0    | ...
     36     |   1    | bit 4 of the green intensity (most significant bit)
            |        | is bit 1 of the pixel
     37..37 |  -1    | bits are not used
            |        |
            |        |
     48     |   8    | bit 0 of the blue intensity (least significant bit)
            |        | is bit 8 of the pixel
     49     |   9    | bit 1 of the blue intensity is bit 9 of the pixel
     50     |  10    | ...
     51     |  11    | ...
     52     |  12    | bit 4 of the green intensity (most significant bit)
            |        | is bit 12 of the pixel
     53..63 |  -1    | bits are not used
            |        |
            |        |
     64..79 |  -1    | no alpha channel
            |        |
            |        |
     80..95 |  -1    | no genlock/overlay
            |        |
            |        |
     96     |   7    | bit 7 is an unused bit
     97..127|  -1    | no further unused bits
            |        |

Note: The output in work_out[5..7/14] only exist since EdDI 1.1. Check the cookie version before you use them.

2.5.12 INQUIRE DEVICE STATUS INFORMATION (VDI 248)

Vq_devinfo() reports back, if a driver exists and if he has been opened. Besides the name of the driver (e.g. "XVGA256.SYS") and the 'readable' name ("VGA 256 colors") are returned. If the file name is empty, there is no driver with the given id <device>.

Decl.:  void  vq_devinfo( WORD handle, WORD device, WORD *dev_open,
                          BYTE *file_name, BYTE *device_name );
Call:   vq_devinfo( handle, device, &dev_open, file_name, device_name );

Variable         Arguments           Meaning
Input:

contrl[0]        248                 vq_devinfo
contrl[1]        0                   entries in ptsin
contrl[3]        1                   entries in intin
contrl[6]        handle
intin[0]         device              device id (0-99)

Output:

contrl[2]        p                   number of _WORDS_ in ptsout
contrl[4]        i                   number of words in intout

ptsout[0]        dev_open            0: driver is closed
                                     1: driver is already open
ptsout[1..p-1]   device_name         readable device name
intout[0..i-1]   file_name           file name

Note: The file name is returned with one word per character and contrl[4] is the length of the string. The readable name is a C string terminated with a zero and contrl[2] contains the number of words in ptsout.

2.5.13 INQUIRE EXTENDED DEVICE STATUS INFORMATION (VDI 248, 4242)

Similar to vq_devinfo() the function vq_ext_devinfo() returns information about the driver.

Decl.:  WORD  vq_ext_devinfo( WORD handle, WORD device, WORD *dev_exists,
                          BYTE *file_path, BYTE *file_name, BYTE *name );

Call:   dev_open = vq_ext_devinfo( handle, device, &dev_exists, file_path,
                                   file_name, name );

Variable         Arguments           Meaning
Input:

contrl[0]        248                 vq_devinfo
contrl[1]        0                   entries in ptsin
contrl[3]        7                   entries in intin
contrl[5]        4242                sub-opcode
contrl[6]        handle
intin[0]         device              device id (0-99)
intin[1/2]       file_path           pointer to the file path
intin[3/4]       file_name           pointer to the file name
intin[5/6]       name                pointer to the device name

Output:

contrl[2]        0                   entries in ptsout
contrl[4]        2                   entries in intout
intout[0]        dev_exists          0: no driver
                                     != 0: driver exists
intout[1]:       dev_open            0: driver is closed
                                     != 0: driver is already open

All strings are C strings!

Particularities of certain Drivers


Home NVDI Programmer's Guide List of VDI functions Color Settings