X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fcd%2Fcd_sys.c;h=6b92d568e3edf00dd492c7b6295ad7f34a488798;hb=fa8fb7544593a0ed43f3354cc5f41150464b55bf;hp=319f4f1a99e5ae668e0aa3ae55c2843f649bb999;hpb=1cfc5cc4ce06642b9bc45ca3b9d32793718e9455;p=picodrive.git diff --git a/pico/cd/cd_sys.c b/pico/cd/cd_sys.c index 319f4f1..6b92d56 100644 --- a/pico/cd/cd_sys.c +++ b/pico/cd/cd_sys.c @@ -196,7 +196,7 @@ PICO_INTERNAL void Reset_CD(void) } -int Insert_CD(char *cdimg_name, int type) +int Insert_CD(const char *cdimg_name, int type) { int ret = 1; @@ -208,7 +208,9 @@ int Insert_CD(char *cdimg_name, int type) ret = Load_CD_Image(cdimg_name, type); if (ret == 0) { CD_Present = 1; - Pico_mcd->scd.Status_CDD = READY; + /* for open tray close command will handle Status_CDD */ + if (Pico_mcd->scd.Status_CDD != TRAY_OPEN) + Pico_mcd->scd.Status_CDD = READY; } } @@ -469,6 +471,10 @@ PICO_INTERNAL int Play_CDD_c3(void) if (delay < 0) delay = -delay; delay >>= 12; + // based on genplys GX + if (delay < 13) + delay = 13; + Pico_mcd->scd.Cur_LBA = new_lba; CDC_Update_Header(); @@ -651,15 +657,12 @@ PICO_INTERNAL int Fast_Rewind_CDD_c9(void) PICO_INTERNAL int Close_Tray_CDD_cC(void) { - CD_Present = 0; - //Clear_Sound_Buffer(); - Pico_mcd->scd.Status_CDC &= ~1; // Stop CDC read elprintf(EL_STATUS, "tray close\n"); if (PicoMCDcloseTray != NULL) - CD_Present = PicoMCDcloseTray(); + PicoMCDcloseTray(); Pico_mcd->scd.Status_CDD = CD_Present ? STOPPED : NOCD; Pico_mcd->cdd.Status = 0x0000;