mirror of
https://github.com/RetroPie/EmulationStation.git
synced 2025-04-02 10:41:48 -04:00
Compare commits
9 commits
75ea3484a5
...
6d6ad38497
Author | SHA1 | Date | |
---|---|---|---|
|
6d6ad38497 | ||
|
51b6f4162d | ||
|
803bad626e | ||
|
6b4281ac9f | ||
|
894543cea6 | ||
|
d46f04a25b | ||
|
a7a9dec637 | ||
|
72892db014 | ||
|
d03b0e60c7 |
9 changed files with 93 additions and 43 deletions
|
@ -92,6 +92,7 @@ namespace PlatformIds
|
|||
"ti99",
|
||||
"dragon32",
|
||||
"zmachine",
|
||||
"fmtowns",
|
||||
|
||||
"ignore", // do not allow scraping for this system
|
||||
"invalid"
|
||||
|
|
|
@ -93,6 +93,7 @@ namespace PlatformIds
|
|||
TI_99,
|
||||
DRAGON32,
|
||||
ZMACHINE,
|
||||
FMTOWNS,
|
||||
|
||||
PLATFORM_IGNORE, // do not allow scraping for this system
|
||||
PLATFORM_COUNT
|
||||
|
|
|
@ -52,7 +52,18 @@ bool parseArgs(int argc, char* argv[])
|
|||
|
||||
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)
|
||||
{
|
||||
|
@ -182,6 +193,7 @@ bool parseArgs(int argc, char* argv[])
|
|||
"--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"
|
||||
"--monitor N monitor index (0-)\n"
|
||||
"\nGame and settings visibility in ES and behaviour of ES:\n"
|
||||
"--force-disable-filters force the UI to ignore applied filters on\n"
|
||||
" gamelist (p)\n"
|
||||
|
|
|
@ -109,6 +109,7 @@ const std::map<PlatformId, std::string> gamesdb_new_platformid_map{
|
|||
{ TRS80_COLOR_COMPUTER, "4941" },
|
||||
{ TI_99, "4953" },
|
||||
{ TANDY, "4941" },
|
||||
{ FMTOWNS, "4932" },
|
||||
};
|
||||
|
||||
void thegamesdb_generate_json_scraper_requests(const ScraperSearchParams& params,
|
||||
|
|
|
@ -100,7 +100,8 @@ const std::map<PlatformId, unsigned short> screenscraper_platformid_map{
|
|||
{ TANDY, 144 },
|
||||
{ TI_99, 205 },
|
||||
{ DRAGON32, 91 },
|
||||
{ ZMACHINE, 21 }
|
||||
{ ZMACHINE, 21 },
|
||||
{ FMTOWNS, 253 }
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -33,7 +33,8 @@ std::vector<const char*> settings_dont_save {
|
|||
"ScreenHeight",
|
||||
"ScreenOffsetX",
|
||||
"ScreenOffsetY",
|
||||
"ScreenRotate"
|
||||
"ScreenRotate",
|
||||
"MonitorID"
|
||||
};
|
||||
|
||||
Settings::Settings()
|
||||
|
@ -178,6 +179,7 @@ void Settings::setDefaults()
|
|||
mIntMap["ScreenOffsetX"] = 0;
|
||||
mIntMap["ScreenOffsetY"] = 0;
|
||||
mIntMap["ScreenRotate"] = 0;
|
||||
mIntMap["MonitorID"] = 0;
|
||||
|
||||
mBoolMap["UseFullscreenPaging"] = false;
|
||||
|
||||
|
|
|
@ -342,27 +342,39 @@ bool GuiInputConfig::filterTrigger(Input input, InputConfig* config, int inputId
|
|||
#if defined(__linux__)
|
||||
// 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
|
||||
|
||||
if((
|
||||
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
|
||||
) && InputManager::getInstance()->getAxisCountByDevice(config->getDeviceId()) == 6)
|
||||
);
|
||||
bool isAnbernic = (
|
||||
strcmp(config->getDeviceGUIDString().c_str(), "03004ab1020500000913000010010000") == 0 // Anbernic RG P01 has same issue
|
||||
);
|
||||
|
||||
if((isPlaystation || isAnbernic)
|
||||
&& InputManager::getInstance()->getAxisCountByDevice(config->getDeviceId()) == 6)
|
||||
{
|
||||
// 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;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// ignore negative pole for axes 2/5 only when triggers are being configured
|
||||
if(input.type == TYPE_AXIS && (input.id == 2 || input.id == 5))
|
||||
bool genericTrigger = !isAnbernic && (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(input.value == 1)
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
#include <SDL_events.h>
|
||||
#ifdef WIN32
|
||||
#include <codecvt>
|
||||
#include <windows.h>
|
||||
#include "Shlwapi.h"
|
||||
#pragma comment(lib, "Shlwapi.lib")
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
@ -31,12 +33,24 @@ int runRestartCommand()
|
|||
int runSystemCommand(const std::string& cmd_utf8)
|
||||
{
|
||||
#ifdef WIN32
|
||||
// on Windows we use _wsystem to support non-ASCII paths
|
||||
// which requires converting from utf8 to a wstring
|
||||
typedef std::codecvt_utf8<wchar_t> convert_type;
|
||||
std::wstring_convert<convert_type, wchar_t> converter;
|
||||
std::wstring wchar_str = converter.from_bytes(cmd_utf8);
|
||||
return _wsystem(wchar_str.c_str());
|
||||
std::string args = std::string(PathGetArgs(cmd_utf8.c_str()));
|
||||
std::string program = cmd_utf8.substr(0, cmd_utf8.length() - args.length());
|
||||
SHELLEXECUTEINFO ShExecInfo = {0};
|
||||
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
|
||||
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
|
||||
ShExecInfo.hwnd = NULL;
|
||||
ShExecInfo.lpVerb = NULL;
|
||||
ShExecInfo.lpFile = program.c_str();
|
||||
ShExecInfo.lpParameters = args.c_str();
|
||||
ShExecInfo.lpDirectory = NULL;
|
||||
ShExecInfo.nShow = SW_SHOW;
|
||||
ShExecInfo.hInstApp = NULL;
|
||||
ShellExecuteEx(&ShExecInfo);
|
||||
WaitForSingleObject(ShExecInfo.hProcess, INFINITE);
|
||||
CloseHandle(ShExecInfo.hProcess);
|
||||
DWORD dwExitCode = 0;
|
||||
GetExitCodeProcess(ShExecInfo.hProcess, &dwExitCode);
|
||||
return dwExitCode;
|
||||
#else
|
||||
return system(cmd_utf8.c_str());
|
||||
#endif
|
||||
|
|
|
@ -75,8 +75,14 @@ namespace Renderer
|
|||
|
||||
initialCursorState = (SDL_ShowCursor(0) != 0);
|
||||
|
||||
int displayIndex = Settings::getInstance()->getInt("MonitorID");
|
||||
|
||||
if(displayIndex < 0 || displayIndex >= SDL_GetNumVideoDisplays()){
|
||||
displayIndex = 0;
|
||||
}
|
||||
|
||||
SDL_DisplayMode dispMode;
|
||||
SDL_GetDesktopDisplayMode(0, &dispMode);
|
||||
SDL_GetDesktopDisplayMode(displayIndex, &dispMode);
|
||||
windowWidth = Settings::getInstance()->getInt("WindowWidth") ? Settings::getInstance()->getInt("WindowWidth") : dispMode.w;
|
||||
windowHeight = Settings::getInstance()->getInt("WindowHeight") ? Settings::getInstance()->getInt("WindowHeight") : dispMode.h;
|
||||
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();
|
||||
|
||||
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();
|
||||
return false;
|
||||
|
|
Loading…
Add table
Reference in a new issue