CD-ROM: Add configuration option to bypass CRC and ECC checks.

This commit is contained in:
OBattler
2025-08-31 21:29:32 +02:00
parent 1b173963fe
commit de64f74c30
3 changed files with 12 additions and 1 deletions

View File

@@ -344,7 +344,7 @@ cdrom_is_sector_good(cdrom_t *dev, const uint8_t *b, const uint8_t mode2, const
{ {
int ret = 1; int ret = 1;
if ((dev->cd_status != CD_STATUS_DVD) && (!mode2 || (form == 1))) { if (!dev->no_check && (dev->cd_status != CD_STATUS_DVD) && (!mode2 || (form == 1))) {
if (mode2 && (form == 1)) { if (mode2 && (form == 1)) {
const uint32_t crc = cdrom_crc32(0xffffffff, &(b[16]), 2056) ^ 0xffffffff; const uint32_t crc = cdrom_crc32(0xffffffff, &(b[16]), 2056) ^ 0xffffffff;

View File

@@ -1463,6 +1463,9 @@ load_floppy_and_cdrom_drives(void)
sprintf(temp, "cdrom_%02i_speed", c + 1); sprintf(temp, "cdrom_%02i_speed", c + 1);
cdrom[c].speed = ini_section_get_int(cat, temp, 8); cdrom[c].speed = ini_section_get_int(cat, temp, 8);
sprintf(temp, "cdrom_%02i_no_check", c + 1);
cdrom[c].no_check = ini_section_get_int(cat, temp, 0);
sprintf(temp, "cdrom_%02i_type", c + 1); sprintf(temp, "cdrom_%02i_type", c + 1);
p = ini_section_get_string(cat, temp, cdrom[c].bus_type == CDROM_BUS_MKE ? "cr563" : "86cd"); p = ini_section_get_string(cat, temp, cdrom[c].bus_type == CDROM_BUS_MKE ? "cr563" : "86cd");
/* TODO: Configuration migration, remove when no longer needed. */ /* TODO: Configuration migration, remove when no longer needed. */
@@ -3405,6 +3408,12 @@ save_floppy_and_cdrom_drives(void)
sprintf(temp, "cdrom_%02i_host_drive", c + 1); sprintf(temp, "cdrom_%02i_host_drive", c + 1);
ini_section_delete_var(cat, temp); ini_section_delete_var(cat, temp);
sprintf(temp, "cdrom_%02i_no_check", c + 1);
if (cdrom[c].no_check)
ini_section_set_int(cat, temp, cdrom[c].no_check);
else
ini_section_delete_var(cat, temp);
sprintf(temp, "cdrom_%02i_speed", c + 1); sprintf(temp, "cdrom_%02i_speed", c + 1);
if ((cdrom[c].bus_type == 0) || (cdrom[c].speed == 8)) if ((cdrom[c].bus_type == 0) || (cdrom[c].speed == 8))
ini_section_delete_var(cat, temp); ini_section_delete_var(cat, temp);

View File

@@ -367,6 +367,8 @@ typedef struct cdrom {
uint8_t host_letter; uint8_t host_letter;
uint8_t mode2; uint8_t mode2;
int no_check;
uint8_t _F_LUT[_LUT_SIZE]; uint8_t _F_LUT[_LUT_SIZE];
uint8_t _B_LUT[_LUT_SIZE]; uint8_t _B_LUT[_LUT_SIZE];