X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fcd%2Fcd_sys.c;h=6b92d568e3edf00dd492c7b6295ad7f34a488798;hb=b26701370b773deded710187215a7db98513b941;hp=32a9425509dc95ceccf36e82723937a737a647a6;hpb=35e3031aaab69be3703de3b6ce0cfa64aae5ece8;p=picodrive.git diff --git a/pico/cd/cd_sys.c b/pico/cd/cd_sys.c index 32a9425..6b92d56 100644 --- a/pico/cd/cd_sys.c +++ b/pico/cd/cd_sys.c @@ -208,7 +208,9 @@ int Insert_CD(const 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;