Add method for checking a remote drive.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1417
This commit is contained in:
parent
b8c73b0ff1
commit
9d0029f51b
5 changed files with 19 additions and 4 deletions
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: dos_system.h,v 1.17 2003-10-29 19:42:19 finsterr Exp $ */
|
||||
/* $Id: dos_system.h,v 1.18 2003-11-08 17:59:30 harekiet Exp $ */
|
||||
|
||||
#ifndef DOSSYSTEM_H_
|
||||
#define DOSSYSTEM_H_
|
||||
|
@ -222,6 +222,7 @@ public:
|
|||
virtual Bit8u GetMediaByte(void)=0;
|
||||
virtual void SetDir(const char* path) { strcpy(curdir,path); };
|
||||
virtual void EmptyCache(void) { dirCache.EmptyCache(); };
|
||||
virtual bool isRemote(void)=0;
|
||||
char * GetInfo(void);
|
||||
char curdir[DOS_PATHLENGTH];
|
||||
char info[256];
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: dos_ioctl.cpp,v 1.16 2003-10-14 08:38:35 qbix79 Exp $ */
|
||||
/* $Id: dos_ioctl.cpp,v 1.17 2003-11-08 18:00:46 harekiet Exp $ */
|
||||
|
||||
#include <string.h>
|
||||
#include "dosbox.h"
|
||||
|
@ -78,8 +78,9 @@ bool DOS_IOCTL(void) {
|
|||
drive=reg_bl;if (!drive) drive=dos.current_drive;else drive--;
|
||||
if (Drives[drive]) {
|
||||
reg_dx=0;
|
||||
//TODO Cdrom drives are remote
|
||||
if (Drives[drive]->isRemote()) reg_dx|=(1 << 12);
|
||||
//TODO Set bit 9 on drives that don't support direct I/O
|
||||
reg_al=0;
|
||||
return true;
|
||||
} else {
|
||||
DOS_SetError(DOSERR_INVALID_DRIVE);
|
||||
|
|
|
@ -311,6 +311,10 @@ Bit8u localDrive::GetMediaByte(void) {
|
|||
return allocation.mediaid;
|
||||
}
|
||||
|
||||
bool localDrive::isRemote(void) {
|
||||
return false;
|
||||
}
|
||||
|
||||
localDrive::localDrive(const char * startdir,Bit16u _bytes_sector,Bit8u _sectors_cluster,Bit16u _total_clusters,Bit16u _free_clusters,Bit8u _mediaid) {
|
||||
strcpy(basedir,startdir);
|
||||
sprintf(info,"local directory %s",startdir);
|
||||
|
@ -499,3 +503,7 @@ void cdromDrive::SetDir(const char* path)
|
|||
}
|
||||
localDrive::SetDir(path);
|
||||
};
|
||||
|
||||
bool cdromDrive::isRemote(void) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -227,3 +227,6 @@ Bit8u Virtual_Drive::GetMediaByte(void) {
|
|||
return 0xF8;
|
||||
}
|
||||
|
||||
bool Virtual_Drive::isRemote(void) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
virtual bool FileExists(const char* name);
|
||||
virtual bool FileStat(const char* name, FileStat_Block * const stat_block);
|
||||
virtual Bit8u GetMediaByte(void);
|
||||
|
||||
virtual bool isRemote(void);
|
||||
private:
|
||||
char basedir[CROSS_LEN];
|
||||
|
||||
|
@ -71,6 +71,7 @@ public:
|
|||
virtual bool GetFileAttr(char * name,Bit16u * attr);
|
||||
virtual bool FindFirst(char * _dir,DOS_DTA & dta);
|
||||
virtual void SetDir(const char* path);
|
||||
virtual bool isRemote(void);
|
||||
private:
|
||||
Bit8u subUnit;
|
||||
};
|
||||
|
@ -95,6 +96,7 @@ public:
|
|||
bool FileStat(const char* name, FileStat_Block* const stat_block);
|
||||
Bit8u GetMediaByte(void);
|
||||
void EmptyCache(void){}
|
||||
bool isRemote(void);
|
||||
private:
|
||||
VFILE_Block * search_file;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue