Skip to content

Commit

Permalink
Merge pull request #4922 from maron2000/fix_mscdex
Browse files Browse the repository at this point in the history
Revise CDROM track info logging
  • Loading branch information
joncampbell123 authored Mar 24, 2024
2 parents 395d1c7 + 19cdbd6 commit 47df411
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions src/dos/cdrom_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,20 @@ bool CDROM_Interface_Image::SetDevice(char* path, int forceCD)
uint16_t size = (uint16_t)strlen(buf);
DOS_WriteFile(STDOUT, (uint8_t*)buf, &size);
}
return result;

int datatracks=0, audiotracks=0;
for(const auto& track : tracks) {
if(track.attr == 0x40) {
datatracks++;
}
else if(track.attr == 0) {
audiotracks++;
}
}
LOG_MSG("CDROM: Image loaded No. of data tracks=%d, audio tracks=%d",
datatracks, audiotracks-1
);
return result;
}

bool CDROM_Interface_Image::GetUPC(unsigned char& attr, char* upc)
Expand All @@ -525,14 +538,15 @@ bool CDROM_Interface_Image::GetAudioTracks(int& stTrack, int& end, TMSF& leadOut
end = (int)(tracks.size() - 1);
FRAMES_TO_MSF(tracks[tracks.size() - 1].start + 150, &leadOut.min, &leadOut.sec, &leadOut.fr);

//#ifdef DEBUG
LOG_MSG("CDROM: GetAudioTracks, stTrack=%d, end=%d, leadOut.min=%d, leadOut.sec=%d, leadOut.fr=%d",
stTrack,
end,
#ifdef DEBUG
LOG_MSG("%s CDROM: GetAudioTracks, stTrack=%d, end=%d, leadOut.min=%d, leadOut.sec=%d, leadOut.fr=%d",
get_time(),
stTrack,
end,
leadOut.min,
leadOut.sec,
leadOut.fr);
//#endif
#endif

return true;
}
Expand Down

0 comments on commit 47df411

Please sign in to comment.