Skip to content

Commit f3fd88f

Browse files
authored
Merge branch 'RetroPie:master' into master
2 parents 8faed5f + fc66fd7 commit f3fd88f

11 files changed

+8998
-3516
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ sudo dnf install SDL2-devel freeimage-devel freetype-devel curl-devel \
2929
vlc-devel rapidjson-devel
3030
```
3131

32+
Optionaly, `pugixml` can be installed and used (Debian package: `libpugixml-dev`, Fedora/SuSE package: `pugixml-devel`), but EmulationStation can use its own included copy if not found.
33+
3234
**Note**: this repository uses a git submodule - to checkout the source and all submodules, use
3335

3436
```bash

es-app/src/Gamelist.cpp

+15-4
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,12 @@ FileData* findOrCreateFile(SystemData* system, const std::string& path, FileType
5656

5757
FileData* file = new FileData(type, path, system->getSystemEnvData(), system);
5858

59-
// skipping arcade assets from gamelist
60-
if(!file->isArcadeAsset())
59+
// skipping arcade assets from gamelist and add only to filesystem
60+
// (fs) folders, i.e. entriess in gamelist with <folder/> and not to
61+
// fs-folders which are marked as <game/> in gamelist. NB:
62+
// treeNode's type (=parent) is determined by the element in the
63+
// gamelist and not by the fs-type.
64+
if(!file->isArcadeAsset() && treeNode->getType() == FOLDER)
6165
{
6266
treeNode->addChild(file);
6367
}
@@ -74,7 +78,14 @@ FileData* findOrCreateFile(SystemData* system, const std::string& path, FileType
7478
LOG(LogWarning) << "gameList: folder " << absFolder << " absent on fs, no FileData object created. Do remove leftover in gamelist.xml to remediate this warning.";
7579
return NULL;
7680
}
77-
81+
// discard constellations like scummvm/game.svm/game.svm as
82+
// scummvm/game.svm/ is a GAME and not a FOLDER
83+
if (treeNode->getType() == GAME)
84+
{
85+
std::string absFolder = Utils::FileSystem::getAbsolutePath(pathSegment, systemPath);
86+
LOG(LogWarning) << "gameList: trying to add game '" << absFolder << "' to a parent <game/> entry is invalid, no FileData object created. Do remove nested <game/> in gamelist.xml to remediate this warning.";
87+
return NULL;
88+
}
7889
// create folder filedata object
7990
std::string absPath = Utils::FileSystem::resolveRelativePath(treeNode->getPath() + "/" + pathSegment, systemPath, false, true);
8091
FileData* folder = new FileData(FOLDER, absPath, system->getSystemEnvData(), system);
@@ -152,7 +163,7 @@ void parseGamelist(SystemData* system)
152163
else if(!file->isArcadeAsset())
153164
{
154165
std::string defaultName = file->metadata.get("name");
155-
file->metadata = MetaDataList::createFromXML(i == 0 ? GAME_METADATA : FOLDER_METADATA, fileNode, relativeTo);
166+
file->metadata = MetaDataList::createFromXML(file->getType() == GAME ? GAME_METADATA : FOLDER_METADATA, fileNode, relativeTo);
156167

157168
//make sure name gets set if one didn't exist
158169
if(file->metadata.get("name").empty())

es-app/src/MetaData.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ MetaDataDecl gameDecls[] = {
1414
{"video", MD_PATH , "", false, "video", "enter path to video"},
1515
{"marquee", MD_PATH, "", false, "marquee", "enter path to marquee"},
1616
{"thumbnail", MD_PATH, "", false, "thumbnail", "enter path to thumbnail"},
17-
{"rating", MD_RATING, "0.000000", false, "rating", "enter rating"},
17+
{"rating", MD_RATING, "0", false, "rating", "enter rating"},
1818
{"releasedate", MD_DATE, "not-a-date-time", false, "release date", "enter release date"},
1919
{"developer", MD_STRING, "unknown", false, "developer", "enter game developer"},
2020
{"publisher", MD_STRING, "unknown", false, "publisher", "enter game publisher"},
@@ -42,7 +42,7 @@ MetaDataDecl folderDecls[] = {
4242
{"thumbnail", MD_PATH, "", false, "thumbnail", "enter path to thumbnail"},
4343
{"video", MD_PATH, "", false, "video", "enter path to video"},
4444
{"marquee", MD_PATH, "", false, "marquee", "enter path to marquee"},
45-
{"rating", MD_RATING, "", false, "rating", "enter rating"},
45+
{"rating", MD_RATING, "0", false, "rating", "enter rating"},
4646
{"releasedate", MD_DATE, blankDate(), true, "release date", "enter release date"},
4747
{"developer", MD_STRING, "", false, "developer", "enter game developer"},
4848
{"publisher", MD_STRING, "", false, "publisher", "enter game publisher"},

es-app/src/SystemScreenSaver.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ void SystemScreenSaver::handleScreenSaverEditingCollection()
205205
{
206206
// we're exiting the screensaver, restore the currently actively editing collection
207207
CollectionSystemManager::get()->exitEditMode(true);
208-
if (mRegularEditingCollection != "Favorites")
208+
if (mRegularEditingCollection != "Favorites" && mRegularEditingCollection != "")
209209
CollectionSystemManager::get()->setEditMode(mRegularEditingCollection, true);
210210
mRegularEditingCollection = "";
211211
}

es-app/src/guis/GuiMetaDataEd.cpp

+34-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "guis/GuiMetaDataEd.h"
22

3+
#include <stdlib.h>
34
#include "components/ButtonComponent.h"
45
#include "components/ComponentList.h"
56
#include "components/DateTimeComponent.h"
@@ -19,6 +20,7 @@
1920
#include "FileFilterIndex.h"
2021
#include "SystemData.h"
2122
#include "Window.h"
23+
#include "Log.h"
2224

2325
GuiMetaDataEd::GuiMetaDataEd(Window* window, MetaDataList* md, const std::vector<MetaDataDecl>& mdd, ScraperSearchParams scraperParams,
2426
const std::string& /*header*/, std::function<void()> saveCallback, std::function<void()> deleteFunc) : GuiComponent(window),
@@ -267,19 +269,48 @@ void GuiMetaDataEd::close(bool closeAllWindows)
267269
}
268270
}
269271

270-
bool GuiMetaDataEd::hasChanges()
272+
bool GuiMetaDataEd::hasChanges()
271273
{
272274
assert(mMetaDataDecl.size() >= mEditors.size());
273275
// find out if the user made any changes
274276
int edIdx = 0;
275277
for(auto &mdd : mMetaDataDecl)
276278
{
277-
if(!mdd.isStatistic && mMetaData->get(mdd.key) != mEditors.at(edIdx++)->getValue())
278-
return true;
279+
if(!mdd.isStatistic)
280+
{
281+
std::string gamelistVal = mMetaData->get(mdd.key);
282+
std::string editorVal = mEditors.at(edIdx++)->getValue();
283+
if (mdd.key == "rating")
284+
{
285+
// needed to catch "0", "0.0" or ".<d>" (and "1.0") from gamelist string rating
286+
// getValue() of RatingComponent returns "0" for floats 0, 0.0; "0.<d>" for .<d>
287+
// and "1" for float 1.0
288+
// convert to float and compare to avoid false "Save Changes" prompt
289+
bool ok;
290+
if (to_float(gamelistVal, ok) != to_float(editorVal, ok))
291+
return true;
292+
}
293+
else
294+
{
295+
// string compare
296+
if (gamelistVal != editorVal)
297+
return true;
298+
}
299+
}
279300
}
280301
return false;
281302
}
282303

304+
float GuiMetaDataEd::to_float(const std::string& str, bool& ok)
305+
{
306+
errno = 0;
307+
char* end = nullptr;
308+
float f = std::strtof(str.c_str(), &end);
309+
ok = !str.empty() && !*end && errno == 0;
310+
if (!ok)
311+
LOG(LogWarning) << "Conversion of input string '" << str << "' to float failed or is incomplete. Return value: " << f;
312+
return f;
313+
}
283314

284315
bool GuiMetaDataEd::input(InputConfig* config, Input input)
285316
{

es-app/src/guis/GuiMetaDataEd.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "GuiComponent.h"
99
#include "MetaData.h"
1010

11+
1112
class ComponentList;
1213
class TextComponent;
1314

@@ -26,7 +27,8 @@ class GuiMetaDataEd : public GuiComponent
2627
void fetch();
2728
void fetchDone(const ScraperSearchResult& result);
2829
void close(bool closeAllWindows);
29-
bool hasChanges();
30+
bool hasChanges();
31+
float to_float(const std::string& str, bool& ok);
3032

3133
NinePatchComponent mBackground;
3234
ComponentGrid mGrid;

es-core/src/HttpReq.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,13 @@ HttpReq::HttpReq(const std::string& url)
7777
}
7878

7979
//set curl restrict redirect protocols
80+
//starting with 7.85.0, CURLOPT_REDIR_PROTOCOLS is deprecated
81+
// and CURLOPT_REDIR_PROTOCOLS_STR should be used instead
82+
#if CURL_AT_LEAST_VERSION(7,85,0)
83+
err = curl_easy_setopt(mHandle, CURLOPT_REDIR_PROTOCOLS_STR, "http,https");
84+
#else
8085
err = curl_easy_setopt(mHandle, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
86+
#endif
8187
if(err != CURLE_OK)
8288
{
8389
mStatus = REQ_IO_ERROR;

resources/mamebioses.xml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Generated on 2022-02-11, from MAME 0.240 (Arcade).dat, fbneo.dat, mame2003-plus.xml -->
1+
<!-- Generated on 2024-02-22, from MAME 0.262 (arcade).dat, fbneo.dat, mame2003-plus.xml -->
22
<bios>3dobios</bios>
33
<bios>acpsx</bios>
44
<bios>airlbios</bios>
@@ -9,6 +9,7 @@
99
<bios>ar_bios</bios>
1010
<bios>aristmk5</bios>
1111
<bios>aristmk6</bios>
12+
<bios>aristmk7</bios>
1213
<bios>atarisy1</bios>
1314
<bios>awbios</bios>
1415
<bios>bubsys</bios>
@@ -47,6 +48,7 @@
4748
<bios>konamigx</bios>
4849
<bios>konendev</bios>
4950
<bios>kpython</bios>
51+
<bios>kpython2</bios>
5052
<bios>kviper</bios>
5153
<bios>lindbios</bios>
5254
<bios>mac2bios</bios>
@@ -67,6 +69,7 @@
6769
<bios>nss</bios>
6870
<bios>pgm</bios>
6971
<bios>playch10</bios>
72+
<bios>pumpitup</bios>
7073
<bios>recel</bios>
7174
<bios>sammymdl</bios>
7275
<bios>segasp</bios>

0 commit comments

Comments
 (0)