#!/bin/bash
# 1100-3dfx-banshee-voodoo345.sh
# match 3dfx cards supported by Xorg tdfx driver

XORG_CONF="$1"

[ -n "$XORG_CONF" ] || exit 2
[ -f "$XORG_CONF" ] || exit 2

[ "$PCI_VENDOR_ID" = "121a" ] || exit 1

case "$PCI_DEVICE_ID" in
    0003|0004|0005|0009)
        ;;
    *)
        exit 1
        ;;
esac

logger -t retrodebian-xorg-autoconfig "Configuring 3dfx tdfx for $PCI_DEVICE_NAME [$PCI_DEVICE_ID]"

sed -i \
    -e "s|{DeviceDriver}|tdfx|g" \
    "$XORG_CONF" || exit 2

exit 0