home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 6 / FreshFish_September1994.bin / new / dev / c / hce / examples / clib / tests / chiptest.c < prev    next >
C/C++ Source or Header  |  1992-09-02  |  1KB  |  83 lines

  1. /*
  2.  * HCC chip memory demonstration program by TetiSoft
  3.  *
  4.  * This is not an example of good programming style
  5.  */
  6.  
  7. /*
  8.  * Modified slightly by Jason Petty for HCE. (15/6/94)
  9.  * Changes marked VANSOFT.
  10.  */
  11.  
  12. void *IntuitionBase;
  13.  
  14. /* Moved 'chip' keyword to start of line. VANSOFT. */
  15.  
  16. chip unsigned short pointer[] = /* NOTICE THE WORD 'chip'
  17.      * If you don't use it, the pointer will be
  18.      * invisible on Amigas with non-chip memory
  19.      */
  20. {
  21.  0x0000,0x0000,
  22.  0xffff,0xffff,
  23.  0x8001,0x8001,
  24.  0x8001,0x8001,
  25.  0x8001,0x8001,
  26.  0x8001,0x8001,
  27.  0x8001,0x8001,
  28.  0x8001,0x8001,
  29.  0xffff,0xffff,
  30.  0x0000,0x0000
  31. };
  32.  
  33. struct NewWindow {
  34.  short left,top;
  35.  short width,height;
  36.  char detailpen, blockpen;
  37.  long idcmpflags;
  38.  long flags;
  39.  void *gadget;
  40.  void *checkmark;
  41.  char *title;
  42.  void *screen;
  43.  void *bitmap;
  44.  short minw,minh;
  45.  short maxw,maxh;
  46.  short type
  47. } NewWindow =
  48. {
  49.  0,11,
  50.  400,50,
  51.  2,1,
  52.  0,
  53.  0x1000,
  54.  0,
  55.  0,
  56.  "Chip memory demonstration for HCC/HCE",  /* Changed, VANSOFT. */
  57.  0,
  58.  0,
  59.  0,0,
  60.  0,0,
  61.  1
  62. };
  63.  
  64. main()
  65. {
  66.  void *Window, *OpenWindow(), *OpenLibrary();
  67.  
  68.  IntuitionBase=OpenLibrary("intuition.library",33);
  69.  if (IntuitionBase==0) exit(20);
  70.  
  71.  Window=OpenWindow(&NewWindow);
  72.  if (Window==0) {
  73.   CloseLibrary(IntuitionBase);
  74.   exit(20);
  75.  }
  76.  
  77.  SetPointer(Window, pointer, 8, 8, 0, 0);
  78.  Delay(10*50);
  79.  ClearPointer(Window);
  80.  CloseWindow(Window);
  81.  CloseLibrary(IntuitionBase);
  82. }
  83.