View Single Post
Old 28 September 2012, 11:55   #54
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,934
Thanks. It finally makes sense..

PFS3 has following code, standard PFS3 does not have TRACKDISK define:

Code:
static BOOL TestRemovability(globaldata *g)
{
#ifdef TRACKDISK

  struct DriveGeometry *geom = g->geom;
  struct IOExtTD *request = g->request;
  BOOL result;

	if(g->trackdisk)
	{
		request->iotd_Req.io_Data = g->geom;
		request->iotd_Req.io_Command = TD_GETGEOMETRY;
		request->iotd_Req.io_Length = sizeof(struct DriveGeometry);

		if(DoIO((struct IORequest *)request) == NULL)
			result = geom->dg_Flags & DGF_REMOVABLE;
		else
			result = 1;     /* trackdisk assumed to be removable */
	}
	else
	{
	  struct DosEnvec *env = g->dosenvec;

		if( (env->de_Surfaces <= 2) && (env->de_LowCyl == 0) )
			result = 1;     /* to accomodate things like the diskspare.device */
		else
			result = 0;     /* disk is assumed to be NOT removable by default */
	}

	return(result);

#else
	return 1;           /* to accomodate SyQuest, Floptical etc */
#endif
}
I enabled TRACKDISK so that floppy changes also work (This define is required because it is also used in other parts of code). But g->trackdisk is only true if device is trackdisk.device (or diskspare) -> code falls back to that DosEnvec check that I assume returns false when using your usb device?

If false is returned: no ADDCHANGEINT but REMCHANGEINT with NULL io request is still called during ACTION_DIE -> crash.

In next and hopefully final version TestRemovability() will always return true which should fix this problem.
Toni Wilen is offline  
 
Page generated in 0.05824 seconds with 10 queries