Build Your Own Arcade Controls Forum

Software Support => GroovyMAME => Topic started by: TheElectricMonk on March 14, 2022, 05:12:39 pm

Title: Exit message in console window - how to suppress?
Post by: TheElectricMonk on March 14, 2022, 05:12:39 pm
Long story short: Currently building my first virtual pinball cab using PinballX as a front end, and thought I'd take advantage of the big vertical screen, add a spinner and a few vertical MAME games.

It's all working beautifully, but when I exit MAME (in this case GroovyMAME 0.221, since it plays a few games that other versions complain about), I get a quick pop-up console window with suppressed error messages. It disappears after a fraction of a second, but it just looks ugly.

Is there a way to suppress this window? Like a "quiet" mode or something? I tried nolog, noverbose, nodebug, nooslog and noconsole, all to no avail.

Any help would be greatly appreciated.

EDIT:
This is what I'm talking about. Message varies from game to game, of course. And it doesn't matter if I use GroovyMAME or other MAME .exes.
(https://i.imgur.com/CmzqvgD.jpg)
Title: Re: Exit message in console window - how to suppress?
Post by: psakhis on March 14, 2022, 05:35:28 pm
Test confirm_quit 0 on mame.ini
Title: Re: Exit message in console window - how to suppress?
Post by: TheElectricMonk on March 14, 2022, 06:26:25 pm
Thanks, but confirm_quit 0 has already been set.

In the meantime, I've just mapped another key (unused by the buttons on my cab) as "UI cancel" and created an AutoHotKey script that when I press the "Exit" button (mapped to Escape)
- covers the screen with a black rectangle the size of the screen's resolution
- waits 200 ms
- kills the groovymame.exe process
- waits for another 500 ms
- removes the black rectangle

It's a clunky workaround, but it works. Still, a more elegant solution would be preferable...
Title: Re: Exit message in console window - how to suppress?
Post by: Calamity on March 15, 2022, 10:32:10 am
You're not using an AMD card, are you? Is that a CRT?
Title: Re: Exit message in console window - how to suppress?
Post by: 10yard on March 15, 2022, 10:56:58 am
You can pipe the standard output from MAME (or any command) elsewhere so it doesn’t appear on your screen.
This example sends output and error messages to a null file.

Code: [Select]
mame mspacman > nul 2>&1
Add  > nul 2>&1 to the end of your mame arguments and it should sort your problem.
Title: Re: Exit message in console window - how to suppress?
Post by: psakhis on March 15, 2022, 02:53:01 pm
As a part of Windows hidden, the solution is setting a cmd out of screen.

1) Edit register with regedit for save your settings (export to cmd_show.reg file)
- [HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe]
- [HKEY_CURRENT_USER\Console\EmulaStation]

2) Define a WindowPosition key out of your screen and export to a cmd_hide.reg file. (you can test it, opening a cmd)

3) Set this settings before and after of launching frontend, example:
regedit /s cmd_hide.reg
c:\users\arcade\emulationstation\emulationstation.exe --no-splash
regedit /s cmd_show.reg




Title: Re: Exit message in console window - how to suppress?
Post by: TheElectricMonk on March 16, 2022, 04:41:13 pm
You're not using an AMD card, are you? Is that a CRT?

NVIDIA GForce. I'm using a Panasonic Flatscreen as playing field. (Yes, I know, Groovymame is made chiefly for CRTs, but it's running a few games that are incompatible with other versions of MAME I tried)


You can pipe the standard output from MAME (or any command) elsewhere so it doesn’t appear on your screen.
This example sends output and error messages to a null file.

Code: [Select]
mame mspacman > nul 2>&1
Add  > nul 2>&1 to the end of your mame arguments and it should sort your problem.

Thank you, that's a great idea, and it works beautifully when I'm starting MAME from a batch file.
For some reason though, when I'm launching the game this way via the PinballX frontend, it immediately crashes back to menu. I may have to try the PinballX forum for this.


As a part of Windows hidden, the solution is setting a cmd out of screen.

1) Edit register with regedit for save your settings (export to cmd_show.reg file)
- [HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe]
- [HKEY_CURRENT_USER\Console\EmulaStation]

2) Define a WindowPosition key out of your screen and export to a cmd_hide.reg file. (you can test it, opening a cmd)

3) Set this settings before and after of launching frontend, example:
regedit /s cmd_hide.reg
c:\users\arcade\emulationstation\emulationstation.exe --no-splash
regedit /s cmd_show.reg


Could you go into a bit more detail? It feels like I'm missing half the information here.
In what format do I need to add the screen position? I don't see an entry named %SystemRoot%_system32_cmd.exe in HKEY_CURRENT_USER\Console. Do I need to create one? In what format?
If you have it, could you post the contents of your .reg file please?
Title: Re: Exit message in console window - how to suppress?
Post by: psakhis on March 16, 2022, 06:00:18 pm
Hi, maybe you are in W10.

Settings are saved here HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe (only exists when you save properties)

For setting WindowsPosition
1) Windows Key + R --> Type cmd
2) Properties - Design Tab
3) Set WindowsPosition (you can see with prev image if windows will be hidden)

Title: Re: Exit message in console window - how to suppress?
Post by: TheElectricMonk on March 17, 2022, 01:53:34 pm
Hi, maybe you are in W10.

Settings are saved here HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe (only exists when you save properties)

For setting WindowsPosition
1) Windows Key + R --> Type cmd
2) Properties - Design Tab
3) Set WindowsPosition (you can see with prev image if windows will be hidden)

Thank you for explaining! It works, but only when I try to open CMD manually. The MAME text window still pops up in its usual place after I quit a game.
Still, I'm sure this trick will be useful to me somewhere down the road.
For the time being, I'll stick with my AHK script.

Just in case anyone may need it or something similar in the future, here it is:

Remap your "Exit GUI" key in MAME to something else, then force your frontend to run the compiled script before starting a MAME game.


Esc::
{
BlockInput, on
Gui, Color, black
Gui +AlwaysOnTop
Gui -Caption
Gui, Show, x0 y0 w%A_ScreenWidth% h%A_ScreenHeight%
Sleep, 200
Process, Close, groovymame.exe
Sleep, 500
Gui, Destroy
BlockInput, off
ExitApp
}
Return


This will
1. block any further user input
2. create a black surface covering the width and height of the screen
3. wait for 200 milliseconds, then kill the mame process
4. wait for 500 milliseconds (enough time for the cmd window to appear and disappear), then remove the black surface
5. allow user input again
6. quit the script
Title: Re: Exit message in console window - how to suppress?
Post by: psakhis on March 17, 2022, 03:46:38 pm
Probably you need to configure WindowsPosition on a opened cmd because parent process is the propietary (in my case emulastation)

In this case, on W7x64 i needed to configure for emulastation on a differnet reg key.
- [HKEY_CURRENT_USER\Console\EmulaStation]