VOGONS


Problem in drive_fat.cpp

Topic actions

First post, by NewRisingSun

User metadata
Rank Oldbie
Rank
Oldbie

In dos/drive_fat.cpp, there are several instances of or similar to

	if (!loadedSector) {
currentSector = myDrive->getAbsoluteSectFromBytePos(firstCluster, seekpos);
if(currentSector == 0) {
/* EOC reached before EOF */
*size = 0;
loadedSector = false;
return true;
}
curSectOff = 0;
myDrive->loadedDisk->Read_AbsoluteSector(currentSector, sectorBuffer);
loadedSector = true;
}

Why is curSectOff set to zero instead of "seekpos % myDrive->getSectorSize();"? Setting it to zero breaks at least two games: installing Prince of Persia 2 from floppy disk images and "Icon: Quest for the Ring" (which uses FCBs). Changing curSectOffs to the modulus of seekpos fixes both games while to my knowledge not breaking anything else. loadedSector can be false because fatFile::Seek reads a sector into sectorBuffer without setting loadedSector to true (which is also strange, but there may be a reason for it).

Reply 2 of 3, by NewRisingSun

User metadata
Rank Oldbie
Rank
Oldbie

Oh. Well, maybe it will get incorporated into SVN this time, since in the case of Icon it can also affect single-disk games. 😢

Reply 3 of 3, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Right. Let me try and find those images.

Water flows down the stream
How to ask questions the smart way!