From ae597c2e46c3097d5f13631d408c4761022e0f90 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 10 Feb 2025 05:31:29 +0100 Subject: [PATCH] Reverted the dark mode forcing and reveted CD-ROM to old behavior if bus is SCSI, because it turns out the changes are not even needed on SCSI. --- src/qt/qt_winrawinputfilter.cpp | 1 - src/scsi/scsi_cdrom.c | 15 +++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/qt/qt_winrawinputfilter.cpp b/src/qt/qt_winrawinputfilter.cpp index 272b389c5..13e0ec9a7 100644 --- a/src/qt/qt_winrawinputfilter.cpp +++ b/src/qt/qt_winrawinputfilter.cpp @@ -65,7 +65,6 @@ extern void win_keyboard_handle(uint32_t scancode, int up, int e0, int e1); #include "ui_qt_mainwindow.h" bool windows_is_light_theme() { - return 0; // based on https://stackoverflow.com/questions/51334674/how-to-detect-windows-10-light-dark-mode-in-win32-application // The value is expected to be a REG_DWORD, which is a signed 32-bit little-endian diff --git a/src/scsi/scsi_cdrom.c b/src/scsi/scsi_cdrom.c index 07590d5ae..8a39edb39 100644 --- a/src/scsi/scsi_cdrom.c +++ b/src/scsi/scsi_cdrom.c @@ -611,7 +611,9 @@ scsi_cdrom_update_request_length(scsi_cdrom_t *dev, int len, const int block_len break; } } - dev->requested_blocks = 1; + + if (dev->drv->bus_type != CDROM_BUS_SCSI) + dev->requested_blocks = 1; fallthrough; default: @@ -1044,11 +1046,12 @@ scsi_cdrom_read_data(scsi_cdrom_t *dev, const int msf, const int type, const int if (dev->drv->cd_status == CD_STATUS_EMPTY) scsi_cdrom_not_ready(dev); - else { - if (dev->sector_pos > dev->drv->cdrom_capacity) { - scsi_cdrom_lba_out_of_range(dev); - ret = -1; - } else { + else if (dev->sector_pos > dev->drv->cdrom_capacity) { + scsi_cdrom_lba_out_of_range(dev); + ret = -1; + } else { + ret = 1; + for (int i = 0; (i < dev->requested_blocks) && (ret > 0); i++) { ret = cdrom_readsector_raw(dev->drv, dev->buffer + dev->buffer_pos, dev->sector_pos, msf, type, flags, &temp_len, vendor_type);