Build Your Own Arcade Controls Forum

Main => Raspberry Pi & Dev Board => Topic started by: jdevane on May 07, 2019, 12:28:52 pm

Title: Single Boot Pi - Shut down button script question help
Post by: jdevane on May 07, 2019, 12:28:52 pm
What I would like to do is use a pi with a single rom for a cabinet build.  I would like to have a power button ont he machine that is actually a keypress to exit MAME..

I have used retropie to setup my system, but all I am doing is running that one game.  I'd like MAME to be closed first so that it will save state, instead of just cutting power at the game screen.  I have noticed that when I close my game right now the system proceeds to load emulation station...

So I'm guessing after the autostart script runs the MAME single game boot command, and that sessions is closed, that linux is telling the system to run the rest of the autostart script correct?  Which is why it loads emulationstation.  What I would like to do is make the system close Mame when you press a button that closes mame and would then run a timed shutdown sequence.  Say after ten seconds it will complete a power down, but if you press player 1 button it will cancel the shutdown and proceed to emulation station...        I've been looking at doing something simple with Dialog in linux but it doesn't have something from what I've read that can work quite like I want.  Seems like the -pause command still requires user input.

Any ideas?  I really want to make the Pi platform work, because I know I could make this work on a windows PC, but I'm learning linux still and I'm sure there is something that will make this work like I want...
Title: Re: Single Boot Pi - Shut down button script question help
Post by: keilmillerjr on May 07, 2019, 04:39:40 pm
Check out the retroflag script on GitHub. Easy enough to modify it for what you want.