db.c is ugly but almost reads the game position db.