From eaf55b8dfd034cd344f99e2781e3a6cab52ae4e7 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Sun, 16 Jan 2011 20:49:43 +0000 Subject: [PATCH] Add dummy support for openmode 4. Legend Of the Red Dragon 4.07 uses this. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3667 --- include/dos_system.h | 2 +- src/dos/drive_local.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/dos_system.h b/include/dos_system.h index eab510e7..34d99fc2 100644 --- a/include/dos_system.h +++ b/include/dos_system.h @@ -250,7 +250,7 @@ public: virtual void Activate(void) {}; }; -enum { OPEN_READ=0,OPEN_WRITE=1,OPEN_READWRITE=2, DOS_NOT_INHERIT=128}; +enum { OPEN_READ=0, OPEN_WRITE=1, OPEN_READWRITE=2, OPEN_READ_NO_MOD=4, DOS_NOT_INHERIT=128}; enum { DOS_SEEK_SET=0,DOS_SEEK_CUR=1,DOS_SEEK_END=2}; diff --git a/src/dos/drive_local.cpp b/src/dos/drive_local.cpp index f53cc0c4..50ae6f1c 100644 --- a/src/dos/drive_local.cpp +++ b/src/dos/drive_local.cpp @@ -83,9 +83,10 @@ bool localDrive::FileCreate(DOS_File * * file,char * name,Bit16u /*attributes*/) bool localDrive::FileOpen(DOS_File * * file,char * name,Bit32u flags) { const char* type; switch (flags&0xf) { - case OPEN_READ:type="rb"; break; - case OPEN_WRITE:type="rb+"; break; - case OPEN_READWRITE:type="rb+"; break; + case OPEN_READ: type = "rb" ; break; + case OPEN_WRITE: type = "rb+"; break; + case OPEN_READWRITE: type = "rb+"; break; + case OPEN_READ_NO_MOD: type = "rb" ; break; //No modification of dates. LORD4.07 uses this default: DOS_SetError(DOSERR_ACCESS_CODE_INVALID); return false;