int Atari_Exit(int run_monitor)
{
        /* restore to text mode */
        ShutdownVgaEnvironment();

        key_delete();                           /* enable keyboard in monitor */

        if (run_monitor) {
#ifdef SOUND
                Sound_Pause();
#endif
                if (monitor()) {
#ifdef MONITOR_BREAK
                        if (!break_step)       /*do not enter videomode when stepping through the code*/
#endif
                        SetupVgaEnvironment();
#ifdef SOUND
                        Sound_Continue();
#endif
                        return 1;                       /* return to emulation */
                }
        }

#ifdef SOUND
        Sound_Exit();
#endif

        Aflushlog();

        return 0;
}
int Atari_Exit(int run_monitor)
{
    Aflushlog();

    if (run_monitor && monitor())
        return TRUE;

#ifdef SOUND
    Sound_Exit();
#endif

    return FALSE;
}
int Atari_Exit(int run_monitor)
{
	backlight_xchg();	/* restore backlight settings */
	SystemParametersInfo(SPI_SETBATTERYIDLETIMEOUT, bat_timeout, NULL, SPIF_SENDCHANGE);

	/* monitor is not avaliable in this port */
	if(run_monitor)
		return 1;

#ifdef BUFFERED_LOG
	Aflushlog();
#endif

	uninitinput();
	groff();

#ifdef SOUND
	Sound_Exit();
#endif

	return 0;
}