Skip to content

Port to PySDL2 and adapt for universal use #37

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

Merged
merged 30 commits into from
Apr 1, 2025
Merged

Conversation

JeodC
Copy link
Contributor

@JeodC JeodC commented Mar 27, 2025

Description

Linked to #36

This pull request does the following:

  • Adapts RomM Client to PySDL2 for rendering
  • Bundles PIL, dotenv, and SDL2 dependencies (and adds them to sys.path for use)

RomM Client is no longer limited to muOS and can now be used by virtually anything that has Python and an internet connection.

  • GPTOKEYB is leveraged to avoid reliance on SDL gamepad controls (a PortMaster dependency for the time being)
    • Use ABXY as normal, R1 and L1 scroll pages, START brings up menu, HOTKEY + START to quit the app
  • RomM looks for the roms folder by searching two levels above the current directory (assumes the romM folder is inside a system folder like ports)
  • Compatibility with muOS is retained (tested) with a caveat:
    • The user can no longer choose which sdcard to use, as RomM uses the same card it's running from given the above rule
    • See the new TO-DO.md for notes
  • Rebrand the README.md file to reflect changes
    • PortMaster palette was used for the logo, this can be changed to the traditional RomM palette if desired

I have tested with the following devices:

  • TrimUI Smart Pro / Knulli
  • RG353V / RockNIX
  • Retroid Pocket Mini / RockNIX
  • RG40xx-H / muOS Big Banana

In all cases tests successfully navigated the ui, downloaded a rom from the host, and confirmed it could boot.

Checklist
Please check all that apply.

Please review code thoroughly as it may contain obsolete or duplicate imports in various places. I will be absent for roughly one week with limited social media and will return next week to review comments and critiques.

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR

Screenshots

image

@JeodC JeodC force-pushed the sdl2 branch 5 times, most recently from c16c7c6 to cba8a2f Compare March 27, 2025 22:29
@zurdi15
Copy link
Member

zurdi15 commented Mar 27, 2025

Dude this is fucking awesome

@JeodC JeodC force-pushed the sdl2 branch 2 times, most recently from 4e47f5c to 8f6fdad Compare March 27, 2025 23:46
@JeodC JeodC force-pushed the sdl2 branch 2 times, most recently from 9dba3e7 to 54afc58 Compare March 28, 2025 00:28
@JeodC
Copy link
Contributor Author

JeodC commented Mar 28, 2025

Note for review: I was unable to get a system working for dynamic button positions scaling with screen size. I intend to look into that and high dpi scaling next week, but given the trouble I've been having I welcome some help!

@JeodC
Copy link
Contributor Author

JeodC commented Mar 31, 2025

Progress report:

image

We now use PySDL2's render-to-texture method to render a base 640x480 ui and then blit it to the fullscreen window. This accounts for the various display resolutions the application will run on while retaining the visuals.

Inputs need to be mapped from gamecontrollerdb.txt, commonly used by emulationstation and I believe muOS as well. If successful then we can eliminate SDLK and gptokeyb entirely. Alternatively we can include gptokeyb as it's open source and rely solely on it, meaning that buttons will be nearly identical across devices and firmwares.

I resolved an issue where the application would crash if the user attempted to open and use the menus before platforms were fetched.

@gantoine gantoine merged commit f4bd7db into rommapp:main Apr 1, 2025
1 check passed
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.

3 participants