Pico_mcd->scd.Cur_Track = 0;\r
Pico_mcd->scd.Cur_LBA = -150;\r
Pico_mcd->scd.Status_CDC &= ~1;\r
- Pico_mcd->scd.Status_CDD = CD_Present ? READY : NOCD;\r
+ if (Pico_mcd->scd.Status_CDD != TRAY_OPEN)\r
+ Pico_mcd->scd.Status_CDD = CD_Present ? READY : NOCD;\r
Pico_mcd->scd.CDD_Complete = 0;\r
Pico_mcd->scd.File_Add_Delay = 0;\r
}\r
int ret = 1;\r
\r
CD_Present = 0;\r
- Pico_mcd->scd.Status_CDD = NOCD;\r
\r
if (cdimg_name != NULL && type != CIT_NOT_CD)\r
{\r
ret = Load_CD_Image(cdimg_name, type);\r
if (ret == 0) {\r
CD_Present = 1;\r
- /* for open tray close command will handle Status_CDD */\r
- if (Pico_mcd->scd.Status_CDD != TRAY_OPEN)\r
+\r
+ if (Pico_mcd->scd.Status_CDD == TRAY_OPEN)\r
+ {\r
+ if (Pico_mcd->bios[0x122 ^ 1] == '2')\r
+ Close_Tray_CDD_cC();\r
+ // else bios will issue it\r
+ }\r
+ else\r
+ {\r
Pico_mcd->scd.Status_CDD = READY;\r
+ }\r
}\r
}\r
\r
+ if (Pico_mcd->scd.Status_CDD != TRAY_OPEN && !CD_Present)\r
+ Pico_mcd->scd.Status_CDD = NOCD;\r
+\r
return ret;\r
}\r
\r
\r
-void Stop_CD(void)\r
+int Stop_CD(void)\r
{\r
+ int ret = CD_Present;\r
+\r
Unload_ISO();\r
CD_Present = 0;\r
+\r
+ return ret;\r
}\r
\r
\r
if (delay < 0) delay = -delay;\r
delay >>= 12;\r
\r
- // based on genplys GX\r
- if (delay < 13)\r
+ if (Pico_mcd->scd.Cur_LBA > 0 && delay < 13)\r
+ // based on genplus GX\r
delay = 13;\r
\r
Pico_mcd->scd.Cur_LBA = new_lba;\r