Skip to content

Commit

Permalink
xdvd: Force small XISOs to report as DVD roms
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryzee119 committed Jun 10, 2024
1 parent 906a7f5 commit 490d12e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions hw/ide/atapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,27 @@ static inline int media_present(IDEState *s)
/* XXX: DVDs that could fit on a CD will be reported as a CD */
static inline int media_is_dvd(IDEState *s)
{
#ifdef XBOX
// We need to prevent small XISOs from being reported as CD-ROMs
// If the DVD security path is set, we can assume it is an XISO.
const char *dvd_security_path = g_config.sys.files.dvd_security_path;
if (strlen(dvd_security_path) > 0) {
return 1;
}
#endif
return (media_present(s) && s->nb_sectors > CD_MAX_SECTORS);
}

static inline int media_is_cd(IDEState *s)
{
#ifdef XBOX
// We need to prevent small XISOs from being reported as CD-ROMs
// If the DVD security path is set, we can assume it is an XISO.
const char *dvd_security_path = g_config.sys.files.dvd_security_path;
if (strlen(dvd_security_path) > 0) {
return 0;
}
#endif
return (media_present(s) && s->nb_sectors <= CD_MAX_SECTORS);
}

Expand Down

0 comments on commit 490d12e

Please sign in to comment.