libretro / dosbox-libretro

Port of DOSBox (upstream) to the libretro API.
GNU General Public License v2.0
61 stars 40 forks source link

Fix infinite loop on exit #47

Closed garbear closed 7 years ago

garbear commented 7 years ago

When I typed "exit", dosbox went into an infinite loop instead of exiting to Kodi

andres-asm commented 7 years ago

that ends up closing RetroArch though. I guess the shutdown env is not implemented in your frontend.

garbear commented 7 years ago

how does a game signal that it should be closed? I thought that was what the shutdown env command was for?

meepingsnesroms commented 7 years ago

Is there a difference between "close emulator" and "shutdown retroarch" commands? Is there a way to just close the emulator and reactivate core select? RETRO_ENVIRONMENT_SHUTDOWN Requests the frontend to shutdown. Should only be used if game has a specific way to shutdown the game from a menu item or similar.

andres-asm commented 7 years ago

@garbear it's supposed to shutdown the whole thing. I guess in retroplayer it doesn't honour it but RA does it (that's why we disabled that)

No there is no way to do just close the core from within the core.

Alcaro commented 7 years ago

That entire env is a confusing mess. I've seen someone try to use it as "internal error, can't continue, can't even return from this function, just kill me". (Don't know if it was fixed.)

meepingsnesroms commented 7 years ago

I think disabling the exit command on the top level prompt would be better,it would still work if you started a new prompt from a program or the CMD line.

garbear commented 7 years ago

I was mistaken, the shutdown env is to power off the system, not close the game or RetroArch. According to the doc:

* Requests the frontend to shutdown.
* Should only be used if game has a specific
* way to shutdown the game from a menu item or similar.

Should this env command be removed? It doesn't make sense to shutdown Lakka on the RPi, and on Kodi there are different modes of shutdown (Exit, Shutdown, Reboot, Shutdown timer, etc), so it doesn't make sense to honor this env there either.

Maybe we should add an env RETRO_ENVIRONMENT_UNLOAD_GAME for those cores with "a specific way to shutdown the game from a menu item or similar"? E.g. these two:

dosbox

scummvm

meepingsnesroms commented 7 years ago

This would be better implemented as a "Your emulated computer has powered off, you can now close RetroArch safely." message instead of killing RetroArch or just locking up.

If there is a core exit method that wont kill RetroArch I dont know of please post it and I will reopen this and implement it.