CD-ROM: Assorted fixes and correct an incorrectly inverted mode 2 form check.

This commit is contained in:
OBattler
2025-08-27 16:08:55 +02:00
parent b576ad256e
commit e9eb337b4f
2 changed files with 3 additions and 3 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 (!mode2 || (form != 1)) { if (!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

@@ -2240,7 +2240,7 @@ image_load_mds(cd_image_t *img, const char *mdsfile)
image_log(img->log, "Final tracks list:\n"); image_log(img->log, "Final tracks list:\n");
for (int i = 0; i < img->tracks_num; i++) { for (int i = 0; i < img->tracks_num; i++) {
ct = &(img->tracks[i]); ct = &(img->tracks[i]);
for (int j = 0; j < 3; j++) { for (int j = 0; j <= ct->max_index; j++) {
ci = &(ct->idx[j]); ci = &(ct->idx[j]);
image_log(img->log, " [TRACK ] %02X INDEX %02X: [%8s, %016" PRIX64 "]\n", image_log(img->log, " [TRACK ] %02X INDEX %02X: [%8s, %016" PRIX64 "]\n",
ct->point, j, ct->point, j,
@@ -2278,7 +2278,7 @@ image_clear_tracks(cd_image_t *img)
cur = &img->tracks[i]; cur = &img->tracks[i];
if (((cur->point >= 1) && (cur->point <= 99)) || if (((cur->point >= 1) && (cur->point <= 99)) ||
(cur->point == 0xa2)) for (int j = 0; j < 3; j++) { (cur->point == 0xa2)) for (int j = 0; j <= cur->max_index; j++) {
idx = &(cur->idx[j]); idx = &(cur->idx[j]);
/* Make sure we do not attempt to close a NULL file. */ /* Make sure we do not attempt to close a NULL file. */
if ((idx->file != NULL) && (idx->type == INDEX_NORMAL)) { if ((idx->file != NULL) && (idx->type == INDEX_NORMAL)) {