Main > Main Forum

Screen saver while MAME is paused

Pages: (1/3) > >>

rCadeGaming:

I'm writing my own front-end for Mame.  It has a feature where if you leave it idle for a period of time, it launches a random game and runs it for a little while.  That games stops after a while, goes back to the FE for a few seconds, and it launches another game.  This process repeats until you press any button or move the mouse/trackball.  Then it returns to the FE and the initial idle timer resets.

This is done simply by launching MAME with the "seconds to run" property, and telling it to use an alternate mame.ini, pointing to an alternate default.cfg file, where all the cabinet's inputs are set to "ui cancel."

I got this all working great as a screen saver for the FE, but the problem is that the user can still launch a game manually, pause it, and walk away to let the screen burn in.

Anyone know how to add a screen saver or something to the pause screen in MAME?  I could turn the pause brightness all the way down, but that's really a last resort.

Since I'm writing my own front-end, it can't be a feature of another.  Anyone know of a stand-alone program or a diff or some kind of mod or solution?

If someone good with C could write a diff, I think it would be helpful to a lot of cab builders.  A simple but effective solution could be that the pause screen is the normal dimmed gameplay screen for a minute or so, then something pops up and moves around the screen to prevent burn-in.

Any ideas?

Le Chuck:

I would think that you could do an AHK script that whenever P <insert your pause button> is depressed it runs a script that first pauses two minutes then sends a key press to save state then sends a keypress to exit game.  After that everything else takes over.  When you come back you just need to load state.   

rCadeGaming:

Looked up AutoHotKey.  I could try something use this, but I'm worried it would get out of sync with whether MAME is paused or not.  Autokey can't interact directly with MAME right?

I know it should be easy to find the code in MAME that runs when you push pause and add something there.  I would like to be able to write it myself, but I don't know anywhere close to enough about C/C++.  I wrote my FE in Visual Basic .NET. 

Le Chuck:

In AHK you can add a one liner to make the code only activate when MAME is running.  It's an if win active command I think.  Nitz would have already written the code for you if he had seen this thread.  He's generally helpful like that.  I on the other hand tend to muddle though my coding. 

nitz:

Heard my name again! ;D

rCadeGaming, if I'm understanding correctly, you want a screen saver to kick in when mame has been paused for a couple minutes, but not otherwise? This does the trick.


--- Quote ---setTitleMatchMode, 2

Loop
{
IfWinNotActive, MAME
continue
    If (A_TimeIdle > 120000)
    {
    setworkingdir, C:\Windows\System32
    run ribbons.scr /s
        Loop
        {
        If (A_TimeIdle < 120000)
        break
        }
    }
}

--- End quote ---

The top two lines of the first loop cause it to simply restart whenever mame is not the active window. But if it is, the script continues and checks the idle time. When it's less than 2 minutes, the loop starts over. When it's greater than 2 minutes, the script changes to the directory where the screensavers are, and runs the ribbons screensaver (I'm on Windows 7, the directory may be different and the ribbons screensaver may not exist depending on what flavor of Windows you're on, so adjust accordingly) Then it runs another loop until idle time is less than 2 minutes (ie. you pressed something) then the whole process starts over. Whenever you exit mame, it gets stuck at the beginning of the main loop until you start mame again.

I realize this may not be *quite* what you asked for since it does not require mame to be paused. I did it this way because doing it the other way would require a special mame compile. If you want to go down that road we can, but I think this works nicely since you'd be hard pressed to find an arcade game that would have you not pressing anything for a whole 2 minutes straight, except maybe during an ending sequence.

 :cheers:

Pages: (1/3) > >>

Go to full version