Eric Helgeson 6 kuukautta sitten
vanhempi
sitoutus
8006f6824e

+ 2 - 2
boards/rpipico.json

@@ -50,6 +50,6 @@
             "picoprobe"
         ]
     },
-    "url": "http://bluescsi.com",
-    "vendor": "Rabbit Hole Computing LLC"
+    "url": "https://bluescsi.com",
+    "vendor": "BlueSCSI"
 }

+ 2 - 2
boards/rpipico2.json

@@ -52,6 +52,6 @@
             "pico-debug"
         ]
     },
-    "url": "http://bluescsi.com",
-    "vendor": "Rabbit Hole Computing LLC"
+    "url": "https://bluescsi.com",
+    "vendor": "BlueSCSI"
 }

+ 2 - 2
boards/rpipico2w.json

@@ -50,6 +50,6 @@
             "picoprobe"
         ]
     },
-    "url": "http://bluescsi.com",
-    "vendor": "Rabbit Hole Computing LLC"
+    "url": "https://bluescsi.com",
+    "vendor": "BlueSCSI"
 }

+ 2 - 2
boards/rpipicow.json

@@ -50,6 +50,6 @@
             "picoprobe"
         ]
     },
-    "url": "http://bluescsi.com",
-    "vendor": "Rabbit Hole Computing LLC"
+    "url": "https://bluescsi.com",
+    "vendor": "BlueSCSI"
 }

+ 10 - 3
lib/BlueSCSI_platform_RP2MCU/BlueSCSI_platform.cpp

@@ -188,7 +188,7 @@ bool platform_reclock(bluescsi_speed_grade_t speed_grade)
         }
     }
     else
-        logmsg("Speed grade is set to default, reclocking skipped");
+        dbgmsg("Speed grade is set to default, reclocking skipped");
 
     return do_reclock;
 }
@@ -351,7 +351,7 @@ void platform_init()
     }
 #else
     g_log_debug = false;
-    logmsg ("SCSI termination is handled by a hardware jumper");
+    //logmsg ("SCSI termination is handled by a hardware jumper");
 #endif  // HAS_DIP_SWITCHES
 
         logmsg("===========================================================");
@@ -772,7 +772,7 @@ static void usb_input_poll()
     if (platform_msc_lock_get()) return; // Avoid re-entrant USB events
 #endif
 
-    // Caputure reboot key sequence
+    // Capture reboot key sequence
     static bool mass_storage_reboot_keyed = false;
     static bool basic_reboot_keyed = false;
     volatile uint32_t* scratch0 = (uint32_t *)(WATCHDOG_BASE + WATCHDOG_SCRATCH0_OFFSET);
@@ -822,6 +822,7 @@ static void adc_poll()
 {
 #if PLATFORM_VDD_WARNING_LIMIT_mV > 0
     static bool initialized = false;
+    static bool adc_initial_logged = false;
     static int lowest_vdd_seen = PLATFORM_VDD_WARNING_LIMIT_mV;
 
     if (!initialized)
@@ -872,6 +873,12 @@ static void adc_poll()
             lowest_vdd_seen = vdd_mV - 50; // Small hysteresis to avoid excessive warnings
         }
     }
+    else if (!adc_initial_logged && adc_value_max != 0)
+    {
+            adc_initial_logged = true;
+            int vdd_mV = (700 * 4096) / adc_value_max;
+            logmsg("INFO: Pico Voltage: ", (vdd_mV / 1000.0), "V.");
+    }
 #endif // PLATFORM_VDD_WARNING_LIMIT_mV > 0
 }
 

+ 2 - 2
lib/BlueSCSI_platform_RP2MCU/BlueSCSI_platform_config.h

@@ -53,8 +53,8 @@
 # define PLATFORM_MAX_SCSI_SPEED S2S_CFG_SPEED_SYNC_20
 # define PLATFORM_DEFAULT_SCSI_SPEED_SETTING 20
 #elif defined(BLUESCSI_V2)
-# define PLATFORM_NAME "BlueSCSI BS2"
-# define PLATFORM_PID "BS2"
+# define PLATFORM_NAME "BlueSCSI"
+# define PLATFORM_PID "Pico"
 # define PLATFORM_REVISION "1.0"
 # define PLATFORM_MAX_SCSI_SPEED S2S_CFG_SPEED_SYNC_20
 # define PLATFORM_DEFAULT_SCSI_SPEED_SETTING 20

+ 1 - 1
lib/BlueSCSI_platform_RP2MCU/BlueSCSI_platform_msc.cpp

@@ -105,7 +105,7 @@ public:
   ~MSCScopedLock() { platform_msc_lock_set(false); }
 };
 
-/* return true if USB presence detected / eligble to enter CR mode */
+/* return true if USB presence detected / eligible to enter CR mode */
 bool platform_sense_msc() {
 
 #if defined(BLUESCSI_PICO) || defined(BLUESCSI_PICO_2)

+ 1 - 2
lib/BlueSCSI_platform_RP2MCU/scsiPhy.cpp

@@ -104,8 +104,7 @@ extern "C" bool scsiStatusSEL()
         // Releasing happens with bus release.
         g_scsi_ctrl_bsy = 0;
 
-#ifdef BLUESCSI_BS2
-        // From BS2 repository commit 8971584485c42, not sure of purpose.
+#ifdef BLUESCSI_V2
         SCSI_OUT(CD, 0);
         SCSI_OUT(MSG, 0);
         SCSI_ENABLE_CONTROL_OUT();

+ 95 - 24
src/BlueSCSI.cpp

@@ -133,22 +133,39 @@ void init_logfile()
   first_open_after_boot = false;
 }
 
+static const char * fatTypeToChar(int fatType)
+{
+  switch (fatType)
+  {
+    case FAT_TYPE_EXFAT:
+      return "exFAT";
+    case FAT_TYPE_FAT32:
+      return "FAT32";
+    case FAT_TYPE_FAT16:
+      return "FAT16";
+    case FAT_TYPE_FAT12:
+      return "FAT12";
+    default:
+      return "Unknown";
+  }
+}
+
 void print_sd_info()
 {
+  logmsg(" ");
+  logmsg("=== SD Card Info ===");
   uint64_t size = (uint64_t)SD.vol()->clusterCount() * SD.vol()->bytesPerCluster();
-  logmsg("SD card detected, FAT", (int)SD.vol()->fatType(),
+  logmsg("SD card detected, ", fatTypeToChar((int)SD.vol()->fatType()),
           " volume size: ", (int)(size / 1024 / 1024), " MB");
 
   cid_t sd_cid;
 
   if(SD.card()->readCID(&sd_cid))
   {
-    logmsg("SD MID: ", (uint8_t)sd_cid.mid, ", OID: ", (uint8_t)sd_cid.oid[0], " ", (uint8_t)sd_cid.oid[1]);
-
     char sdname[6] = {sd_cid.pnm[0], sd_cid.pnm[1], sd_cid.pnm[2], sd_cid.pnm[3], sd_cid.pnm[4], 0};
-    logmsg("SD Name: ", sdname);
-    logmsg("SD Date: ", (int)sd_cid.mdtMonth(), "/", sd_cid.mdtYear());
-    logmsg("SD Serial: ", sd_cid.psn());
+    logmsg("SD Name: ", sdname, ", MID: ", (uint8_t)sd_cid.mid, ", OID: ", (uint8_t)sd_cid.oid[0], " ", (uint8_t)sd_cid.oid[1]);
+    dbgmsg("SD Date: ", (int)sd_cid.mdtMonth(), "/", sd_cid.mdtYear());
+    dbgmsg("SD Serial: ", sd_cid.psn());
   }
 
   sds_t sds = {0};
@@ -156,7 +173,52 @@ void print_sd_info()
   {
     logmsg("-- WARNING: Your SD Card Speed Class is ", (int)sds.speedClass(), ". Class ", (int) SD_SPEED_CLASS_WARN_BELOW," or better is recommended for best performance.");
   }
+}
 
+static const char * typeToChar(int deviceType)
+{
+  switch (deviceType)
+  {
+    case S2S_CFG_OPTICAL:
+      return "Optical";
+    case S2S_CFG_FIXED:
+      return "Fixed";
+    case S2S_CFG_FLOPPY_14MB:
+      return "Floppy1.4MB";
+    case S2S_CFG_MO:
+      return "MO";
+    case S2S_CFG_NETWORK:
+      return "Network";
+    case S2S_CFG_SEQUENTIAL:
+      return "Tape";
+    case S2S_CFG_REMOVABLE:
+      return "Removable";
+    case S2S_CFG_ZIP100:
+      return "ZIP100";
+    default:
+      return "Unknown";
+  }
+}
+
+static const char * quirksToChar(int quirks)
+{
+  switch (quirks)
+  {
+    case S2S_CFG_QUIRKS_APPLE:
+      return "Apple";
+    case S2S_CFG_QUIRKS_OMTI:
+      return "OMTI";
+    case S2S_CFG_QUIRKS_VMS:
+      return "VMS";
+    case S2S_CFG_QUIRKS_XEBEC:
+      return "XEBEC";
+    case S2S_CFG_QUIRKS_X68000:
+      return "X68000";
+    case S2S_CFG_QUIRKS_NONE:
+      return "None";
+    default:
+      return "Unknown";
+  }
 }
 
 /*********************************/
@@ -326,8 +388,7 @@ bool findHDDImages()
   ini_gets("SCSI", "Dir", "/", imgdir, sizeof(imgdir), CONFIGFILE);
   int dirindex = 0;
 
-  logmsg("Finding images in directory ", imgdir, ":");
-
+  logmsg("=== Finding images in ", imgdir, " ===");
   FsFile root;
   root.open(imgdir);
   if (!root.isOpen())
@@ -341,7 +402,9 @@ bool findHDDImages()
   int usedDefaultId = 0;
   uint8_t removable_count = 0;
   uint8_t eject_btn_set = 0;
+#ifdef BLUESCSI_BUTTONS
   uint8_t last_removable_device = 255;
+#endif // BLUESCSI_BUTTONS
   while (1)
   {
     if (!file.openNext(&root, O_READ))
@@ -509,7 +572,7 @@ bool findHDDImages()
           }
         }
         else if(id < NUM_SCSIID && lun < NUM_SCSILUN) {
-          logmsg("-- Opening ", fullname, " for id:", id, " lun:", lun);
+          logmsg("== Opening ", fullname, " for ID:", id, " LUN:", lun);
 
           if (g_scsi_settings.getDevicePreset(id) != DEV_PRESET_NONE)
           {
@@ -540,6 +603,8 @@ bool findHDDImages()
   g_romdrive_active = scsiDiskActivateRomDrive();
 
   // Print SCSI drive map
+  logmsg(" ");
+  logmsg("=== Configured SCSI Devices ===");
   for (int i = 0; i < NUM_SCSIID; i++)
   {
     const S2S_TargetCfg* cfg = s2s_getConfigByIndex(i);
@@ -550,16 +615,15 @@ bool findHDDImages()
 
       if (cfg->deviceType == S2S_CFG_NETWORK)
       {
-        logmsg("SCSI ID: ", (int)(cfg->scsiId & 7),
-              ", Type: ", (int)cfg->deviceType,
-              ", Quirks: ", (int)cfg->quirks);
+        logmsg("ID: ", (int)(cfg->scsiId & S2S_CFG_TARGET_ID_BITS),
+              ", Type: ", typeToChar((int)cfg->deviceType));
       }
       else
       {
-        logmsg("SCSI ID: ", (int)(cfg->scsiId & S2S_CFG_TARGET_ID_BITS),
+        logmsg("ID: ", (int)(cfg->scsiId & S2S_CFG_TARGET_ID_BITS),
               ", BlockSize: ", (int)cfg->bytesPerSector,
-              ", Type: ", (int)cfg->deviceType,
-              ", Quirks: ", (int)cfg->quirks,
+              ", Type: ", typeToChar((int)cfg->deviceType),
+              ", Quirks: ", quirksToChar((int)cfg->quirks),
               ", Size: ", capacity_kB, "kB",
               typeIsRemovable((S2S_CFG_TYPE)cfg->deviceType) ? ", Removable" : ""
               );
@@ -575,15 +639,17 @@ bool findHDDImages()
        if (typeIsRemovable((S2S_CFG_TYPE)cfg->deviceType))
         {
           removable_count++;
+#ifdef BLUESCSI_BUTTONS
           last_removable_device = id;
           if ( getEjectButton(id) !=0 )
           {
             eject_btn_set++;
           }
+#endif // BLUESCSI_BUTTONS
         }
     }
   }
-
+#ifdef BLUESCSI_BUTTONS
   if (removable_count == 1)
   {
     // If there is a removable device
@@ -591,7 +657,7 @@ bool findHDDImages()
       logmsg("Eject set to device with ID: ", last_removable_device);
     else if (eject_btn_set == 0 && !platform_has_phy_eject_button())
     {
-      logmsg("Found 1 removable device, to set an eject button see EjectButton in the '", CONFIGFILE,"', or the http://bluescsi.com/manual");
+      logmsg("Found 1 removable device, to set an eject button see EjectButton in the '", CONFIGFILE,"', or the https://github.com/BlueSCSI/BlueSCSI-v2/wiki/Buttons");
     }
   }
   else if (removable_count > 1)
@@ -608,15 +674,16 @@ bool findHDDImages()
       {
         if( getEjectButton(id) != 0)
         {
-          logmsg("-- SCSI ID: ", (int)id, " type: ", (int) s2s_getConfigById(id)->deviceType, " button mask: ", getEjectButton(id));
+          logmsg("-- ID: ", (int)id, " type: ", (int) s2s_getConfigById(id)->deviceType, " button mask: ", getEjectButton(id));
         }
       }
     }
     else
     {
-      logmsg("Multiple removable devices, to set an eject button see EjectButton in the '", CONFIGFILE,"', or the http://bluescsi.com/manual");
+      logmsg("Multiple removable devices, to set an eject button see EjectButton in the '", CONFIGFILE,"', or the https://github.com/BlueSCSI/BlueSCSI-v2/wiki/Buttons");
     }
   }
+#endif // BLUESCSI_BUTTONS
   return foundImage;
 }
 
@@ -628,6 +695,8 @@ void readSCSIDeviceConfig()
 {
   s2s_configInit(&scsiDev.boardCfg);
 
+  logmsg("");
+  logmsg("=== Finding images ===");
   for (int i = 0; i < NUM_SCSIID; i++)
   {
     scsiDiskLoadConfig(i);
@@ -787,13 +856,15 @@ static void reinitSCSI()
     platform_network_init(scsiDev.boardCfg.wifiMACAddress);
     if (scsiDev.boardCfg.wifiSSID[0] != '\0')
       platform_network_wifi_join(scsiDev.boardCfg.wifiSSID, scsiDev.boardCfg.wifiPassword);
+    else
+      logmsg("No Wi-Fi SSID or Password found. Use the BlueSCSI Wi-Fi DA to configure the network.");
   }
   else
   {
     platform_network_deinit();
   }
 #endif // BLUESCSI_NETWORK
-
+  logmsg("");
 }
 
 // Alert user that update bin file not used
@@ -819,7 +890,7 @@ static void check_for_unused_update_files()
   if (bin_files_found)
   {
     logmsg("Please use the ", FIRMWARE_PREFIX ,"*.zip firmware bundle, or the proper .bin or .uf2 file to update the firmware.");
-    logmsg("See http://bluescsi.com/manual for more information");
+    logmsg("See https://github.com/blueSCSI/BlueSCSI-v2/wiki/Updating-Firmware for more information");
   }
 }
 
@@ -1051,7 +1122,7 @@ static void bluescsi_setup_sd_card(bool wait_for_card = true)
     else
     {
 #ifndef ENABLE_AUDIO_OUTPUT // if audio is enabled, skip message because reclocking ocurred earlier
-      logmsg("Speed grade set to Default, skipping reclocking");
+      dbgmsg("Speed grade set to Default, skipping reclocking");
 #endif
     }
 #endif
@@ -1113,12 +1184,12 @@ extern "C" void bluescsi_setup(void)
     )
     {
       bluescsi_msc_loop();
-      logmsg("Re-processing filenames and bluescsi.ini config parameters");
+      logmsg("Re-processing filenames and " CONFIGFILE " config parameters");
       bluescsi_setup_sd_card();
     }
   }
 #endif
-  logmsg("Clock set to: ", (int) platform_sys_clock_in_hz(), "Hz");
+  logmsg("Clock set to: ", static_cast<int>(platform_sys_clock_in_hz() / 1000000), "MHz");
   logmsg("Initialization complete!");
 }
 

+ 2 - 2
src/BlueSCSI_Toolbox.cpp

@@ -38,8 +38,8 @@ extern "C" int8_t scsiToolboxEnabled()
     static int8_t enabled = -1;
     if (enabled == -1)
     {
-        enabled = ini_getbool("SCSI", "EnableToolbox", 0, CONFIGFILE);
-        logmsg("Toolbox enabled = ", enabled);
+        enabled = ini_getbool("SCSI", "EnableToolbox", 1, CONFIGFILE);
+        dbgmsg("BlueSCSI Toolbox enabled = ", enabled);
     }
     return enabled == 1;
 }

+ 8 - 7
src/BlueSCSI_config.h

@@ -30,7 +30,8 @@
 
 // Use variables for version number
 #define FW_VER_NUM      "25.06.17"
-#define FW_VER_SUFFIX   "release"
+// rel or dev only.
+#define FW_VER_SUFFIX   "dev"
 
 #define DEF_STRINGFY(DEF) STRINGFY(DEF)
 #define STRINGFY(STR) #STR
@@ -41,8 +42,8 @@
 
 // Configuration and log file paths
 #define CONFIGFILE  "bluescsi.ini"
-#define LOGFILE     "bluelog.txt"
-#define CRASHFILE   "blueerr.txt"
+#define LOGFILE     "log.txt"
+#define CRASHFILE   "err.txt"
 #define FIRMWARE_PREFIX "BlueSCSI-FW"
 
 // Prefix for command file to create new image (case-insensitive)
@@ -101,13 +102,13 @@
 #define DEFAULT_BLOCKSIZE_OPTICAL 2048
 
 // Default SCSI drive information when Apple quirks are enabled
-#define APPLE_DRIVEINFO_FIXED     {"DEC",      "BlueSCSI HDD",      PLATFORM_REVISION, "1.0"}
+#define APPLE_DRIVEINFO_FIXED     {"QUANTUM",  "BlueSCSI Pico",      PLATFORM_REVISION, "1.0"}
 #define APPLE_DRIVEINFO_REMOVABLE {"IOMEGA",   "BETA230",           PLATFORM_REVISION, "2.02"}
 #define APPLE_DRIVEINFO_OPTICAL   {"MATSHITA", "CD-ROM CR-8004",    PLATFORM_REVISION, "1.1f"}
-#define APPLE_DRIVEINFO_FLOPPY    {"IOMEGA",   "Io20S         *F",  "PP33",            ""}
+#define APPLE_DRIVEINFO_FLOPPY    {"IOMEGA",   "Io20S         *F", "PP33", ""}
 #define APPLE_DRIVEINFO_MAGOPT    {"MOST",     "RMD-5200",          PLATFORM_REVISION, "1.0"}
-#define APPLE_DRIVEINFO_NETWORK   {"Dayna",    "SCSI/Link",         "2.0f",            ""}
-#define APPLE_DRIVEINFO_TAPE      {"BLUESCSI", "APPLE_TAPE",        PLATFORM_REVISION, ""}
+#define APPLE_DRIVEINFO_NETWORK   {"Dayna",    "SCSI/Link",       "2.0f", ""}
+#define APPLE_DRIVEINFO_TAPE      {"BlueSCSI", "APPLE_TAPE",        PLATFORM_REVISION, ""}
 
 // Default Iomega ZIP drive information
 #define IOMEGA_DRIVEINFO_ZIP100     {"IOMEGA", "ZIP 100", "D.13", ""}

+ 38 - 27
src/BlueSCSI_disk.cpp

@@ -113,12 +113,13 @@ bool scsiDiskActivateRomDrive()
 #else
 
     uint32_t maxsize = platform_get_romdrive_maxsize() - PLATFORM_ROMDRIVE_PAGE_SIZE;
-    logmsg("-- Platform supports ROM drive up to ", (int)(maxsize / 1024), " kB");
+    logmsg("");
+    logmsg("== Platform supports ROM drive up to ", (int)(maxsize / 1024), " kB");
 
     romdrive_hdr_t hdr = {};
     if (!romDriveCheckPresent(&hdr))
     {
-        logmsg("---- ROM drive image not detected");
+        dbgmsg("---- ROM drive image not detected");
         return false;
     }
 
@@ -132,7 +133,7 @@ bool scsiDiskActivateRomDrive()
     if (rom_scsi_id >= 0 && rom_scsi_id <= 7)
     {
         hdr.scsi_id = rom_scsi_id;
-        logmsg("---- ROM drive SCSI id overriden in ini file, changed to ", (int)hdr.scsi_id);
+        logmsg("---- ROM drive SCSI id overridden in ini file, changed to ", (int)hdr.scsi_id);
     }
 
     if (s2s_getConfigById(hdr.scsi_id))
@@ -357,6 +358,7 @@ static void autoConfigGeometry(image_config_t &img)
             method = "device type floppy";
             sect = 18;
             head = 80;
+            found_chs = true;
         }
         else if (img.scsiSectors <= 1032192)
         {
@@ -385,11 +387,19 @@ static void autoConfigGeometry(image_config_t &img)
     }
 
     bool divisible = (img.scsiSectors % ((uint32_t)img.sectorsPerTrack * img.headsPerCylinder)) == 0;
-    logmsg("---- Drive geometry from ", method,
-        ": SectorsPerTrack=", (int)img.sectorsPerTrack,
-        " HeadsPerCylinder=", (int)img.headsPerCylinder,
-        " total sectors ", (int)img.scsiSectors,
-        divisible ? " (divisible)" : " (not divisible)"
+    if (!divisible)
+        logmsg("---- Geometry set from ", method,
+               ": SectorsPerTrack=", (int) img.sectorsPerTrack,
+               " HeadsPerCylinder=", (int) img.headsPerCylinder,
+               " total sectors ", (int) img.scsiSectors,
+               " (not divisible)"
+        );
+    else
+        dbgmsg("---- Geometry set from ", method,
+               ": SectorsPerTrack=", (int) img.sectorsPerTrack,
+               " HeadsPerCylinder=", (int) img.headsPerCylinder,
+               " total sectors ", (int) img.scsiSectors,
+               " (divisible)"
         );
 }
 
@@ -435,7 +445,7 @@ bool scsiDiskOpenHDDImage(int target_idx, const char *filename, int scsi_lun, in
         }
         else
         {
-            logmsg("---- WARNING: file ", filename, " is not contiguous. This will increase read latency.");
+            logmsg("---- WARNING: ", filename, " is fragmented, see https://github.com/BlueSCSI/BlueSCSI-v2/wiki/Image-File-Fragmentation");
         }
 
         S2S_CFG_TYPE setting_type = (S2S_CFG_TYPE) g_scsi_settings.getDevice(target_idx)->deviceType;
@@ -446,7 +456,7 @@ bool scsiDiskOpenHDDImage(int target_idx, const char *filename, int scsi_lun, in
 
         if (type == S2S_CFG_FIXED)
         {
-            logmsg("---- Configuring as disk drive drive");
+            logmsg("---- Configuring as disk drive");
             img.deviceType = S2S_CFG_FIXED;
         }
         else if (type == S2S_CFG_OPTICAL)
@@ -517,7 +527,7 @@ bool scsiDiskOpenHDDImage(int target_idx, const char *filename, int scsi_lun, in
         }
         else if (img.prefetchbytes > 0)
         {
-            logmsg("---- Read prefetch enabled: ", (int)img.prefetchbytes, " bytes");
+            dbgmsg("---- Read prefetch enabled: ", (int)img.prefetchbytes, " bytes");
         }
         else
         {
@@ -726,7 +736,7 @@ static void scsiDiskCheckDir(char * dir_name, int target_idx, image_config_t* im
         {
             img->deviceType = type;
             img->image_directory = true;
-            logmsg("SCSI", target_idx, " searching default ", type_name, " image directory '", dir_name, "'");
+            dbgmsg("== ID ", target_idx, " ", type_name, " image directory '", dir_name, "' ==");
         }
     }
 }
@@ -1075,8 +1085,8 @@ void scsiDiskLoadConfig(int target_idx)
         {
           g_scsi_settings.getDevice(target_idx)->blockSize = img.deviceType == S2S_CFG_OPTICAL ?  DEFAULT_BLOCKSIZE_OPTICAL : DEFAULT_BLOCKSIZE;
         }
+        logmsg("== Opening '", filename, "' for ID ", target_idx);
         int blocksize = getBlockSize(filename, target_idx);
-        logmsg("-- Opening '", filename, "' for id: ", target_idx);
         scsiDiskOpenHDDImage(target_idx, filename, 0, blocksize, (S2S_CFG_TYPE) img.deviceType, img.use_prefix);
     }
 }
@@ -1092,7 +1102,7 @@ uint32_t getBlockSize(char *filename, uint8_t scsi_id)
         if (8 <= blktmp && blktmp <= 64 * 1024)
         {
             block_size = blktmp;
-            logmsg("-- Using custom block size, ",(int) block_size," from filename: ", filename);
+            dbgmsg("-- Using block size, ",(int) block_size," from filename: ", filename);
         }
     }
     return block_size;
@@ -1269,14 +1279,19 @@ extern "C"
 void s2s_configInit(S2S_BoardCfg* config)
 {
     char tmp[64];
-
+    logmsg("");
+    logmsg("=== Global Config ===");
     if (SD.exists(CONFIGFILE))
     {
         logmsg("Reading configuration from " CONFIGFILE);
     }
+    else if (SD.exists(CONFIGFILE ".txt") || SD.exists(CONFIGFILE ".rtf"))
+    {
+        logmsg("WARNING: Config file with incorrect file extension found: " CONFIGFILE ".txt/rtf");
+    }
     else
     {
-        logmsg("Config file " CONFIGFILE " not found, using defaults");
+        logmsg("" CONFIGFILE " not found, using defaults");
     }
 
     // Get default values from system preset, if any
@@ -1285,11 +1300,7 @@ void s2s_configInit(S2S_BoardCfg* config)
 
     if (g_scsi_settings.getSystemPreset() != SYS_PRESET_NONE)
     {
-        logmsg("Active configuration (using system preset \"", g_scsi_settings.getSystemPresetName(), "\"):");
-    }
-    else
-    {
-        logmsg("Active configuration:");
+        logmsg("Using system preset \"", g_scsi_settings.getSystemPresetName(), "\")");
     }
 
     memset(config, 0, sizeof(S2S_BoardCfg));
@@ -1307,7 +1318,7 @@ void s2s_configInit(S2S_BoardCfg* config)
     else if (maxSyncSpeed < 20 && config->scsiSpeed > S2S_CFG_SPEED_SYNC_10)
         config->scsiSpeed = S2S_CFG_SPEED_SYNC_10;
 
-    logmsg("-- SelectionDelay = ", (int)config->selectionDelay);
+    dbgmsg("-- SelectionDelay = ", (int)config->selectionDelay);
 
     if (sysCfg->enableUnitAttention)
     {
@@ -1316,12 +1327,12 @@ void s2s_configInit(S2S_BoardCfg* config)
     }
     else
     {
-        logmsg("-- EnableUnitAttention = No");
+        dbgmsg("-- EnableUnitAttention = No");
     }
 
     if (sysCfg->enableSCSI2)
     {
-        logmsg("-- EnableSCSI2 = Yes");
+        dbgmsg("-- EnableSCSI2 = Yes");
         config->flags |= S2S_CFG_ENABLE_SCSI2;
     }
     else
@@ -1336,7 +1347,7 @@ void s2s_configInit(S2S_BoardCfg* config)
     }
     else
     {
-        logmsg("-- EnableSelLatch = No");
+        dbgmsg("-- EnableSelLatch = No");
     }
 
     if (sysCfg->mapLunsToIDs)
@@ -1346,13 +1357,13 @@ void s2s_configInit(S2S_BoardCfg* config)
     }
     else
     {
-        logmsg("-- MapLunsToIDs = No");
+        dbgmsg("-- MapLunsToIDs = No");
     }
 
 #ifdef PLATFORM_HAS_PARITY_CHECK
     if (sysCfg->enableParity)
     {
-        logmsg("-- EnableParity = Yes");
+        dbgmsg("-- EnableParity = Yes");
         config->flags |= S2S_CFG_ENABLE_PARITY;
     }
     else

+ 2 - 2
src/BlueSCSI_initiator.cpp

@@ -123,7 +123,7 @@ void scsiInitiatorInit()
     }
     else
     {
-        logmsg("InitiatorID set to ID ", g_initiator_state.initiator_id);
+        logmsg("InitiatorID set to ID ", static_cast<int>(g_initiator_state.initiator_id));
     }
     g_initiator_state.max_retry_count = ini_getl("SCSI", "InitiatorMaxRetry", 5, CONFIGFILE);
     g_initiator_state.use_read10 = ini_getbool("SCSI", "InitiatorUseRead10", false, CONFIGFILE);
@@ -771,7 +771,7 @@ bool scsiRequestSense(int target_id, uint8_t *sense_key, uint8_t *sense_asc, uin
                                          response, sizeof(response),
                                          NULL, 0);
 
-    dbgmsg("RequestSense response: ", bytearray(response, 18),
+    logmsg("RequestSense response: ", bytearray(response, 18),
         " sense_key ", (int)(response[2] & 0xF),
         " asc ", response[12], " ascq ", response[13]);
 

+ 14 - 1
src/BlueSCSI_log.cpp

@@ -34,7 +34,7 @@ bool g_log_debug = false;
 bool g_log_ignore_busy_free = false;
 uint8_t g_scsi_log_mask = 0xFF;
 
-// This memory buffer can be read by debugger and is also saved to bluelog.txt
+// This memory buffer can be read by debugger and is also saved to log.txt
 #define LOGBUFMASK (LOGBUFSIZE - 1)
 
 // The log buffer is in special uninitialized RAM section so that it is not reset
@@ -131,6 +131,19 @@ void log_raw(int value)
     log_raw(p);
 }
 
+void log_raw(double value)
+{
+    char buffer[6];
+    snprintf(buffer, sizeof buffer, "%0.3f", value);
+    log_raw(buffer);
+}
+
+void log_raw(bool value)
+{
+    if(value) log_raw("true");
+    else log_raw("false");
+}
+
 void log_raw(bytearray array)
 {
     for (size_t i = 0; i < array.len; i++)

+ 8 - 1
src/BlueSCSI_log.h

@@ -60,6 +60,12 @@ void log_raw(uint64_t value);
 // Log integer as decimal
 void log_raw(int value);
 
+// Log integer as decimal
+void log_raw(double value);
+
+// Log boolean
+void log_raw(bool value);
+
 // Log array of bytes
 struct bytearray {
     bytearray(const uint8_t *data, size_t len): data(data), len(len) {}
@@ -97,7 +103,8 @@ inline void log_raw(T first, T2 second, Rest... rest)
 template<typename... Params>
 inline void logmsg(Params... params)
 {
-    logmsg_start();
+    if (g_log_debug)
+        log_raw("[", (int)millis(), "ms] ");
     log_raw(params...);
     logmsg_end();
 }

+ 1 - 1
src/BlueSCSI_settings.cpp

@@ -295,7 +295,7 @@ scsi_system_settings_t *BlueSCSISettings::initSystem(const char *presetName)
     // This is a hack to figure out if apple quirks is on via a dip switch
     S2S_TargetCfg img;
 
-    img.quirks = S2S_CFG_QUIRKS_NONE;
+    img.quirks = S2S_CFG_QUIRKS_APPLE;
     #ifdef PLATFORM_CONFIG_HOOK
             PLATFORM_CONFIG_HOOK(&img);
     #endif

+ 1 - 1
src/ROMDrive.cpp

@@ -113,7 +113,7 @@ bool scsiDiskProgramRomDrive(const char *filename, int scsi_id, int blocksize, S
     uint64_t filesize = file.size();
     uint32_t maxsize = platform_get_romdrive_maxsize() - PLATFORM_ROMDRIVE_PAGE_SIZE;
 
-    logmsg("---- SCSI ID: ", scsi_id, " blocksize ", blocksize, " type ", (int)type);
+    logmsg("---- ID: ", scsi_id, " blocksize ", blocksize, " type ", (int)type);
     logmsg("---- ROM drive maximum size is ", (int)maxsize,
           " bytes, image file is ", (int)filesize, " bytes");
 

+ 2 - 2
utils/analyze_crashlog.sh

@@ -6,8 +6,8 @@
 #
 # Usage:
 #    utils/analyze_crashlog.sh                    # paste log to console, press ctrl-D to end
-#    utils/analyze_crashlog.sh bluelog.txt        # read log from file
-#    utils/analyze_crashlog.sh bluelog.txt path   # read log from file and find firmware at path
+#    utils/analyze_crashlog.sh log.txt            # read log from file
+#    utils/analyze_crashlog.sh log.txt path       # read log from file and find firmware at path
 
 if [ "x$1" = "x" ]; then
     logfile=$(mktemp /tmp/crashlog-XXXXXXX)