A new version is available: It fixes one bug that affected Eye of the Beholder and Might and Magic 3. Status: No known bugs, working great, all of my games supported. Still no zipped image mounting, however, since prompt's patch is far too heavy to be just included.
Ooops.
I meant compiler doesn't accept some lines like '<<<<<<< drive_cache.cpp'
This is what I got when compiling in mingw32/msys with your patch that I downloaded from sourceforge. I used the latest clean cvs source (with no other patches applied).
1if g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../../include -I/usr/local/include/SDL -Dmain=SDL_main -s -O2 -pipe -fprofile-use -fomit-frame-pointer -mtune=i686 -march=i586 -MT drive_cache.o -MD -MP -MF ".deps/drive_cache.Tpo" -c -o drive_cache.o drive_cache.cpp; \ 2then mv -f ".deps/drive_cache.Tpo" ".deps/drive_cache.Po"; else rm -f ".deps/drive_cache.Tpo"; exit 1; fi 3drive_cache.cpp: In member function `void DOS_Drive_Cache::SetBaseDir(const char*, DOS_Drive*)': 4drive_cache.cpp:167: error: expected primary-expression before '<<' token 5drive_cache.cpp:167: error: expected primary-expression before '<<' token 6drive_cache.cpp:167: error: expected primary-expression before '<<' token 7drive_cache.cpp:167: error: expected primary-expression before '<' token 8drive_cache.cpp:167: error: `drive_cache' undeclared (first use this function) 9drive_cache.cpp:167: error: (Each undeclared identifier is reported only once for each function it appears in.) 10drive_cache.cpp:168: error: expected `;' before "char" 11drive_cache.cpp:169: error: `windrive' undeclared (first use this function) 12drive_cache.cpp:171: error: expected primary-expression before '==' token 13drive_cache.cpp:171: error: expected primary-expression before '==' token 14drive_cache.cpp:171: error: expected primary-expression before '==' token 15drive_cache.cpp:171: error: expected primary-expression before '=' token 16drive_cache.cpp:172: error: expected primary-expression before "char" 17drive_cache.cpp:172: error: expected `;' before "char" 18drive_cache.cpp:173: error: no match for 'operator=' in '*drive = ((DOS_Drive_Cache*)this)->DOS_Drive_Cache::basePath[0]' 19../../include/dos_system.h:232: note: candidates are: DOS_Drive& DOS_Drive::operator=(const DOS_Drive&) 20drive_cache.cpp:175: error: cannot convert `DOS_Drive*' to `const CHAR*' for argument `1' to `BOOL GetVolumeInformationA(const CHAR*, CHAR*, DWORD, DWORD*, DWORD*, DWORD*, CHAR*, DWORD)' 21drive_cache.cpp:185: error: expected primary-expression before '>>' token 22drive_cache.cpp:185: error: expected primary-expression before '>>' token 23drive_cache.cpp:185: error: expected primary-expression before '>>' token 24drive_cache.cpp:185: error: expected primary-expression before '>' token 25drive_cache.cpp:187: error: expected `;' before "SetLabel" 26drive_cache.cpp:193: error: a function-definition is not allowed here before '{' token 27drive_cache.cpp:193: error: expected `,' or `;' before '{' token 28drive_cache.cpp:198: error: a function-definition is not allowed here before '{' token 29drive_cache.cpp:198: error: expected `,' or `;' before '{' token 30drive_cache.cpp:231: error: a function-definition is not allowed here before '{' token 31drive_cache.cpp:231: error: expected `,' or `;' before '{' token 32drive_cache.cpp:263: error: a function-definition is not allowed here before '{' token 33drive_cache.cpp:263: error: expected `,' or `;' before '{' token 34drive_cache.cpp:280: error: a function-definition is not allowed here before '{' token 35drive_cache.cpp:280: error: expected `,' or `;' before '{' token 36drive_cache.cpp:310: error: a function-definition is not allowed here before '{' token 37drive_cache.cpp:310: error: expected `,' or `;' before '{' token 38drive_cache.cpp:316: error: a function-definition is not allowed here before '{' token 39drive_cache.cpp:316: error: expected `,' or `;' before '{' token 40drive_cache.cpp:339: error: a function-definition is not allowed here before '{' token 41drive_cache.cpp:339: error: expected `,' or `;' before '{' token 42drive_cache.cpp:371: error: a function-definition is not allowed here before '{' token 43drive_cache.cpp:371: error: expected `,' or `;' before '{' token 44drive_cache.cpp:397: error: a function-definition is not allowed here before '{' token 45drive_cache.cpp:397: error: expected `,' or `;' before '{' token 46drive_cache.cpp:409: error: a function-definition is not allowed here before '{' token 47drive_cache.cpp:409: error: expected `,' or `;' before '{' token 48drive_cache.cpp:432: error: a function-definition is not allowed here before '{' token 49drive_cache.cpp:432: error: expected `,' or `;' before '{' token 50drive_cache.cpp:443: error: a function-definition is not allowed here before '{' token 51drive_cache.cpp:443: error: expected `,' or `;' before '{' token 52drive_cache.cpp:513: error: a function-definition is not allowed here before '{' token 53drive_cache.cpp:513: error: expected `,' or `;' before '{' token 54drive_cache.cpp:593: error: a function-definition is not allowed here before '{' token 55drive_cache.cpp:593: error: expected `,' or `;' before '{' token 56drive_cache.cpp:604: error: a function-definition is not allowed here before '{' token 57drive_cache.cpp:604: error: expected `,' or `;' before '{' token 58drive_cache.cpp:628: error: a function-definition is not allowed here before '{' token 59drive_cache.cpp:628: error: expected `,' or `;' before '{' token 60drive_cache.cpp:645: error: a function-definition is not allowed here before '{' token
…Show last 25 lines
61drive_cache.cpp:645: error: expected `,' or `;' before '{' token 62drive_cache.cpp:682: error: a function-definition is not allowed here before '{' token 63drive_cache.cpp:682: error: expected `,' or `;' before '{' token 64drive_cache.cpp:697: error: a function-definition is not allowed here before '{' token 65drive_cache.cpp:697: error: expected `,' or `;' before '{' token 66drive_cache.cpp:741: error: a function-definition is not allowed here before '{' token 67drive_cache.cpp:741: error: expected `,' or `;' before '{' token 68drive_cache.cpp:761: error: expected primary-expression before '(' token 69drive_cache.cpp:761: error: expected primary-expression before "const" 70drive_cache.cpp:761: error: expected primary-expression before '*' token 71drive_cache.cpp:762: error: expected `;' before '{' token 72drive_cache.cpp:767: error: a function-definition is not allowed here before '{' token 73drive_cache.cpp:767: error: expected `,' or `;' before '{' token 74drive_cache.cpp:773: error: a function-definition is not allowed here before '{' token 75drive_cache.cpp:773: error: expected `,' or `;' before '{' token 76drive_cache.cpp:781: error: a function-definition is not allowed here before '{' token 77drive_cache.cpp:781: error: expected `,' or `;' before '{' token 78drive_cache.cpp:794: error: expected `}' at end of input 79make[3]: *** [drive_cache.o] Error 1 80make[3]: Leaving directory `/c/dosbox/src/dos' 81make[2]: *** [all-recursive] Error 1 82make[2]: Leaving directory `/c/dosbox/src' 83make[1]: *** [all-recursive] Error 1 84make[1]: Leaving directory `/c/dosbox' 85make: *** [all] Error 2
hmm remove the lines with <<<<<>>>>>> in it.
they are just pointers to show you where the confilicts appeared.
else use an older version of drive_cacche.cpp. the changes I commited were OS/2 only and shouldn't affect the results under windows.
Thanks, Qbix.
I didn't know it is against older version of drive_cache.cpp.
I think that it should be updated for successful compilation against the latest cvs.
It's not against an older version, I just missed that one conflict, as I didn't use the patch on windows. AsI said, all lines starting with "+" in your original diff can be safely deleted. Anyhow, I have uploaded a new patch with that glitch fixed.
QBix, how's your opinion regarding this patch? And what's your opinion on allowing images to be loaded from DOS drives (like prompt's patch above, which is unfortunately quite intrusive)?
EDIT: I'd love to upload the new patch, but sf.net is having problems. soon.. 😉
It's just the fact that it changes a big amount of existing code. I've thought about integrating it with my patch, but maintaining physfs would become more difficult and your approach can be treated like a different issue.
There's still an error during compilation under windows.
You changed
'void DOS_Drive_Cache::SetBaseDir(const char* baseDir)' to
'void DOS_Drive_Cache::SetBaseDir(const char* baseDir, DOS_Drive *drive)'
But it seems that 'DOS_Drive *drive' crashed with 'char drive[4] = "C:\\";'.
Why is that crashing, and how does renaming drive[] to drives[] fix it? Also, it looks like that change might break the OS2 part at the bottom, which checks drive[0].
Does changing this:
char drive[4] = "C:\\";
to
char drive[] = "C:\\";
I tested my little changes only under Windows. And it's a temporary fix to complete compilation without errors.
I changed that also as you said, but result is the same.
1drive_cache.cpp: In member function `void DOS_Drive_Cache::SetBaseDir(const char*, DOS_Drive*)': 2drive_cache.cpp:167: error: declaration of 'char drive[]' shadows a parameter
Oh I see. Can you post the first few lines of the definition of SetBaseDir() in drive_cache.cpp? I'm guessing that it has a parameter named drive in the parameter list, in which case whoever wrote that code needs to take a look at it to figure out why he/she is defining a variable whose name is already in scope.
Yeah, it's definitely broken and whoever wrote it needs to resolve the conflict between DOS_Drive *drive in the parameter list for DOS_Drive_Cache() and char drive[4] farther down.
Here is a patch that I modified a little bit against current cvs.
The patch also includes Krounz's bug-fix.
I assume that gulikoza updated it himself, too.
Thanks for your kind help, fellows. Using the current CVS and ykhwong's updated diff attachment, I still get:
$ patch -sup1 -l -p1 --dry-run <dosbox-physfs-20051205.diff
1 out of 4 hunks FAILED -- saving rejects to include/dos_system.h.rej
2 out of 7 hunks FAILED -- saving rejects to src/dos/drives.h.rej
and/or:
$ patch -l -p1 --dry-run <dosbox-physfs-20051205.diff
patching file `configure.in'
Hunk #1 succeeded at 284 (offset 24 lines).
patching file `include/dos_system.h'
Hunk #1 succeeded at 118 (offset 7 lines).
Hunk #3 succeeded at 204 (offset 7 lines).
Hunk #4 FAILED at 214.
1 out of 4 hunks FAILED -- saving rejects to include/dos_system.h.rej
patching file `src/dos/dos_programs.cpp'
Hunk #1 succeeded at 148 (offset 1 line).
Hunk #3 succeeded at 181 (offset 1 line).
Hunk #5 succeeded at 211 (offset 1 line).
Hunk #7 succeeded at 249 (offset 11 lines).
patching file `src/dos/drive_cache.cpp'
patching file `src/dos/drive_fat.cpp'
Hunk #4 succeeded at 414 (offset 7 lines).
Hunk #5 succeeded at 704 (offset 8 lines).
Hunk #6 succeeded at 748 (offset 9 lines).
Hunk #7 succeeded at 766 (offset 10 lines).
Hunk #8 succeeded at 779 (offset 9 lines).
Hunk #9 succeeded at 894 (offset 14 lines).
Hunk #10 succeeded at 1054 (offset 9 lines).
Hunk #11 succeeded at 1111 (offset 14 lines).
Hunk #12 succeeded at 1158 (offset 9 lines).
patching file `src/dos/drive_iso.cpp'
Hunk #1 succeeded at 187 (offset 5 lines).
Hunk #3 succeeded at 312 (offset -10 lines).
patching file `src/dos/drive_local.cpp'
Hunk #1 succeeded at 48 (offset 1 line).
Hunk #3 succeeded at 141 (offset 1 line).
Hunk #4 succeeded at 181 with fuzz 2 (offset 28 lines).
Hunk #5 succeeded at 257 (offset 1 line).
Hunk #6 succeeded at 301 (offset 28 lines).
Hunk #7 succeeded at 289 (offset 1 line).
Hunk #8 succeeded at 326 (offset 28 lines).
Hunk #9 succeeded at 317 (offset 1 line).
Hunk #10 succeeded at 421 with fuzz 1 (offset 33 lines).
Hunk #11 succeeded at 419 (offset 1 line).
Hunk #12 succeeded at 585 (offset 45 lines).
Hunk #13 succeeded at 554 with fuzz 1 (offset 3 lines).
patching file `src/dos/drive_physfs.cpp'
patching file `src/dos/drives.cpp'
patching file `src/dos/drives.h'
Hunk #1 FAILED at 32.
Hunk #2 succeeded at 77 (offset 1 line).
Hunk #4 succeeded at 197 (offset 3 lines).
Hunk #5 FAILED at 231.
Hunk #6 succeeded at 344 (offset 4 lines).
Hunk #7 succeeded at 401 (offset 23 lines).
2 out of 7 hunks FAILED -- saving rejects to src/dos/drives.h.rej
patching file `src/dos/drive_virtual.cpp'
Hunk #1 succeeded at 139 (offset 1 line).
Hunk #3 succeeded at 199 (offset 1 line).
Hunk #4 succeeded at 229 (offset 5 lines).
Hunk #5 succeeded at 237 (offset 1 line).
patching file `src/dos/Makefile.am'
patching file `src/shell/shell.cpp'
Hunk #1 succeeded at 366 (offset 44 lines).
patching file `src/dos/drive_cache.cpp'
Hunk #1 succeeded at 163 (offset -1 lines).