mirror of https://github.com/stella-emu/stella.git
added actual ROM size to ROM info (developer mode only)
This commit is contained in:
parent
6a9f1075d2
commit
64be78b6b7
|
@ -150,10 +150,11 @@ void RomInfoWidget::parseProperties(const FilesystemNode& node)
|
||||||
Controller::Type leftType = Controller::getType(left);
|
Controller::Type leftType = Controller::getType(left);
|
||||||
Controller::Type rightType = Controller::getType(right);
|
Controller::Type rightType = Controller::getType(right);
|
||||||
string bsDetected = myProperties.get(PropType::Cart_Type);
|
string bsDetected = myProperties.get(PropType::Cart_Type);
|
||||||
|
size_t size = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ByteBuffer image;
|
ByteBuffer image;
|
||||||
string md5 = ""; size_t size = 0;
|
string md5 = "";
|
||||||
|
|
||||||
if(node.exists() && !node.isDirectory() &&
|
if(node.exists() && !node.isDirectory() &&
|
||||||
(image = instance().openROM(node, md5, size)) != nullptr)
|
(image = instance().openROM(node, md5, size)) != nullptr)
|
||||||
|
@ -179,8 +180,21 @@ void RomInfoWidget::parseProperties(const FilesystemNode& node)
|
||||||
myRomInfo.push_back("Controllers: " + (left + " (left), " + right + " (right)"));
|
myRomInfo.push_back("Controllers: " + (left + " (left), " + right + " (right)"));
|
||||||
|
|
||||||
if(bsDetected != "")
|
if(bsDetected != "")
|
||||||
myRomInfo.push_back("Type: " + Bankswitch::typeToDesc(Bankswitch::nameToType(bsDetected)));
|
{
|
||||||
|
ostringstream buf;
|
||||||
|
|
||||||
|
// Display actual ROM size in developer mode
|
||||||
|
if(instance().settings().getBool("dev.settings"))
|
||||||
|
{
|
||||||
|
buf << " - ";
|
||||||
|
if(size < 1_KB)
|
||||||
|
buf << size << "B";
|
||||||
|
else
|
||||||
|
buf << (std::round(size / float(1_KB))) << "K";
|
||||||
|
}
|
||||||
|
myRomInfo.push_back("Type: " + Bankswitch::typeToDesc(Bankswitch::nameToType(bsDetected))
|
||||||
|
+ buf.str());
|
||||||
|
}
|
||||||
setDirty();
|
setDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue