#ifndef EVD_PREFS_H
#define EVD_PREFS_H

/*
 *  evd_prefs.h - definition of the preferences file
 *  Copyright (C) 1997 Aki Laukkanen
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software Foundation,
 *  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif

#ifndef UTILITY_TAGITEM_H
#include <utility/tagitem.h>
#endif

#ifndef MAKETRI
#define MAKETRI(a,b,c) (a<<16|b<<8|c)
#endif

/*
 *  The preferences file consists of a sequence of
 *  tags (see utility/tagitem.h). The first tag is
 *  always EVD_Version and the data value is the version
 *  of the file (currently 2).
 *
 *  The rest of the tags are in random order. The taglist
 *  is terminated like normally with TAG_END.
 *
 *  If there's an indication that the data value is a pointer
 *  then it's an offset relative to the start of the preferences
 *  file. Normally this kind of data like the palettes are stored
 *  after the taglist.
 */

/*
 *  Tagitems for the prefs file
 */

#define EVD_Version (TAG_USER+MAKETRI('V','E','R'))     /* version */
#define EVD_BBlank  (TAG_USER+MAKETRI('B','B','L'))     /* border blank */
#define EVD_FCached (TAG_USER+MAKETRI('F','C','A'))     /* chunky buffer not copyback */
#define EVD_CImprec (TAG_USER+MAKETRI('C','I','M'))     /* chip imprecise */
#define EVD_OwnRefr (TAG_USER+MAKETRI('O','R','F'))     /* own refresh */
#define EVD_RRate   (TAG_USER+MAKETRI('R','A','T'))     /* refresh rate */
#define EVD_UsedPal (TAG_USER+MAKETRI('U','S','P'))     /* this palette is the default one */
#define EVD_NumPals (TAG_USER+MAKETRI('N','U','P'))     /* number or palettes */
#define EVD_Palette (TAG_USER+MAKETRI('P','A','L'))     /* pointer to an array of palettes */

/*
 *  Structures
 */

struct palette_entry
{
	ULONG   off_cached_palname;
	ULONG   off_palname;
	ULONG   epsilon;
	ULONG   rgb[64];
};

/*
 * current version
 */

#define PREFS_VERSION 2
#define PREFS_FILENAME_USE "env:turboevd.prefs"
#define PREFS_FILENAME_SAVE "envarc:turboevd.prefs"

#endif // EVD_PREFS_H
