}
/*}}}*/
/* Device_setGeometry -- Set disk geometry */ /*{{{*/
-void Device_setGeometry(struct Device *this, int secLength, int sectrk, int tracks)
+void Device_setGeometry(struct Device *this, int secLength, int sectrk, int tracks, off_t offset)
{
int n;
this->secLength=secLength;
this->sectrk=sectrk;
this->tracks=tracks;
+ // Bill Buckels - add this->offset
+ this->offset=offset;
+
+
+ // Bill Buckels - not sure what to do here
if (this->drvtype == CPMDRV_WIN95)
{
DRIVEPARAMS drvp;
LPVOID iobuffer;
DWORD bytesread;
- if (SetFilePointer(drive->hdisk, offset, NULL, FILE_BEGIN) == INVALID_FILE_SIZE)
+ // Bill Buckels - add drive->offset
+ if (SetFilePointer(drive->hdisk, offset+drive->offset, NULL, FILE_BEGIN) == INVALID_FILE_SIZE)
{
return strwin32error();
}
return NULL;
}
+ // Bill Buckels - not sure what to do here
if (drive->drvtype == CPMDRV_WIN95)
{
DIOC_REGISTERS reg;
return 0;
}
- if (lseek(drive->fd,offset,SEEK_SET)==-1)
+ // Bill Buckels - add drive->offset
+ if (lseek(drive->fd,offset+drive->offset,SEEK_SET)==-1)
{
return strerror(errno);
}
LPVOID iobuffer;
DWORD byteswritten;
- if (SetFilePointer(drive->hdisk, offset, NULL, FILE_BEGIN) == INVALID_FILE_SIZE)
+ // Bill Buckels - add drive->offset
+ if (SetFilePointer(drive->hdisk, offset+drive->offset, NULL, FILE_BEGIN) == INVALID_FILE_SIZE)
{
return strwin32error();
}
return NULL;
}
+ // Bill Buckels - not sure what to do here
if (drive->drvtype == CPMDRV_WIN95)
{
DIOC_REGISTERS reg;
return NULL;
}
- if (lseek(drive->fd,offset, SEEK_SET)==-1)
+ // Bill Buckels - add drive->offset
+ if (lseek(drive->fd,offset+drive->offset, SEEK_SET)==-1)
{
return strerror(errno);
}