/*
** AGA Colourlist Demo
** -------------------
** Displays an AGA colourlist (24bit colour lines).
**
** To exit the demo, press the left mouse button.
**
** Compiles under SAS/C and DICE.
*/

#include <exec/memory.h>
#include <proto/games.h>
#include <proto/exec.h>

#define AMT_PLANES 1

struct GMSBase *GMSBase;
extern struct ExecBase *SysBase;

LONG ColourList[] = {
   0x010000,0x020000,0x030000,0x040000,0x050000,0x060000,0x070000,0x080000,
   0x090000,0x0a0000,0x0b0000,0x0c0000,0x0d0000,0x0e0000,0x0f0000,0x100000,
   0x110000,0x120000,0x130000,0x140000,0x150000,0x160000,0x170000,0x180000,
   0x190000,0x1a0000,0x1b0000,0x1c0000,0x1d0000,0x1e0000,0x1f0000,0x200000,
   0x210000,0x220000,0x230000,0x240000,0x250000,0x260000,0x270000,0x280000,
   0x290000,0x2a0000,0x2b0000,0x2c0000,0x2d0000,0x2e0000,0x2f0000,0x300000,
   0x310000,0x320000,0x330000,0x340000,0x350000,0x360000,0x370000,0x380000,
   0x390000,0x3a0000,0x3b0000,0x3c0000,0x3d0000,0x3e0000,0x3f0000,0x400000,
   0x410000,0x420000,0x430000,0x440000,0x450000,0x460000,0x470000,0x480000,
   0x490000,0x4a0000,0x4b0000,0x4c0000,0x4d0000,0x4e0000,0x4f0000,0x500000,
   0x510000,0x520000,0x530000,0x540000,0x550000,0x560000,0x570000,0x580000,
   0x590000,0x5a0000,0x5b0000,0x5c0000,0x5d0000,0x5e0000,0x5f0000,0x600000,
   0x610000,0x620000,0x630000,0x640000,0x650000,0x660000,0x670000,0x680000,
   0x690000,0x6a0000,0x6b0000,0x6c0000,0x6d0000,0x6e0000,0x6f0000,0x700000,
   0x710000,0x720000,0x730000,0x740000,0x750000,0x760000,0x770000,0x780000,
   0x790000,0x7a0000,0x7b0000,0x7c0000,0x7d0000,0x7e0000,0x7f0000,0x800000,
   0x810000,0x820000,0x830000,0x840000,0x850000,0x860000,0x870000,0x880000,
   0x890000,0x8a0000,0x8b0000,0x8c0000,0x8d0000,0x8e0000,0x8f0000,0x900000,
   0x910000,0x920000,0x930000,0x940000,0x950000,0x960000,0x970000,0x980000,
   0x990000,0x9a0000,0x9b0000,0x9c0000,0x9d0000,0x9e0000,0x9f0000,0xa00000,
   0xa10000,0xa20000,0xa30000,0xa40000,0xa50000,0xa60000,0xa70000,0xa80000,
   0xa90000,0xaa0000,0xab0000,0xac0000,0xad0000,0xae0000,0xaf0000,0xb00000,
   0xb10000,0xb20000,0xb30000,0xb40000,0xb50000,0xb60000,0xb70000,0xb80000,
   0xb90000,0xba0000,0xbb0000,0xbc0000,0xbd0000,0xbe0000,0xbf0000,0xc00000,
   0xc10000,0xc20000,0xc30000,0xc40000,0xc50000,0xc60000,0xc70000,0xc80000,
   0xc90000,0xca0000,0xcb0000,0xcc0000,0xcd0000,0xce0000,0xcf0000,0xd00000,
   0xd10000,0xd20000,0xd30000,0xd40000,0xd50000,0xd60000,0xd70000,0xd80000,
   0xd90000,0xda0000,0xdb0000,0xdc0000,0xdd0000,0xde0000,0xdf0000,0xe00000,
   0xe10000,0xe20000,0xe30000,0xe40000,0xe50000,0xe60000,0xe70000,0xe80000,
   0xe90000,0xea0000,0xeb0000,0xec0000,0xed0000,0xee0000,0xef0000,0xf00000,
   0xf10000,0xf20000,0xf30000,0xf40000,0xf50000,0xf60000,0xf70000,0xf80000,
   0xf90000,0xfa0000,0xfb0000,0xfc0000,0xfd0000,0xfe0000,0xff0000,
   -1
};

LONG RasterList[] = {
     COL24LIST(0,1,0,&ColourList),
     RASTEND
};

struct GameScreen GameScreen = {
       GSV1,
       0,0,0,               /* Screen_Mem1,2,3 */
       0,                   /* ScreenLink */
       0,                   /* Address of palette */
       &RasterList,         /* Address of rasterlist */
       0,                   /* Amount of colours in palette */
       320,256,             /* Screen Width and Height */
       320/8,256,           /* Picture Width/8 and Height */
       AMT_PLANES,          /* Amount of Planes */
       0,0,                 /* X/Y screen offset */
       0,0,                 /* X/Y picture offset */
       BLKBDR,              /* Special attributes */
       LORES|COL24BIT,      /* Screen mode */
       PLANAR,              /* Screen type */
       0                    /* Reserved */
};

struct GameScreen *OurScreen = &GameScreen;

/*=========================================================================*/

void main(void)
{
   if (GMSBase = (struct GMSBase *) OpenLibrary("games.library",0)) {
      SetUserPrefs(0);
      if (Add_Screen(OurScreen) == NULL) {
         Show_Screen(OurScreen);
         Wait_LMB();
         Delete_Screen(OurScreen);
      }
      CloseLibrary((struct Library *)GMSBase);
   }
}

/*=========================================================================*/

