/***
 *** parse_opt.h: option parsing routine for SVGATextMode
 *** (c) 1995 Koen Gadeyne (kmg@barco.be)
 ***/

#ifndef _PARSE_OPT_H
#define _PARSE_OPT_H

/*
 * Supported Options
 * These are single-bit values, allowing one option string to set multiple single options!
 */

#define NUM_OPTIONS      15

#define OPT_HIBIT_LOW      (1 << 0)
#define OPT_HIBIT_HIGH     (1 << 1)
#define OPT_ET4000_ALTCLK  (1 << 2)
#define OPT_SWAP_HIBIT     (1 << 3)
#define OPT_LEGEND         (1 << 4)
#define OPT_FAST_DRAM      (1 << 5)
#define OPT_MED_DRAM       (1 << 6)
#define OPT_SLOW_DRAM      (1 << 7)
#define OPT_XFAST_DRAM     (1 << 8)
#define OPT_LOADFONT       (1 << 9)
#define OPT_CLOCKDIV2      (1 << 10)
#define OPT_NUMBER_NINE    (1 << 11)
#define OPT_SPEA_MERCURY   (1 << 12)
#define OPT_SYNC           (1 << 13)
#define OPT_NO_UL          (1 << 14)


/* option strings: same order as option numbers! */
#define OPTION_STRINGS   { "HIBIT_LOW" , "HIBIT_HIGH" , "ET4000_AltClockSel" , "SWAP_HIBIT" , "Legend" ,\
                           "Fast_DRAM" , "Med_DRAM" , "Slow_DRAM" , "XFast_DRAM" , "LoadFont" ,\
                           "ClockDiv2" , "Number_Nine" , "SPEA_Mercury" , "SyncDisks" , "NoUnderline" }

/* allowed options per chipset (in bit mask format) */
#define COMMON_OPTS         OPT_SYNC | OPT_LOADFONT | OPT_NO_UL
#define OPTIONS_ALLOWED   { COMMON_OPTS | OPT_CLOCKDIV2,   /* VGA */\
                            COMMON_OPTS | OPT_CLOCKDIV2 | OPT_NUMBER_NINE | OPT_LEGEND | OPT_SPEA_MERCURY,   /* S3 */\
                            COMMON_OPTS | OPT_FAST_DRAM | OPT_MED_DRAM | OPT_SLOW_DRAM | OPT_XFAST_DRAM,   /* Cirrus */\
                            COMMON_OPTS | OPT_CLOCKDIV2 | OPT_HIBIT_LOW | OPT_HIBIT_HIGH | OPT_ET4000_ALTCLK | OPT_LEGEND,\
                            COMMON_OPTS | OPT_CLOCKDIV2,   /* TVGA8900 */\
                            COMMON_OPTS | OPT_CLOCKDIV2,   /* TVGA9000 */\
                            COMMON_OPTS | OPT_CLOCKDIV2,   /* PAVGA1 */\
                            COMMON_OPTS | OPT_CLOCKDIV2,   /* WDC90C0X */\
                            COMMON_OPTS | OPT_CLOCKDIV2 | OPT_SWAP_HIBIT,  /* WDC90C1X */\
                            COMMON_OPTS | OPT_CLOCKDIV2 | OPT_SWAP_HIBIT,  /* WDC90C2X */\
                            COMMON_OPTS | OPT_CLOCKDIV2 | OPT_SWAP_HIBIT,  /* WDC90C3X */\
                            COMMON_OPTS | OPT_CLOCKDIV2,   /* ATI */\
                            COMMON_OPTS | OPT_CLOCKDIV2,   /* ATIMACH32 */\
                            COMMON_OPTS | OPT_CLOCKDIV2    /* VIDEO7 */\
                          }

int parse_opt(FILE* param_file, int chipset, const char* str_chipset);


#endif