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
Skip mame bios/devices #432
Conversation
@joolswills New attempt after the my old PR #329, when mame stuff was hardcoded. |
I'm happy to merge this if others are. |
I'm not, first off it has changes that is pure code style changes, to one that is not matching how ES style is. I would advice against a merge until all these issues are adressed. |
Sorry. I missed the styling issues - I agree with your comments @tomaz82 |
es-app/src/SystemData.cpp
Outdated
@@ -112,7 +112,8 @@ void SystemData::populateFolder(FileData* folder) | |||
continue; | |||
|
|||
FileData* newGame = new FileData(GAME, filePath, mEnvData, this); | |||
folder->addChild(newGame); | |||
if(!newGame->isArcadeAsset()) | |||
folder->addChild(newGame); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent
es-core/src/MameNames.cpp
Outdated
std::string xmlpath = ResourceManager::getInstance()->getResourcePath(":/mamenames.xml"); | ||
|
||
if(!Utils::FileSystem::exists(xmlpath)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated whitespace changes.
resources/mamedevices.xml
Outdated
<device>dmv_k235</device> | ||
<device>mc1502_rom</device> | ||
<device>ql_pcmlqdi</device> | ||
<device>gfxultrp</device> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no newlines at eof in xmls
es-core/src/MameNames.h
Outdated
static void deinit (); | ||
static MameNames* getInstance(); | ||
const bool isAsset (const std::string& _mameName); | ||
std::string getRealName(const std::string& _mameName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for styling changes here. if you think the indent is wrong, it can be done as a separate later commit.
Oh my, for some reason atom gone crazy with tabs (it should replace by 2 spaces). Let me fix all pointed issues. |
Using tabs is correct for the ES sources. |
While working in the fix, I can see the existing mamenames.xml has no newline at eof. Should I add to it too? |
@tomaz82 Why not, then, use the standard |
258aeee
to
93956ab
Compare
Ok, I've made all requested fixes using |
@raelgc because that "standard" std::binary_search still requires algorithm included ( which most likely will include even more headers ) which is pointless when we have a fast search algorithm there already. |
But we already have |
I never said you should write your own, I said you should use the one VERY similar to the one we have in getRealName, it's your way of thinking about code that had ES take 50+ minutes to compile on the RPi3 before I optimized it down to less than 10 minutes. |
Interesting @tomaz82, I was not aware of the compilation time. Thanks for explaining. It's a really fare argument! In defense of the Just to share: for someone using Atom and the breaking styling: I gone to Preferences > Editor and disable |
@raelgc I understand, but what other files do, doesn't affect the compiletime of this file. |
@tomaz82 Sure, I'll work on this. |
@tomaz82 Just pushed the separated list for bios and device! :) |
@joolswills and @tomaz82: is it good to go now? |
@pjft Do you mind to test and give any feedback? Expected result is to not see mame devices in the gamelist, by example, |
Hi. I don't have much time this week, apologies. I'll give it a go when I have the chance, but I suspect the main feedback here/green light would have to come from @tomaz82 as he's the one who had specific concerns about the code and libraries being used. I see you're still including , which I believe was one of the concerns @tomaz82 raised, unless I missed something else here. |
I'm still waiting for the requested changes |
@tomaz82 Just removed |
So, I had a few moments today and compiled this and tested. Still, the BIOS files still show up on my arcade set. Am I meant to enable one option? At least neogeo.zip and pgm.zip show up. |
Well, see if it could be applied in a single place then - I'm not especially fond of the idea of duplicating logic unless really necessary. Thanks. |
@pjft I just pushed a change to prevent arcade assets get read from gamelist.xml. When you have some free time, please, can you test again? |
es-app/src/Gamelist.cpp
Outdated
@@ -128,11 +133,11 @@ void parseGamelist(SystemData* system) | |||
//load the metadata | |||
std::string defaultName = file->metadata.get("name"); | |||
file->metadata = MetaDataList::createFromXML(GAME_METADATA, fileNode, relativeTo); | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary whitespace added
es-app/src/Gamelist.cpp
Outdated
//make sure name gets set if one didn't exist | ||
if(file->metadata.get("name").empty()) | ||
file->metadata.set("name", defaultName); | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary whitespace added
es-app/src/SystemData.cpp
Outdated
if(!newGame->isArcadeAsset()) | ||
{ | ||
folder->addChild(newGame); | ||
isGame = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing tabs
@jrassa Just made the requested changes. |
Hi! I'm so sorry for the delay, and also for the update. For some reason, they are still showing. I'm running the binary from commit from 2 days ago :/ The resources from the gamelists are still showing somehow - at least neogeo.zip and pgm.zip . |
@pjft Sounds like I'm still missing some other entry points. Any chance your ES is configured to something different than the default? I mean, a filter applied from our tests on the improved Kids mode, something like that? |
I don't expect that to be the case, but I'll look into it in the coming days and get back to you. |
@pjft Just to share: I tested both cases (mame assets outside the gamelist), and later manually added assets in the Just wondering which is the difference between our setups. For this reason I'm mentioning the filters. But of course, can be other features. |
es-app/src/FileData.cpp
Outdated
const bool FileData::isArcadeAsset() | ||
{ | ||
const std::string stem = Utils::FileSystem::getStem(mPath); | ||
return ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing space here, it seems?
es-app/src/Gamelist.cpp
Outdated
treeNode->addChild(file); | ||
|
||
// skipping arcade assets from gamelist | ||
if(!treeNode->isArcadeAsset()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that in my scenario, it does not go through here.
es-app/src/Gamelist.cpp
Outdated
treeNode->addChild(file); | ||
|
||
// skipping arcade assets from gamelist | ||
if(!treeNode->isArcadeAsset()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's your error. treeNode will be the parent folder in this case. You probably want to run this check against "file", which is the newly-created file.
That being said, I'm not fully comfortable with the idea of even creating a FileData object if we're going to discard it - I'd rather only create it if we're going to use it, otherwise make sure to return NULL - and see if we don't crash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pjft First: thank you for your time and patience.
I just pushed the requested changes but not yet the NULL
return (before double check with you).
If I return NULL, it'll not crash, but it'll produce this output:
lvl0: Error finding/creating FileData for "/home/rael/RetroPie/roms/neogeo/neogeo.zip", skipping.`
Returning the FileData
, no error output.
How should I proceed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd leave a definitive answer for others to chime in on, but in my perspective I'm not wholly bothered by that warning. The alternative is to create FileData objects that are dangling without a parent, take up memory, and never get explicitly removed. I'd imagine there'd be some edge case where that'd come and bite us back.
But if anyone else has any recommendation or preference, I'd happily take that.
@pjft Sorry for the long time away from this. But how about now? I'm avoiding the error message and avoiding create any additional metadata with the |
Seems to work well, from my brief testing. |
@tomaz82 and @joolswills I think we're good to go now (i.e., I've addressed all issues pointed by you guys, thanks for that). |
@joolswills: in the last weeks, I just got playing with settings and thinking about you've said about performance and focus on Raspberry devices. And probably today the only "annoying" BIOS we have displayed in the gamelist is usually So, in a second moment, I'm no more inclined to include all this overhead that my PR will produce just to handle few files we can easily get hidden. What do you think? |
i still think the PR is a good idea. all other ways of hiding BIOS files need manual intervention from the user. neogeo.zip is needed in the roms folder for MAME cores, and it's not the only BIOS file needed in MAME - 2003 also needs skns, pgm, and taitofx1. later versions of MAME will have need even more BIOS files. fbalpha has neogeo.zip (which can be hidden via the BIOS folder, but that requires manual intervention by the user, and knowledge of that niche behaviour), but it also requires isgsm, nmk004, pgm, skns, and ym2608. |
Well, in any case, I just squashed the commits. |
I'm going to merge this unless anyone has an issue |
Thanks for your work on this. |
Skip mame bios/devices
New attempt as now mame files were moved to external files.