diff --git a/include/dos_inc.h b/include/dos_inc.h index 3333e3a3..5155acdd 100644 --- a/include/dos_inc.h +++ b/include/dos_inc.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_inc.h,v 1.67 2007-06-12 20:22:07 c2woody Exp $ */ +/* $Id: dos_inc.h,v 1.68 2007-06-13 07:25:14 qbix79 Exp $ */ #ifndef DOSBOX_DOS_INC_H #define DOSBOX_DOS_INC_H @@ -174,7 +174,7 @@ Bit8u DOS_FCBRead(Bit16u seg,Bit16u offset, Bit16u numBlocks); Bit8u DOS_FCBWrite(Bit16u seg,Bit16u offset,Bit16u numBlocks); Bit8u DOS_FCBRandomRead(Bit16u seg,Bit16u offset,Bit16u numRec,bool restore); Bit8u DOS_FCBRandomWrite(Bit16u seg,Bit16u offset,Bit16u numRec,bool restore); -bool DOS_FCBGetFileSize(Bit16u seg,Bit16u offset,Bit16u numRec); +bool DOS_FCBGetFileSize(Bit16u seg,Bit16u offset); bool DOS_FCBDeleteFile(Bit16u seg,Bit16u offset); bool DOS_FCBRenameFile(Bit16u seg, Bit16u offset); void DOS_FCBSetRandomRecord(Bit16u seg, Bit16u offset); diff --git a/include/dos_system.h b/include/dos_system.h index 8b30d5e3..dfb8638f 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.39 2007-01-21 16:21:22 c2woody Exp $ */ +/* $Id: dos_system.h,v 1.40 2007-06-13 07:25:14 qbix79 Exp $ */ #ifndef DOSBOX_DOS_SYSTEM_H #define DOSBOX_DOS_SYSTEM_H @@ -80,12 +80,10 @@ public: virtual bool UpdateDateTimeFromHost() { return true; } void SetDrive(Bit8u drv) { hdrive=drv;} Bit8u GetDrive(void) { return hdrive;} - Bit8u type; Bit32u flags; Bit16u time; Bit16u date; Bit16u attr; - Bit32u size; Bits refCtr; bool open; char* name; diff --git a/src/dos/dos.cpp b/src/dos/dos.cpp index fbc8d81a..168efe4a 100644 --- a/src/dos/dos.cpp +++ b/src/dos/dos.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos.cpp,v 1.101 2007-06-12 20:22:08 c2woody Exp $ */ +/* $Id: dos.cpp,v 1.102 2007-06-13 07:25:14 qbix79 Exp $ */ #include #include @@ -288,7 +288,7 @@ static Bitu DOS_21Handler(void) { LOG(LOG_FCB,LOG_NORMAL)("DOS:0x22 FCB-Random write used, result:al=%d",reg_al); break; case 0x23: /* Get file size for FCB */ - if (DOS_FCBGetFileSize(SegValue(ds),reg_dx,reg_cx)) reg_al = 0x00; + if (DOS_FCBGetFileSize(SegValue(ds),reg_dx)) reg_al = 0x00; else reg_al = 0xFF; break; case 0x24: /* Set Random Record number for FCB */ diff --git a/src/dos/dos_classes.cpp b/src/dos/dos_classes.cpp index 804998ee..5ac6d4e7 100644 --- a/src/dos/dos_classes.cpp +++ b/src/dos/dos_classes.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_classes.cpp,v 1.51 2007-06-12 20:22:08 c2woody Exp $ */ +/* $Id: dos_classes.cpp,v 1.52 2007-06-13 07:25:14 qbix79 Exp $ */ #include #include @@ -462,8 +462,12 @@ void DOS_FCB::FileOpen(Bit8u _fhandle) { sSave(sFCB,cur_block,0); sSave(sFCB,rec_size,128); // sSave(sFCB,rndm,0); // breaks Jewels of darkness. - Bit8u temp=RealHandle(_fhandle); - sSave(sFCB,filesize,Files[temp]->size); + Bit8u temp = RealHandle(_fhandle); + Bit32u size = 0; + Files[temp]->Seek(&size,DOS_SEEK_END); + sSave(sFCB,filesize,size); + size = 0; + Files[temp]->Seek(&size,DOS_SEEK_SET); sSave(sFCB,time,Files[temp]->time); sSave(sFCB,date,Files[temp]->date); } diff --git a/src/dos/dos_devices.cpp b/src/dos/dos_devices.cpp index d20ce408..a3efa85a 100644 --- a/src/dos/dos_devices.cpp +++ b/src/dos/dos_devices.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_devices.cpp,v 1.16 2007-01-13 08:35:49 qbix79 Exp $ */ +/* $Id: dos_devices.cpp,v 1.17 2007-06-13 07:25:14 qbix79 Exp $ */ #include #include "dosbox.h" @@ -92,12 +92,10 @@ bool DOS_Device::WriteToControlChannel(PhysPt bufptr,Bit16u size,Bit16u * retcod } DOS_File::DOS_File(const DOS_File& orig) { - type=orig.type; flags=orig.flags; time=orig.time; date=orig.date; attr=orig.attr; - size=orig.size; refCtr=orig.refCtr; open=orig.open; name=0; @@ -107,12 +105,10 @@ DOS_File::DOS_File(const DOS_File& orig) { } DOS_File & DOS_File::operator= (const DOS_File & orig) { - type=orig.type; flags=orig.flags; time=orig.time; date=orig.date; attr=orig.attr; - size=orig.size; refCtr=orig.refCtr; open=orig.open; if(name) { diff --git a/src/dos/dos_files.cpp b/src/dos/dos_files.cpp index 90b702f6..3abf5004 100644 --- a/src/dos/dos_files.cpp +++ b/src/dos/dos_files.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_files.cpp,v 1.85 2007-06-12 20:22:08 c2woody Exp $ */ +/* $Id: dos_files.cpp,v 1.86 2007-06-13 07:25:14 qbix79 Exp $ */ #include #include @@ -978,13 +978,14 @@ Bit8u DOS_FCBRandomWrite(Bit16u seg,Bit16u offset,Bit16u numRec,bool restore) { return error; } -bool DOS_FCBGetFileSize(Bit16u seg,Bit16u offset,Bit16u numRec) { +bool DOS_FCBGetFileSize(Bit16u seg,Bit16u offset) { char shortname[DOS_PATHLENGTH];Bit16u entry;Bit8u handle;Bit16u rec_size; DOS_FCB fcb(seg,offset); fcb.GetName(shortname); if (!DOS_OpenFile(shortname,0,&entry)) return false; - handle=RealHandle(entry); - Bit32u size=Files[handle]->size; + handle = RealHandle(entry); + Bit32u size = 0; + Files[handle]->Seek(&size,DOS_SEEK_END); DOS_CloseFile(entry);fcb.GetSeqData(handle,rec_size); Bit32u random=(size/rec_size); if (size % rec_size) random++; diff --git a/src/dos/drive_iso.cpp b/src/dos/drive_iso.cpp index dc1eec41..7ed9962c 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.18 2007-06-12 20:22:08 c2woody Exp $ */ +/* $Id: drive_iso.cpp,v 1.19 2007-06-13 07:25:14 qbix79 Exp $ */ #include #include @@ -52,10 +52,9 @@ isoFile::isoFile(isoDrive *drive, const char *name, FileStat_Block *stat, Bit32u time = stat->time; date = stat->date; attr = stat->attr; - size = stat->size; fileBegin = offset; filePos = fileBegin; - fileEnd = fileBegin + size; + fileEnd = fileBegin + stat->size; cachedSector = -1; open = true; this->name = NULL; diff --git a/src/dos/drive_local.cpp b/src/dos/drive_local.cpp index 279e18b6..aa93af5d 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.74 2007-01-09 17:44:20 c2woody Exp $ */ +/* $Id: drive_local.cpp,v 1.75 2007-06-13 07:25:14 qbix79 Exp $ */ #include #include @@ -517,7 +517,6 @@ localFile::localFile(const char* _name, FILE * handle) { } else { time=1;date=1; } - size=(Bit32u)temp_stat.st_size; attr=DOS_ATTR_ARCHIVE; last_action=NONE; read_only_medium=false;