//---------------------------------------------------------------------------
// VRAM allocation module
//
// April 1996, Geoffroy Audy - Konami Computer Entertainment, Chicago (KCEC)
//---------------------------------------------------------------------------

#define  X_START_VRAM     320              // Starting coordinate of the
#define  Y_START_VRAM     0                // available space in VRAM
#define  WIDTH_VRAM       1024 - 320       // Width and height of the
#define  HEIGHT_VRAM      512              // available space in VRAM
#define  X_MIN_UNIT_VRAM  32               // Min. allocatable block in VRAM,
#define  Y_MIN_UNIT_VRAM  32               // in 16-bit pixels unit
#define  X_VRAM_BLOCK     ((WIDTH_VRAM) / X_MIN_UNIT_VRAM) // Nbr of block on
#define  Y_VRAM_BLOCK     (HEIGHT_VRAM / Y_MIN_UNIT_VRAM)  // X and Y axis
#define  MAXHANDLES       50               // 50 handles maximum

#ifndef __point
   #define __point
   typedef struct
   {
      int x;
      int y;
   } point;
#endif

int FreeVram (int handle);
void InitAllocVram (void);
point AllocVram (int width, int height, short *hdle, int align);
void DumpDataAllocVram (DoubleBuffer *db);
point FixAllocVram (int coorx, int coory, int width, int height, int *hdle);
int AllocClut ();
int FreeClut (int clut);
