Skip to content

Add RetroArch as a frontend (#239)#240

Open
SineSwiper wants to merge 7 commits into
Gemba:masterfrom
SineSwiper:add-retroarch-frontend
Open

Add RetroArch as a frontend (#239)#240
SineSwiper wants to merge 7 commits into
Gemba:masterfrom
SineSwiper:add-retroarch-frontend

Conversation

@SineSwiper
Copy link
Copy Markdown

Here's the PR for issue 239.

@SineSwiper
Copy link
Copy Markdown
Author

SineSwiper commented Mar 21, 2026

Replying to this comment:

Any reason you did not file a PR?

Here ya go.

I am not sure if using the CSV file for a frontend, as this file is esp. for hinting scrapers with an API, but let me think about it.

I'm open to wherever you want the data. But, I felt like hardcoding it was wrong, especially since this CSV file was already serving a purpose of mapping platform names to other API IDs.

I am not sold to have RetroPie-Paths hardwired /opt/retropie/... as default. On Linux ~/.config/retroarch is a better choice (RetroPie symlinks those to /opt/retropie/...). macOS and Windows may need some research of the default folders.

I was mostly basing this off of other prior art (see grep -R '/opt/retropie' src), but this line also exists:

src/config.cpp
55:        {"XDG_CONFIG_HOME", QDir::homePath() % "/.config"},

AFAICT there is no evaluation of any retroarch.cfg (aso.) to identify possible path alterations in your contribution? (not an issue more a confirmation, as the user may provide altered paths to Skyscraper explicitly at least on a coarse grained level (cf. mediaFolder)).

Is this reading the RetroArch config files? No, mainly because I didn't see any sort of mechanism like that for the other frontends. Might be a good idea for media/ROM defaults. Though, I think it would deserve some sort of frontendConfigDir property in the Skyscraper config to override the directory to look for those.

But, there are overrides with the usual config.ini properties. Here's what I had in my retroarch section:

[retroarch]
gameListFolder="/home/pi/Arcade/retroarch/playlists"
mediaFolder="/home/pi/Arcade/retroarch/thumbnails"
unattend="true"
artworkXml="artwork-retroarch.xml"

I did have to run through a perl-pie script to change the ROM paths to /storage/emulated/0/ROMs/, but that's only because I'm running Skyscraper on my Retropie to transfer data to my AYN Thor.

The double trailing spaces are deliberately there (new line without paragraph space in between), maybe your IDE/editor removed them automagically. The single ones are save to remove.

Sorry, yeah, my IDE removes trailing whitespace. Are you referencing the Markdown edits? I thought Markdown conversions compressed any whitespace (newlines or space) down to a single space. (Which is sad for me, because I'm one of the few double-space-per-sentence holdouts left...)

For windows builds the JSON should contain \ instead of / for the "path": element in JSON

I'm just using entry.absoluteFilePath here. I can scan through and see if I'm joining dir/files in the wrong way, though.

Make sure to apply the clang formatter rules of the project before PR-ing.

Yep, I did. Ran through the CONTRIBUTING doc. Hence the initial feature request.

The negating test on the not supported media file MANUAL should test according to the comment above. ;-)

Okay, let me take a look at that one.

Comment thread src/retroarch.cpp Outdated
Comment thread src/retroarch.cpp
Comment thread src/retroarch.h Outdated
Comment thread src/skyscraper.cpp Outdated
// types
if (config.frontend == "retroarch") {
const QString oldSubPath = "/" % config.platform;
const QString newSubPath = "/" % frontend->getPlatformOutputName();
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, yes, these are definitely *NIX path separators.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if there's anything to fix. AFAIK, Qt's file classes will keep forward slashes, even for Windows, eg: /C:/Roms/snes/game.zip. If there's any cross-platform compatibility to fix, it's likely at a lower-level, where QList<GameEntry> &gameEntries gets built.

Comment thread test/retroarch/test_retroarch.cpp
SineSwiper and others added 4 commits March 21, 2026 12:24
* Fix MARQUEE entry in retroarch.h
* Add more negative tests to testSupportedMedia
* Remove unnecessary path check in frontendExtra read
- read retroarch_dbname from peas.json instead from platforms_idmap.csv
- config.ini parameter fixed to accept -e from CLI as raExtra=
- always write PNG for cover/boxart, screenshot and wheel/logo, by using a compositor artwork file
- change "path" in target JSON from / to \\ for Windows
- display of Textures in CLI summary output hidden for frontend RA
- doc FRONTENDS,md updated
- fixed unit tests
- marked further FIXMEs in retroarch.cpp
@Gemba
Copy link
Copy Markdown
Owner

Gemba commented Apr 26, 2026

@SineSwiper I had to change a few things, most important changes are the move from platforms_id to peas for the RA DB Name and the CLI -e and config option (now raExtra=). The preservation of existing info should be fairly easy, as it boils down of "comparing" JSON data, but I am short on time to continue this.

@SineSwiper
Copy link
Copy Markdown
Author

This all looks good to me so far. I'll download it and try it out this weekend.

- known limitiations extended (doc)
- testcases updated
- inputfolder for RA always absolute
- moved some path logic from skyscraper.cpp to retroarch.cpp
@Gemba
Copy link
Copy Markdown
Owner

Gemba commented May 5, 2026

Some more adjustments: Preserve values of existing playlist and require that the inputFolder= is always absolute.

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.

2 participants