Эх сурвалжийг харах

Use 2048 as default block size for CD-ROM (#27)

Petteri Aimonen 3 жил өмнө
parent
commit
9b5a4f9de9
1 өөрчлөгдсөн 11 нэмэгдсэн , 2 устгасан
  1. 11 2
      src/AzulSCSI.cpp

+ 11 - 2
src/AzulSCSI.cpp

@@ -169,13 +169,22 @@ bool findHDDImages()
     if(!file.isDir()) {
       file.getName(name, MAX_FILE_PATH+1);
       file.close();
-      if ((tolower(name[0]) == 'h' && tolower(name[1]) == 'd') ||
-          (tolower(name[0]) == 'c' && tolower(name[1]) == 'd')) {
+      bool is_hd = (tolower(name[0]) == 'h' && tolower(name[1]) == 'd');
+      bool is_cd = (tolower(name[0]) == 'c' && tolower(name[1]) == 'd');
+
+      if (is_hd || is_cd)
+      {
         // Defaults for Hard Disks
         int id  = 1; // 0 and 3 are common in Macs for physical HD and CD, so avoid them.
         int lun = 0;
         int blk = 512;
 
+        if (is_cd)
+        {
+          // Use 2048 as the default sector size for CD-ROMs
+          blk = 2048;
+        }
+
         // Positionally read in and coerase the chars to integers.
         // We only require the minimum and read in the next if provided.
         int file_name_length = strlen(name);