mirror of https://github.com/stella-emu/stella.git
Merge branch 'master' of https://github.com/stella-emu/stella
This commit is contained in:
commit
37afed9778
|
@ -126,31 +126,36 @@ void RomInfoWidget::parseProperties(const FilesystemNode& node)
|
||||||
myRomInfo.push_back("Note: " + myProperties.get(Cartridge_Note));
|
myRomInfo.push_back("Note: " + myProperties.get(Cartridge_Note));
|
||||||
bool swappedPorts = myProperties.get(Console_SwapPorts) == "YES";
|
bool swappedPorts = myProperties.get(Console_SwapPorts) == "YES";
|
||||||
|
|
||||||
|
// Load the image for controller auto detection
|
||||||
string left = myProperties.get(Controller_Left);
|
string left = myProperties.get(Controller_Left);
|
||||||
string right = myProperties.get(Controller_Right);
|
string right = myProperties.get(Controller_Right);
|
||||||
|
try
|
||||||
// load the image for auto detection
|
|
||||||
BytePtr image;
|
|
||||||
string md5 = myProperties.get(Cartridge_MD5);
|
|
||||||
uInt32 size = 0;
|
|
||||||
|
|
||||||
if(node.exists() && !node.isDirectory() && (image = instance().openROM(node, md5, size)) != nullptr)
|
|
||||||
{
|
{
|
||||||
left = ControllerDetector::detectName(image.get(), size, left,
|
BytePtr image;
|
||||||
!swappedPorts ? Controller::Jack::Left : Controller::Jack::Right,
|
string md5 = myProperties.get(Cartridge_MD5);
|
||||||
instance().settings());
|
uInt32 size = 0;
|
||||||
right = ControllerDetector::detectName(image.get(), size, right,
|
|
||||||
!swappedPorts ? Controller::Jack::Right : Controller::Jack::Left,
|
if(node.exists() && !node.isDirectory() &&
|
||||||
instance().settings());
|
(image = instance().openROM(node, md5, size)) != nullptr)
|
||||||
|
{
|
||||||
|
if(BSPF::equalsIgnoreCase(left, "AUTO"))
|
||||||
|
left = ControllerDetector::detectName(image.get(), size, left,
|
||||||
|
!swappedPorts ? Controller::Jack::Left : Controller::Jack::Right,
|
||||||
|
instance().settings());
|
||||||
|
if(BSPF::equalsIgnoreCase(right, "AUTO"))
|
||||||
|
right = ControllerDetector::detectName(image.get(), size, right,
|
||||||
|
!swappedPorts ? Controller::Jack::Right : Controller::Jack::Left,
|
||||||
|
instance().settings());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
myRomInfo.push_back("Controllers: " + (left + " (left), " + right + " (right)"));
|
catch(const runtime_error&)
|
||||||
|
{
|
||||||
#if 0
|
// Do nothing; we simply don't update the controllers if openROM
|
||||||
myRomInfo.push_back("YStart/Height: " + myProperties.get(Display_YStart) +
|
// failed for any reason
|
||||||
" " + myProperties.get(Display_Height));
|
left = right = "";
|
||||||
#endif
|
}
|
||||||
|
if(left != "" && right != "")
|
||||||
setDirty();
|
myRomInfo.push_back("Controllers: " + (left + " (left), " + right + " (right)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
Loading…
Reference in New Issue