ret = Load_CD_Image(cdimg_name, type);\r
if (ret == 0) {\r
CD_Present = 1;\r
- Pico_mcd->scd.Status_CDD = READY;\r
+ /* for open tray close command will handle Status_CDD */\r
+ if (Pico_mcd->scd.Status_CDD != TRAY_OPEN)\r
+ Pico_mcd->scd.Status_CDD = READY;\r
}\r
}\r
\r
\r
PICO_INTERNAL int Close_Tray_CDD_cC(void)\r
{\r
- CD_Present = 0;\r
- //Clear_Sound_Buffer();\r
-\r
Pico_mcd->scd.Status_CDC &= ~1; // Stop CDC read\r
\r
elprintf(EL_STATUS, "tray close\n");\r
\r
if (PicoMCDcloseTray != NULL)\r
- CD_Present = PicoMCDcloseTray();\r
+ PicoMCDcloseTray();\r
\r
Pico_mcd->scd.Status_CDD = CD_Present ? STOPPED : NOCD;\r
Pico_mcd->cdd.Status = 0x0000;\r
extern unsigned int s68k_poll_adclk;
void (*PicoMCDopenTray)(void) = NULL;
-int (*PicoMCDcloseTray)(void) = NULL;
+void (*PicoMCDcloseTray)(void) = NULL;
PICO_INTERNAL void PicoInitMCD(void)
\r
// cd/Pico.c\r
extern void (*PicoMCDopenTray)(void);\r
-extern int (*PicoMCDcloseTray)(void);\r
+extern void (*PicoMCDcloseTray)(void);\r
extern int PicoCDBuffers;\r
\r
// Pico/Pico.c\r
\r
if (is_sram)\r
{\r
- romfname_ext(saveFname, (PicoAHW&1) ? "brm"PATH_SEP : "srm"PATH_SEP, (PicoAHW&1) ? ".brm" : ".srm");\r
+ romfname_ext(saveFname, (PicoAHW & PAHW_MCD) ? "brm"PATH_SEP : "srm"PATH_SEP,\r
+ (PicoAHW & PAHW_MCD) ? ".brm" : ".srm");\r
if (load) {\r
if (try_ropen_file(saveFname)) return saveFname;\r
// try in current dir..\r
}\r
}\r
\r
-static void emu_msg_tray_open(void)\r
+static void emu_tray_open(void)\r
{\r
- emu_status_msg("CD tray opened");\r
+ engineState = PGS_TrayMenu;\r
+}\r
+\r
+static void emu_tray_close(void)\r
+{\r
+ emu_status_msg("CD tray closed.");\r
}\r
\r
void emu_reset_game(void)\r
\r
PicoInit();\r
PicoMessage = plat_status_msg_busy_next;\r
- PicoMCDopenTray = emu_msg_tray_open;\r
- PicoMCDcloseTray = menu_loop_tray;\r
+ PicoMCDopenTray = emu_tray_open;\r
+ PicoMCDcloseTray = emu_tray_close;\r
}\r
\r
void emu_finish(void)\r
PGS_KeyConfig,
PGS_ReloadRom,
PGS_Menu,
+ PGS_TrayMenu,
PGS_RestartRun,
PGS_Suspending, /* PSP */
PGS_SuspendWake, /* PSP */
menu_loop();\r
break;\r
\r
+ case PGS_TrayMenu:\r
+ menu_loop_tray();\r
+ break;\r
+\r
case PGS_ReloadRom:\r
if (emu_reload_rom(rom_fname_reload))\r
engineState = PGS_Running;\r
\r
case PGS_RestartRun:\r
engineState = PGS_Running;\r
+ /* vvv fallthrough */\r
\r
case PGS_Running:\r
emu_loop();\r
\r
static menu_entry e_menu_tray[] =\r
{\r
- mee_label ("The unit is about to"),\r
- mee_label ("close the CD tray."),\r
+ mee_label ("The CD tray has opened."),\r
mee_label (""),\r
mee_label (""),\r
mee_handler("Load CD image", mh_tray_load_cd),\r