Skip to content

Commit

Permalink
Fix "shut down core after auto started game" and "Always show menu on…
Browse files Browse the repository at this point in the history
… startup" start menu behaviors (#437)
  • Loading branch information
schellingb committed Dec 4, 2023
1 parent 327899c commit ec46145
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dosbox_pure_osd.h
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,7 @@ static void DBP_PureMenuProgram(Program** make)

static void InterceptInputAnyPress(DBP_Event_Type type, int val, int val2, void* self)
{
if (type == DBPET_KEYUP || type == DBPET_MOUSEUP || type == DBPET_JOY1UP || type == DBPET_JOY2UP)
if (type == DBPET_KEYDOWN || type == DBPET_MOUSEDOWN || type == DBPET_JOY1DOWN || type == DBPET_JOY2DOWN)
if ((DBP_GetTicks() - ((Menu*)self)->opentime) > 300)
((Menu*)self)->pressedAnyKey = true;
}
Expand All @@ -1460,7 +1460,7 @@ static void DBP_PureMenuProgram(Program** make)
{
enum { M_NORMAL, M_BOOT, M_FINISH } m = (cmd->FindExist("-BOOT") ? M_BOOT : cmd->FindExist("-FINISH") ? M_FINISH : M_NORMAL);

if (DBP_Run::HandleStartup(m == M_BOOT))
if (DBP_Run::HandleStartup(m == M_BOOT && dbp_menu_time >= 0))
return;

opentime = DBP_GetTicks();
Expand All @@ -1469,7 +1469,7 @@ static void DBP_PureMenuProgram(Program** make)
bool runsoloexe = (ms->exe_count == 1 && ms->fs_count <= 1);

#ifndef STATIC_LINKING
if (m == M_FINISH && dbp_menu_time >= 0 && dbp_menu_time < 99 && (runsoloexe || DBP_Run::autoboot.use) && (opentime - dbp_lastmenuticks) < 500)
if (m == M_FINISH && dbp_menu_time >= 0 && dbp_menu_time < 99 && (runsoloexe || DBP_Run::autoboot.use) && (opentime - dbp_lastmenuticks) >= 500)
{
if (dbp_menu_time == 0) { first_shell->exit = true; return; }
sprintf(msgbuf, "* GAME ENDED - EXITTING IN %d SECONDS - PRESS ANY KEY TO CONTINUE *", dbp_menu_time);
Expand Down

0 comments on commit ec46145

Please sign in to comment.