#define OK 1
#define NOT_OK 0

/* -------- stuff for save() (from Commdore IFF Disk Fish 185) ------- */

/* For masking unwanted Viewmodes bits */
#define BADFLAGS  (SPRITES|VP_HIDE|GENLOCK_AUDIO|GENLOCK_VIDEO)
#define FLAGMASK  (~BADFLAGS)
#define CAMGMASK  (FLAGMASK & 0x0000FFFFL)

/* Other Stuff for saving the picture */
#define bufsize 512

#define ifficon_width 80
#define ifficon_height 31
#define ifficon_num_planes 2
#define ifficon_words_per_plane 155

#ifdef LATTICE
UWORD chip ifficon_data[] = {
#else
UWORD ifficon_data[] = {
#endif

/* Plane 0 */
  0xffff,0xffff,0xffff,0xffff,0xfffe,0x8000,0x0000,0x0000,
  0x0000,0x0001,0xbfff,0xffff,0xffff,0xffff,0xfffd,0xa000,
  0x0000,0x0000,0x01ff,0x8005,0xa000,0x0000,0x0000,0x07ff,
  0xe005,0xa000,0x0000,0x0000,0x0fff,0xf005,0xa000,0x0000,
  0x0000,0x1fff,0xf805,0xa000,0x0000,0x0014,0x1fff,0xf805,
  0xa000,0x0000,0x3510,0x047f,0xf805,0xa000,0x0000,0x8010,
  0x800f,0xf005,0xa000,0x0001,0x0010,0x0187,0xe005,0xa0ff,
  0xe383,0x8600,0x000f,0xff85,0xa3ff,0xff01,0x0008,0x7d01,
  0xffe5,0xa7ff,0xfc30,0x0000,0x2f81,0xfff5,0xa7ff,0xfc10,
  0x2378,0x0011,0xfffd,0xafff,0xff02,0x2000,0x800b,0xfffd,
  0xa7ff,0xfc3f,0xc000,0x210f,0xfffd,0xa7ff,0xfa02,0xe600,
  0x000f,0xfff5,0xa3ff,0xff80,0x0408,0x1d47,0xffe5,0xa0ff,
  0xfff0,0x0000,0x2741,0xff85,0xa007,0xfff8,0x2140,0x60e0,
  0x0005,0xa00f,0xfffe,0x03ff,0x8000,0x0005,0xa00f,0xffff,
  0x4018,0x0000,0x0005,0xa00f,0xfffc,0xe000,0x0000,0x0005,
  0xa00f,0xfffc,0x0000,0x0000,0x0005,0xa007,0xfff8,0x0000,
  0x0000,0x0005,0xa003,0xfff0,0x0000,0x0000,0x0005,0xa000,
  0x7f80,0x0000,0x0000,0x0005,0xbfff,0xffff,0xffff,0xffff,
  0xfffd,0x8000,0x0000,0x0000,0x0000,0x0001,0x7fff,0xffff,
  0xffff,0xffff,0xffff,

/* Plane 1 */
  0xffff,0xffff,0xffff,0xffff,0xfffe,0xffff,0xffff,0xffff,
  0xffff,0xfffe,0xffff,0xffff,0xffff,0xffff,0xfffe,0xe000,
  0x0000,0x0000,0x0000,0x0006,0xe000,0x0000,0x0000,0x0000,
  0x0006,0xe000,0x0000,0x0000,0x0000,0x0006,0xe000,0x0000,
  0x0000,0x0008,0x0006,0xe000,0x0000,0x0003,0xe00c,0x0006,
  0xe000,0x0000,0x000f,0xfb80,0x0006,0xe000,0x0000,0x000f,
  0xfff0,0x0006,0xe000,0x0000,0x000f,0xfff8,0x0006,0xe000,
  0x007c,0x060f,0xfff0,0x0006,0xe000,0x00fe,0xf80f,0x82fe,
  0x0006,0xe000,0x03ff,0xfe1f,0xc07e,0x0006,0xe002,0x03ef,
  0xfc07,0xfffe,0x0806,0xe007,0x03fd,0xdf80,0x7ff4,0x0c06,
  0xe000,0x03c0,0x3f80,0x1ff0,0x0006,0xe000,0x05fc,0x1f80,
  0x1ff0,0x0006,0xe000,0x007f,0xfb88,0x0280,0x0006,0xe000,
  0x000f,0xff00,0x0040,0x0006,0xe000,0x0007,0xfe00,0x0000,
  0x0006,0xe000,0x0001,0xfc00,0x0000,0x0006,0xe000,0x0600,
  0xa000,0x0000,0x0006,0xe000,0x0000,0x0000,0x0000,0x0006,
  0xe000,0x0000,0x0000,0x0000,0x0006,0xe000,0x0000,0x0000,
  0x0000,0x0006,0xe000,0x0000,0x0000,0x0000,0x0006,0xe000,
  0x0000,0x0000,0x0000,0x0006,0xffff,0xffff,0xffff,0xffff,
  0xfffe,0xffff,0xffff,0xffff,0xffff,0xfffe,0x0000,0x0000,
  0x0000,0x0000,0x0000
};

#define ilbm_size      sizeof(ilbm_data)

 struct  Image ilbmimage =
 {
 0,0,
 ifficon_width,ifficon_height,ifficon_num_planes,
 &ifficon_data[0],
 0x03,0x00,
 NULL,
 };

struct DiskObject ILBMobject = {
   WB_DISKMAGIC,
   WB_DISKVERSION,

   /* Gadget Structure */
   NULL,		    /* Ptr to next gadget */
   0,0, 		    /* Leftedge, Topedge */
   ifficon_width, ifficon_height,	   /* Width, Height */
   GADGHCOMP|GADGIMAGE, 	      /* Flags */
   RELVERIFY|GADGIMMEDIATE, /* Activation */
   BOOLGADGET,		    /* Type */
   (APTR)&ilbmimage,        /* Render */
   NULL,		    /* Select Render */
   NULL,		    /* Text */
   NULL,NULL,NULL,NULL,     /* Exclude, Special, ID, UserData */

   WBPROJECT,		    /* WBObject type */
   "c:IView",               /* Default tool */
   NULL,		    /* Tool Types */
   NO_ICON_POSITION,	    /* Current X */
   NO_ICON_POSITION,	    /* Current Y */
   NULL,NULL,NULL,	    /* Drawer, ToolWindow, Stack */
   };
