home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / CD32 / CD32_Support / examples / SA_Examples / lowlevel / VBlankInt / vblankint.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-31  |  2.9 KB  |  82 lines

  1. /*
  2.  * Constants
  3.  */
  4.  
  5. #define PROGRAM_NAME "VBlankInt"        /* Program name */
  6.  
  7. #define KICKSTART_VERSION 40            /* Minimum Kickstart version */
  8. #define WORKBENCH_VERSION 40            /* Minimum Workbench version */
  9.  
  10. #define SCREEN_WIDTH 640                /* Screen width */
  11. #define SCREEN_HEIGHT GfxBase->NormalDisplayRows /* Screen height */
  12. #define SCREEN_DEPTH 2                  /* Screen depth */
  13. #define SCREEN_DISPLAYID HIRES_KEY      /* Screen display ID */
  14.  
  15. #define VBLANKINT_COOKIE 0xC0EDBABE     /* Cookie for interrupt data */
  16.  
  17. #define VBEAMPOS_THRESHOLD_NTSC 20      /* Vertical beam position
  18.                                            threshold for NTSC systems */
  19. #define VBEAMPOS_THRESHOLD_PAL 20       /* Vertical beam position
  20.                                            threshold for PAL systems */
  21.  
  22. /*
  23.  * Prototypes
  24.  */
  25.  
  26. /* from main.c */
  27. void main(int argc,char *argv[]);
  28. void goodbye(int returnCode);
  29.  
  30. /* from vblank.c */
  31. void __asm __interrupt __saveds vblankInterrupt(register __a1 APTR intData);
  32.  
  33. /*
  34.  * Globals
  35.  */
  36.  
  37. #ifdef MAIN
  38.  
  39. struct GfxBase *GfxBase=NULL;                   /* graphics.library base */
  40. struct Library *IntuitionBase=NULL,             /* intuition.library base */
  41.     *LowLevelBase=NULL;                         /* lowlevel.library base */
  42.  
  43. struct Screen *screen=NULL;                     /* Screen */
  44.  
  45. struct MsgPort *timerPort=NULL;                 /* timer.device message port */
  46. struct timerequest *timerRequest=NULL;          /* timer.device I/O request */
  47. BOOL timerOpen=FALSE;                           /* timer.device open? */
  48.  
  49. WORD vbeamThreshold;                            /* Vertical beam position
  50.                                                    threshold */
  51.  
  52. APTR vblankIntHandle=NULL;                      /* Vertical blank
  53.                                                    interrupt handle */
  54. ULONG vblankIntBadData=0UL;                     /* Counter for calls to
  55.                                                    vertical blank interrupt
  56.                                                    handler with bad data */
  57. ULONG vblankIntThreshold=0UL;                   /* Counter for calls to
  58.                                                    vertical blank interrupt
  59.                                                    handler with vertical
  60.                                                    beam position beyond
  61.                                                    threshold */
  62. ULONG vblankIntCall=0UL;                        /* Counter for total calls
  63.                                                    to vertical blank interrupt
  64.                                                    handler */
  65.  
  66. #else /* MAIN */
  67.  
  68. extern struct GfxBase *GfxBase;
  69. extern struct Library *IntuitionBase, *LowLevelBase;
  70.  
  71. extern struct Screen *screen;
  72.  
  73. extern WORD vbeamThreshold;
  74.  
  75. extern APTR vblankIntHandle;
  76. extern ULONG vblankIntBadData;
  77. extern ULONG vblankIntBadVBlank;
  78. extern ULONG vblankIntThreshold;
  79. extern ULONG vblankIntCall;
  80.  
  81. #endif /* MAIN */
  82.