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

Added support for embedded portable handhelds #1781

Merged
merged 16 commits into from Feb 11, 2023

Conversation

kloptops
Copy link
Contributor

@kloptops kloptops commented Feb 10, 2023

Description

This PR is the changes required to allow GemRB to run on embedded portable handheld devices running linux.

The changes I have made are for the following purposes:

  • These handhelds have limited hardware and as such require gles2 for rendering. The current shaders do not work, I have added a flag to disable GLSL shaders and this allows the game to run well. (-DUSE_NO_GLSL)
  • The game is run with a companion program that listens to the handhelds gamepad and translates it into keyboard/mouse events, this allows more fine grained control and better portability between devices/platforms. GemRB currently listens for the same events and is doubling up events, i have added an option to disable the sdl controller api inside of gemrb. (-DSDL_DISABLE_CONTROLLER_API)
  • The last option is to fix resolution independence on devices with higher resolution screens. These devices do not run with an x windows server so the current fullscreen/windowed code doesn't scale up the screen resolution. (-DSDL_RESOLUTION_INDEPENDANCE="ON")

Thank you so much for this excellent engine, we have a very active community and many people are excited to use this to play such classic games.

Checklist

  • Commit messages are descriptive and explain the rationale for changes
  • I used the same coding style as the surrounding code
  • I have tested the proposed changes
  • I extended the documentation, if necessary
  • The proposed change builds also on our build bots (check after submission)

…dont play nice with GLES2,

Resolution independance so we can scale up the game on some of the larger screen devices,
and we need to be able to disable the sdl controller api as we run our own controller to
keyboard/mouse stuff through gptokeyb.

Added options to CMakeLists.txt:
- -DUSE_NO_GLSL to CMakeLists.txt to disable GLSL shaders
- -DSDL_RESOLUTION_INDEPENDANCE for resolution independance
- -DSDL_DISABLE_CONTROLLER_API to disable the SDL controller code
@lynxlynxlynx
Copy link
Member

Thanks! Some cleanup will be needed, but first I want to check this odd GLSL stuff — did you actually load a game and saw it render well? I'm not sure you get much benefit from enabling a crippled GLES compared to the software rendering.

@kloptops
Copy link
Contributor Author

Okay you're right, the GLSL stuff can be removed. I had issues with it when I was first getting the engine to run on the hardware. I ended up disabling the shader stuff then never tried it again.

Here is bg1 running on the hardware.
2023-02-10-18-37-23-852755653
2023-02-10-18-37-11-157575961
IMG_6420

The changes I have made are for the following purposes:
- The game is run with a companion program that listens to the handhelds gamepad and translates it into
keyboard/mouse events, this allows more fine grained control and better portability between
devices/platforms. GemRB currently listens for the same events and is doubling up events, i have added an
option to disable the sdl controller api inside of gemrb. (-DSDL_DISABLE_CONTROLLER_API)
- The last option is to fix resolution independence on devices with higher resolution screens. These devices
do not run with an x windows server so the current fullscreen/windowed code doesn't scale up the screen
resolution. (-DSDL_RESOLUTION_INDEPENDANCE="ON")
The changes I have made are for the following purposes:
- The game is run with a companion program that listens to the handhelds gamepad and translates it into
keyboard/mouse events, this allows more fine grained control and better portability between
devices/platforms. GemRB currently listens for the same events and is doubling up events, i have added an
option to disable the sdl controller api inside of gemrb. (-DSDL_DISABLE_CONTROLLER_API)
- The last option is to fix resolution independence on devices with higher resolution screens. These devices
do not run with an x windows server so the current fullscreen/windowed code doesn't scale up the screen
resolution. (-DSDL_RESOLUTION_INDEPENDANCE="ON")
@MarcelHB
Copy link
Collaborator

MarcelHB commented Feb 10, 2023

Can you elaborate on what kind of devices you have been testing GemRB here? Like the SoC of that ... GameBoy? 😉 For future references and compatibility.

@kloptops
Copy link
Contributor Author

So we have been testing it on the Anbernic RG351V (Rockchip RK3326), RG353V (Rockchip RK3566), and RG552 (Rockchip RK3399) on the AmberElec/ArkOS/UnofficialOS operating systems.

We use a system called PortMaster that allows us to package up the games in a way that they can run on all the above oses/hardware.

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@lynxlynxlynx
Copy link
Member

You can then add AmberElec / ArkOS /UnofficialOS to the exotic OSes list in the README as well.

…` to use `cmake/cmake_config.h.in`

Added AmberElec, ArkOS, UnofficialOS to the exotic OSes in `README.md`
@lynxlynxlynx lynxlynxlynx merged commit 53dc555 into gemrb:master Feb 11, 2023
@lynxlynxlynx
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

4 participants