mirror of
https://github.com/RetroPie/EmulationStation.git
synced 2025-04-02 10:41:48 -04:00
Compare commits
10 commits
17118a2e73
...
3d7ff867f2
Author | SHA1 | Date | |
---|---|---|---|
|
3d7ff867f2 | ||
|
51b6f4162d | ||
|
803bad626e | ||
|
6b4281ac9f | ||
|
894543cea6 | ||
|
d46f04a25b | ||
|
a7a9dec637 | ||
|
81c62c97ee | ||
|
75c01f73ab | ||
|
feab8293e5 |
12 changed files with 113 additions and 37 deletions
|
@ -248,6 +248,10 @@ All systems must be contained within the <systemList> tag.-->
|
||||||
You MUST include the period at the start of the extension! It's also case sensitive. -->
|
You MUST include the period at the start of the extension! It's also case sensitive. -->
|
||||||
<extension>.smc .sfc .SMC .SFC</extension>
|
<extension>.smc .sfc .SMC .SFC</extension>
|
||||||
|
|
||||||
|
<!-- A list of filenames to ignore, delimited by any of the whitespace characters (", \r\n\t").
|
||||||
|
You MUST wrap each filename in double quotes (since some filenames contain spaces). Not case sensitive. -->
|
||||||
|
<ignore>"filename1.bin" "filename2.iso" "filename3.zip"</ignore>
|
||||||
|
|
||||||
<!-- The shell command executed when a game is selected. A few special tags are replaced if found in a command, like %ROM% (see below). -->
|
<!-- The shell command executed when a game is selected. A few special tags are replaced if found in a command, like %ROM% (see below). -->
|
||||||
<command>snesemulator %ROM%</command>
|
<command>snesemulator %ROM%</command>
|
||||||
<!-- This example would run the bash command "snesemulator /home/user/roms/snes/Super\ Mario\ World.sfc". -->
|
<!-- This example would run the bash command "snesemulator /home/user/roms/snes/Super\ Mario\ World.sfc". -->
|
||||||
|
|
|
@ -45,6 +45,8 @@ CollectionSystemManager::CollectionSystemManager(Window* window) : mWindow(windo
|
||||||
mCollectionEnvData->mStartPath = "";
|
mCollectionEnvData->mStartPath = "";
|
||||||
std::vector<std::string> exts;
|
std::vector<std::string> exts;
|
||||||
mCollectionEnvData->mSearchExtensions = exts;
|
mCollectionEnvData->mSearchExtensions = exts;
|
||||||
|
std::vector<std::string> ignores;
|
||||||
|
mCollectionEnvData->mFilesToIgnore = ignores;
|
||||||
mCollectionEnvData->mLaunchCommand = "";
|
mCollectionEnvData->mLaunchCommand = "";
|
||||||
std::vector<PlatformIds::PlatformId> allPlatformIds;
|
std::vector<PlatformIds::PlatformId> allPlatformIds;
|
||||||
allPlatformIds.push_back(PlatformIds::PLATFORM_IGNORE);
|
allPlatformIds.push_back(PlatformIds::PLATFORM_IGNORE);
|
||||||
|
|
|
@ -92,6 +92,7 @@ namespace PlatformIds
|
||||||
"ti99",
|
"ti99",
|
||||||
"dragon32",
|
"dragon32",
|
||||||
"zmachine",
|
"zmachine",
|
||||||
|
"fmtowns",
|
||||||
|
|
||||||
"ignore", // do not allow scraping for this system
|
"ignore", // do not allow scraping for this system
|
||||||
"invalid"
|
"invalid"
|
||||||
|
|
|
@ -93,6 +93,7 @@ namespace PlatformIds
|
||||||
TI_99,
|
TI_99,
|
||||||
DRAGON32,
|
DRAGON32,
|
||||||
ZMACHINE,
|
ZMACHINE,
|
||||||
|
FMTOWNS,
|
||||||
|
|
||||||
PLATFORM_IGNORE, // do not allow scraping for this system
|
PLATFORM_IGNORE, // do not allow scraping for this system
|
||||||
PLATFORM_COUNT
|
PLATFORM_COUNT
|
||||||
|
|
|
@ -102,7 +102,12 @@ void SystemData::populateFolder(FileData* folder)
|
||||||
// skip hidden files and folders
|
// skip hidden files and folders
|
||||||
if(!showHidden && Utils::FileSystem::isHidden(filePath))
|
if(!showHidden && Utils::FileSystem::isHidden(filePath))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// skip ignored files and folders
|
||||||
|
std::string fileName = Utils::String::toLower(Utils::FileSystem::getFileName(filePath));
|
||||||
|
if(std::find(mEnvData->mFilesToIgnore.cbegin(), mEnvData->mFilesToIgnore.cend(), fileName) != mEnvData->mFilesToIgnore.cend())
|
||||||
|
continue;
|
||||||
|
|
||||||
//this is a little complicated because we allow a list of extensions to be defined (delimited with a space)
|
//this is a little complicated because we allow a list of extensions to be defined (delimited with a space)
|
||||||
//we first get the extension of the file itself:
|
//we first get the extension of the file itself:
|
||||||
extension = Utils::FileSystem::getExtension(filePath);
|
extension = Utils::FileSystem::getExtension(filePath);
|
||||||
|
@ -192,6 +197,27 @@ SystemData* SystemData::loadSystem(pugi::xml_node system)
|
||||||
extensions.push_back(xt);
|
extensions.push_back(xt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list.clear();
|
||||||
|
|
||||||
|
list = readList(system.child("ignore").text().get());
|
||||||
|
std::vector<std::string> ignores;
|
||||||
|
|
||||||
|
for (auto ignore = list.cbegin(); ignore != list.cend(); ignore++)
|
||||||
|
{
|
||||||
|
std::string ig = Utils::String::toLower(*ignore);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ig = Utils::String::replace(ig, "\"", "");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (std::find(ignores.begin(), ignores.end(), ig) == ignores.end())
|
||||||
|
ignores.push_back(ig);
|
||||||
|
}
|
||||||
|
|
||||||
|
list.clear();
|
||||||
|
|
||||||
cmd = system.child("command").text().get();
|
cmd = system.child("command").text().get();
|
||||||
|
|
||||||
// platform id list
|
// platform id list
|
||||||
|
@ -244,6 +270,7 @@ SystemData* SystemData::loadSystem(pugi::xml_node system)
|
||||||
SystemEnvironmentData* envData = new SystemEnvironmentData;
|
SystemEnvironmentData* envData = new SystemEnvironmentData;
|
||||||
envData->mStartPath = path;
|
envData->mStartPath = path;
|
||||||
envData->mSearchExtensions = extensions;
|
envData->mSearchExtensions = extensions;
|
||||||
|
envData->mFilesToIgnore = ignores;
|
||||||
envData->mLaunchCommand = cmd;
|
envData->mLaunchCommand = cmd;
|
||||||
envData->mPlatformIds = platformIds;
|
envData->mPlatformIds = platformIds;
|
||||||
|
|
||||||
|
@ -414,6 +441,10 @@ void SystemData::writeExampleConfig(const std::string& path)
|
||||||
" You MUST include the period at the start of the extension! It's also case sensitive. -->\n"
|
" You MUST include the period at the start of the extension! It's also case sensitive. -->\n"
|
||||||
" <extension>.nes .NES</extension>\n"
|
" <extension>.nes .NES</extension>\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
" <!-- A list of filenames to ignore, delimited by any of the whitespace characters (\", \\r\\n\\t\").\n"
|
||||||
|
" You MUST wrap each filename in double quotes (since some filenames contain spaces). Not case sensitive. -->\n"
|
||||||
|
" <ignore>\"filename1.bin\" \"filename2.iso\" \"filename3.zip\"</ignore>\n"
|
||||||
|
"\n"
|
||||||
" <!-- The shell command executed when a game is selected. A few special tags are replaced if found in a command:\n"
|
" <!-- The shell command executed when a game is selected. A few special tags are replaced if found in a command:\n"
|
||||||
" %ROM% is replaced by a bash-special-character-escaped absolute path to the ROM.\n"
|
" %ROM% is replaced by a bash-special-character-escaped absolute path to the ROM.\n"
|
||||||
" %BASENAME% is replaced by the \"base\" name of the ROM. For example, \"/foo/bar.rom\" would have a basename of \"bar\". Useful for MAME.\n"
|
" %BASENAME% is replaced by the \"base\" name of the ROM. For example, \"/foo/bar.rom\" would have a basename of \"bar\". Useful for MAME.\n"
|
||||||
|
|
|
@ -20,6 +20,7 @@ struct SystemEnvironmentData
|
||||||
{
|
{
|
||||||
std::string mStartPath;
|
std::string mStartPath;
|
||||||
std::vector<std::string> mSearchExtensions;
|
std::vector<std::string> mSearchExtensions;
|
||||||
|
std::vector<std::string> mFilesToIgnore;
|
||||||
std::string mLaunchCommand;
|
std::string mLaunchCommand;
|
||||||
std::vector<PlatformIds::PlatformId> mPlatformIds;
|
std::vector<PlatformIds::PlatformId> mPlatformIds;
|
||||||
};
|
};
|
||||||
|
@ -35,6 +36,7 @@ public:
|
||||||
inline const std::string& getFullName() const { return mFullName; }
|
inline const std::string& getFullName() const { return mFullName; }
|
||||||
inline const std::string& getStartPath() const { return mEnvData->mStartPath; }
|
inline const std::string& getStartPath() const { return mEnvData->mStartPath; }
|
||||||
inline const std::vector<std::string>& getExtensions() const { return mEnvData->mSearchExtensions; }
|
inline const std::vector<std::string>& getExtensions() const { return mEnvData->mSearchExtensions; }
|
||||||
|
inline const std::vector<std::string>& getFilesToIgnore() const { return mEnvData->mFilesToIgnore; }
|
||||||
inline const std::string& getThemeFolder() const { return mThemeFolder; }
|
inline const std::string& getThemeFolder() const { return mThemeFolder; }
|
||||||
inline SystemEnvironmentData* getSystemEnvData() const { return mEnvData; }
|
inline SystemEnvironmentData* getSystemEnvData() const { return mEnvData; }
|
||||||
inline const std::vector<PlatformIds::PlatformId>& getPlatformIds() const { return mEnvData->mPlatformIds; }
|
inline const std::vector<PlatformIds::PlatformId>& getPlatformIds() const { return mEnvData->mPlatformIds; }
|
||||||
|
|
|
@ -52,7 +52,18 @@ bool parseArgs(int argc, char* argv[])
|
||||||
|
|
||||||
for(int i = 1; i < argc; i++)
|
for(int i = 1; i < argc; i++)
|
||||||
{
|
{
|
||||||
if(strcmp(argv[i], "--resolution") == 0)
|
if(strcmp(argv[i], "--monitor") == 0)
|
||||||
|
{
|
||||||
|
if (i >= argc - 1)
|
||||||
|
{
|
||||||
|
std::cerr << "Invalid monitor supplied.";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int monitor = atoi(argv[i + 1]);
|
||||||
|
i++; // skip the argument value
|
||||||
|
Settings::getInstance()->setInt("MonitorID", monitor);
|
||||||
|
}else if(strcmp(argv[i], "--resolution") == 0)
|
||||||
{
|
{
|
||||||
if(i >= argc - 2)
|
if(i >= argc - 2)
|
||||||
{
|
{
|
||||||
|
@ -180,7 +191,9 @@ bool parseArgs(int argc, char* argv[])
|
||||||
"--screensize WIDTH HEIGHT for a canvas smaller than the full resolution,\n"
|
"--screensize WIDTH HEIGHT for a canvas smaller than the full resolution,\n"
|
||||||
" or if rotating into portrait mode\n"
|
" or if rotating into portrait mode\n"
|
||||||
"--screenoffset X Y move the canvas by x,y pixels\n"
|
"--screenoffset X Y move the canvas by x,y pixels\n"
|
||||||
|
"--fullscreen-borderless borderless fullscreen window\n"
|
||||||
"--windowed not fullscreen, should be used with --resolution\n"
|
"--windowed not fullscreen, should be used with --resolution\n"
|
||||||
|
"--monitor N monitor index (0-)\n"
|
||||||
"\nGame and settings visibility in ES and behaviour of ES:\n"
|
"\nGame and settings visibility in ES and behaviour of ES:\n"
|
||||||
"--force-disable-filters force the UI to ignore applied filters on\n"
|
"--force-disable-filters force the UI to ignore applied filters on\n"
|
||||||
" gamelist (p)\n"
|
" gamelist (p)\n"
|
||||||
|
|
|
@ -109,6 +109,7 @@ const std::map<PlatformId, std::string> gamesdb_new_platformid_map{
|
||||||
{ TRS80_COLOR_COMPUTER, "4941" },
|
{ TRS80_COLOR_COMPUTER, "4941" },
|
||||||
{ TI_99, "4953" },
|
{ TI_99, "4953" },
|
||||||
{ TANDY, "4941" },
|
{ TANDY, "4941" },
|
||||||
|
{ FMTOWNS, "4932" },
|
||||||
};
|
};
|
||||||
|
|
||||||
void thegamesdb_generate_json_scraper_requests(const ScraperSearchParams& params,
|
void thegamesdb_generate_json_scraper_requests(const ScraperSearchParams& params,
|
||||||
|
|
|
@ -100,7 +100,8 @@ const std::map<PlatformId, unsigned short> screenscraper_platformid_map{
|
||||||
{ TANDY, 144 },
|
{ TANDY, 144 },
|
||||||
{ TI_99, 205 },
|
{ TI_99, 205 },
|
||||||
{ DRAGON32, 91 },
|
{ DRAGON32, 91 },
|
||||||
{ ZMACHINE, 21 }
|
{ ZMACHINE, 21 },
|
||||||
|
{ FMTOWNS, 253 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,27 +13,28 @@ Settings* Settings::sInstance = NULL;
|
||||||
// these values are NOT saved to es_settings.xml
|
// these values are NOT saved to es_settings.xml
|
||||||
// since they're set through command-line arguments, and not the in-program settings menu
|
// since they're set through command-line arguments, and not the in-program settings menu
|
||||||
std::vector<const char*> settings_dont_save {
|
std::vector<const char*> settings_dont_save {
|
||||||
"Debug" ,
|
"Debug",
|
||||||
"DebugGrid" ,
|
"DebugGrid",
|
||||||
"DebugText" ,
|
"DebugText",
|
||||||
"DebugImage" ,
|
"DebugImage",
|
||||||
"ForceKid" ,
|
"ForceKid",
|
||||||
"ForceKiosk" ,
|
"ForceKiosk",
|
||||||
"IgnoreGamelist" ,
|
"IgnoreGamelist",
|
||||||
"HideConsole" ,
|
"HideConsole",
|
||||||
"ShowExit" ,
|
"ShowExit",
|
||||||
"ConfirmQuit" ,
|
"ConfirmQuit",
|
||||||
"SplashScreen" ,
|
"SplashScreen",
|
||||||
"VSync" ,
|
"VSync",
|
||||||
"FullscreenBorderless" ,
|
"FullscreenBorderless",
|
||||||
"Windowed" ,
|
"Windowed",
|
||||||
"WindowWidth" ,
|
"WindowWidth",
|
||||||
"WindowHeight" ,
|
"WindowHeight",
|
||||||
"ScreenWidth" ,
|
"ScreenWidth",
|
||||||
"ScreenHeight" ,
|
"ScreenHeight",
|
||||||
"ScreenOffsetX" ,
|
"ScreenOffsetX",
|
||||||
"ScreenOffsetY" ,
|
"ScreenOffsetY",
|
||||||
"ScreenRotate"
|
"ScreenRotate",
|
||||||
|
"MonitorID"
|
||||||
};
|
};
|
||||||
|
|
||||||
Settings::Settings()
|
Settings::Settings()
|
||||||
|
@ -178,6 +179,7 @@ void Settings::setDefaults()
|
||||||
mIntMap["ScreenOffsetX"] = 0;
|
mIntMap["ScreenOffsetX"] = 0;
|
||||||
mIntMap["ScreenOffsetY"] = 0;
|
mIntMap["ScreenOffsetY"] = 0;
|
||||||
mIntMap["ScreenRotate"] = 0;
|
mIntMap["ScreenRotate"] = 0;
|
||||||
|
mIntMap["MonitorID"] = 0;
|
||||||
|
|
||||||
mBoolMap["UseFullscreenPaging"] = false;
|
mBoolMap["UseFullscreenPaging"] = false;
|
||||||
|
|
||||||
|
|
|
@ -342,27 +342,39 @@ bool GuiInputConfig::filterTrigger(Input input, InputConfig* config, int inputId
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
// on Linux, some gamepads return both an analog axis and a digital button for the trigger;
|
// on Linux, some gamepads return both an analog axis and a digital button for the trigger;
|
||||||
// we want the analog axis only, so this function removes the button press event
|
// we want the analog axis only, so this function removes the button press event
|
||||||
|
bool isPlaystation = (
|
||||||
|
// match PlayStation joystick with 6 axes only
|
||||||
|
strstr(config->getDeviceName().c_str(), "PLAYSTATION") != NULL
|
||||||
|
|| strstr(config->getDeviceName().c_str(), "Sony Interactive") != NULL // Official dualshock 4
|
||||||
|
|| strstr(config->getDeviceName().c_str(), "PS3 Ga") != NULL
|
||||||
|
|| strstr(config->getDeviceName().c_str(), "PS(R) Ga") != NULL
|
||||||
|
// BigBen kid's PS3 gamepad 146b:0902, matched on SDL GUID because its name "Bigben Interactive Bigben Game Pad" may be too generic
|
||||||
|
|| strcmp(config->getDeviceGUIDString().c_str(), "030000006b1400000209000011010000") == 0
|
||||||
|
);
|
||||||
|
bool isAnbernic = (
|
||||||
|
strcmp(config->getDeviceGUIDString().c_str(), "03004ab1020500000913000010010000") == 0 // Anbernic RG P01 has same issue
|
||||||
|
);
|
||||||
|
|
||||||
if((
|
if((isPlaystation || isAnbernic)
|
||||||
// match PlayStation joystick with 6 axes only
|
&& InputManager::getInstance()->getAxisCountByDevice(config->getDeviceId()) == 6)
|
||||||
strstr(config->getDeviceName().c_str(), "PLAYSTATION") != NULL
|
|
||||||
|| strstr(config->getDeviceName().c_str(), "PS3 Ga") != NULL
|
|
||||||
|| strstr(config->getDeviceName().c_str(), "PS(R) Ga") != NULL
|
|
||||||
// BigBen kid's PS3 gamepad 146b:0902, matched on SDL GUID because its name "Bigben Interactive Bigben Game Pad" may be too generic
|
|
||||||
|| strcmp(config->getDeviceGUIDString().c_str(), "030000006b1400000209000011010000") == 0
|
|
||||||
) && InputManager::getInstance()->getAxisCountByDevice(config->getDeviceId()) == 6)
|
|
||||||
{
|
{
|
||||||
// digital triggers are unwanted
|
// digital triggers are unwanted
|
||||||
if(input.type == TYPE_BUTTON && (input.id == 6 || input.id == 7))
|
if((
|
||||||
|
(isPlaystation && (input.id == 6 || input.id == 7))
|
||||||
|
|| (isAnbernic && (input.id == 8 || input.id == 9))
|
||||||
|
) && input.type == TYPE_BUTTON)
|
||||||
{
|
{
|
||||||
mHoldingInput = false;
|
mHoldingInput = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore negative pole for axes 2/5 only when triggers are being configured
|
bool genericTrigger = !isAnbernic && (input.id == 2 || input.id == 5);
|
||||||
if(input.type == TYPE_AXIS && (input.id == 2 || input.id == 5))
|
bool anbernicTrigger = isAnbernic && (input.id == 4 || input.id == 5);
|
||||||
|
// ignore negative pole for axes only when triggers are being configured
|
||||||
|
if(input.type == TYPE_AXIS && (genericTrigger || anbernicTrigger))
|
||||||
{
|
{
|
||||||
|
|
||||||
if(strstr(GUI_INPUT_CONFIG_LIST[inputId].name, "Trigger") != NULL)
|
if(strstr(GUI_INPUT_CONFIG_LIST[inputId].name, "Trigger") != NULL)
|
||||||
{
|
{
|
||||||
if(input.value == 1)
|
if(input.value == 1)
|
||||||
|
|
|
@ -75,8 +75,14 @@ namespace Renderer
|
||||||
|
|
||||||
initialCursorState = (SDL_ShowCursor(0) != 0);
|
initialCursorState = (SDL_ShowCursor(0) != 0);
|
||||||
|
|
||||||
|
int displayIndex = Settings::getInstance()->getInt("MonitorID");
|
||||||
|
|
||||||
|
if(displayIndex < 0 || displayIndex >= SDL_GetNumVideoDisplays()){
|
||||||
|
displayIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
SDL_DisplayMode dispMode;
|
SDL_DisplayMode dispMode;
|
||||||
SDL_GetDesktopDisplayMode(0, &dispMode);
|
SDL_GetDesktopDisplayMode(displayIndex, &dispMode);
|
||||||
windowWidth = Settings::getInstance()->getInt("WindowWidth") ? Settings::getInstance()->getInt("WindowWidth") : dispMode.w;
|
windowWidth = Settings::getInstance()->getInt("WindowWidth") ? Settings::getInstance()->getInt("WindowWidth") : dispMode.w;
|
||||||
windowHeight = Settings::getInstance()->getInt("WindowHeight") ? Settings::getInstance()->getInt("WindowHeight") : dispMode.h;
|
windowHeight = Settings::getInstance()->getInt("WindowHeight") ? Settings::getInstance()->getInt("WindowHeight") : dispMode.h;
|
||||||
screenWidth = Settings::getInstance()->getInt("ScreenWidth") ? Settings::getInstance()->getInt("ScreenWidth") : windowWidth;
|
screenWidth = Settings::getInstance()->getInt("ScreenWidth") ? Settings::getInstance()->getInt("ScreenWidth") : windowWidth;
|
||||||
|
@ -89,7 +95,7 @@ namespace Renderer
|
||||||
|
|
||||||
const unsigned int windowFlags = (Settings::getInstance()->getBool("Windowed") ? 0 : (Settings::getInstance()->getBool("FullscreenBorderless") ? SDL_WINDOW_BORDERLESS : SDL_WINDOW_FULLSCREEN)) | getWindowFlags();
|
const unsigned int windowFlags = (Settings::getInstance()->getBool("Windowed") ? 0 : (Settings::getInstance()->getBool("FullscreenBorderless") ? SDL_WINDOW_BORDERLESS : SDL_WINDOW_FULLSCREEN)) | getWindowFlags();
|
||||||
|
|
||||||
if((sdlWindow = SDL_CreateWindow("EmulationStation", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, windowWidth, windowHeight, windowFlags)) == nullptr)
|
if((sdlWindow = SDL_CreateWindow("EmulationStation", SDL_WINDOWPOS_UNDEFINED_DISPLAY(displayIndex), SDL_WINDOWPOS_UNDEFINED_DISPLAY(displayIndex), windowWidth, windowHeight, windowFlags)) == nullptr)
|
||||||
{
|
{
|
||||||
LOG(LogError) << "Error creating SDL window!\n\t" << SDL_GetError();
|
LOG(LogError) << "Error creating SDL window!\n\t" << SDL_GetError();
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue