diff --git a/marshw.c b/marshw.c index e6f0f957d..689d31b26 100644 --- a/marshw.c +++ b/marshw.c @@ -251,10 +251,9 @@ void Mars_Init(void) Mars_UpdateCD(); - if (mars_cd_ok && !(mars_cd_ok & 0x2)) + if (mars_cd_ok & 0x1) { - /* if the CD is present and it's */ - /* not an MD+, give it seconds to init */ + /* if the CD is present, give it seconds to init */ Mars_WaitTicks(180); } } diff --git a/marssound.c b/marssound.c index dd1726c8b..75a1f6a4c 100644 --- a/marssound.c +++ b/marssound.c @@ -116,7 +116,7 @@ void S_Init(void) sfxchannels[i].data = NULL; // check if CD is available, reset the driver option if not - mcd_avail = S_CDAvailable(); + mcd_avail = S_CDAvailable() & 0x1; if (!mcd_avail && sfxdriver > 1) sfxdriver = 0; diff --git a/o_main.c b/o_main.c index 56b1f8799..ba9b02137 100644 --- a/o_main.c +++ b/o_main.c @@ -140,6 +140,8 @@ void O_DrawControl(void) void O_Init (void) { + int cd_avail; + /* cache all needed graphics */ o_cursor1 = W_CheckNumForName("M_SKULL1"); o_cursor2 = W_CheckNumForName("M_SKULL2"); @@ -254,10 +256,13 @@ void O_Init (void) D_memcpy(menuscreen[ms_audio].name, "Audio", 7); menuscreen[ms_audio].firstitem = mi_soundvol; menuscreen[ms_audio].numitems = mi_music - mi_soundvol + 1; - if (S_CDAvailable()) /* MD+ */ + + cd_avail = S_CDAvailable(); + if (cd_avail) /* CDA or MD+ */ { menuscreen[ms_audio].numitems++; - menuscreen[ms_audio].numitems++; + if (cd_avail & 0x1) /* CD, not MD+ */ + menuscreen[ms_audio].numitems++; } D_memcpy(menuscreen[ms_video].name, "Video", 7); @@ -572,7 +577,7 @@ void O_Control (player_t *player) case mi_music: if (++o_musictype > mustype_cd) o_musictype = mustype_cd; - if (o_musictype == mustype_cd && !S_CDAvailable()) + if (o_musictype == mustype_cd) o_musictype = mustype_fm; break; case mi_sfxdriver: diff --git a/src-md/crt0.s b/src-md/crt0.s index 6be78368f..c91ec09ad 100644 --- a/src-md/crt0.s +++ b/src-md/crt0.s @@ -913,6 +913,7 @@ read_cdstate: move.w megasd_num_cdtracks,d0 lsl.l #2,d0 or.w megasd_ok,d0 + or.w cd_ok,d0 move.w d0,0xA15122 move.w #0,0xA15120 /* done */ diff --git a/src-md/main.c b/src-md/main.c index 55a954f55..16fbdf683 100644 --- a/src-md/main.c +++ b/src-md/main.c @@ -120,7 +120,7 @@ uint16_t InitCD(void) scd_init_pcm(); - return 1; // CD ready to go! + return 0x1; // CD ready to go! } int main(void) diff --git a/src-md/megasd.c b/src-md/megasd.c index f0232109f..737c706d4 100644 --- a/src-md/megasd.c +++ b/src-md/megasd.c @@ -61,7 +61,7 @@ static uint16_t ProtectedInitMegaSD(void) MEGASD_CTRL_PORT = MEGASD_CMD_GET_NUMTRKS; MEGASD_WAIT_CMD_RSLT(timeout); megasd_num_cdtracks = MEGASD_RSLT_PORT; - return 0x0003; // MD+, CD OK + return 0x0002; // MD+, CD OK } #undef MEGASD_WAIT_CMD_RSLT