Skip to content

Commit

Permalink
Merge pull request #4703 from nanshiki/dpbmediaid
Browse files Browse the repository at this point in the history
Fixed incorrect position for writing Media ID
  • Loading branch information
joncampbell123 authored Dec 24, 2023
2 parents 479eb28 + 773697b commit 6f35373
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/dos/dos_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2357,7 +2357,7 @@ void unmount(int lcv) {
if (cdrom) IDE_CDROM_Detach(lcv);
Drives[lcv]=0;
DOS_EnableDriveMenu('A'+lcv);
mem_writeb(Real2Phys(dos.tables.mediaid)+(unsigned int)'A'+lcv*dos.tables.dpb_size,0);
mem_writeb(Real2Phys(dos.tables.mediaid)+lcv*dos.tables.dpb_size,0);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/dos/dos_programs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ void MountHelper(char drive, const char drive2[DOS_PATHLENGTH], std::string cons
if (!newdrive) E_Exit("DOS:Can't create drive");
Drives[drive-'A']=newdrive;
DOS_EnableDriveMenu(drive);
mem_writeb(Real2Phys(dos.tables.mediaid)+(drive-'A')*2,mediaid);
mem_writeb(Real2Phys(dos.tables.mediaid)+(drive-'A')*dos.tables.dpb_size,mediaid);
if(drive_type=="CDROM")
LOG_MSG("GUI: Drive %c is mounted as CD-ROM",drive);
else
Expand Down Expand Up @@ -488,7 +488,7 @@ void MenuMountDrive(char drive, const char drive2[DOS_PATHLENGTH]) {
if(error && (type==DRIVE_CDROM)) return;
Drives[drive-'A']=newdrive;
DOS_EnableDriveMenu(drive);
mem_writeb(Real2Phys(dos.tables.mediaid)+(drive-'A')*2,mediaid);
mem_writeb(Real2Phys(dos.tables.mediaid)+(drive-'A')*dos.tables.dpb_size,mediaid);
if(type == DRIVE_CDROM) LOG_MSG("GUI: Drive %c is mounted as CD-ROM %c:\\", drive, drive);
else LOG_MSG("GUI: Drive %c is mounted as local directory %c:\\", drive, drive);
if(drive == drive2[0] && strlen(drive2) == 3) {
Expand Down

0 comments on commit 6f35373

Please sign in to comment.