1
0
Fork 0

Remove from DOS_File type and size. type wasn't used at all. size was only implemented in 50% of the drives.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2885
This commit is contained in:
Peter Veenstra 2007-06-13 07:25:14 +00:00
parent e42291ec7a
commit df0f8ee9d6
8 changed files with 21 additions and 24 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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 <stdlib.h>
#include <string.h>
@ -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 */

View file

@ -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 <string.h>
#include <stdlib.h>
@ -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);
}

View file

@ -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 <string.h>
#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) {

View file

@ -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 <string.h>
#include <stdlib.h>
@ -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++;

View file

@ -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 <cctype>
#include <cstring>
@ -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;

View file

@ -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 <stdio.h>
#include <stdlib.h>
@ -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;