First post, by Glidos
- Rank
- l33t
I've been working towards getting Glidos to support DOSBox (which I really should have looked at years ago). My first throughts were to add VDD support to DOSBox, but that's looking hard (it's unclear without some reverse engineering where VDDs expect the DOS registers to be stashed while "DispatchCall" is executed).
Glidos used not to use a VDD, instead communicating via a named pipe. I've reenstated that as an option, and now have something partly working (TR1 works at least in some configurations).
I've had to patch DOSBox a little just to avoid it translating the name of the named pipe. Here's the patch. It's slightly hacky.
Index: src/dos/dos_files.cpp
===================================================================
RCS file: /cvsroot/dosbox/dosbox/src/dos/dos_files.cpp,v
retrieving revision 1.112
diff -u -r1.112 dos_files.cpp
--- src/dos/dos_files.cpp 9 Jul 2009 20:06:57 -0000 1.112
+++ src/dos/dos_files.cpp 17 Aug 2009 16:12:01 -0000
@@ -63,6 +63,19 @@
DOS_SetError(DOSERR_FILE_NOT_FOUND);
return false;
}
+ if(strlen(name) > 4 && memcmp(name, "\\\\.\\", 4) == 0)
+ {
+ /* The program is opening a Windows device or pipe.
+ * Either we are running under Windows, in which case
+ * no translation should be applied to the name, or
+ * we are running under some other OS, in which case
+ * no tranlation will help. */
+ strcpy(fullname, name);
+ /* Trickery: pretend the path valid for the default
+ * drive */
+ *drive = DOS_GetDefaultDrive();
+ return true;
+ }
const char * name_int = name;
char tempdir[DOS_PATHLENGTH];
char upname[DOS_PATHLENGTH];
Index: src/dos/drive_local.cpp
===================================================================
RCS file: /cvsroot/dosbox/dosbox/src/dos/drive_local.cpp,v
retrieving revision 1.82
diff -u -r1.82 drive_local.cpp
--- src/dos/drive_local.cpp 18 Jul 2009 18:42:55 -0000 1.82
+++ src/dos/drive_local.cpp 17 Aug 2009 16:10:07 -0000
@@ -90,10 +90,22 @@
return false;
}
char newname[CROSS_LEN];
- strcpy(newname,basedir);
- strcat(newname,name);
- CROSS_FILENAME(newname);
- dirCache.ExpandName(newname);
+ if(strlen(name) > 4 && memcmp(name, "\\\\.\\", 4) ==0)
+ {
+ /* The program is opening a Windows device or pipe.
+ * Either we are running under Windows, in which case
+ * no translation should be applied to the name, or
+ * we are running under some other OS, in which case
+ * no tranlation will help. */
+ strcpy(newname,name);
+ }
+ else
+ {
+ strcpy(newname,basedir);
+ strcat(newname,name);
+ CROSS_FILENAME(newname);
+ dirCache.ExpandName(newname);
+ }
FILE * hand=fopen(newname,type);
// Bit32u err=errno;