mirror of https://github.com/stella-emu/stella.git
Merge remote-tracking branch 'remotes/origin/master' into feature-highscores
Fixed redraw problems.
This commit is contained in:
commit
d5c6daf9f9
|
@ -253,8 +253,8 @@ void CheatManager::saveCheatDatabase()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
stringstream out;
|
stringstream out;
|
||||||
for(const auto& iter: myCheatMap)
|
for(const auto& [md5, cheat]: myCheatMap)
|
||||||
out << "\"" << iter.first << "\" " << "\"" << iter.second << "\"" << endl;
|
out << "\"" << md5 << "\" " << "\"" << cheat << "\"" << endl;
|
||||||
|
|
||||||
try { myOSystem.cheatFile().write(out); }
|
try { myOSystem.cheatFile().write(out); }
|
||||||
catch(...) { return; }
|
catch(...) { return; }
|
||||||
|
|
|
@ -147,27 +147,6 @@ bool HighScoresManager::get(const Properties& props, uInt32& numVariationsR,
|
||||||
|
|
||||||
info.scoreAddr = getPropScoreAddr(jprops);
|
info.scoreAddr = getPropScoreAddr(jprops);
|
||||||
|
|
||||||
//if(jprops.contains(SCORE_ADDRESSES))
|
|
||||||
//{
|
|
||||||
// const json addrProps = jprops.at(SCORE_ADDRESSES);
|
|
||||||
|
|
||||||
// if(!addrProps.empty() && addrProps.is_array())
|
|
||||||
// {
|
|
||||||
// int a = 0;
|
|
||||||
|
|
||||||
// for(const json& addresses : addrProps)
|
|
||||||
// {
|
|
||||||
// const string address = addresses.get<string>();
|
|
||||||
|
|
||||||
// if(address.empty())
|
|
||||||
// info.scoreAddr[a++] = DEFAULT_ADDRESS;
|
|
||||||
// else
|
|
||||||
// info.scoreAddr[a++] = fromHexStr(address);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
return enabled();
|
return enabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,10 +265,7 @@ const string HighScoresManager::notes(const json& jprops) const
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
/*bool HighScoresManager::armRAM(const json& jprops) const
|
/*bool HighScoresManager::armRAM(const json& jprops) const
|
||||||
{
|
{
|
||||||
//string armRAM = getPropIdx(jprops, PropType::Cart_Formats, IDX_ARM_RAM);
|
return getPropStr(jprops, ARM_RAM);
|
||||||
|
|
||||||
//return armRAM.empty() ? DEFAULT_ARM_RAM : armRAM != "0";
|
|
||||||
return false;
|
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -320,9 +296,8 @@ uInt32 HighScoresManager::numAddrBytes(const json& jprops) const
|
||||||
Int32 HighScoresManager::numVariations() const
|
Int32 HighScoresManager::numVariations() const
|
||||||
{
|
{
|
||||||
json jprops;
|
json jprops;
|
||||||
uInt16 vars = numVariations(properties(jprops));
|
|
||||||
|
|
||||||
return vars;;
|
return numVariations(properties(jprops));
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -584,7 +559,8 @@ Int32 HighScoresManager::fromBCD(uInt8 bcd) const
|
||||||
return (bcd >> 4) * 10 + bcd % 16;
|
return (bcd >> 4) * 10 + bcd % 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
const string HighScoresManager::VARIATIONS_COUNT = "variations_number";
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
const string HighScoresManager::VARIATIONS_COUNT = "variations_count";
|
||||||
const string HighScoresManager::VARIATIONS_ADDRESS = "variations_address";
|
const string HighScoresManager::VARIATIONS_ADDRESS = "variations_address";
|
||||||
const string HighScoresManager::VARIATIONS_BCD = "variations_bcd";
|
const string HighScoresManager::VARIATIONS_BCD = "variations_bcd";
|
||||||
const string HighScoresManager::VARIATIONS_ZERO_BASED = "variations_zero_based";
|
const string HighScoresManager::VARIATIONS_ZERO_BASED = "variations_zero_based";
|
||||||
|
|
|
@ -162,13 +162,13 @@ string JoyMap::getEventMappingDesc(int stick, const Event::Type event, const Eve
|
||||||
{
|
{
|
||||||
ostringstream buf;
|
ostringstream buf;
|
||||||
|
|
||||||
for(auto item : myMap)
|
for (const auto& [_mapping, _event]: myMap)
|
||||||
{
|
{
|
||||||
if(item.second == event && item.first.mode == mode)
|
if (_event == event && _mapping.mode == mode)
|
||||||
{
|
{
|
||||||
if(buf.str() != "")
|
if(buf.str() != "")
|
||||||
buf << ", ";
|
buf << ", ";
|
||||||
buf << "J" << stick << getDesc(event, item.first);
|
buf << "J" << stick << getDesc(event, _mapping);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return buf.str();
|
return buf.str();
|
||||||
|
@ -179,9 +179,9 @@ JoyMap::JoyMappingArray JoyMap::getEventMapping(const Event::Type event, const E
|
||||||
{
|
{
|
||||||
JoyMappingArray map;
|
JoyMappingArray map;
|
||||||
|
|
||||||
for(auto item : myMap)
|
for (const auto& [_mapping, _event]: myMap)
|
||||||
if(item.second == event && item.first.mode == mode)
|
if (_event == event && _mapping.mode == mode)
|
||||||
map.push_back(item.first);
|
map.push_back(_mapping);
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
@ -191,23 +191,23 @@ json JoyMap::saveMapping(const EventMode mode) const
|
||||||
{
|
{
|
||||||
json eventMappings = json::array();
|
json eventMappings = json::array();
|
||||||
|
|
||||||
for(auto& item : myMap) {
|
for (const auto& [_mapping, _event]: myMap) {
|
||||||
if(item.first.mode != mode) continue;
|
if (_mapping.mode != mode) continue;
|
||||||
|
|
||||||
json eventMapping = json::object();
|
json eventMapping = json::object();
|
||||||
|
|
||||||
eventMapping["event"] = item.second;
|
eventMapping["event"] = _event;
|
||||||
|
|
||||||
if(item.first.button != JOY_CTRL_NONE) eventMapping["button"] = item.first.button;
|
if (_mapping.button != JOY_CTRL_NONE) eventMapping["button"] = _mapping.button;
|
||||||
|
|
||||||
if(item.first.axis != JoyAxis::NONE) {
|
if (_mapping.axis != JoyAxis::NONE) {
|
||||||
eventMapping["axis"] = item.first.axis;
|
eventMapping["axis"] = _mapping.axis;
|
||||||
eventMapping["axisDirection"] = item.first.adir;
|
eventMapping["axisDirection"] = _mapping.adir;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(item.first.hat != -1) {
|
if (_mapping.hat != -1) {
|
||||||
eventMapping["hat"] = item.first.hat;
|
eventMapping["hat"] = _mapping.hat;
|
||||||
eventMapping["hatDirection"] = item.first.hdir;
|
eventMapping["hatDirection"] = _mapping.hdir;
|
||||||
}
|
}
|
||||||
|
|
||||||
eventMappings.push_back(eventMapping);
|
eventMappings.push_back(eventMapping);
|
||||||
|
|
|
@ -194,13 +194,13 @@ string KeyMap::getEventMappingDesc(const Event::Type event, const EventMode mode
|
||||||
{
|
{
|
||||||
ostringstream buf;
|
ostringstream buf;
|
||||||
|
|
||||||
for(auto item : myMap)
|
for (const auto& [_mapping, _event]: myMap)
|
||||||
{
|
{
|
||||||
if(item.second == event && item.first.mode == mode)
|
if (_event == event && _mapping.mode == mode)
|
||||||
{
|
{
|
||||||
if(buf.str() != "")
|
if(buf.str() != "")
|
||||||
buf << ", ";
|
buf << ", ";
|
||||||
buf << getDesc(item.first);
|
buf << getDesc(_mapping);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return buf.str();
|
return buf.str();
|
||||||
|
@ -211,9 +211,9 @@ KeyMap::MappingArray KeyMap::getEventMapping(const Event::Type event, const Even
|
||||||
{
|
{
|
||||||
MappingArray map;
|
MappingArray map;
|
||||||
|
|
||||||
for(auto item : myMap)
|
for (const auto& [_mapping, _event]: myMap)
|
||||||
if(item.second == event && item.first.mode == mode)
|
if (_event == event && _mapping.mode == mode)
|
||||||
map.push_back(item.first);
|
map.push_back(_mapping);
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
@ -223,17 +223,16 @@ json KeyMap::saveMapping(const EventMode mode) const
|
||||||
{
|
{
|
||||||
json mappings = json::array();
|
json mappings = json::array();
|
||||||
|
|
||||||
for(auto item : myMap)
|
for (const auto& [_mapping, _event]: myMap) {
|
||||||
{
|
if (_mapping.mode != mode) continue;
|
||||||
if(item.first.mode != mode) continue;
|
|
||||||
|
|
||||||
json mapping = json::object();
|
json mapping = json::object();
|
||||||
|
|
||||||
mapping["event"] = item.second;
|
mapping["event"] = _event;
|
||||||
mapping["key"] = item.first.key;
|
mapping["key"] = _mapping.key;
|
||||||
|
|
||||||
if(item.first.mod != StellaMod::KBDM_NONE)
|
if (_mapping.mod != StellaMod::KBDM_NONE)
|
||||||
mapping["mod"] = item.first.mod;
|
mapping["mod"] = serializeModkeyMask(_mapping.mod);
|
||||||
|
|
||||||
mappings.push_back(mapping);
|
mappings.push_back(mapping);
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,8 +122,8 @@ int PhysicalJoystickHandler::add(const PhysicalJoystickPtr& stick)
|
||||||
// For non-unique names that already have a database entry,
|
// For non-unique names that already have a database entry,
|
||||||
// we append ' #x', where 'x' increases consecutively
|
// we append ' #x', where 'x' increases consecutively
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for(const auto& i: myDatabase)
|
for(const auto& [_name, _info]: myDatabase)
|
||||||
if(BSPF::startsWithIgnoreCase(i.first, stick->name) && i.second.joy)
|
if(BSPF::startsWithIgnoreCase(_name, stick->name) && _info.joy)
|
||||||
++count;
|
++count;
|
||||||
|
|
||||||
if(count > 0)
|
if(count > 0)
|
||||||
|
@ -223,39 +223,39 @@ void PhysicalJoystickHandler::mapStelladaptors(const string& saport)
|
||||||
saOrder[0] = 2; saOrder[1] = 1;
|
saOrder[0] = 2; saOrder[1] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto& stick: mySticks)
|
for(auto& [_id, _joyptr]: mySticks)
|
||||||
{
|
{
|
||||||
// remove previously added emulated ports
|
// remove previously added emulated ports
|
||||||
size_t pos = stick.second->name.find(" (emulates ");
|
size_t pos = _joyptr->name.find(" (emulates ");
|
||||||
|
|
||||||
if(pos != std::string::npos)
|
if(pos != std::string::npos)
|
||||||
stick.second->name.erase(pos);
|
_joyptr->name.erase(pos);
|
||||||
|
|
||||||
if(BSPF::startsWithIgnoreCase(stick.second->name, "Stelladaptor"))
|
if(BSPF::startsWithIgnoreCase(_joyptr->name, "Stelladaptor"))
|
||||||
{
|
{
|
||||||
if(saOrder[saCount] == 1)
|
if(saOrder[saCount] == 1)
|
||||||
{
|
{
|
||||||
stick.second->name += " (emulates left joystick port)";
|
_joyptr->name += " (emulates left joystick port)";
|
||||||
stick.second->type = PhysicalJoystick::JT_STELLADAPTOR_LEFT;
|
_joyptr->type = PhysicalJoystick::JT_STELLADAPTOR_LEFT;
|
||||||
}
|
}
|
||||||
else if(saOrder[saCount] == 2)
|
else if(saOrder[saCount] == 2)
|
||||||
{
|
{
|
||||||
stick.second->name += " (emulates right joystick port)";
|
_joyptr->name += " (emulates right joystick port)";
|
||||||
stick.second->type = PhysicalJoystick::JT_STELLADAPTOR_RIGHT;
|
_joyptr->type = PhysicalJoystick::JT_STELLADAPTOR_RIGHT;
|
||||||
}
|
}
|
||||||
saCount++;
|
saCount++;
|
||||||
}
|
}
|
||||||
else if(BSPF::startsWithIgnoreCase(stick.second->name, "2600-daptor"))
|
else if(BSPF::startsWithIgnoreCase(_joyptr->name, "2600-daptor"))
|
||||||
{
|
{
|
||||||
if(saOrder[saCount] == 1)
|
if(saOrder[saCount] == 1)
|
||||||
{
|
{
|
||||||
stick.second->name += " (emulates left joystick port)";
|
_joyptr->name += " (emulates left joystick port)";
|
||||||
stick.second->type = PhysicalJoystick::JT_2600DAPTOR_LEFT;
|
_joyptr->type = PhysicalJoystick::JT_2600DAPTOR_LEFT;
|
||||||
}
|
}
|
||||||
else if(saOrder[saCount] == 2)
|
else if(saOrder[saCount] == 2)
|
||||||
{
|
{
|
||||||
stick.second->name += " (emulates right joystick port)";
|
_joyptr->name += " (emulates right joystick port)";
|
||||||
stick.second->type = PhysicalJoystick::JT_2600DAPTOR_RIGHT;
|
_joyptr->type = PhysicalJoystick::JT_2600DAPTOR_RIGHT;
|
||||||
}
|
}
|
||||||
saCount++;
|
saCount++;
|
||||||
}
|
}
|
||||||
|
@ -354,8 +354,8 @@ void PhysicalJoystickHandler::setStickDefaultMapping(int stick, Event::Type even
|
||||||
void PhysicalJoystickHandler::setDefaultMapping(Event::Type event, EventMode mode)
|
void PhysicalJoystickHandler::setDefaultMapping(Event::Type event, EventMode mode)
|
||||||
{
|
{
|
||||||
eraseMapping(event, mode);
|
eraseMapping(event, mode);
|
||||||
for (auto& i : mySticks)
|
for (const auto& [_id, _joyptr]: mySticks)
|
||||||
setStickDefaultMapping(i.first, event, mode);
|
setStickDefaultMapping(_id, event, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -529,24 +529,24 @@ void PhysicalJoystickHandler::eraseMapping(Event::Type event, EventMode mode)
|
||||||
// Otherwise, only reset the given event
|
// Otherwise, only reset the given event
|
||||||
if(event == Event::NoType)
|
if(event == Event::NoType)
|
||||||
{
|
{
|
||||||
for (auto& stick : mySticks)
|
for (auto& [_id, _joyptr]: mySticks)
|
||||||
{
|
{
|
||||||
stick.second->eraseMap(mode); // erase all events
|
_joyptr->eraseMap(mode); // erase all events
|
||||||
if(mode == EventMode::kEmulationMode)
|
if(mode == EventMode::kEmulationMode)
|
||||||
{
|
{
|
||||||
stick.second->eraseMap(EventMode::kCommonMode);
|
_joyptr->eraseMap(EventMode::kCommonMode);
|
||||||
stick.second->eraseMap(EventMode::kJoystickMode);
|
_joyptr->eraseMap(EventMode::kJoystickMode);
|
||||||
stick.second->eraseMap(EventMode::kPaddlesMode);
|
_joyptr->eraseMap(EventMode::kPaddlesMode);
|
||||||
stick.second->eraseMap(EventMode::kKeypadMode);
|
_joyptr->eraseMap(EventMode::kKeypadMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (auto& stick : mySticks)
|
for (auto& [_id, _joyptr]: mySticks)
|
||||||
{
|
{
|
||||||
stick.second->eraseEvent(event, mode); // only reset the specific event
|
_joyptr->eraseEvent(event, mode); // only reset the specific event
|
||||||
stick.second->eraseEvent(event, getEventMode(event, mode));
|
_joyptr->eraseEvent(event, getEventMode(event, mode));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -558,9 +558,9 @@ void PhysicalJoystickHandler::saveMapping()
|
||||||
// any changes that have been made during the program run
|
// any changes that have been made during the program run
|
||||||
json mapping = json::array();
|
json mapping = json::array();
|
||||||
|
|
||||||
for(const auto& i: myDatabase)
|
for(const auto& [_name, _info]: myDatabase)
|
||||||
{
|
{
|
||||||
json map = i.second.joy ? i.second.joy->getMap() : i.second.mapping;
|
json map = _info.joy ? _info.joy->getMap() : _info.mapping;
|
||||||
|
|
||||||
if (!map.is_null()) mapping.emplace_back(map);
|
if (!map.is_null()) mapping.emplace_back(map);
|
||||||
}
|
}
|
||||||
|
@ -574,19 +574,16 @@ string PhysicalJoystickHandler::getMappingDesc(Event::Type event, EventMode mode
|
||||||
ostringstream buf;
|
ostringstream buf;
|
||||||
EventMode evMode = getEventMode(event, mode);
|
EventMode evMode = getEventMode(event, mode);
|
||||||
|
|
||||||
for(const auto& s: mySticks)
|
for(const auto& [_id, _joyptr]: mySticks)
|
||||||
{
|
{
|
||||||
uInt32 stick = s.first;
|
if(_joyptr)
|
||||||
const PhysicalJoystickPtr j = s.second;
|
|
||||||
|
|
||||||
if(j)
|
|
||||||
{
|
{
|
||||||
//Joystick mapping / labeling
|
//Joystick mapping / labeling
|
||||||
if(j->joyMap.getEventMapping(event, evMode).size())
|
if(_joyptr->joyMap.getEventMapping(event, evMode).size())
|
||||||
{
|
{
|
||||||
if(buf.str() != "")
|
if(buf.str() != "")
|
||||||
buf << ", ";
|
buf << ", ";
|
||||||
buf << j->joyMap.getEventMappingDesc(stick, event, evMode);
|
buf << _joyptr->joyMap.getEventMappingDesc(_id, event, evMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -819,8 +816,8 @@ void PhysicalJoystickHandler::handleHatEvent(int stick, int hat, int value)
|
||||||
VariantList PhysicalJoystickHandler::database() const
|
VariantList PhysicalJoystickHandler::database() const
|
||||||
{
|
{
|
||||||
VariantList db;
|
VariantList db;
|
||||||
for(const auto& i: myDatabase)
|
for(const auto& [_name, _info]: myDatabase)
|
||||||
VarList::push_back(db, i.first, i.second.joy ? i.second.joy->ID : -1);
|
VarList::push_back(db, _name, _info.joy ? _info.joy->ID : -1);
|
||||||
|
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
|
@ -830,13 +827,13 @@ ostream& operator<<(ostream& os, const PhysicalJoystickHandler& jh)
|
||||||
{
|
{
|
||||||
os << "---------------------------------------------------------" << endl
|
os << "---------------------------------------------------------" << endl
|
||||||
<< "joy database:" << endl;
|
<< "joy database:" << endl;
|
||||||
for(const auto& i: jh.myDatabase)
|
for(const auto& [_name, _info]: jh.myDatabase)
|
||||||
os << i.first << endl << i.second << endl << endl;
|
os << _name << endl << _info << endl << endl;
|
||||||
|
|
||||||
os << "---------------------" << endl
|
os << "---------------------" << endl
|
||||||
<< "joy active:" << endl;
|
<< "joy active:" << endl;
|
||||||
for(const auto& i: jh.mySticks)
|
for(const auto& [_id, _joyptr]: jh.mySticks)
|
||||||
os << i.first << ": " << *i.second << endl;
|
os << _id << ": " << *_joyptr << endl;
|
||||||
os << "---------------------------------------------------------"
|
os << "---------------------------------------------------------"
|
||||||
<< endl << endl << endl;
|
<< endl << endl << endl;
|
||||||
|
|
||||||
|
|
|
@ -123,11 +123,11 @@ void parseCommandLine(int ac, char* av[],
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
cout << "Global opts:" << endl;
|
cout << "Global opts:" << endl;
|
||||||
for(const auto& x: globalOpts)
|
for(const auto& [key, value]: globalOpts)
|
||||||
cout << " -> " << x.first << ": " << x.second << endl;
|
cout << " -> " << key << ": " << value << endl;
|
||||||
cout << "Local opts:" << endl;
|
cout << "Local opts:" << endl;
|
||||||
for(const auto& x: localOpts)
|
for(const auto& [key, value]: localOpts)
|
||||||
cout << " -> " << x.first << ": " << x.second << endl;
|
cout << " -> " << key << ": " << value << endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,8 +100,8 @@ void KeyValueRepositoryConfigfile::save(const std::map<string, Variant>& values)
|
||||||
<< ";" << endl;
|
<< ";" << endl;
|
||||||
|
|
||||||
// Write out each of the key and value pairs
|
// Write out each of the key and value pairs
|
||||||
for(const auto& pair: values)
|
for(const auto& [key, value]: values)
|
||||||
out << pair.first << " = " << pair.second << endl;
|
out << key << " = " << value << endl;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -635,9 +635,9 @@ string DebuggerParser::saveScriptFile(string file)
|
||||||
|
|
||||||
stringstream out;
|
stringstream out;
|
||||||
Debugger::FunctionDefMap funcs = debugger.getFunctionDefMap();
|
Debugger::FunctionDefMap funcs = debugger.getFunctionDefMap();
|
||||||
for(const auto& f: funcs)
|
for(const auto& [name, cmd]: funcs)
|
||||||
if (!debugger.isBuiltinFunction(f.first))
|
if (!debugger.isBuiltinFunction(name))
|
||||||
out << "function " << f.first << " {" << f.second << "}" << endl;
|
out << "function " << name << " {" << cmd << "}" << endl;
|
||||||
|
|
||||||
for(const auto& w: myWatches)
|
for(const auto& w: myWatches)
|
||||||
out << "watch " << w << endl;
|
out << "watch " << w << endl;
|
||||||
|
@ -1526,10 +1526,8 @@ void DebuggerParser::executeListfunctions()
|
||||||
const Debugger::FunctionDefMap& functions = debugger.getFunctionDefMap();
|
const Debugger::FunctionDefMap& functions = debugger.getFunctionDefMap();
|
||||||
|
|
||||||
if(functions.size() > 0)
|
if(functions.size() > 0)
|
||||||
{
|
for(const auto& [name, cmd]: functions)
|
||||||
for(const auto& iter: functions)
|
commandResult << name << " -> " << cmd << endl;
|
||||||
commandResult << iter.first << " -> " << iter.second << endl;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
commandResult << "no user-defined functions";
|
commandResult << "no user-defined functions";
|
||||||
}
|
}
|
||||||
|
|
|
@ -253,7 +253,7 @@ void Settings::setRepository(shared_ptr<KeyValueRepository> repository)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void Settings::load(const Options& options)
|
void Settings::load(const Options& options)
|
||||||
{
|
{
|
||||||
Options fromFile = myRespository->load();
|
Options fromFile = myRespository->load();
|
||||||
for (const auto& opt: fromFile)
|
for (const auto& opt: fromFile)
|
||||||
setValue(opt.first, opt.second, false);
|
setValue(opt.first, opt.second, false);
|
||||||
|
|
||||||
|
|
|
@ -123,27 +123,25 @@ void ContextMenu::setSelectedIndex(int idx)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void ContextMenu::setSelected(const Variant& tag, const Variant& defaultTag)
|
void ContextMenu::setSelected(const Variant& tag, const Variant& defaultTag)
|
||||||
{
|
{
|
||||||
if(tag != "") // indicates that the defaultTag should be used instead
|
auto SEARCH_AND_SELECT = [&](const Variant& t)
|
||||||
{
|
{
|
||||||
for(uInt32 item = 0; item < _entries.size(); ++item)
|
for(uInt32 item = 0; item < _entries.size(); ++item)
|
||||||
{
|
{
|
||||||
if(BSPF::equalsIgnoreCase(_entries[item].second.toString(), tag.toString()))
|
if(BSPF::equalsIgnoreCase(_entries[item].second.toString(), t.toString()))
|
||||||
{
|
{
|
||||||
setSelectedIndex(item);
|
setSelectedIndex(item);
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
// If we get this far, the value wasn't found; use the default value
|
// First try searching for a valid tag
|
||||||
for(uInt32 item = 0; item < _entries.size(); ++item)
|
bool tagSelected = tag != "" && SEARCH_AND_SELECT(tag);
|
||||||
{
|
|
||||||
if(BSPF::equalsIgnoreCase(_entries[item].second.toString(), defaultTag.toString()))
|
// Otherwise use the default tag
|
||||||
{
|
if(!tagSelected)
|
||||||
setSelectedIndex(item);
|
SEARCH_AND_SELECT(defaultTag);
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -416,6 +416,7 @@ void HighScoresDialog::updateWidgets(bool init)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_defaultWidget->setEnabled(myHighScores[0] > 0);
|
_defaultWidget->setEnabled(myHighScores[0] > 0);
|
||||||
|
setDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -481,6 +482,7 @@ void HighScoresDialog::deleteRank(int rank)
|
||||||
myHighScoreRank--;
|
myHighScoreRank--;
|
||||||
myEditRank--;
|
myEditRank--;
|
||||||
myEditNameWidgets[myEditRank]->setText(myEditNameWidgets[myEditRank + 1]->getText());
|
myEditNameWidgets[myEditRank]->setText(myEditNameWidgets[myEditRank + 1]->getText());
|
||||||
|
setDirty();
|
||||||
}
|
}
|
||||||
myDirty = true;
|
myDirty = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,10 +80,10 @@ void JoystickDialog::loadConfig()
|
||||||
myJoyIDs.clear();
|
myJoyIDs.clear();
|
||||||
|
|
||||||
StringList sticks;
|
StringList sticks;
|
||||||
for(const auto& i: instance().eventHandler().physicalJoystickDatabase())
|
for(const auto& [_name, _id]: instance().eventHandler().physicalJoystickDatabase())
|
||||||
{
|
{
|
||||||
sticks.push_back(i.first);
|
sticks.push_back(_name);
|
||||||
myJoyIDs.push_back(i.second.toInt());
|
myJoyIDs.push_back(_id.toInt());
|
||||||
}
|
}
|
||||||
myJoyList->setList(sticks);
|
myJoyList->setList(sticks);
|
||||||
myJoyList->setSelected(0);
|
myJoyList->setSelected(0);
|
||||||
|
|
Loading…
Reference in New Issue