#!/bin/sh
dialog \
--title "Select clock chip class" \
--menu "Please choose the appropriate DAC class\n\
 for your card. (current: $1)" \
21 60 10 \
\
"ATT"	"AT&T chips" \
"Bt"	"Brooktree chips" \
"Cirrus" "Cirrus Logic chips" \
"IBM"	"IBM chips (inc. std VGA)" \
"ICS"	"Integrated Circuit Systems" \
"S3"	"S3 Incorporated" \
"SC"	"Sierra Semiconductor" \
"TI"	"Texas Instruments" \
"Tseng" "Tseng Laboratories" \
"none"	"none" \
\
2> /tmp/.dacclass 

DAC_CLASS=$1
DAC_TYPE=$2

NEW_DAC_CLASS=`cat /tmp/.dacclass`

if [ "$NEW_DAC_CLASS" != "" ]; then
  if [ "$NEW_DAC_CLASS" = "$DAC_CLASS" ]; then 
    ramdac/$NEW_DAC_CLASS/.configure $2;
   else
    ramdac/$NEW_DAC_CLASS/.configure;
  fi
  NEW_DAC_TYPE=`cat /tmp/.dactype`
  if [ "$NEW_DAC_TYPE" != "" ]; then
    DAC_CLASS=$NEW_DAC_CLASS
    DAC_TYPE=$NEW_DAC_TYPE
  fi
fi

echo $DAC_CLASS>/tmp/.dacclass
echo $DAC_TYPE>/tmp/.dactype
