#include <proto/exec.h>
#include <proto/dos.h>
#include <hardware/custom.h>
#include "SetDebugSpeed_VERSION.h"

#define	BAUD_9600	372
#define	BAUD_19200	184
#define	BAUD_38400	92
#define	BAUD_57600	61
#define	BAUD_76800	46
#define	BAUD_115200	30


#define	INDEX_9600	0
#define	INDEX_19200	1
#define	INDEX_38400	2
#define	INDEX_57600	3
#define	INDEX_76800	4
#define	INDEX_115200	5



char	*ArgumentString = "9600/S,19200/S,38400/S,57600/S,76800/S,115200/S";
LONG	*MyArgs[6];
extern struct ExecBase	*SysBase;
UBYTE	vers[] = VERSTAG;

void	main(void)
{
struct RDArgs	*rdargs;
  if ((rdargs=ReadArgs(ArgumentString,(LONG*) &MyArgs[0],NULL)))
  {
    if (MyArgs[INDEX_9600])
    {
      ((struct Custom*) 0xdff000)->serper	=	BAUD_9600;
    }
    else
    if (MyArgs[INDEX_19200])
    {
      ((struct Custom*) 0xdff000)->serper	=	BAUD_19200;
    }
    else
    if (MyArgs[INDEX_38400])
    {
      ((struct Custom*) 0xdff000)->serper	=	BAUD_38400;
    }
    else
    if (MyArgs[INDEX_57600])
    {
      ((struct Custom*) 0xdff000)->serper	=	BAUD_57600;
    }
    else
    if (MyArgs[INDEX_76800])
    {
      ((struct Custom*) 0xdff000)->serper	=	BAUD_76800;
    }
    else
    if (MyArgs[INDEX_115200])
    {
      ((struct Custom*) 0xdff000)->serper	=	BAUD_115200;
    }
    FreeArgs(rdargs);
  }
  else
  {
    Printf("Commandline Error\n");
    return;
  }
}
