OpenTTD on OGA

Game ROMs compatibility, performance and new cores
Post Reply
rybamlot
Posts: 3
Joined: Tue Dec 29, 2020 2:28 am
languages_spoken: english
Has thanked: 2 times
Been thanked: 0
Contact:

OpenTTD on OGA

Post by rybamlot »

OpenTTD is one of my all-time favorites and I am looking for a way to play it on my OGA.
For the most part, it has never been any issue to get OpenTTD to work on any low powered device. However, on the OGA there seem to be two problems: controls and resolution. It seems like the newer versions of OPENTTD don't want to start at all with a resolution below 640x480. Starting from console, I get the error ""No usable screen resolutions found!". In the source we can find the following code:

Code: Select all

 {
   int modes = SDL_GetNumDisplayModes(0);
   if (modes == 0) usererror("sdl: no modes available");
  
   _resolutions.clear();
  
   SDL_DisplayMode mode;
   for (int i = 0; i < modes; i++) {
     SDL_GetDisplayMode(0, i, &mode);
  
     uint w = mode.w;
     uint h = mode.h;
  
     if (w < 640 || h < 480) continue; // reject too small resolutions
  
     if (std::find(_resolutions.begin(), _resolutions.end(), Dimension(w, h)) != _resolutions.end()) continue;
     _resolutions.emplace_back(w, h);
   }
   if (_resolutions.empty()) usererror("No usable screen resolutions found!\n");
   SortResolutions();
 }
Which suggests that it should be possible to work around this. I am willing to try, but I am very inexperienced with linux and compiling.
Alternatively, there is a PSP homebrew port that works perfectly in PPSSPP on the OGA. https://sourceforge.net/projects/opentt ... enttd-psp/The controls are really good, and it's possible to use the full surface area of the OGA screen without stretching. It even works with OpenTTD mods. However, the port is from 2008 and is missing a lot of essential quality-of-life features from the newer releases.
Image
I was wondering if anyone had advice or had better success in getting OpenTTD on the OGA to work. The game is very addicting, works with low specs and the gameplay is slow enough to work well on with using the analog stick as the mouse.

User avatar
meveric
Posts: 11382
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, GoA v1.1, H2+, HC4, GoS
Has thanked: 59 times
Been thanked: 443 times
Contact:

Re: OpenTTD on OGA

Post by meveric »

My Images: viewtopic.php?f=193&t=38177 and viewtopic.php?f=193&t=37399 use X11 as a graphical backend which allows for scaling.
It's as simple as

Code: Select all

xrandr --output DSI-1 --scale 2x2
or

Code: Select all

xrandr --output DSI-1 --scale 1.5x1.5
1.5x1.5 = 720x480
2x2 = 960x640

with that you can easily run OpenTTD on the ODROID Go Advance.
On the gaming image I already provide mouse support via joyconfig-mouse.xml which can be loaded into antimicro a tool for mapping gamepad inputs to mouse and keyboard events.

With that you can "easily" control OpenTTD.

Here's an example that it actually works:
Image

And here a short video. For whatever reason I couldn't get music to work, but sound worked fine (sorry for the bad quality):
https://oph.mdrjr.net/meveric/other/Vid ... td-go2.mp4

I actually used 1.6 as as scaling factor.
Of cause if you're using the new ODROID Go Super, you don't need scaling, or you are fine with 1.1 or 1.2 scaling for all elements.
These users thanked the author meveric for the post:
rybamlot (Wed Dec 30, 2020 9:39 am)
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

crashoverride
Posts: 5217
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 400 times
Contact:

Re: OpenTTD on OGA

Post by crashoverride »

I usually do not release work done for research purposes, but I have posted a port of OpenTTD for GO-Super:
https://github.com/OtherCrashOverride/O ... /ogs-1.7.1

I mentioned in another thread that I wished to evaluate the possibility of new ports that take advantage of the larger GO-Super display. OpenTTD seemed like a good candidate so I added native GO-Super support for display and input. Note that it is an older version (1.7.1) as I could not get "master" to display anything. This older version matches that provided in the Ubuntu 18.04 repository and works with the repository provided content packs (graphics/sound).

[edit - screen shot attached]
ScreenShot.png
ScreenShot.png (255.21 KiB) Viewed 234 times
These users thanked the author crashoverride for the post (total 2):
rybamlot (Thu Dec 31, 2020 12:31 pm) • shanti (Sat Jan 02, 2021 1:08 pm)

User avatar
meveric
Posts: 11382
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, GoA v1.1, H2+, HC4, GoS
Has thanked: 59 times
Been thanked: 443 times
Contact:

Re: OpenTTD on OGA

Post by meveric »

Sadly this won't help if people want to use this on an GO2.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

rybamlot
Posts: 3
Joined: Tue Dec 29, 2020 2:28 am
languages_spoken: english
Has thanked: 2 times
Been thanked: 0
Contact:

Re: OpenTTD on OGA

Post by rybamlot »

meveric wrote:
Wed Dec 30, 2020 8:06 am
My Images: viewtopic.php?f=193&t=38177 and viewtopic.php?f=193&t=37399 use X11 as a graphical backend which allows for scaling.
It's as simple as

Code: Select all

xrandr --output DSI-1 --scale 2x2
or

Code: Select all

xrandr --output DSI-1 --scale 1.5x1.5
1.5x1.5 = 720x480
2x2 = 960x640

with that you can easily run OpenTTD on the ODROID Go Advance.
On the gaming image I already provide mouse support via joyconfig-mouse.xml which can be loaded into antimicro a tool for mapping gamepad inputs to mouse and keyboard events.

Hmm, looking at your images they seem great. I am trying out the GameStation one on my other microsd and having fun with it. OpenTTD with scaling didn't really work on my main arch setup, still giving me the same error. However, the scaling method works great for any desktop-related work on the small screen. I've been using antimicro and onboard already for a more approachable desktop experience.
crashoverride wrote:
Wed Dec 30, 2020 1:58 pm
I usually do not release work done for research purposes, but I have posted a port of OpenTTD for GO-Super:
https://github.com/OtherCrashOverride/O ... /ogs-1.7.1

I mentioned in another thread that I wished to evaluate the possibility of new ports that take advantage of the larger GO-Super display. OpenTTD seemed like a good candidate so I added native GO-Super support for display and input. Note that it is an older version (1.7.1) as I could not get "master" to display anything. This older version matches that provided in the Ubuntu 18.04 repository and works with the repository provided content packs (graphics/sound).
This is also great! I had a few errors pop up trying to compile it on arch on my OGA 1.1, but managed to figure it out. It's actually working well and I like having the controls included. It will be a fun small project to add some extra controls. With every error I am learning something new about linux and compiling, so it's great. I bought my OGA with the assumption that setting it up will be at least 70% of the fun I'm going to have with the device. Maybe ideally I would want to use both scaling and your openttd, but that's something for the future.
meveric wrote:
Thu Dec 31, 2020 5:17 pm
Sadly this won't help if people want to use this on an GO2.
Image

Actually it does work well on my OGA 1.1.

crashoverride
Posts: 5217
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 400 times
Contact:

Re: OpenTTD on OGA

Post by crashoverride »

rybamlot wrote:
Fri Jan 01, 2021 12:33 am
Maybe ideally I would want to use both scaling and your openttd, but that's something for the future.
This is actually easy to implement, and I plan to add scaling to support GO2.

A note about the controls. As previously stated, this port was done for research purposes. Once of the research items is gamepad mouse emulation. Currently, the DPad moves the mouse a single pixel at a time while the left analogue control moves the mouse faster depending on how far it is pressed. This mouse "acceleration" still needs some tuning but seems to be a good start. The A/B buttons function as left and right click. Feedback or suggestions for better controls are welcomed.

rybamlot
Posts: 3
Joined: Tue Dec 29, 2020 2:28 am
languages_spoken: english
Has thanked: 2 times
Been thanked: 0
Contact:

Re: OpenTTD on OGA

Post by rybamlot »

crashoverride wrote:
Fri Jan 01, 2021 4:31 am
rybamlot wrote:
Fri Jan 01, 2021 12:33 am
Maybe ideally I would want to use both scaling and your openttd, but that's something for the future.
This is actually easy to implement, and I plan to add scaling to support GO2.

A note about the controls. As previously stated, this port was done for research purposes. Once of the research items is gamepad mouse emulation. Currently, the DPad moves the mouse a single pixel at a time while the left analogue control moves the mouse faster depending on how far it is pressed. This mouse "acceleration" still needs some tuning but seems to be a good start. The A/B buttons function as left and right click. Feedback or suggestions for better controls are welcomed.
Yeah, still it helped a lot. I appreciate that you uploaded the source and I am not in position to make any requests for extra work on your part. It works well enough to play and I am going to play around with the source and see if I can make it work better by myself. Once I can get it going, I will let you know if I have any specific ideas.

Post Reply

Return to “Game emulations”

Who is online

Users browsing this forum: No registered users and 0 guests