Skip to content

Commit

Permalink
On disk change from INT 13, also clear the cached dir cluster and fat…
Browse files Browse the repository at this point in the history
… sector cache. Bliss by DeathStar not only makes a floppy appear through INT 13h interception, but it also dynamically changes the root directory and FAT table whenever it switches to the next "disk" between demo parts
  • Loading branch information
joncampbell123 committed Jul 9, 2024
1 parent bb79407 commit a258e3b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/dos/drive_fat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3713,6 +3713,11 @@ void fatDrive::checkDiskChange(void) {
firstDataSector = ((Bitu)BPB.v.BPB_RsvdSecCnt + ((Bitu)BPB.v.BPB_NumFATs * (Bitu)BPB.v.BPB_FATSz16) + (Bitu)RootDirSectors) + (Bitu)partSectOff;
firstRootDirSect = (Bitu)BPB.v.BPB_RsvdSecCnt + ((Bitu)BPB.v.BPB_NumFATs * (Bitu)BPB.v.BPB_FATSz16) + (Bitu)partSectOff;

cwdDirCluster = 0;

memset(fatSectBuffer,0,1024);
curFatSect = 0xffffffff;

LOG_MSG("NEW FAT: data=%llu root=%llu rootdirsect=%lu datasect=%lu",
(unsigned long long)firstDataSector,(unsigned long long)firstRootDirSect,
(unsigned long)RootDirSectors,(unsigned long)DataSectors);
Expand Down

0 comments on commit a258e3b

Please sign in to comment.