Skip to content

Commit

Permalink
Revise CD-ROM empty drive emulation
Browse files Browse the repository at this point in the history
  • Loading branch information
joncampbell123 committed Feb 29, 2024
1 parent 8049aeb commit 780da7c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Next:
- Add "empty drive" CD-RIM image type "IMGMOUNT e: -t iso -empty" as a way
- Add "empty drive" CD-RIM image type "IMGMOUNT e: empty -t iso" as a way
to emulate an empty CD-ROM drive with no disc in the drive. (joncampbell123).
- Add "empty drive" floppy image type "IMGMOUNT 0 empty -t floppy -fs none"
as a way to emulate a floppy drive with no disk in the drive. (joncampbell123).
Expand Down
16 changes: 8 additions & 8 deletions src/dos/drive_iso.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -999,12 +999,11 @@ isoDrive::isoDrive(char driveLetter, const char* fileName, uint8_t mediaid, int&
if (value == "1" || value == "") enable_udf = true; // "-o udf" or "-o udf=1"
else if (value == "0") enable_udf = false;
}
else if (name == "empty") {
empty_drive = true;
fileName = "empty";
}
}

if (!strcmp(fileName,"empty"))
empty_drive = true;

if (!CDROM_Interface_Image::images_init) {
CDROM_Interface_Image::images_init = true;
for (size_t i=0;i < 26;i++)
Expand Down Expand Up @@ -2358,17 +2357,18 @@ void isoDrive :: EmptyCache(void) {
return;
}
}
if (dos_kernel_disabled) return;
enable_udf = (dos.version.major > 7 || (dos.version.major == 7 && dos.version.minor >= 10));//default
enable_rock_ridge = dos.version.major >= 7 || uselfn;
enable_joliet = dos.version.major >= 7 || uselfn;
is_joliet = false;
//this->fileName[0] = '\0'; /* deleted to fix issue #3848. Revert this if there are any flaws */
//this->discLabel[0] = '\0'; /* deleted to fix issue #3848. Revert this if there are any flaws */
nextFreeDirIterator = 0;
size_t numberOfDirIterators = sizeof(dirIterators) / sizeof(dirIterators[0]);
for(std::size_t i = 0; i < numberOfDirIterators; ++i) {
dirIterators[i] = isoDrive::DirIterator{};
}
size_t numberOfDirIterators = sizeof(dirIterators) / sizeof(dirIterators[0]);
for(std::size_t i = 0; i < numberOfDirIterators; ++i) {
dirIterators[i] = isoDrive::DirIterator{};
}
memset(sectorHashEntries, 0, sizeof(sectorHashEntries));
memset(&rootEntry, 0, sizeof(isoDirEntry));
//safe_strncpy(this->fileName, fileName, CROSS_LEN); /* deleted to fix issue #3848. Revert this if there are any flaws */
Expand Down

0 comments on commit 780da7c

Please sign in to comment.