Provide better error message on console for Xin1 bankswitch schemes,

and make 'Default' button do the right thing when configuring global
ROM properties.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2530 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2012-06-07 15:34:43 +00:00
parent 21f25d1553
commit 15ea3e6439
3 changed files with 20 additions and 5 deletions

View File

@ -95,7 +95,8 @@ Cartridge* Cartridge::create(const uInt8* image, uInt32 size, string& md5,
type = createFromMultiCart(image, size, 2, md5, id, settings);
buf << id;
}
else
dtype = "WRONG_SIZE";
}
else if(type == "4IN1")
{
@ -106,6 +107,8 @@ Cartridge* Cartridge::create(const uInt8* image, uInt32 size, string& md5,
type = createFromMultiCart(image, size, 4, md5, id, settings);
buf << id;
}
else
dtype = "WRONG_SIZE";
}
else if(type == "8IN1")
{
@ -116,6 +119,8 @@ Cartridge* Cartridge::create(const uInt8* image, uInt32 size, string& md5,
type = createFromMultiCart(image, size, 8, md5, id, settings);
buf << id;
}
else
dtype = "WRONG_SIZE";
}
else if(type == "16IN1")
{
@ -126,6 +131,8 @@ Cartridge* Cartridge::create(const uInt8* image, uInt32 size, string& md5,
type = createFromMultiCart(image, size, 16, md5, id, settings);
buf << id;
}
else
dtype = "WRONG_SIZE";
}
else if(type == "32IN1")
{
@ -136,6 +143,8 @@ Cartridge* Cartridge::create(const uInt8* image, uInt32 size, string& md5,
type = createFromMultiCart(image, size, 32, md5, id, settings);
buf << id;
}
else
dtype = "WRONG_SIZE";
}
else if(type == "64IN1")
{
@ -146,6 +155,8 @@ Cartridge* Cartridge::create(const uInt8* image, uInt32 size, string& md5,
type = createFromMultiCart(image, size, 64, md5, id, settings);
buf << id;
}
else
dtype = "WRONG_SIZE";
}
else if(type == "128IN1")
{
@ -156,6 +167,8 @@ Cartridge* Cartridge::create(const uInt8* image, uInt32 size, string& md5,
type = createFromMultiCart(image, size, 128, md5, id, settings);
buf << id;
}
else
dtype = "WRONG_SIZE";
}
// We should know the cart's type by now so let's create it
@ -219,6 +232,8 @@ Cartridge* Cartridge::create(const uInt8* image, uInt32 size, string& md5,
cartridge = new CartridgeSB(image, size, settings);
else if(type == "X07")
cartridge = new CartridgeX07(image, size, settings);
else if(dtype == "WRONG_SIZE")
cerr << "ERROR: Invalid cartridge size for type " << type << " ..." << endl;
else
cerr << "ERROR: Invalid cartridge type " << type << " ..." << endl;

View File

@ -184,7 +184,7 @@ void GlobalPropsDialog::loadConfig()
{
Settings& settings = instance().settings();
myBSType->setSelected(settings.getString("bs"), "DEFAULT");
myBSType->setSelected(settings.getString("bs"), "AUTO-DETECT");
myLeftDiff->setSelected(settings.getString("ld"), "DEFAULT");
myRightDiff->setSelected(settings.getString("rd"), "DEFAULT");
myTVType->setSelected(settings.getString("tv"), "DEFAULT");
@ -201,7 +201,7 @@ void GlobalPropsDialog::saveConfig()
string s;
s = myBSType->getSelectedTag();
if(s == "DEFAULT") s = "";
if(s == "AUTO-DETECT") s = "";
settings.setString("bs", s);
s = myLeftDiff->getSelectedTag();
@ -224,7 +224,7 @@ void GlobalPropsDialog::saveConfig()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void GlobalPropsDialog::setDefaults()
{
myBSType->setSelected("DEFAULT", "");
myBSType->setSelected("AUTO-DETECT", "");
myLeftDiff->setSelected("DEFAULT", "");
myRightDiff->setSelected("DEFAULT", "");
myTVType->setSelected("DEFAULT", "");

View File

@ -642,7 +642,7 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
instance().settings().setString("lastrom", myList->getSelectedString());
else
instance().frameBuffer().showMessage(
"Error creating console (check ROM file)",
"Error creating console (check ROM file/bankswitch scheme)",
kMiddleCenter, true);
}
else