From e9df6e56ab0fbdd3b38b6fb64064375c43333c4b Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Wed, 3 Nov 2004 23:13:55 +0000 Subject: [PATCH] Change fpu for Elvira. Added isRemovable to drive for dott.cd and alike. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2047 --- include/dos_system.h | 3 ++- src/dos/dos_ioctl.cpp | 12 ++++++++---- src/dos/drive_fat.cpp | 5 +++-- src/dos/drive_iso.cpp | 7 ++++++- src/dos/drive_local.cpp | 10 +++++++++- src/dos/drive_virtual.cpp | 4 ++++ src/dos/drives.h | 11 ++++++++--- src/fpu/fpu_instructions.h | 4 +++- 8 files changed, 43 insertions(+), 13 deletions(-) diff --git a/include/dos_system.h b/include/dos_system.h index ef29576a..66d28cde 100644 --- a/include/dos_system.h +++ b/include/dos_system.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_system.h,v 1.26 2004-10-20 12:27:18 qbix79 Exp $ */ +/* $Id: dos_system.h,v 1.27 2004-11-03 23:13:53 qbix79 Exp $ */ #ifndef DOSSYSTEM_H_ #define DOSSYSTEM_H_ @@ -242,6 +242,7 @@ public: virtual void SetDir(const char* path) { strcpy(curdir,path); }; virtual void EmptyCache(void) { dirCache.EmptyCache(); }; virtual bool isRemote(void)=0; + virtual bool isRemovable(void)=0; char * GetInfo(void); char curdir[DOS_PATHLENGTH]; char info[256]; diff --git a/src/dos/dos_ioctl.cpp b/src/dos/dos_ioctl.cpp index d50cc386..3c9995a6 100644 --- a/src/dos/dos_ioctl.cpp +++ b/src/dos/dos_ioctl.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_ioctl.cpp,v 1.20 2004-08-04 09:12:53 qbix79 Exp $ */ +/* $Id: dos_ioctl.cpp,v 1.21 2004-11-03 23:13:54 qbix79 Exp $ */ #include #include "dosbox.h" @@ -41,8 +41,9 @@ bool DOS_IOCTL(void) { switch(reg_al) { case 0x00: /* Get Device Information */ reg_dx=Files[handle]->GetInformation(); + reg_ax=reg_dx; //Destroyed officially return true; - case 0x06: /* Get Input Status */ + case 0x06: /* Get Input Status */ if (Files[handle]->GetInformation() & 0x8000) { //Check for device reg_al=(Files[handle]->GetInformation() & 0x40) ? 0x0 : 0xff; } else { // FILE @@ -67,8 +68,11 @@ bool DOS_IOCTL(void) { case 0x08: /* Check if block device removable */ drive=reg_bl;if (!drive) drive=dos.current_drive;else drive--; if (Drives[drive]) { - if (drive<2) reg_ax=0; /* Drive a,b are removable if mounted */ - else reg_ax=1; + /* Drive a,b are removable if mounted * + * So are cdrom drives */ + if (drive < 2 || Drives[drive]->isRemovable()) + reg_ax=0; + else reg_ax=1; return true; } else { DOS_SetError(DOSERR_INVALID_DRIVE); diff --git a/src/dos/drive_fat.cpp b/src/dos/drive_fat.cpp index a0e6d7bb..71bfd157 100644 --- a/src/dos/drive_fat.cpp +++ b/src/dos/drive_fat.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: drive_fat.cpp,v 1.5 2004-09-05 14:23:04 qbix79 Exp $ */ +/* $Id: drive_fat.cpp,v 1.6 2004-11-03 23:13:54 qbix79 Exp $ */ #include #include @@ -698,7 +698,8 @@ Bit32u fatDrive::getFirstFreeClust(void) { } -bool fatDrive::isRemote(void) { return false; } +bool fatDrive::isRemote(void) { return false; } +bool fatDrive::isRemovable(void) { return false; } Bit8u fatDrive::GetMediaByte(void) { return loadedDisk->GetBiosType(); } diff --git a/src/dos/drive_iso.cpp b/src/dos/drive_iso.cpp index fb62e694..acb549e6 100644 --- a/src/dos/drive_iso.cpp +++ b/src/dos/drive_iso.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: drive_iso.cpp,v 1.3 2004-10-05 21:18:48 qbix79 Exp $ */ +/* $Id: drive_iso.cpp,v 1.4 2004-11-03 23:13:55 qbix79 Exp $ */ #include #include @@ -367,6 +367,11 @@ bool isoDrive::isRemote(void) return true; } +bool isoDrive::isRemovable(void) +{ + return true; +} + inline bool isoDrive :: readSector(Bit8u *buffer, Bit32u sector) { return CDROM_Interface_Image::images[subUnit]->ReadSector(buffer, false, sector); diff --git a/src/dos/drive_local.cpp b/src/dos/drive_local.cpp index 2b216eed..9393e4f5 100644 --- a/src/dos/drive_local.cpp +++ b/src/dos/drive_local.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: drive_local.cpp,v 1.52 2004-10-12 09:42:25 qbix79 Exp $ */ +/* $Id: drive_local.cpp,v 1.53 2004-11-03 23:13:55 qbix79 Exp $ */ #include #include @@ -366,6 +366,10 @@ bool localDrive::isRemote(void) { return false; } +bool localDrive::isRemovable(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); @@ -572,3 +576,7 @@ void cdromDrive::SetDir(const char* path) bool cdromDrive::isRemote(void) { return true; } + +bool cdromDrive::isRemovable(void) { + return true; +} diff --git a/src/dos/drive_virtual.cpp b/src/dos/drive_virtual.cpp index e12ad737..d9321c54 100644 --- a/src/dos/drive_virtual.cpp +++ b/src/dos/drive_virtual.cpp @@ -236,3 +236,7 @@ Bit8u Virtual_Drive::GetMediaByte(void) { bool Virtual_Drive::isRemote(void) { return false; } + +bool Virtual_Drive::isRemovable(void) { + return false; +} diff --git a/src/dos/drives.h b/src/dos/drives.h index e5de809f..16f6d670 100644 --- a/src/dos/drives.h +++ b/src/dos/drives.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: drives.h,v 1.24 2004-10-05 19:55:03 qbix79 Exp $ */ +/* $Id: drives.h,v 1.25 2004-11-03 23:13:55 qbix79 Exp $ */ #ifndef _DRIVES_H__ #define _DRIVES_H__ @@ -49,6 +49,7 @@ public: virtual bool FileStat(const char* name, FileStat_Block * const stat_block); virtual Bit8u GetMediaByte(void); virtual bool isRemote(void); + virtual bool isRemovable(void); private: char basedir[CROSS_LEN]; friend void DOS_Shell::CMD_SUBST(char* args); @@ -140,6 +141,7 @@ public: virtual bool FileStat(const char* name, FileStat_Block * const stat_block); virtual Bit8u GetMediaByte(void); virtual bool isRemote(void); + virtual bool isRemovable(void); public: Bit32u getAbsoluteSectFromBytePos(Bit32u startClustNum, Bit32u bytePos); Bit32u getSectorSize(void); @@ -200,6 +202,7 @@ public: virtual bool FindFirst(char * _dir,DOS_DTA & dta,bool fcb_findfirst=false); virtual void SetDir(const char* path); virtual bool isRemote(void); + virtual bool isRemovable(void); private: Bit8u subUnit; }; @@ -295,6 +298,7 @@ public: virtual Bit8u GetMediaByte(void); virtual void EmptyCache(void){} virtual bool isRemote(void); + virtual bool isRemovable(void); bool readSector(Bit8u *buffer, Bit32u sector); private: int readDirEntry(isoDirEntry *de, Bit8u *data); @@ -326,11 +330,12 @@ public: bool GetFileAttr(char * name,Bit16u * attr); bool Rename(char * oldname,char * newname); bool AllocationInfo(Bit16u * _bytes_sector,Bit8u * _sectors_cluster,Bit16u * _total_clusters,Bit16u * _free_clusters); - bool FileExists(const char* name); - bool FileStat(const char* name, FileStat_Block* const stat_block); + bool FileExists(const char* name); + bool FileStat(const char* name, FileStat_Block* const stat_block); Bit8u GetMediaByte(void); void EmptyCache(void){} bool isRemote(void); + virtual bool isRemovable(void); private: VFILE_Block * search_file; }; diff --git a/src/fpu/fpu_instructions.h b/src/fpu/fpu_instructions.h index 539f3b10..3f681853 100644 --- a/src/fpu/fpu_instructions.h +++ b/src/fpu/fpu_instructions.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: fpu_instructions.h,v 1.24 2004-10-13 19:26:26 qbix79 Exp $ */ +/* $Id: fpu_instructions.h,v 1.25 2004-11-03 23:13:55 qbix79 Exp $ */ static void FPU_FINIT(void) { @@ -322,6 +322,8 @@ static void FPU_ST80(PhysPt addr,Bitu reg) Bit64s exp80final= (exp80>>52) - BIAS64 + BIAS80; Bit64s mant80 = fpu.regs[reg].ll&LONGTYPE(0x000fffffffffffff); Bit64s mant80final= (mant80 << 11); + // Elvira wants the 8 and tcalc doesn't + if(fpu.regs[reg].d != 0) mant80final |= LONGTYPE(0x8000000000000000); test.begin= (static_cast(sign80)<<15)| static_cast(exp80final); test.eind.ll=mant80final; mem_writed(addr,test.eind.l.lower);