Skip to content

Commit 71700bd

Browse files
committed
Added <theme> tag to es_systems.cfg.
1 parent 0b83c7d commit 71700bd

File tree

4 files changed

+47
-25
lines changed

4 files changed

+47
-25
lines changed

README.md

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@ EmulationStation
33

44
A cross-platform graphical front-end for emulators with controller navigation.
55

6+
Project website: http://emulationstation.org
7+
68
**Raspberry Pi users:**
79
A cool guy named petrockblog made a script which automatically installs many emulators and ES. It also includes options for configuring your RPi and setting it up to boot directly into ES. You can find it here: https://github.com/petrockblog/RetroPie-Setup
810

11+
Download
12+
========
13+
14+
Download a pre-compiled version at [emulationstation.org](http://emulationstation.org#download).
15+
16+
917
I found a bug! I have a problem!
1018
================================
1119

@@ -33,21 +41,20 @@ EmulationStation has a few dependencies. For building, you'll need SDL2, Boost (
3341
**On Debian/Ubuntu:**
3442
All of this be easily installed with apt-get:
3543
```bash
36-
sudo apt-get install libsdl2-dev libboost-dev libboost-system-dev libboost-filesystem-dev libboost-date-time-dev libfreeimage-dev libfreetype6-dev libeigen3-dev libcurl-dev libasound2-dev
44+
sudo apt-get install libsdl2-dev libboost-system-dev libboost-filesystem-dev libboost-date-time-dev libfreeimage-dev libfreetype6-dev libeigen3-dev libcurl4-openssl-dev libasound2-dev libgl1-mesa-dev
3745
```
3846

39-
Unless you're on the Raspberry Pi, you'll also need OpenGL:
40-
```bash
41-
sudo apt-get install libgl1-mesa-dev
42-
```
43-
44-
**Generate and Build Makefile with CMake:**
47+
Then, generate and build the Makefile with CMake:
4548
```bash
4649
cd YourEmulationStationDirectory
4750
cmake .
4851
make
4952
```
5053

54+
**On the Raspberry Pi:**
55+
56+
Complete Raspberry Pi build instructions at [emulationstation.org](http://emulationstation.org/gettingstarted.html#install_rpi_standalone).
57+
5158
**On Windows:**
5259

5360
[Boost](http://www.boost.org/users/download/) (you'll need to compile yourself or get the pre-compiled binaries)
@@ -62,7 +69,7 @@ make
6269

6370
[CURL](http://curl.haxx.se/download.html) (you'll need to compile or get the pre-compiled (DLL version))
6471

65-
(remember to copy necessary .DLLs into the same folder as the executable: FreeImage.dll, freetype6.dll, SDL2.dll, and zlib1.dll)
72+
(remember to copy necessary .DLLs into the same folder as the executable: FreeImage.dll, freetype6.dll, SDL2.dll, libcurl.dll, and zlib1.dll)
6673

6774
[CMake](http://www.cmake.org/cmake/resources/software.html) (this is used for generating the Visual Studio project)
6875

@@ -73,12 +80,10 @@ Configuring
7380
===========
7481

7582
**~/.emulationstation/es_systems.cfg:**
76-
When first run, an example systems configuration file will be created at $HOME/.emulationstation/es_systems.cfg. This example has some comments explaining how to write the configuration file, and an example RetroArch launch command. See the "Writing an es_systems.cfg" section for more information.
83+
When first run, an example systems configuration file will be created at `~/.emulationstation/es_systems.cfg`. `~` is `$HOME` on Linux, and `%HOMEPATH%` on Windows. This example has some comments explaining how to write the configuration file. See the "Writing an es_systems.cfg" section for more information.
7784

7885
**Keep in mind you'll have to set up your emulator separately from EmulationStation!**
7986

80-
After you launch a game, EmulationStation will return once your system's command terminates (i.e. your emulator closes).
81-
8287
**~/.emulationstation/es_input.cfg:**
8388
When you first start EmulationStation, you will be prompted to configure an input device. The process is thus:
8489

@@ -94,7 +99,7 @@ The new configuration will be added to the `~/.emulationstation/es_input.cfg` fi
9499

95100
**Both new and old devices can be (re)configured at any time by pressing the Start button and choosing "CONFIGURE INPUT".** From here, you may unplug the device you used to open the menu and plug in a new one, if necessary. New devices will be appended to the existing input configuration file, so your old devices will remain configured.
96101

97-
**If things stop working, you can delete the `~/.emulationstation/es_input.cfg` file to make the input configuration screen reappear on next run.**
102+
**If your controller stops working, you can delete the `~/.emulationstation/es_input.cfg` file to make the input configuration screen re-appear on next run.**
98103

99104

100105
You can use `--help` or `-h` to view a list of command-line options. Briefly outlined here:
@@ -115,6 +120,8 @@ As long as ES hasn't frozen, you can always press F4 to close the application.
115120
Writing an es_systems.cfg
116121
=========================
117122

123+
Complete configuration instructions at [emulationstation.org](http://emulationstation.org/gettingstarted.html#config).
124+
118125
The `es_systems.cfg` file contains the system configuration data for EmulationStation, written in XML. This tells EmulationStation what systems you have, what platform they correspond to (for scraping), and where the games are located.
119126

120127
ES will check two places for an es_systems.cfg file, in the following order, stopping after it finds one that works:
@@ -135,27 +142,31 @@ All systems must be contained within the <systemList> tag.-->
135142
<!-- Here's an example system to get you started. -->
136143
<system>
137144
<!-- A short name, used internally. -->
138-
<name>SNES</name>
145+
<name>snes</name>
139146

140147
<!-- A "pretty" name, displayed in the menus and such. This one is optional. -->
141148
<fullname>Super Nintendo Entertainment System</fullname>
142149

143-
<!-- The path to start searching for ROMs in. '~' will be expanded to $HOME or $HOMEPATH, depending on platform.
150+
<!-- The path to start searching for ROMs in. '~' will be expanded to $HOME or %HOMEPATH%, depending on platform.
144151
All subdirectories (and non-recursive links) will be included. -->
145152
<path>~/roms/snes</path>
146153

147154
<!-- A list of extensions to search for, delimited by any of the whitespace characters (", \r\n\t").
148155
You MUST include the period at the start of the extension! It's also case sensitive. -->
149156
<extension>.smc .sfc .SMC .SFC</extension>
150157

151-
<!-- The shell command executed when a game is selected. A few special tags are replaced if found in a command, like %ROM%. -->
158+
<!-- The shell command executed when a game is selected. A few special tags are replaced if found in a command, like %ROM% (see below). -->
152159
<command>snesemulator %ROM%</command>
153160
<!-- This example would run the bash command "snesemulator /home/user/roms/snes/Super\ Mario\ World.sfc". -->
154161

155162
<!-- The platform(s) to use when scraping. You can see the full list of accepted platforms in src/PlatformIds.cpp.
156163
It's case sensitive, but everything is lowercase. This tag is optional.
157-
You can use multiple platforms too, delimited with any of the whitespace characters (", \r\n\t"), eg: "<platform>genesis, megadrive</platform>" -->
164+
You can use multiple platforms too, delimited with any of the whitespace characters (", \r\n\t"), eg: "genesis, megadrive" -->
158165
<platform>snes</platform>
166+
167+
<!-- The theme to load from the current theme set. See THEMES.md for more information.
168+
This tag is optional; if not set, it will use the value of <name>. -->
169+
<theme>snes</theme>
159170
</system>
160171
</systemList>
161172
```

THEMES.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ If that file doesn't exist, ES will try to find the theme in the current **theme
3232
The theme set system makes it easy for users to try different themes and allows distributions to include multiple theme options. Users can change the currently active theme set in the "UI Settings" menu. The option is only visible if at least one theme set exists.
3333

3434
There are two places ES can load theme sets from:
35-
* `[HOME]/.emulationstation/themes/[CURRENT_THEME_SET]/[SYSTEM_NAME]/theme.xml`
36-
* `/etc/emulationstation/themes/[CURRENT_THEME_SET]/[SYSTEM_NAME]/theme.xml`
35+
* `[HOME]/.emulationstation/themes/[CURRENT_THEME_SET]/[SYSTEM_THEME]/theme.xml`
36+
* `/etc/emulationstation/themes/[CURRENT_THEME_SET]/[SYSTEM_THEME]/theme.xml`
37+
38+
`[SYSTEM_THEME]` is the `<theme>` tag for the system, as defined in `es_systems.cfg`. If the `<theme>` tag is not set, ES will use the system's `<name>`.
3739

3840
If both files happen to exist, ES will pick the first one (the one located in the home directory).
3941

src/SystemData.cpp

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ std::vector<SystemData*> SystemData::sSystemVector;
1818
namespace fs = boost::filesystem;
1919

2020
SystemData::SystemData(const std::string& name, const std::string& fullName, const std::string& startPath, const std::vector<std::string>& extensions,
21-
const std::string& command, const std::vector<PlatformIds::PlatformId>& platformIds)
21+
const std::string& command, const std::vector<PlatformIds::PlatformId>& platformIds, const std::string& themeFolder)
2222
{
2323
mName = name;
2424
mFullName = fullName;
@@ -34,6 +34,7 @@ SystemData::SystemData(const std::string& name, const std::string& fullName, con
3434
mSearchExtensions = extensions;
3535
mLaunchCommand = command;
3636
mPlatformIds = platformIds;
37+
mThemeFolder = themeFolder;
3738

3839
mRootFolder = new FileData(FOLDER, mStartPath, this);
3940
mRootFolder->metadata.set("name", mFullName);
@@ -254,7 +255,7 @@ bool SystemData::loadConfig()
254255

255256
for(pugi::xml_node system = systemList.child("system"); system; system = system.next_sibling("system"))
256257
{
257-
std::string name, fullname, path, cmd;
258+
std::string name, fullname, path, cmd, themeFolder;
258259
PlatformIds::PlatformId platformId = PlatformIds::PLATFORM_UNKNOWN;
259260

260261
name = system.child("name").text().get();
@@ -290,6 +291,9 @@ bool SystemData::loadConfig()
290291
platformIds.push_back(platformId);
291292
}
292293

294+
// theme folder
295+
themeFolder = system.child("theme").text().as_string(name.c_str());
296+
293297
//validate
294298
if(name.empty() || path.empty() || extensions.empty() || cmd.empty())
295299
{
@@ -301,7 +305,7 @@ bool SystemData::loadConfig()
301305
boost::filesystem::path genericPath(path);
302306
path = genericPath.generic_string();
303307

304-
SystemData* newSys = new SystemData(name, fullname, path, extensions, cmd, platformIds);
308+
SystemData* newSys = new SystemData(name, fullname, path, extensions, cmd, platformIds, themeFolder);
305309
if(newSys->getRootFolder()->getChildren().size() == 0)
306310
{
307311
LOG(LogWarning) << "System \"" << name << "\" has no games! Ignoring it.";
@@ -328,7 +332,7 @@ void SystemData::writeExampleConfig(const std::string& path)
328332
" <!-- A short name, used internally. Traditionally lower-case. -->\n"
329333
" <name>nes</name>\n"
330334
"\n"
331-
" <!-- A \"pretty\" name, displayed in the header and such. -->\n"
335+
" <!-- A \"pretty\" name, displayed in menus and such. -->\n"
332336
" <fullname>Nintendo Entertainment System</fullname>\n"
333337
"\n"
334338
" <!-- The path to start searching for ROMs in. '~' will be expanded to $HOME on Linux or %HOMEPATH% on Windows. -->\n"
@@ -346,9 +350,12 @@ void SystemData::writeExampleConfig(const std::string& path)
346350
"\n"
347351
" <!-- The platform to use when scraping. You can see the full list of accepted platforms in src/PlatformIds.cpp.\n"
348352
" It's case sensitive, but everything is lowercase. This tag is optional.\n"
349-
" You can use multiple platforms too, delimited with any of the whitespace characters (\", \\r\\n\\t\"), eg: \"<platform>genesis, megadrive</platform>\" -->\n"
353+
" You can use multiple platforms too, delimited with any of the whitespace characters (\", \\r\\n\\t\"), eg: \"genesis, megadrive\" -->\n"
350354
" <platform>nes</platform>\n"
351355
"\n"
356+
" <!-- The theme to load from the current theme set. See THEMES.md for more information.\n"
357+
" This tag is optional. If not set, it will default to the value of <name>. -->\n"
358+
" <theme>nes</theme>\n"
352359
" </system>\n"
353360
"</systemList>\n";
354361

@@ -404,7 +411,7 @@ std::string SystemData::getThemePath() const
404411
return localThemePath.generic_string();
405412

406413
// not in game folder, try theme sets
407-
return ThemeData::getThemeFromCurrentSet(mName).generic_string();
414+
return ThemeData::getThemeFromCurrentSet(mThemeFolder).generic_string();
408415
}
409416

410417
bool SystemData::hasGamelist() const

src/SystemData.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ class SystemData
1212
{
1313
public:
1414
SystemData(const std::string& name, const std::string& fullName, const std::string& startPath, const std::vector<std::string>& extensions,
15-
const std::string& command, const std::vector<PlatformIds::PlatformId>& platformIds);
15+
const std::string& command, const std::vector<PlatformIds::PlatformId>& platformIds, const std::string& themeFolder);
1616
~SystemData();
1717

1818
inline FileData* getRootFolder() const { return mRootFolder; };
1919
inline const std::string& getName() const { return mName; }
2020
inline const std::string& getFullName() const { return mFullName; }
2121
inline const std::string& getStartPath() const { return mStartPath; }
2222
inline const std::vector<std::string>& getExtensions() const { return mSearchExtensions; }
23+
inline const std::string& getThemeFolder() const { return mThemeFolder; }
2324

2425
inline const std::vector<PlatformIds::PlatformId>& getPlatformIds() const { return mPlatformIds; }
2526
inline bool hasPlatformId(PlatformIds::PlatformId id) { return std::find(mPlatformIds.begin(), mPlatformIds.end(), id) != mPlatformIds.end(); }
@@ -70,6 +71,7 @@ class SystemData
7071
std::vector<std::string> mSearchExtensions;
7172
std::string mLaunchCommand;
7273
std::vector<PlatformIds::PlatformId> mPlatformIds;
74+
std::string mThemeFolder;
7375
std::shared_ptr<ThemeData> mTheme;
7476

7577
void populateFolder(FileData* folder);

0 commit comments

Comments
 (0)