Esempio n. 1
0
File: host.c Progetto: ld-test/tekui
TLIBAPI void
TEKlib_CloseModule(TAPTR boot, TAPTR knmod)
{
	struct host_modhandle *handle = knmod;
	if (handle->type == TYPE_DLL)
		closemodule(handle->entry.object);
	TEKlib_FreeVec(boot, handle);
}
Esempio n. 2
0
File: recv.c Progetto: eswartz/emul
int	main(void)
{
	int	ch;
	char	comm[256];
	struct	stat st;


	printf("RECV -- 99/4A ROM dump receiver by Edward Swartz.\n\n"
	       "Companion to TRANS on the 99/4A.\n\n");

	if (stat("MODULES",&st) || stat("ROMS",&st) || stat("MODULES.INF",&st))
	{
		printf("This program needs to be run from the directory where V9t9.EXE,\n"
		       "MODULES.INF, etc., are located.  (Use RECV.BAT from that directory.)\n");
		exit(1);
	}

	printf("In order to use this program, TRANS must be running on a\n"
	       "99/4A system connected to this PC by a serial cable.\n"
	       "It's best to start the 99/4A TRANS before running this program.\n\n"
	       "Press <Enter> to continue, or <Esc> to exit RECV:");
	do
		ch=getch();
	while	(ch!=13 && ch!=27);

	if (ch==27)
		exit(1);


	do
	{
		printf("\n\n\nEnter the DOS serial port you are using to connect\n"
		       "to the 99/4A.  Valid values are 1-4.\n\n: ");
		comm[0]=2;
		port=atoi(cgets(comm));
	}	while (port<1 || port>4);

	do
	{
		printf("\n\n\nEnter the IRQ of COM%d.  Typical value is %d.\n\n: ",
			port, ((port==1 || port==3) ? 4 : 3));
		comm[0]=2;
		irq=atoi(cgets(comm));
	}	while (irq<0 || irq>7);

	port--;			// fix port to 0-3

	do
	{
		printf("\n\n\nEnter the baud rate you used to initialize the RS232\n"
		       "in TRANS.  Valid baud rates are\n"
		       "\t110 300 600 1200 2400 4800 9600.\n\n: ");
		comm[0]=5;
		baudrate=atoi(cgets(comm));
	}	while (baudrate<110 || baudrate>9600);

	com_init(port,baudrate,irq);

	printf("\n\nRECV is ready to go.\n\n"
	       "Press a key at any time to abort.\n\n");
	while (!kbhit())
	{
//		ch=bioscom(_COM_RECEIVE,0,port);
		buf_init();
		if (!gs(comm))
		switch(comm[0])
		{
			case	'S':	ps("G");
					if (dump())
						Err();
					break;
			case	'M':    getbasename();
					ps("N");
					break;
			case	'N':	closemodule();
					ps("M");
					break;
			default:	Err();
					break;
		}
		else
			Err();
	}

	com_off();
	return	0;
}