Attract-Mode Support Forum

Attract-Mode Support => General => Topic started by: a_netanel on April 25, 2017, 02:02:17 PM

Title: Request: quiet (no prints) mode
Post by: a_netanel on April 25, 2017, 02:02:17 PM
I'm trying to minimize the amount of output to the console, that can be seen in the second before the game is launched.
I tried to redirect stdout to /dev/null, but this way the runcommand menu does not clear, even if i send a clear command in runcommand-onstart.sh etc.

I looked in the cpp code and saw there are only 94 lines that output to stdout (greped "cout").
I believe it could be quite easy (to someone who remembers how to program cpp, that is) to add a flag that quiets these couts.

Many thanks!
Title: Re: Request: quiet (no prints) mode
Post by: a_netanel on April 25, 2017, 02:29:51 PM
Just for sake of completion, for now I manage to quiet the output by an ugly hack:
1. change the autostart script to:
Code: [Select]
stty -echo
clear
attract 2>1 |grep -o $'\033c'

2. create runcommand-onstart and runcommand-onend scripts that contain:
Code: [Select]
printf "\033c"
Title: Re: Request: quiet (no prints) mode
Post by: a_netanel on April 25, 2017, 03:37:33 PM
Tweaked it a bit to hide cursor as well.
autostart.sh:
Code: [Select]
setterm -cursor off
stty -echo
clear
attract 2>&1 | grep -o $'\033\[2J'

runcommand-onstart.sh & runcommand.onend.sh:
Code: [Select]
printf "\033[H\033[2J"
Sorry about the spam, but I think this should be documented :)
Title: Re: Request: quiet (no prints) mode
Post by: progets on April 26, 2017, 11:12:47 PM
It's not spam and it should be documented. Great info.
Title: Re: Request: quiet (no prints) mode
Post by: d4NY0 on May 14, 2017, 06:29:00 AM
Excellent tweak. Thank you.

But I got one problem. I start a game and push a button to configure emulator options. When I choose the "Launch" option, the blue runcommand background stays visible on both sides of my widescreen display while playing Dreamcast.

Any idea?

Edit: This happens only using Reicast (Dreamcast).
Title: Re: Request: quiet (no prints) mode
Post by: tekn0 on July 06, 2017, 09:19:37 AM
Thank you so much for this workaround. It is working great here.

Launch screen is now all clean. Also the GetErrorx500 thing is now gone as well! :)
Title: Re: Request: quiet (no prints) mode
Post by: slowsl on September 25, 2017, 11:26:55 AM
Is there a dummy's guide to getting this accomplished on a retropie?  I'm not quite sure I follow on what to do.
Thanks!
Title: Re: Request: quiet (no prints) mode
Post by: flexfulton on October 12, 2017, 07:55:29 AM
This is great to remove the visually unappealing flash of the glGetError.  The only issue with this is that if you use the Retropie Setup Script that will flash on the screen now before and after the launching.png.

A simple reboot with get rid of it though.  So for now it's the best best for a completely clean system.
Title: Re: Request: quiet (no prints) mode
Post by: flexfulton on October 12, 2017, 08:02:50 AM
Is there a dummy's guide to getting this accomplished on a retropie?  I'm not quite sure I follow on what to do.
Thanks!

You need to replace what is in the autostart.sh script found in /opt/retropie/configs/all with

setterm -cursor off
stty -echo
clear
attract 2>&1 | grep -o $'\033\[2J'

You can just make sure that a # is in front of all the existing lines in you would rather save it in case you need to revert back.

Thank you need to make two text files one called runcommand-onstart and one called runcommand-onend.  They both need to contain printf "\033[H\033[2J"
Once you created them, rename them to add the .sh to the end and then upload them into the /opt/retropie/configs/all folder.

This can all be done via WinSCP but you can also do it via command line if you want.  Th

Please note that if you use the Retropie Setup Script at any time that will flash up before the game loads.  This can be cleaned up by rebooting the system.

Also note that all terminal text that you wish to input to the system via USB keyboard will no longer show up either.  It will accept the text you just won't be able to see it.  You can however SSH into the system to do all your work if required.

Good luck!
Title: Re: Request: quiet (no prints) mode
Post by: mojoatomic on October 13, 2017, 05:36:42 PM
The [H inside of    printf "\033[H\033[2J"   gave me an issue.  Once that's removed, this is a great solution and I can confirm it works great.


https://youtu.be/iIsJCYU7_4I
Title: Re: Request: quiet (no prints) mode
Post by: flexfulton on October 18, 2017, 10:47:01 AM
What was the issue you were having?