I call it before the game is run and mostly everything works fine with one exception.
Batch files don't CD into the proper dir.
For instance loading duke 3d I have this batch:
@echo off
C:
cd \DUKE3D
DUKE3D.exe […] Show full quote
@echo off
C:
cd \DUKE3D
DUKE3D.exe
So if my overlay autload code is enabled I end up with this:
If it's disabled it works fine.
The kicker is that if it's enabled and I run the bat again manually from the prompt it works.
Now if I load the exe directly.. it all just works fine, saves are redirected and everything...
But I intend this to work properly for eXoDOS sets so I'd like to solve this.
Maybe I'm mounting "too late" or is there any other way.
I was thinking I could populate an autoexec line and install it with InstallBefore instead of the code I'm referencing.
Would that be better/safer?
Well if it's launching, it's clearly CD'ing in to the directory with the exe, though it looks like it's trying to mount a CD image as C since there's no cfg file being seen.
If the patch itself is something that is applied to the file system, then you need to test that it's completed before trying it. In which case I'm still wondering why you're trying to run "the CD" and not a local file system.
@fr500 I haven't touched overlay functionality yet, so I am not 100% sure if it's the problem here, but when working on resolving DOSBox imgmount issues in Boxtron, I discovered that DOSBox mount points are very sensitive to commands preceding mounts, current working dir and some parts of UI use case-sensitive paths, even though it is counterintuitive for a DOS emulator (Windows users don't care, as it affects only Linux and Mac users). I suggest trying:
- using `cd DUKE3D` instead of `cd \DUKE3D`
- double-checking that DUKE3D directory and DUKE3D.exe use exact same paths (case-sensitive!) as the files on the actual filesystem
Aside of that, I took a peak in your dosbox-svn Git repo - would you be interested in cooperating with us on dosbox-staging?
The return prompt might indicate that the CD\DUKE3D line failed. Does that line work ?
Yes it works, if I run it manually afterwards immediately after the failure.
So maybe as Kisai said mounting is happening too late or at the same time (I run dosbox in a thread of sorts)
I'll have to figure a way to run the mount in a way that it happens right before "call program-name"
dreamer_ wrote:@fr500 I haven't touched overlay functionality yet, so I am not 100% sure if it's the problem here, but when working on resolvin […] Show full quote
@fr500 I haven't touched overlay functionality yet, so I am not 100% sure if it's the problem here, but when working on resolving DOSBox imgmount issues in Boxtron, I discovered that DOSBox mount points are very sensitive to commands preceding mounts, current working dir and some parts of UI use case-sensitive paths, even though it is counterintuitive for a DOS emulator (Windows users don't care, as it affects only Linux and Mac users). I suggest trying:
- using `cd DUKE3D` instead of `cd \DUKE3D`
- double-checking that DUKE3D directory and DUKE3D.exe use exact same paths (case-sensitive!) as the files on the actual filesystem
Aside of that, I took a peak in your dosbox-svn Git repo - would you be interested in cooperating with us on dosbox-staging?
Well, actually the whole idea is not touching the batch files that work fine otherwise, but I'll try the changes none-the-less.
Regarding the repo, sure, but in what capacity?, I see you're maintaining a set of branches, patches, etc.
What would be the workflow? I strive to keep my core untouched as much as possible.
fr500 wrote:Yes it works, if I run it manually afterwards immediately after the failure.
So maybe as Kisai said mounting is happening too la […] Show full quote
Qbix wrote:
The return prompt might indicate that the CD\DUKE3D line failed. Does that line work ?
Yes it works, if I run it manually afterwards immediately after the failure.
So maybe as Kisai said mounting is happening too late or at the same time (I run dosbox in a thread of sorts)
I'll have to figure a way to run the mount in a way that it happens right before "call program-name"
can you add a pause command before executing the main executable ?
(and check the contents of z:\autoexec.bat)
Oh you're right, pause does the trick, so I guess its happening too late.
I think my blaster line issue may be the same. I need to find a way to enter these before control->startup I guess
Maybe I should try to convert these lines in autoexec commands programatically? I figure that could solve the issue and also prevent me from duplicating this kind of code:
1bool mount_overlay_filesystem(char drive, const char* path) 2{ 3 Bit16u sizes[4]; 4 Bit8u mediaid; 5 Bit8u o_error = 0; 6 std::string str_size; 7 str_size="512,32,32765,16000"; 8 mediaid=0xF8; 9 Bit8u bit8size=(Bit8u) sizes[1]; 10 11 DOS_Drive * overlay; 12 13 localDrive* ldp = dynamic_cast<localDrive*>(Drives[drive-'A']); 14 cdromDrive* cdp = dynamic_cast<cdromDrive*>(Drives[drive-'A']); 15 16 if (log_cb) 17 log_cb(RETRO_LOG_INFO, "[dosbox] mounting %s in %c as overlay\n", path, drive); 18 19 struct stat path_stat; 20 21 if (stat(path, &path_stat) == 0 && S_ISDIR(path_stat.st_mode)) 22 { 23 if (log_cb) 24 log_cb(RETRO_LOG_INFO, "[dosbox] save directory already exists %s\n", path); 25 } 26 else 27 { 28 if (log_cb) 29 log_cb(RETRO_LOG_INFO, "[dosbox] creating save directory %s\n", path); 30#if (WIN32) 31 if (mkdir(path) == -1) 32#else 33 if (mkdir(path, 0700) == -1) 34#endif 35 { 36 if (log_cb) 37 log_cb(RETRO_LOG_INFO, "[dosbox] error creating save directory %s\n", path); 38 return false; 39 } 40 } 41 if (!Drives[drive-'A']) 42 { 43 if (log_cb) 44 log_cb(RETRO_LOG_INFO, "[dosbox] base drive %c is not mounted\n", drive); 45 write_out("No basedrive mounted yet!"); 46 return false; 47 } 48 49 if (!ldp || cdp) 50 { 51 if (log_cb) 52 log_cb(RETRO_LOG_INFO, "[dosbox] base drive %c is not compatible\n", drive); 53 return false; 54 } 55 std::string base = ldp->getBasedir(); 56 overlay = new Overlay_Drive(base.c_str(), path, sizes[0], bit8size, sizes[2], sizes[3], mediaid, o_error); 57 58 59 if (overlay) 60 {
…Show last 36 lines
61 if (o_error) 62 { 63 if (o_error == 1) 64 { 65 if (log_cb) 66 log_cb(RETRO_LOG_INFO, "[dosbox] can't mix absolute and relative paths"); 67 } 68 else if (o_error == 2) 69 { 70 if (log_cb) 71 log_cb(RETRO_LOG_INFO, "[dosbox] overlay can't be in the same underlying file system"); 72 } 73 else 74 { 75 if (log_cb) 76 log_cb(RETRO_LOG_INFO, "[dosbox] something went wrong"); 77 } 78 delete overlay; 79 return false; 80 } 81 delete Drives[drive-'A']; 82 Drives[drive-'A'] = 0; 83 } 84 else 85 { 86 if (log_cb) 87 log_cb(RETRO_LOG_INFO, "[dosbox] overlay construction failed"); 88 return false; 89 } 90 Drives[drive - 'A'] = overlay; 91 mem_writeb(Real2Phys(dos.tables.mediaid) + (drive-'A') * 9, overlay->GetMediaByte()); 92 std::string label; 93 label = drive; label += "_OVERLAY"; 94 overlay->dirCache.SetLabel(label.c_str(), false, false); 95 return true; 96}
That said, it would be nice to have functions that wrap mount, imgmount and config commands, it would make it a lot easier for people working in alternate GUIs (excuse me if such helper exist already, I just couldn{t figure it out).
I had to do some wacky stuff to update config varialbes: