Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues when switching screen resolution #360

Open
madmodder123 opened this issue Jul 19, 2020 · 6 comments
Open

Issues when switching screen resolution #360

madmodder123 opened this issue Jul 19, 2020 · 6 comments

Comments

@madmodder123
Copy link

Raspberry Pi 4 with RetroPie 4.6.4
Commander Genius v2.4.5 built from source (although this issue has been here for awhile now)

If you set the game up in 1080p, quit out of the program, and then switch your resolution to 720p, the next time you launch Commander Genius you will only see a black screen due to the program trying to draw at a higher resolution than your monitor is displaying.
If we could get some command line parameters to adjust program's the screen resolution that would solve this problem pretty easy, or develop an internal solution.

Here's my workaround in the meantime:

I wrote a bash script that is automatically launched before the game that grabs the screen resolution being used and then edits the cgenius.cfg file to have the proper resolution (I only switch between 720p and 1080p, but it wouldn't be hard to adjust the regex for other resolutions).

#!/usr/bin/env bash

OUTPUT="/opt/retropie/configs/ports/cgenius/cgenius.cfg"

screen_width=$(tvservice -s | grep -m 1 -o '[0-9][0-9][0-9]\+x[0-9][0-9][0-9]\+' | grep -m 1 -o '[0-9][0-9][0-9]\+x' | grep -m 1 -o '[0-9][0-9][0-9]\+')
screen_height=$(tvservice -s | grep -m 1 -o '[0-9][0-9][0-9]\+x[0-9][0-9][0-9]\+' | grep -m 1 -o 'x[0-9][0-9][0-9]\+' | grep -m 1 -o '[0-9][0-9][0-9]\+')

if [ "$screen_height" -ge "900" ]; then
	sudo sed -i 's/width = 1280/width = 1920/g' $OUTPUT
	sudo sed -i 's/height = 720/height = 1080/g' $OUTPUT
else
	sudo sed -i 's/width = 1920/width = 1280/g' $OUTPUT
	sudo sed -i 's/height = 1080/height = 720/g' $OUTPUT
fi

Thanks for all your work :)

@gerstrong
Copy link
Owner

Hi, you are welcome. Can you send me a log? Also be sure you really used the latest CG version, the one from the master branch. Regarding resolutions I have been fixing a lot black related issues in the last.

@madmodder123
Copy link
Author

Hi, you are welcome. Can you send me a log? Also be sure you really used the latest CG version, the one from the master branch. Regarding resolutions I have been fixing a lot black related issues in the last.

Here's the log: runcommand.log
So here is what I observed:

Setup - Raspberry Pi set to 720p, cgenius set to 1080p fullscreen,

with OpenGL = false
Same behavior I listed in my original post.
with OpenGL = true
UI will actually load, but will only show maybe 30% of the bottom right of the UI

snapshot

As a side note there seems to be an issue with OpenGL automatically being toggled off sometimes when you go into the Display/Video menus and back out (even if you don't change anything)

@gerstrong
Copy link
Owner

Sorry for the very late reply. It has been difficult to keep up with these bugs. I am reworking the resolution setup code. I'll get back to this when I have news. Apologies from my side.

@alonroz
Copy link

alonroz commented Jun 14, 2024

Having a similar issue on a 640x480 device. Resolution is fine on first load, but from the 2nd time I run the game, it resets itself to 1080p, no matter what settings I set in the game or launcher.
Only erasing the cfg file works to fix the issue, which is a bother to do every time I run the game. I've even tried setting the cfg file to read-only, but somehow it still resets to 1080p.

@gerstrong
Copy link
Owner

gerstrong commented Jun 17, 2024

Thanks for your Feedback, can you hint which version on which OS you used? Also commit id and post of the CGLog.html would be useful for further investigation.

@alonroz
Copy link

alonroz commented Jun 18, 2024

Thanks for your Feedback, can you hint which version on which OS you used? Also commit id and post of the CGLog.html would be useful for further investigation.

Device: Anbernic RG35XX SP
OS: muOS v2405 Beans (https://muos.dev/release/plush/2405)
Commander Genius is run via PortMaster (https://portmaster.games/detail.html?name=commander.genius&devices=)

I'll try to find the log in the device later today, will post if able to export it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants