home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0040 - 0049 / ibm0040-0049 / ibm0040.tar / ibm0040 / IMGPROC.ZIP / C4.ZIP / TEST2.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-06  |  2.1 KB  |  69 lines

  1. /*  
  2. Copyright 1990 by John Wiley & Sons, Inc.
  3.           All Rights Reserved.
  4. */
  5. /*********************************************************/
  6. /***                  Listing P2Ch3L3                  ***/
  7. /***          Video Digitizer Test Program Two         ***/
  8. /***                written in Turbo C                 ***/
  9. /***                        by                         ***/
  10. /***                 Craig A. Lindley                  ***/
  11. /***                                                   ***/
  12. /***         Ver: 1.0    Last Update: 08/04/89         ***/
  13. /*********************************************************/
  14.  
  15. /*
  16. This program is used to check the sync detect circuitry on the digitizer.
  17. It continually counts how many sync pulses it detects per video field.
  18. The timing parameters in the low level digitizer driver code, digitize.asm,
  19. should be varied until only the values of 271 and 272 are obtained. This
  20. program is terminated by hitting any key.
  21. */
  22.  
  23. #include <stdio.h>
  24. #include <conio.h>
  25. #include "digitizer.h"
  26.  
  27.  
  28. void main( void )
  29. {
  30.    struct ImageReq Req;                /* ImageReq structure */
  31.    unsigned Done = FALSE;              /* loop terminating boolean */
  32.  
  33.    clrscr();
  34.    printf("Digitizer Test Program Two - Sync Detect Circuitry Test\n\n");
  35.  
  36. /*
  37.    Build a structure that defines what the digitizer should acquire.
  38.    This will be passed to the digitizer by a call to InitializeDigitizer
  39.    function. This also tells the low level code where the digitizer
  40.    is attached.
  41. */
  42.  
  43.    Req.ComputerType   = PS220;
  44.    Req.PrtBase        = 0x3BC;
  45.    Req.HMode          = LowRes;
  46.    Req.VMode          = NonInterlace;
  47.    Req.NumberOfPasses = 1;
  48.    Req.Flags          = 0L;
  49.    Req.FirstLine      = 0;
  50.    Req.FirstPixel     = 0;
  51.    Req.LastLine       = 200;
  52.    Req.LastPixel      = 320;
  53.  
  54.    InitializeDigitizer(&Req);          /* initialize the digitizer */
  55.  
  56.    printf("SyncPerField Test\n");
  57.    printf("  Hit any key to terminate\n\n");
  58.  
  59.    Done = FALSE;
  60.  
  61.    while (!Done)
  62.    {
  63.       printf("SPF=%d\n",SyncsPerField());
  64.       if (kbhit())
  65.         Done = TRUE;
  66.    }
  67. }
  68.  
  69.