
:	Unix/Tnix Version
:	Keyshell Version Number 1	*/

:
: Determine which microprocessor will be used.
:

cat <<!!

Only one microprocessor can be selected when building a ColorKey+ configuration.
You may set your account up to use more than one microprocessor by building
a separate configuration for each microprocessor with the program 'setksh'.
Switch configurations by choosing the 'RESTORE' option in 'setksh'.

Please specify which microprocessor you will be using.

1)  none used                     11) 6801 or 68120
2)  68000 family of processors    12) 8048
3)  8086 or 8088                  13) 8051
4)  8086/8087 or 8088/8087        14) 6800 or 6802
5)  Z80                           15) 1802
6)  6809                          16) 8080
7)  Z8001                         17) other
8)  Z8002
9)  9900 or 9989
10) 8085

Please enter the number of your selection (1-17): 
!!
invalid=0
while test $invalid
do
	read INPUT
	case $INPUT in
		1)	micro=;invalid=;;
		2)	micro=68000;invalid=;;
		3)	micro=8086;invalid=;;
		4)	micro=8087;invalid=;;
		5)	micro=Z80;invalid=;;
		6)	micro=6809;invalid=;;
		7)	micro=Z8001;invalid=;;
		8)	micro=Z8002;invalid=;;
		9)	micro=9900;invalid=;;
		10)	micro=8085;invalid=;;
		11)	micro=6801;invalid=;;
		12)	micro=8048;invalid=;;
		13)	micro=8051;invalid=;;
		14)	micro=6800;invalid=;;
		15)	micro=1802;invalid=;;
		16)	micro=8080;invalid=;;
		17)	micro=0;invalid=;;
		*)	echo "Invalid input.  Please enter a number in the range (1-17)."
			echo
			echo -n "Please enter the number of your selection (1-17): "
			;;
	esac

done
:
: Prompt for the microprocessor name if user has not selected one of
: the supported chips.
:

if test "$micro" = "0"; then
	invalid=0
	while test $invalid
	do
	echo
	echo -n "Enter the name of the microprocessor: "
	read micro
	if test $micro; then
		invalid=
	else	echo "You must enter a microprocessor name, try again."; fi
	done
:
: Convert ambiguous microprocessor names into the name required by the
: 8540 Select Command.
:
	if test $micro = 8080A -o $micro = 8080a; then micro=8080; fi
	if test $micro = 8085A -o $micro = 8085a; then micro=8085; fi
	if test $micro = 6802; then micro=6800; fi
	if test $micro = z80 -o $micro = Z80A; then micro=Z80; fi
	if test $micro = z80a; then micro=Z80; fi
	if test $micro = 9989; then micro=9900; fi
	if test $micro = 6809e -o $micro = 6809E; then micro=6809; fi
	if test $micro = 68120; then micro=6801; fi
	if test $micro = 68008 -o $micro = 68010; then micro=68000; fi
	if test $micro = 8041 -o $micro = 8041a; then micro=8048; fi
	if test $micro = 8041A -o $micro = 8049; then micro=8048; fi
	if test $micro = 8021 -o $micro = 8022; then micro=8048; fi
	if test $micro = mcs48 -o $micro = MCS48; then micro=8048; fi
	if test $micro = 3872 -o $micro = f8; then micro=3870; fi
	if test $micro = F8; then micro=3870; fi
	if test $micro = 650x -o $micro = "6500/1"; then micro=6500; fi
	if test $micro = z8001; then micro=Z8001; fi
	if test $micro = z8002; then micro=Z8002; fi
	if test $micro = 8088; then micro=8086; fi
fi

if test "$micro" = "8087"; then microname=8086; else microname=$micro; fi

if test $micro
then
	case $shelltype in
	_sh)
		echo "uP=$micro; export uP" >>$setTEK
		;;
	_csh)
		echo "setenv uP $micro" >>$setTEK
		;;
	esac
	echo "#define _micro _"$micro"uP" >>$kppdefs
	echo "#define _microname "$microname >>$kppdefs
	echo " o  The $microname microprocessor has been specified." \
		>>$kshconfig
else
	echo "#define _micro _unknown" >>$kppdefs
	echo "#define _microname no.emulator" >>$kppdefs
	echo " o  A specific microprocessor has not been selected." \
		>>$kshconfig
fi

