VOGONS


First post, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

I'm working on a project (relevant for games) that sets up Windows 3.11 automatically, and I'm using my own DOSBox build (made with the help of many experts here). Because I want to be able to change and add files to the file system from the host Windows system, and have Windows 3.11 automatically see the changes, I added a line to drive_local.cpp that forces a refresh on every findfirst, like this:

bool localDrive::FindFirst(char * _dir,DOS_DTA & dta,bool fcb_findfirst) {
char tempDir[CROSS_LEN];
strcpy(tempDir,basedir);
strcat(tempDir,_dir);
CROSS_FILENAME(tempDir);

//force empty cache - this line added
EmptyCache(); //rescan floppie-content on each findfirst

for (unsigned int i=0;i<strlen(tempDir);i++) tempDir[i]=toupper(tempDir[i]);
if (allocation.mediaid==0xF0 ) {
EmptyCache(); //rescan floppie-content on each findfirst
}

This method is probably very stupid, but it's the best I could think of. It has the odd side-effect of making drive A: invisible in the Windows 3.11 File Manager. You can run programs from a mounted drive A:, but you can't see the drive or the files in File Manager.

Is there a way to force a rescan of mounted drives on every findfirst, without this weird effect in the Windows 3.11 file manager? I'll be grateful for any advice, and I hope this system will be useful for gamers. It's already in pretty good shape, as described in another tread:

Set up a Win311-DOSBox system in less than one minute

EDIT: I know that I can get DOSBox to rescan on every findfirst by adding "-t floppy" to every mount command, but I'm trying to make this internal, so that a user doesn't need to think about it. Also, that change makes every drive report 1.4MB available, which is too little for installers.

Reply 1 of 1, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

I guess the obvious answer to my question is:

	if ((allocation.mediaid==0xF0 ) || (allocation.mediaid==0xF8)) {	

I'm a little slow to see these things... Anyway, I hope this is right.