
 /* svo.h
    - Include File for SVO Support Routines -
    (c) 1993-94 by Andreas R. Kleinert
    Last changes : 25.02.1994
 */

#ifndef SVO_H
#define SVO_H

#ifndef GRAPHICS_VIEW_H
#include <graphics/view.h>
#endif /* GRAPHICS_VIEW_H */


#define BADFLAGS (SPRITES|VP_HIDE|GENLOCK_AUDIO|GENLOCK_VIDEO)
#define FLAGMASK (~BADFLAGS)
#define BADFLAGS_13 (EXTENDED_MODE|SPRITES|VP_HIDE|GENLOCK_AUDIO|GENLOCK_VIDEO)
#define FLAGMASK_13 (~BADFLAGS)


 /* ********** */
 /* SVO Header */
 /* ********** */

 /* File ID Definitions */

#define SVO_ID          "SVO Graphics File V1.0"
#define SVO_ID_LEN      22                        /* len = 21 + 0 Byte */

struct SVOHeader
{
 UBYTE svo_ID [SVO_ID_LEN];

 UBYTE svo_PixelBits;       /* 1 or 8 (16, 24, 32, ...)             */
 UBYTE svo_PixelDepth;      /* number of svo_PixelBits sized Planes */

 UBYTE svo_Version;         /* (see below)                          */

 ULONG svo_LeftEdge;        /* Screen Dimensions                    */
 ULONG svo_TopEdge;
 ULONG svo_Width;
 ULONG svo_Height;
 
 ULONG svo_Depth;           /* resulting Intuition Screen BitPlanes */

 UWORD svo_ViewMode16;      /* OS V1.2+  ScreenMode ID              */
 UWORD svo_BAD_ViewMode32;  /* DO NOT USE (see below)               */

 ULONG svo_BytesPerLine;

 UBYTE svo_Colors[256][3];  /* if svo_PixelDepth == 1 */

 /* ----- added with svo_Version 1 -------------------------------- */

 ULONG svo_ViewMode32;      /* OS V2.04+ ScreenMode ID (see below)  */


 /* ----- header size may grow in the future (check svo_Version) -- */
};

#define SVOHEADER_SIZE (sizeof(struct SVOHeader))

#define SVO_HEADER_OLDVERSION ((UBYTE) 0)   /* first version   */
#define SVO_HEADER_VERSION    ((UBYTE) 1)   /* current version */


/* Notes :

   (1)

   Do not READ the svo_BAD_ViewMode32 value.
   Check for svo_Version > 0 and READ svo_ViewMode32 instead.
   But do WRITE both values (svo_ViewMode32 and svo_BAD_ViewMode32),
   for compatibility reasons.

   (2)

   For later support of graphic cards there are two possible ways to store
   graphics :

    - planar, one full plane following the next,
      with svo_Depth planes like in IFF-ILBM (svo_PixelBits == 1) :
 
       Colors = (1<<svo_PixelBits-1)<<svo_PixelDepth
              = 1<<svo_PixelDepth 
              = 1<<svo_Depth 

    - bytewise planar, where each plane consists on
      svo_PixelDepth bytes (svo_PixelBits == 8) :
      
       Colors = (1<<svo_PixelBits-1)<<svo_PixelDepth
              = 1<<svo_Depth

       BUT   != 1<<svo_PixelDepth

*/

#endif /* SVO_H */
