mirror of https://github.com/stella-emu/stella.git
Merge branch 'master' into feature/filesystem
This commit is contained in:
commit
c9575e7c6b
|
@ -89,12 +89,12 @@ CheatCodeDialog::CheatCodeDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
myCheatInput->setTarget(this);
|
myCheatInput->setTarget(this);
|
||||||
|
|
||||||
// Add filtering for each textfield
|
// Add filtering for each textfield
|
||||||
EditableWidget::TextFilter f0 = [](char c) {
|
const EditableWidget::TextFilter f0 = [](char c) {
|
||||||
return isprint(c) && c != '\"' && c != ':';
|
return isprint(c) && c != '\"' && c != ':';
|
||||||
};
|
};
|
||||||
myCheatInput->setTextFilter(f0, 0);
|
myCheatInput->setTextFilter(f0, 0);
|
||||||
|
|
||||||
EditableWidget::TextFilter f1 = [](char c) {
|
const EditableWidget::TextFilter f1 = [](char c) {
|
||||||
return (c >= 'a' && c <= 'f') || (c >= '0' && c <= '9');
|
return (c >= 'a' && c <= 'f') || (c >= '0' && c <= '9');
|
||||||
};
|
};
|
||||||
myCheatInput->setTextFilter(f1, 1);
|
myCheatInput->setTextFilter(f1, 1);
|
||||||
|
|
|
@ -36,7 +36,7 @@ CheatManager::CheatManager(OSystem& osystem)
|
||||||
bool CheatManager::add(const string& name, const string& code,
|
bool CheatManager::add(const string& name, const string& code,
|
||||||
bool enable, int idx)
|
bool enable, int idx)
|
||||||
{
|
{
|
||||||
shared_ptr<Cheat> cheat = createCheat(name, code);
|
const shared_ptr<Cheat> cheat = createCheat(name, code);
|
||||||
if(!cheat)
|
if(!cheat)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ void CheatManager::addPerFrame(const string& name, const string& code, bool enab
|
||||||
void CheatManager::addOneShot(const string& name, const string& code)
|
void CheatManager::addOneShot(const string& name, const string& code)
|
||||||
{
|
{
|
||||||
// Evaluate this cheat once, and then immediately discard it
|
// Evaluate this cheat once, and then immediately discard it
|
||||||
shared_ptr<Cheat> cheat = createCheat(name, code);
|
const shared_ptr<Cheat> cheat = createCheat(name, code);
|
||||||
if(cheat)
|
if(cheat)
|
||||||
cheat->evaluate();
|
cheat->evaluate();
|
||||||
}
|
}
|
||||||
|
@ -299,7 +299,7 @@ void CheatManager::saveCheats(const string& md5sum)
|
||||||
cheats << ",";
|
cheats << ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool changed = cheats.str() != myCurrentCheat;
|
const bool changed = cheats.str() != myCurrentCheat;
|
||||||
|
|
||||||
// Only update the list if absolutely necessary
|
// Only update the list if absolutely necessary
|
||||||
if(changed)
|
if(changed)
|
||||||
|
|
|
@ -54,7 +54,7 @@ uInt32 AudioQueue::capacity() const
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
uInt32 AudioQueue::size() const
|
uInt32 AudioQueue::size() const
|
||||||
{
|
{
|
||||||
lock_guard<mutex> guard(myMutex);
|
const lock_guard<mutex> guard(myMutex);
|
||||||
|
|
||||||
return mySize;
|
return mySize;
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ uInt32 AudioQueue::fragmentSize() const
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Int16* AudioQueue::enqueue(Int16* fragment)
|
Int16* AudioQueue::enqueue(Int16* fragment)
|
||||||
{
|
{
|
||||||
lock_guard<mutex> guard(myMutex);
|
const lock_guard<mutex> guard(myMutex);
|
||||||
|
|
||||||
Int16* newFragment = nullptr;
|
Int16* newFragment = nullptr;
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ Int16* AudioQueue::enqueue(Int16* fragment)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Int16* AudioQueue::dequeue(Int16* fragment)
|
Int16* AudioQueue::dequeue(Int16* fragment)
|
||||||
{
|
{
|
||||||
lock_guard<mutex> guard(myMutex);
|
const lock_guard<mutex> guard(myMutex);
|
||||||
|
|
||||||
if (mySize == 0) return nullptr;
|
if (mySize == 0) return nullptr;
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ Int16* AudioQueue::dequeue(Int16* fragment)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void AudioQueue::closeSink(Int16* fragment)
|
void AudioQueue::closeSink(Int16* fragment)
|
||||||
{
|
{
|
||||||
lock_guard<mutex> guard(myMutex);
|
const lock_guard<mutex> guard(myMutex);
|
||||||
|
|
||||||
if (myFirstFragmentForDequeue && fragment)
|
if (myFirstFragmentForDequeue && fragment)
|
||||||
throw runtime_error("attempt to return unknown buffer on closeSink");
|
throw runtime_error("attempt to return unknown buffer on closeSink");
|
||||||
|
|
|
@ -51,7 +51,7 @@ AudioSettings::AudioSettings(Settings& settings)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void AudioSettings::normalize(Settings& settings)
|
void AudioSettings::normalize(Settings& settings)
|
||||||
{
|
{
|
||||||
int settingPreset = settings.getInt(SETTING_PRESET);
|
const int settingPreset = settings.getInt(SETTING_PRESET);
|
||||||
const Preset preset = normalizedPreset(settingPreset);
|
const Preset preset = normalizedPreset(settingPreset);
|
||||||
if (static_cast<int>(preset) != settingPreset) settings.setValue(SETTING_PRESET, static_cast<int>(DEFAULT_PRESET));
|
if (static_cast<int>(preset) != settingPreset) settings.setValue(SETTING_PRESET, static_cast<int>(DEFAULT_PRESET));
|
||||||
|
|
||||||
|
@ -80,18 +80,19 @@ void AudioSettings::normalize(Settings& settings)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
int settingBufferSize = settings.getInt(SETTING_BUFFER_SIZE);
|
const int settingBufferSize = settings.getInt(SETTING_BUFFER_SIZE);
|
||||||
if (settingBufferSize < 0 || settingBufferSize > MAX_BUFFER_SIZE) settings.setValue(SETTING_BUFFER_SIZE, DEFAULT_BUFFER_SIZE);
|
if (settingBufferSize < 0 || settingBufferSize > MAX_BUFFER_SIZE) settings.setValue(SETTING_BUFFER_SIZE, DEFAULT_BUFFER_SIZE);
|
||||||
|
|
||||||
int settingHeadroom = settings.getInt(SETTING_HEADROOM);
|
const int settingHeadroom = settings.getInt(SETTING_HEADROOM);
|
||||||
if (settingHeadroom < 0 || settingHeadroom > MAX_HEADROOM) settings.setValue(SETTING_HEADROOM, DEFAULT_HEADROOM);
|
if (settingHeadroom < 0 || settingHeadroom > MAX_HEADROOM) settings.setValue(SETTING_HEADROOM, DEFAULT_HEADROOM);
|
||||||
|
|
||||||
int settingResamplingQuality = settings.getInt(SETTING_RESAMPLING_QUALITY);
|
const int settingResamplingQuality = settings.getInt(SETTING_RESAMPLING_QUALITY);
|
||||||
const ResamplingQuality resamplingQuality = normalizeResamplingQuality(settingResamplingQuality);
|
const ResamplingQuality resamplingQuality =
|
||||||
|
normalizeResamplingQuality(settingResamplingQuality);
|
||||||
if (static_cast<int>(resamplingQuality) != settingResamplingQuality)
|
if (static_cast<int>(resamplingQuality) != settingResamplingQuality)
|
||||||
settings.setValue(SETTING_RESAMPLING_QUALITY, static_cast<int>(DEFAULT_RESAMPLING_QUALITY));
|
settings.setValue(SETTING_RESAMPLING_QUALITY, static_cast<int>(DEFAULT_RESAMPLING_QUALITY));
|
||||||
|
|
||||||
int settingVolume = settings.getInt(SETTING_VOLUME);
|
const int settingVolume = settings.getInt(SETTING_VOLUME);
|
||||||
if (settingVolume < 0 || settingVolume > 100) settings.setValue(SETTING_VOLUME, DEFAULT_VOLUME);
|
if (settingVolume < 0 || settingVolume > 100) settings.setValue(SETTING_VOLUME, DEFAULT_VOLUME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -309,7 +309,7 @@ bool FBBackendSDL2::setVideoMode(const VideoModeHandler::Mode& mode,
|
||||||
mode.screenS.w, mode.screenS.h, flags);
|
mode.screenS.w, mode.screenS.h, flags);
|
||||||
if(myWindow == nullptr)
|
if(myWindow == nullptr)
|
||||||
{
|
{
|
||||||
string msg = "ERROR: Unable to open SDL window: " + string(SDL_GetError());
|
const string msg = "ERROR: Unable to open SDL window: " + string(SDL_GetError());
|
||||||
Logger::error(msg);
|
Logger::error(msg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -438,7 +438,7 @@ bool FBBackendSDL2::createRenderer()
|
||||||
|
|
||||||
if(myRenderer == nullptr)
|
if(myRenderer == nullptr)
|
||||||
{
|
{
|
||||||
string msg = "ERROR: Unable to create SDL renderer: " + string(SDL_GetError());
|
const string msg = "ERROR: Unable to create SDL renderer: " + string(SDL_GetError());
|
||||||
Logger::error(msg);
|
Logger::error(msg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,7 +131,7 @@ uInt32 HighScoresManager::numVariations(const json& jprops)
|
||||||
bool HighScoresManager::get(const Properties& props, uInt32& numVariationsR,
|
bool HighScoresManager::get(const Properties& props, uInt32& numVariationsR,
|
||||||
ScoresProps& info) const
|
ScoresProps& info) const
|
||||||
{
|
{
|
||||||
json jprops = properties(props);
|
const json jprops = properties(props);
|
||||||
|
|
||||||
numVariationsR = numVariations(jprops);
|
numVariationsR = numVariations(jprops);
|
||||||
|
|
||||||
|
@ -313,7 +313,7 @@ Int32 HighScoresManager::variation(uInt16 addr, bool varBCD, bool zeroBased,
|
||||||
Int32 HighScoresManager::variation() const
|
Int32 HighScoresManager::variation() const
|
||||||
{
|
{
|
||||||
json jprops;
|
json jprops;
|
||||||
uInt16 addr = varAddress(properties(jprops));
|
const uInt16 addr = varAddress(properties(jprops));
|
||||||
|
|
||||||
if(addr == DEFAULT_ADDRESS) {
|
if(addr == DEFAULT_ADDRESS) {
|
||||||
if(numVariations() == 1)
|
if(numVariations() == 1)
|
||||||
|
@ -361,7 +361,7 @@ Int32 HighScoresManager::score(uInt32 numAddrBytes, uInt32 trailingZeroes,
|
||||||
Int32 HighScoresManager::score() const
|
Int32 HighScoresManager::score() const
|
||||||
{
|
{
|
||||||
json jprops;
|
json jprops;
|
||||||
uInt32 numBytes = numAddrBytes(properties(jprops));
|
const uInt32 numBytes = numAddrBytes(properties(jprops));
|
||||||
const ScoreAddresses scoreAddr = getPropScoreAddr(jprops);
|
const ScoreAddresses scoreAddr = getPropScoreAddr(jprops);
|
||||||
|
|
||||||
if(static_cast<uInt32>(scoreAddr.size()) < numBytes)
|
if(static_cast<uInt32>(scoreAddr.size()) < numBytes)
|
||||||
|
@ -432,7 +432,7 @@ Int32 HighScoresManager::special() const
|
||||||
return NO_VALUE;
|
return NO_VALUE;
|
||||||
|
|
||||||
json jprops;
|
json jprops;
|
||||||
uInt16 addr = specialAddress(properties(jprops));
|
const uInt16 addr = specialAddress(properties(jprops));
|
||||||
|
|
||||||
if (addr == DEFAULT_ADDRESS)
|
if (addr == DEFAULT_ADDRESS)
|
||||||
return NO_VALUE;
|
return NO_VALUE;
|
||||||
|
|
|
@ -36,7 +36,7 @@ JPGLibrary::JPGLibrary(OSystem& osystem)
|
||||||
void JPGLibrary::loadImage(const string& filename, FBSurface& surface,
|
void JPGLibrary::loadImage(const string& filename, FBSurface& surface,
|
||||||
VariantList& metaData)
|
VariantList& metaData)
|
||||||
{
|
{
|
||||||
const auto loadImageERROR = [&](const char* s) {
|
const auto loadImageERROR = [](const char* s) {
|
||||||
if(s)
|
if(s)
|
||||||
throw runtime_error(s);
|
throw runtime_error(s);
|
||||||
};
|
};
|
||||||
|
|
|
@ -248,11 +248,21 @@ int JoyMap::loadMapping(const json& eventMappings, const EventMode mode)
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for(const json& eventMapping : eventMappings) {
|
for(const json& eventMapping : eventMappings) {
|
||||||
int button = eventMapping.contains("button") ? eventMapping.at("button").get<int>() : JOY_CTRL_NONE;
|
const int button = eventMapping.contains("button")
|
||||||
JoyAxis axis = eventMapping.contains("axis") ? eventMapping.at("axis").get<JoyAxis>() : JoyAxis::NONE;
|
? eventMapping.at("button").get<int>()
|
||||||
JoyDir axisDirection = eventMapping.contains("axis") ? eventMapping.at("axisDirection").get<JoyDir>() : JoyDir::NONE;
|
: JOY_CTRL_NONE;
|
||||||
int hat = eventMapping.contains("hat") ? eventMapping.at("hat").get<int>() : -1;
|
const JoyAxis axis = eventMapping.contains("axis")
|
||||||
JoyHatDir hatDirection = eventMapping.contains("hat") ? eventMapping.at("hatDirection").get<JoyHatDir>() : JoyHatDir::CENTER;
|
? eventMapping.at("axis").get<JoyAxis>()
|
||||||
|
: JoyAxis::NONE;
|
||||||
|
const JoyDir axisDirection = eventMapping.contains("axis")
|
||||||
|
? eventMapping.at("axisDirection").get<JoyDir>()
|
||||||
|
: JoyDir::NONE;
|
||||||
|
const int hat = eventMapping.contains("hat")
|
||||||
|
? eventMapping.at("hat").get<int>()
|
||||||
|
: -1;
|
||||||
|
const JoyHatDir hatDirection = eventMapping.contains("hat")
|
||||||
|
? eventMapping.at("hatDirection").get<JoyHatDir>()
|
||||||
|
: JoyHatDir::CENTER;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// avoid blocking mappings for NoType events
|
// avoid blocking mappings for NoType events
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace {
|
||||||
|
|
||||||
json serializedMask = json::array();
|
json serializedMask = json::array();
|
||||||
|
|
||||||
for(StellaMod mod: {
|
for(const StellaMod mod: {
|
||||||
StellaMod::KBDM_CTRL,
|
StellaMod::KBDM_CTRL,
|
||||||
StellaMod::KBDM_SHIFT,
|
StellaMod::KBDM_SHIFT,
|
||||||
StellaMod::KBDM_ALT,
|
StellaMod::KBDM_ALT,
|
||||||
|
@ -207,15 +207,16 @@ string KeyMap::getEventMappingDesc(const Event::Type event, const EventMode mode
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
KeyMap::MappingArray KeyMap::getEventMapping(const Event::Type event, const EventMode mode) const
|
KeyMap::MappingArray KeyMap::getEventMapping(const Event::Type event,
|
||||||
|
const EventMode mode) const
|
||||||
{
|
{
|
||||||
MappingArray map;
|
MappingArray ma;
|
||||||
|
|
||||||
for (const auto& [_mapping, _event]: myMap)
|
for (const auto& [_mapping, _event]: myMap)
|
||||||
if (_event == event && _mapping.mode == mode)
|
if (_event == event && _mapping.mode == mode)
|
||||||
map.push_back(_mapping);
|
ma.push_back(_mapping);
|
||||||
|
|
||||||
return map;
|
return ma;
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -51,7 +51,7 @@ void Logger::debug(const string& message)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void Logger::logMessage(const string& message, Level level)
|
void Logger::logMessage(const string& message, Level level)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(mutex);
|
const std::lock_guard<std::mutex> lock(mutex);
|
||||||
|
|
||||||
if(level == Logger::Level::ERR)
|
if(level == Logger::Level::ERR)
|
||||||
{
|
{
|
||||||
|
|
|
@ -169,8 +169,8 @@ void MouseControl::addLeftControllerModes(bool noswap)
|
||||||
{
|
{
|
||||||
ostringstream msg;
|
ostringstream msg;
|
||||||
msg << "Mouse is left " << myLeftController.name() << " controller";
|
msg << "Mouse is left " << myLeftController.name() << " controller";
|
||||||
Controller::Type type = myLeftController.type();
|
const Controller::Type type = myLeftController.type();
|
||||||
int id = noswap ? 0 : 1;
|
const int id = noswap ? 0 : 1;
|
||||||
myModeList.emplace_back(type, id, type, id, msg.str());
|
myModeList.emplace_back(type, id, type, id, msg.str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -190,8 +190,8 @@ void MouseControl::addRightControllerModes(bool noswap)
|
||||||
{
|
{
|
||||||
ostringstream msg;
|
ostringstream msg;
|
||||||
msg << "Mouse is right " << myRightController.name() << " controller";
|
msg << "Mouse is right " << myRightController.name() << " controller";
|
||||||
Controller::Type type = myRightController.type();
|
const Controller::Type type = myRightController.type();
|
||||||
int id = noswap ? 1 : 0;
|
const int id = noswap ? 1 : 0;
|
||||||
myModeList.emplace_back(type, id, type, id, msg.str());
|
myModeList.emplace_back(type, id, type, id, msg.str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,7 +190,7 @@ bool PhysicalJoystickHandler::remove(int id)
|
||||||
// So we use the 'active' joystick list to access them
|
// So we use the 'active' joystick list to access them
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PhysicalJoystickPtr stick = mySticks.at(id);
|
const PhysicalJoystickPtr stick = mySticks.at(id);
|
||||||
|
|
||||||
const auto it = myDatabase.find(stick->name);
|
const auto it = myDatabase.find(stick->name);
|
||||||
if(it != myDatabase.end() && it->second.joy == stick)
|
if(it != myDatabase.end() && it->second.joy == stick)
|
||||||
|
@ -607,7 +607,7 @@ void PhysicalJoystickHandler::enableMapping(const Event::Type event, EventMode m
|
||||||
{
|
{
|
||||||
const PhysicalJoystickPtr j = stick.second;
|
const PhysicalJoystickPtr j = stick.second;
|
||||||
|
|
||||||
JoyMap::JoyMappingArray joyMappings = j->joyMap.getEventMapping(event, mode);
|
const JoyMap::JoyMappingArray joyMappings = j->joyMap.getEventMapping(event, mode);
|
||||||
|
|
||||||
for (const auto& mapping : joyMappings)
|
for (const auto& mapping : joyMappings)
|
||||||
j->joyMap.add(event, EventMode::kEmulationMode, mapping.button,
|
j->joyMap.add(event, EventMode::kEmulationMode, mapping.button,
|
||||||
|
@ -713,7 +713,7 @@ void PhysicalJoystickHandler::saveMapping()
|
||||||
|
|
||||||
for(const auto& [_name, _info]: myDatabase)
|
for(const auto& [_name, _info]: myDatabase)
|
||||||
{
|
{
|
||||||
json map = _info.joy ? _info.joy->getMap() : _info.mapping;
|
const 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);
|
||||||
}
|
}
|
||||||
|
@ -1042,8 +1042,9 @@ ostream& operator<<(ostream& os, const PhysicalJoystickHandler& jh)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void PhysicalJoystickHandler::changeDigitalDeadZone(int direction)
|
void PhysicalJoystickHandler::changeDigitalDeadZone(int direction)
|
||||||
{
|
{
|
||||||
int deadZone = BSPF::clamp(myOSystem.settings().getInt("joydeadzone") + direction,
|
const int deadZone =
|
||||||
Controller::MIN_DIGITAL_DEADZONE, Controller::MAX_DIGITAL_DEADZONE);
|
BSPF::clamp(myOSystem.settings().getInt("joydeadzone") + direction,
|
||||||
|
Controller::MIN_DIGITAL_DEADZONE, Controller::MAX_DIGITAL_DEADZONE);
|
||||||
myOSystem.settings().setValue("joydeadzone", deadZone);
|
myOSystem.settings().setValue("joydeadzone", deadZone);
|
||||||
|
|
||||||
Controller::setDigitalDeadZone(deadZone);
|
Controller::setDigitalDeadZone(deadZone);
|
||||||
|
@ -1051,15 +1052,17 @@ void PhysicalJoystickHandler::changeDigitalDeadZone(int direction)
|
||||||
ostringstream ss;
|
ostringstream ss;
|
||||||
ss << std::round(Controller::digitalDeadZoneValue(deadZone) * 100.F / 32768) << "%";
|
ss << std::round(Controller::digitalDeadZoneValue(deadZone) * 100.F / 32768) << "%";
|
||||||
|
|
||||||
myOSystem.frameBuffer().showGaugeMessage("Digital controller dead zone", ss. str(), deadZone,
|
myOSystem.frameBuffer().showGaugeMessage(
|
||||||
Controller::MIN_DIGITAL_DEADZONE, Controller::MAX_DIGITAL_DEADZONE);
|
"Digital controller dead zone", ss. str(), deadZone,
|
||||||
|
Controller::MIN_DIGITAL_DEADZONE, Controller::MAX_DIGITAL_DEADZONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void PhysicalJoystickHandler::changeAnalogPaddleDeadZone(int direction)
|
void PhysicalJoystickHandler::changeAnalogPaddleDeadZone(int direction)
|
||||||
{
|
{
|
||||||
int deadZone = BSPF::clamp(myOSystem.settings().getInt("adeadzone") + direction,
|
const int deadZone =
|
||||||
Controller::MIN_ANALOG_DEADZONE, Controller::MAX_ANALOG_DEADZONE);
|
BSPF::clamp(myOSystem.settings().getInt("adeadzone") + direction,
|
||||||
|
Controller::MIN_ANALOG_DEADZONE, Controller::MAX_ANALOG_DEADZONE);
|
||||||
myOSystem.settings().setValue("adeadzone", deadZone);
|
myOSystem.settings().setValue("adeadzone", deadZone);
|
||||||
|
|
||||||
Controller::setAnalogDeadZone(deadZone);
|
Controller::setAnalogDeadZone(deadZone);
|
||||||
|
@ -1067,15 +1070,17 @@ void PhysicalJoystickHandler::changeAnalogPaddleDeadZone(int direction)
|
||||||
ostringstream ss;
|
ostringstream ss;
|
||||||
ss << std::round(Controller::analogDeadZoneValue(deadZone) * 100.F / 32768) << "%";
|
ss << std::round(Controller::analogDeadZoneValue(deadZone) * 100.F / 32768) << "%";
|
||||||
|
|
||||||
myOSystem.frameBuffer().showGaugeMessage("Analog controller dead zone", ss.str(), deadZone,
|
myOSystem.frameBuffer().showGaugeMessage(
|
||||||
Controller::MIN_ANALOG_DEADZONE, Controller::MAX_ANALOG_DEADZONE);
|
"Analog controller dead zone", ss.str(), deadZone,
|
||||||
|
Controller::MIN_ANALOG_DEADZONE, Controller::MAX_ANALOG_DEADZONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void PhysicalJoystickHandler::changeAnalogPaddleSensitivity(int direction)
|
void PhysicalJoystickHandler::changeAnalogPaddleSensitivity(int direction)
|
||||||
{
|
{
|
||||||
int sense = BSPF::clamp(myOSystem.settings().getInt("psense") + direction,
|
const int sense =
|
||||||
Paddles::MIN_ANALOG_SENSE, Paddles::MAX_ANALOG_SENSE);
|
BSPF::clamp(myOSystem.settings().getInt("psense") + direction,
|
||||||
|
Paddles::MIN_ANALOG_SENSE, Paddles::MAX_ANALOG_SENSE);
|
||||||
myOSystem.settings().setValue("psense", sense);
|
myOSystem.settings().setValue("psense", sense);
|
||||||
|
|
||||||
Paddles::setAnalogSensitivity(sense);
|
Paddles::setAnalogSensitivity(sense);
|
||||||
|
@ -1083,15 +1088,17 @@ void PhysicalJoystickHandler::changeAnalogPaddleSensitivity(int direction)
|
||||||
ostringstream ss;
|
ostringstream ss;
|
||||||
ss << std::round(Paddles::analogSensitivityValue(sense) * 100.F) << "%";
|
ss << std::round(Paddles::analogSensitivityValue(sense) * 100.F) << "%";
|
||||||
|
|
||||||
myOSystem.frameBuffer().showGaugeMessage("Analog paddle sensitivity", ss.str(), sense,
|
myOSystem.frameBuffer().showGaugeMessage(
|
||||||
Paddles::MIN_ANALOG_SENSE, Paddles::MAX_ANALOG_SENSE);
|
"Analog paddle sensitivity", ss.str(), sense,
|
||||||
|
Paddles::MIN_ANALOG_SENSE, Paddles::MAX_ANALOG_SENSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void PhysicalJoystickHandler::changeAnalogPaddleLinearity(int direction)
|
void PhysicalJoystickHandler::changeAnalogPaddleLinearity(int direction)
|
||||||
{
|
{
|
||||||
int linear = BSPF::clamp(myOSystem.settings().getInt("plinear") + direction * 5,
|
const int linear =
|
||||||
Paddles::MIN_ANALOG_LINEARITY, Paddles::MAX_ANALOG_LINEARITY);
|
BSPF::clamp(myOSystem.settings().getInt("plinear") + direction * 5,
|
||||||
|
Paddles::MIN_ANALOG_LINEARITY, Paddles::MAX_ANALOG_LINEARITY);
|
||||||
myOSystem.settings().setValue("plinear", linear);
|
myOSystem.settings().setValue("plinear", linear);
|
||||||
|
|
||||||
Paddles::setAnalogLinearity(linear);
|
Paddles::setAnalogLinearity(linear);
|
||||||
|
@ -1102,15 +1109,17 @@ void PhysicalJoystickHandler::changeAnalogPaddleLinearity(int direction)
|
||||||
else
|
else
|
||||||
ss << "Off";
|
ss << "Off";
|
||||||
|
|
||||||
myOSystem.frameBuffer().showGaugeMessage("Analog paddle linearity", ss.str(), linear,
|
myOSystem.frameBuffer().showGaugeMessage(
|
||||||
Paddles::MIN_ANALOG_LINEARITY, Paddles::MAX_ANALOG_LINEARITY);
|
"Analog paddle linearity", ss.str(), linear,
|
||||||
|
Paddles::MIN_ANALOG_LINEARITY, Paddles::MAX_ANALOG_LINEARITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void PhysicalJoystickHandler::changePaddleDejitterAveraging(int direction)
|
void PhysicalJoystickHandler::changePaddleDejitterAveraging(int direction)
|
||||||
{
|
{
|
||||||
int dejitter = BSPF::clamp(myOSystem.settings().getInt("dejitter.base") + direction,
|
const int dejitter =
|
||||||
Paddles::MIN_DEJITTER, Paddles::MAX_DEJITTER);
|
BSPF::clamp(myOSystem.settings().getInt("dejitter.base") + direction,
|
||||||
|
Paddles::MIN_DEJITTER, Paddles::MAX_DEJITTER);
|
||||||
myOSystem.settings().setValue("dejitter.base", dejitter);
|
myOSystem.settings().setValue("dejitter.base", dejitter);
|
||||||
|
|
||||||
Paddles::setDejitterBase(dejitter);
|
Paddles::setDejitterBase(dejitter);
|
||||||
|
@ -1121,16 +1130,17 @@ void PhysicalJoystickHandler::changePaddleDejitterAveraging(int direction)
|
||||||
else
|
else
|
||||||
ss << "Off";
|
ss << "Off";
|
||||||
|
|
||||||
myOSystem.frameBuffer().showGaugeMessage("Analog paddle dejitter averaging",
|
myOSystem.frameBuffer().showGaugeMessage(
|
||||||
ss.str(), dejitter,
|
"Analog paddle dejitter averaging", ss.str(), dejitter,
|
||||||
Paddles::MIN_DEJITTER, Paddles::MAX_DEJITTER);
|
Paddles::MIN_DEJITTER, Paddles::MAX_DEJITTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void PhysicalJoystickHandler::changePaddleDejitterReaction(int direction)
|
void PhysicalJoystickHandler::changePaddleDejitterReaction(int direction)
|
||||||
{
|
{
|
||||||
int dejitter = BSPF::clamp(myOSystem.settings().getInt("dejitter.diff") + direction,
|
const int dejitter =
|
||||||
Paddles::MIN_DEJITTER, Paddles::MAX_DEJITTER);
|
BSPF::clamp(myOSystem.settings().getInt("dejitter.diff") + direction,
|
||||||
|
Paddles::MIN_DEJITTER, Paddles::MAX_DEJITTER);
|
||||||
myOSystem.settings().setValue("dejitter.diff", dejitter);
|
myOSystem.settings().setValue("dejitter.diff", dejitter);
|
||||||
|
|
||||||
Paddles::setDejitterDiff(dejitter);
|
Paddles::setDejitterDiff(dejitter);
|
||||||
|
@ -1141,16 +1151,17 @@ void PhysicalJoystickHandler::changePaddleDejitterReaction(int direction)
|
||||||
else
|
else
|
||||||
ss << "Off";
|
ss << "Off";
|
||||||
|
|
||||||
myOSystem.frameBuffer().showGaugeMessage("Analog paddle dejitter reaction",
|
myOSystem.frameBuffer().showGaugeMessage(
|
||||||
ss.str(), dejitter,
|
"Analog paddle dejitter reaction", ss.str(), dejitter,
|
||||||
Paddles::MIN_DEJITTER, Paddles::MAX_DEJITTER);
|
Paddles::MIN_DEJITTER, Paddles::MAX_DEJITTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void PhysicalJoystickHandler::changeDigitalPaddleSensitivity(int direction)
|
void PhysicalJoystickHandler::changeDigitalPaddleSensitivity(int direction)
|
||||||
{
|
{
|
||||||
int sense = BSPF::clamp(myOSystem.settings().getInt("dsense") + direction,
|
const int sense =
|
||||||
Paddles::MIN_DIGITAL_SENSE, Paddles::MAX_DIGITAL_SENSE);
|
BSPF::clamp(myOSystem.settings().getInt("dsense") + direction,
|
||||||
|
Paddles::MIN_DIGITAL_SENSE, Paddles::MAX_DIGITAL_SENSE);
|
||||||
myOSystem.settings().setValue("dsense", sense);
|
myOSystem.settings().setValue("dsense", sense);
|
||||||
|
|
||||||
Paddles::setDigitalSensitivity(sense);
|
Paddles::setDigitalSensitivity(sense);
|
||||||
|
@ -1161,16 +1172,17 @@ void PhysicalJoystickHandler::changeDigitalPaddleSensitivity(int direction)
|
||||||
else
|
else
|
||||||
ss << "Off";
|
ss << "Off";
|
||||||
|
|
||||||
myOSystem.frameBuffer().showGaugeMessage("Digital sensitivity",
|
myOSystem.frameBuffer().showGaugeMessage(
|
||||||
ss.str(), sense,
|
"Digital sensitivity", ss.str(), sense,
|
||||||
Paddles::MIN_DIGITAL_SENSE, Paddles::MAX_DIGITAL_SENSE);
|
Paddles::MIN_DIGITAL_SENSE, Paddles::MAX_DIGITAL_SENSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void PhysicalJoystickHandler::changeMousePaddleSensitivity(int direction)
|
void PhysicalJoystickHandler::changeMousePaddleSensitivity(int direction)
|
||||||
{
|
{
|
||||||
int sense = BSPF::clamp(myOSystem.settings().getInt("msense") + direction,
|
const int sense =
|
||||||
Controller::MIN_MOUSE_SENSE, Controller::MAX_MOUSE_SENSE);
|
BSPF::clamp(myOSystem.settings().getInt("msense") + direction,
|
||||||
|
Controller::MIN_MOUSE_SENSE, Controller::MAX_MOUSE_SENSE);
|
||||||
myOSystem.settings().setValue("msense", sense);
|
myOSystem.settings().setValue("msense", sense);
|
||||||
|
|
||||||
Controller::setMouseSensitivity(sense);
|
Controller::setMouseSensitivity(sense);
|
||||||
|
@ -1178,16 +1190,17 @@ void PhysicalJoystickHandler::changeMousePaddleSensitivity(int direction)
|
||||||
ostringstream ss;
|
ostringstream ss;
|
||||||
ss << sense * 10 << "%";
|
ss << sense * 10 << "%";
|
||||||
|
|
||||||
myOSystem.frameBuffer().showGaugeMessage("Mouse paddle sensitivity",
|
myOSystem.frameBuffer().showGaugeMessage(
|
||||||
ss.str(), sense,
|
"Mouse paddle sensitivity", ss.str(), sense,
|
||||||
Controller::MIN_MOUSE_SENSE, Controller::MAX_MOUSE_SENSE);
|
Controller::MIN_MOUSE_SENSE, Controller::MAX_MOUSE_SENSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void PhysicalJoystickHandler::changeMouseTrackballSensitivity(int direction)
|
void PhysicalJoystickHandler::changeMouseTrackballSensitivity(int direction)
|
||||||
{
|
{
|
||||||
int sense = BSPF::clamp(myOSystem.settings().getInt("tsense") + direction,
|
const int sense =
|
||||||
PointingDevice::MIN_SENSE, PointingDevice::MAX_SENSE);
|
BSPF::clamp(myOSystem.settings().getInt("tsense") + direction,
|
||||||
|
PointingDevice::MIN_SENSE, PointingDevice::MAX_SENSE);
|
||||||
myOSystem.settings().setValue("tsense", sense);
|
myOSystem.settings().setValue("tsense", sense);
|
||||||
|
|
||||||
PointingDevice::setSensitivity(sense);
|
PointingDevice::setSensitivity(sense);
|
||||||
|
@ -1195,16 +1208,17 @@ void PhysicalJoystickHandler::changeMouseTrackballSensitivity(int direction)
|
||||||
ostringstream ss;
|
ostringstream ss;
|
||||||
ss << sense * 10 << "%";
|
ss << sense * 10 << "%";
|
||||||
|
|
||||||
myOSystem.frameBuffer().showGaugeMessage("Mouse trackball sensitivity",
|
myOSystem.frameBuffer().showGaugeMessage(
|
||||||
ss.str(), sense,
|
"Mouse trackball sensitivity", ss.str(), sense,
|
||||||
PointingDevice::MIN_SENSE, PointingDevice::MAX_SENSE);
|
PointingDevice::MIN_SENSE, PointingDevice::MAX_SENSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void PhysicalJoystickHandler::changeDrivingSensitivity(int direction)
|
void PhysicalJoystickHandler::changeDrivingSensitivity(int direction)
|
||||||
{
|
{
|
||||||
int sense = BSPF::clamp(myOSystem.settings().getInt("dcsense") + direction,
|
const int sense =
|
||||||
Driving::MIN_SENSE, Driving::MAX_SENSE);
|
BSPF::clamp(myOSystem.settings().getInt("dcsense") + direction,
|
||||||
|
Driving::MIN_SENSE, Driving::MAX_SENSE);
|
||||||
myOSystem.settings().setValue("dcsense", sense);
|
myOSystem.settings().setValue("dcsense", sense);
|
||||||
|
|
||||||
Driving::setSensitivity(sense);
|
Driving::setSensitivity(sense);
|
||||||
|
@ -1212,9 +1226,9 @@ void PhysicalJoystickHandler::changeDrivingSensitivity(int direction)
|
||||||
ostringstream ss;
|
ostringstream ss;
|
||||||
ss << sense * 10 << "%";
|
ss << sense * 10 << "%";
|
||||||
|
|
||||||
myOSystem.frameBuffer().showGaugeMessage("Driving controller sensitivity",
|
myOSystem.frameBuffer().showGaugeMessage(
|
||||||
ss.str(), sense,
|
"Driving controller sensitivity", ss.str(), sense,
|
||||||
Driving::MIN_SENSE, Driving::MAX_SENSE);
|
Driving::MIN_SENSE, Driving::MAX_SENSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -44,7 +44,7 @@ PhysicalKeyboardHandler::PhysicalKeyboardHandler(OSystem& system, EventHandler&
|
||||||
: myOSystem{system},
|
: myOSystem{system},
|
||||||
myHandler{handler}
|
myHandler{handler}
|
||||||
{
|
{
|
||||||
Int32 version = myOSystem.settings().getInt("event_ver");
|
const Int32 version = myOSystem.settings().getInt("event_ver");
|
||||||
bool updateDefaults = false;
|
bool updateDefaults = false;
|
||||||
|
|
||||||
// Compare if event list version has changed so that key maps became invalid
|
// Compare if event list version has changed so that key maps became invalid
|
||||||
|
@ -396,7 +396,7 @@ void PhysicalKeyboardHandler::enableMapping(const Event::Type event,
|
||||||
EventMode mode)
|
EventMode mode)
|
||||||
{
|
{
|
||||||
// copy from controller mode into emulation mode
|
// copy from controller mode into emulation mode
|
||||||
KeyMap::MappingArray mappings = myKeyMap.getEventMapping(event, mode);
|
const KeyMap::MappingArray mappings = myKeyMap.getEventMapping(event, mode);
|
||||||
|
|
||||||
for (const auto& mapping : mappings)
|
for (const auto& mapping : mappings)
|
||||||
myKeyMap.add(event, EventMode::kEmulationMode, mapping.key, mapping.mod);
|
myKeyMap.add(event, EventMode::kEmulationMode, mapping.key, mapping.mod);
|
||||||
|
|
|
@ -295,9 +295,9 @@ void PNGLibrary::takeSnapshot(uInt32 number)
|
||||||
|
|
||||||
// Figure out the correct snapshot name
|
// Figure out the correct snapshot name
|
||||||
string filename;
|
string filename;
|
||||||
string sspath = myOSystem.snapshotSaveDir().getPath() +
|
const string sspath = myOSystem.snapshotSaveDir().getPath() +
|
||||||
(myOSystem.settings().getString("snapname") != "int" ?
|
(myOSystem.settings().getString("snapname") != "int"
|
||||||
myOSystem.romFile().getNameWithExt()
|
? myOSystem.romFile().getNameWithExt("")
|
||||||
: myOSystem.console().properties().get(PropType::Cart_Name));
|
: myOSystem.console().properties().get(PropType::Cart_Name));
|
||||||
|
|
||||||
// Check whether we want multiple snapshots created
|
// Check whether we want multiple snapshots created
|
||||||
|
@ -313,7 +313,7 @@ void PNGLibrary::takeSnapshot(uInt32 number)
|
||||||
// Determine if the file already exists, checking each successive filename
|
// Determine if the file already exists, checking each successive filename
|
||||||
// until one doesn't exist
|
// until one doesn't exist
|
||||||
filename = sspath + ".png";
|
filename = sspath + ".png";
|
||||||
FSNode node(filename);
|
const FSNode node(filename);
|
||||||
if(node.exists())
|
if(node.exists())
|
||||||
{
|
{
|
||||||
ostringstream buf;
|
ostringstream buf;
|
||||||
|
@ -321,7 +321,7 @@ void PNGLibrary::takeSnapshot(uInt32 number)
|
||||||
{
|
{
|
||||||
buf.str("");
|
buf.str("");
|
||||||
buf << sspath << "_" << i << ".png";
|
buf << sspath << "_" << i << ".png";
|
||||||
FSNode next(buf.str());
|
const FSNode next(buf.str());
|
||||||
if(!next.exists())
|
if(!next.exists())
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -477,7 +477,6 @@ void PaletteHandler::generateCustomPalette(ConsoleTiming timing) const
|
||||||
float G = Y + dotProduct(IQ[chroma], IQG);
|
float G = Y + dotProduct(IQ[chroma], IQG);
|
||||||
float B = Y + dotProduct(IQ[chroma], IQB);
|
float B = Y + dotProduct(IQ[chroma], IQB);
|
||||||
|
|
||||||
|
|
||||||
if(R < 0) R = 0;
|
if(R < 0) R = 0;
|
||||||
if(G < 0) G = 0;
|
if(G < 0) G = 0;
|
||||||
if(B < 0) B = 0;
|
if(B < 0) B = 0;
|
||||||
|
@ -486,9 +485,9 @@ void PaletteHandler::generateCustomPalette(ConsoleTiming timing) const
|
||||||
G = powf(G, 0.9F);
|
G = powf(G, 0.9F);
|
||||||
B = powf(B, 0.9F);
|
B = powf(B, 0.9F);
|
||||||
|
|
||||||
int r = BSPF::clamp(R * 255.F, 0.F, 255.F);
|
const int r = BSPF::clamp(R * 255.F, 0.F, 255.F),
|
||||||
int g = BSPF::clamp(G * 255.F, 0.F, 255.F);
|
g = BSPF::clamp(G * 255.F, 0.F, 255.F),
|
||||||
int b = BSPF::clamp(B * 255.F, 0.F, 255.F);
|
b = BSPF::clamp(B * 255.F, 0.F, 255.F);
|
||||||
|
|
||||||
ourCustomNTSCPalette[(chroma * NUM_LUMA + luma) << 1] = (r << 16) + (g << 8) + b;
|
ourCustomNTSCPalette[(chroma * NUM_LUMA + luma) << 1] = (r << 16) + (g << 8) + b;
|
||||||
}
|
}
|
||||||
|
@ -504,7 +503,7 @@ void PaletteHandler::generateCustomPalette(ConsoleTiming timing) const
|
||||||
// colors 0, 1, 14 and 15 are grayscale
|
// colors 0, 1, 14 and 15 are grayscale
|
||||||
for(int chroma = 2; chroma < NUM_CHROMA - 2; chroma++)
|
for(int chroma = 2; chroma < NUM_CHROMA - 2; chroma++)
|
||||||
{
|
{
|
||||||
int idx = NUM_CHROMA - 1 - chroma;
|
const int idx = NUM_CHROMA - 1 - chroma;
|
||||||
|
|
||||||
UV[idx].x = SATURATION * sinf(offset - fixedShift * chroma);
|
UV[idx].x = SATURATION * sinf(offset - fixedShift * chroma);
|
||||||
if ((idx & 1) == 0)
|
if ((idx & 1) == 0)
|
||||||
|
@ -539,9 +538,9 @@ void PaletteHandler::generateCustomPalette(ConsoleTiming timing) const
|
||||||
G = powf(G, 1.2F);
|
G = powf(G, 1.2F);
|
||||||
B = powf(B, 1.2F);
|
B = powf(B, 1.2F);
|
||||||
|
|
||||||
int r = BSPF::clamp(R * 255.F, 0.F, 255.F);
|
const int r = BSPF::clamp(R * 255.F, 0.F, 255.F),
|
||||||
int g = BSPF::clamp(G * 255.F, 0.F, 255.F);
|
g = BSPF::clamp(G * 255.F, 0.F, 255.F),
|
||||||
int b = BSPF::clamp(B * 255.F, 0.F, 255.F);
|
b = BSPF::clamp(B * 255.F, 0.F, 255.F);
|
||||||
|
|
||||||
ourCustomPALPalette[(chroma * NUM_LUMA + luma) << 1] = (r << 16) + (g << 8) + b;
|
ourCustomPALPalette[(chroma * NUM_LUMA + luma) << 1] = (r << 16) + (g << 8) + b;
|
||||||
}
|
}
|
||||||
|
|
|
@ -245,7 +245,7 @@ string RewindManager::saveAllStates()
|
||||||
|
|
||||||
const uInt32 curIdx = getCurrentIdx();
|
const uInt32 curIdx = getCurrentIdx();
|
||||||
rewindStates(MAX_BUF_SIZE);
|
rewindStates(MAX_BUF_SIZE);
|
||||||
uInt32 numStates = static_cast<uInt32>(cyclesList().size());
|
const uInt32 numStates = static_cast<uInt32>(cyclesList().size());
|
||||||
|
|
||||||
// Save header
|
// Save header
|
||||||
buf.str("");
|
buf.str("");
|
||||||
|
@ -296,7 +296,7 @@ string RewindManager::loadAllStates()
|
||||||
<< ".sta";
|
<< ".sta";
|
||||||
|
|
||||||
// Make sure the file can be opened for reading
|
// Make sure the file can be opened for reading
|
||||||
Serializer in(buf.str(), Serializer::Mode::ReadOnly);
|
const Serializer in(buf.str(), Serializer::Mode::ReadOnly);
|
||||||
if (!in)
|
if (!in)
|
||||||
return "Can't load from all states file";
|
return "Can't load from all states file";
|
||||||
|
|
||||||
|
|
|
@ -159,7 +159,7 @@ void SoundSDL2::setEnabled(bool enable)
|
||||||
void SoundSDL2::open(shared_ptr<AudioQueue> audioQueue,
|
void SoundSDL2::open(shared_ptr<AudioQueue> audioQueue,
|
||||||
EmulationTiming* emulationTiming)
|
EmulationTiming* emulationTiming)
|
||||||
{
|
{
|
||||||
string pre_about = myAboutString;
|
const string pre_about = myAboutString;
|
||||||
|
|
||||||
// Do we need to re-open the sound device?
|
// Do we need to re-open the sound device?
|
||||||
// Only do this when absolutely necessary
|
// Only do this when absolutely necessary
|
||||||
|
@ -344,12 +344,13 @@ void SoundSDL2::processFragment(float* stream, uInt32 length)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void SoundSDL2::initResampler()
|
void SoundSDL2::initResampler()
|
||||||
{
|
{
|
||||||
Resampler::NextFragmentCallback nextFragmentCallback = [this] () -> Int16* {
|
const Resampler::NextFragmentCallback nextFragmentCallback = [this] () -> Int16* {
|
||||||
Int16* nextFragment = nullptr;
|
Int16* nextFragment = nullptr;
|
||||||
|
|
||||||
if(myUnderrun)
|
if(myUnderrun)
|
||||||
nextFragment = myAudioQueue->size() >= myEmulationTiming->prebufferFragmentCount() ?
|
nextFragment = myAudioQueue->size() >= myEmulationTiming->prebufferFragmentCount()
|
||||||
myAudioQueue->dequeue(myCurrentFragment) : nullptr;
|
? myAudioQueue->dequeue(myCurrentFragment)
|
||||||
|
: nullptr;
|
||||||
else
|
else
|
||||||
nextFragment = myAudioQueue->dequeue(myCurrentFragment);
|
nextFragment = myAudioQueue->dequeue(myCurrentFragment);
|
||||||
|
|
||||||
|
@ -360,10 +361,10 @@ void SoundSDL2::initResampler()
|
||||||
return nextFragment;
|
return nextFragment;
|
||||||
};
|
};
|
||||||
|
|
||||||
Resampler::Format formatFrom =
|
const Resampler::Format formatFrom =
|
||||||
Resampler::Format(myEmulationTiming->audioSampleRate(),
|
Resampler::Format(myEmulationTiming->audioSampleRate(),
|
||||||
myAudioQueue->fragmentSize(), myAudioQueue->isStereo());
|
myAudioQueue->fragmentSize(), myAudioQueue->isStereo());
|
||||||
Resampler::Format formatTo =
|
const Resampler::Format formatTo =
|
||||||
Resampler::Format(myHardwareSpec.freq, myHardwareSpec.samples,
|
Resampler::Format(myHardwareSpec.freq, myHardwareSpec.samples,
|
||||||
myHardwareSpec.channels > 1);
|
myHardwareSpec.channels > 1);
|
||||||
|
|
||||||
|
@ -401,39 +402,44 @@ void SoundSDL2::callback(void* udata, uInt8* stream, int len)
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
bool SoundSDL2::playWav(const string& fileName, uInt32 position, uInt32 length)
|
bool SoundSDL2::playWav(const string& fileName, const uInt32 position,
|
||||||
|
const uInt32 length)
|
||||||
{
|
{
|
||||||
uInt32 wavLength{0};
|
|
||||||
|
|
||||||
// Stop any playing WAVs
|
|
||||||
stopWav();
|
|
||||||
|
|
||||||
// Load WAV file
|
// Load WAV file
|
||||||
auto* result = SDL_LoadWAV(fileName.c_str(), &myWavSpec, &myWavBuffer, &wavLength);
|
if(fileName != myWavFilename || myWavBuffer == nullptr)
|
||||||
if(result == nullptr || position > wavLength)
|
{
|
||||||
|
if(myWavBuffer)
|
||||||
|
{
|
||||||
|
SDL_FreeWAV(myWavBuffer);
|
||||||
|
myWavBuffer = nullptr;
|
||||||
|
}
|
||||||
|
if(SDL_LoadWAV(fileName.c_str(), &myWavSpec, &myWavBuffer, &myWavLength) == nullptr)
|
||||||
|
return false;
|
||||||
|
// Set the callback function
|
||||||
|
myWavSpec.callback = wavCallback;
|
||||||
|
myWavSpec.userdata = nullptr;
|
||||||
|
}
|
||||||
|
if(position > myWavLength)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
length = length
|
myWavFilename = fileName;
|
||||||
? std::min(length, wavLength - position)
|
|
||||||
: wavLength;
|
|
||||||
|
|
||||||
// Set the callback function
|
|
||||||
myWavSpec.callback = wavCallback;
|
|
||||||
myWavSpec.userdata = nullptr;
|
|
||||||
|
|
||||||
|
myWavLen = length
|
||||||
|
? std::min(length, myWavLength - position)
|
||||||
|
: myWavLength;
|
||||||
myWavPos = myWavBuffer + position;
|
myWavPos = myWavBuffer + position;
|
||||||
myWavLen = length;
|
|
||||||
|
|
||||||
// Open audio device
|
// Open audio device
|
||||||
const char* device = myDeviceId ? myDevices.at(myDeviceId).first.c_str() : nullptr;
|
|
||||||
|
|
||||||
myWavDevice = SDL_OpenAudioDevice(device, 0, &myWavSpec, nullptr, 0);
|
|
||||||
if(!myWavDevice)
|
if(!myWavDevice)
|
||||||
return false;
|
{
|
||||||
|
const char* device = myDeviceId ? myDevices.at(myDeviceId).first.c_str() : nullptr;
|
||||||
// Play audio
|
|
||||||
SDL_PauseAudioDevice(myWavDevice, 0);
|
|
||||||
|
|
||||||
|
myWavDevice = SDL_OpenAudioDevice(device, 0, &myWavSpec, nullptr, 0);
|
||||||
|
if(!myWavDevice)
|
||||||
|
return false;
|
||||||
|
// Play audio
|
||||||
|
SDL_PauseAudioDevice(myWavDevice, 0);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -443,9 +449,10 @@ void SoundSDL2::stopWav()
|
||||||
if(myWavBuffer)
|
if(myWavBuffer)
|
||||||
{
|
{
|
||||||
// Clean up
|
// Clean up
|
||||||
|
myWavLen = 0;
|
||||||
SDL_CloseAudioDevice(myWavDevice);
|
SDL_CloseAudioDevice(myWavDevice);
|
||||||
|
myWavDevice = 0;
|
||||||
SDL_FreeWAV(myWavBuffer);
|
SDL_FreeWAV(myWavBuffer);
|
||||||
|
|
||||||
myWavBuffer = nullptr;
|
myWavBuffer = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,8 +116,8 @@ class SoundSDL2 : public Sound
|
||||||
|
|
||||||
@return True, if the WAV file can be played
|
@return True, if the WAV file can be played
|
||||||
*/
|
*/
|
||||||
bool playWav(const string& fileName, uInt32 position = 0,
|
bool playWav(const string& fileName, const uInt32 position = 0,
|
||||||
uInt32 length = 0) override;
|
const uInt32 length = 0) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Stop any currently playing WAV file.
|
Stop any currently playing WAV file.
|
||||||
|
@ -186,6 +186,8 @@ class SoundSDL2 : public Sound
|
||||||
AudioSettings& myAudioSettings;
|
AudioSettings& myAudioSettings;
|
||||||
|
|
||||||
// WAV file sound variables
|
// WAV file sound variables
|
||||||
|
string myWavFilename{EmptyString};
|
||||||
|
uInt32 myWavLength{0};
|
||||||
SDL_AudioDeviceID myWavDevice{0};
|
SDL_AudioDeviceID myWavDevice{0};
|
||||||
uInt8* myWavBuffer{nullptr};
|
uInt8* myWavBuffer{nullptr};
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ using namespace std::chrono;
|
||||||
namespace {
|
namespace {
|
||||||
string currentTimestamp()
|
string currentTimestamp()
|
||||||
{
|
{
|
||||||
std::tm now = BSPF::localTime();
|
const std::tm now = BSPF::localTime();
|
||||||
|
|
||||||
std::array<char, 100> formattedTime;
|
std::array<char, 100> formattedTime;
|
||||||
formattedTime.fill(0);
|
formattedTime.fill(0);
|
||||||
|
@ -57,7 +57,7 @@ StaggeredLogger::~StaggeredLogger()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void StaggeredLogger::log()
|
void StaggeredLogger::log()
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(myMutex);
|
const std::lock_guard<std::mutex> lock(myMutex);
|
||||||
|
|
||||||
_log();
|
_log();
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ void StaggeredLogger::startInterval()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void StaggeredLogger::onTimerExpired(uInt32 timerCallbackId)
|
void StaggeredLogger::onTimerExpired(uInt32 timerCallbackId)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(myMutex);
|
const std::lock_guard<std::mutex> lock(myMutex);
|
||||||
|
|
||||||
if (timerCallbackId != myTimerCallbackId) return;
|
if (timerCallbackId != myTimerCallbackId) return;
|
||||||
|
|
||||||
|
|
|
@ -313,7 +313,7 @@ void StateManager::changeState(int direction)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void StateManager::toggleAutoSlot()
|
void StateManager::toggleAutoSlot()
|
||||||
{
|
{
|
||||||
bool autoSlot = !myOSystem.settings().getBool("autoslot");
|
const bool autoSlot = !myOSystem.settings().getBool("autoslot");
|
||||||
|
|
||||||
// Print appropriate message
|
// Print appropriate message
|
||||||
ostringstream buf;
|
ostringstream buf;
|
||||||
|
|
|
@ -98,14 +98,14 @@ void TimerManager::clear()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
std::size_t TimerManager::size() const noexcept
|
std::size_t TimerManager::size() const noexcept
|
||||||
{
|
{
|
||||||
ScopedLock lock(sync);
|
const ScopedLock lock(sync);
|
||||||
return active.size();
|
return active.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
bool TimerManager::empty() const noexcept
|
bool TimerManager::empty() const noexcept
|
||||||
{
|
{
|
||||||
ScopedLock lock(sync);
|
const ScopedLock lock(sync);
|
||||||
return active.empty();
|
return active.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -284,7 +284,7 @@ void ZipHandler::ZipFile::readEcd()
|
||||||
buflen = myLength;
|
buflen = myLength;
|
||||||
|
|
||||||
// Allocate buffer
|
// Allocate buffer
|
||||||
ByteBuffer buffer = make_unique<uInt8[]>(buflen + 1);
|
const ByteBuffer buffer = make_unique<uInt8[]>(buflen + 1);
|
||||||
if(buffer == nullptr)
|
if(buffer == nullptr)
|
||||||
throw runtime_error(errorMessage(ZipError::OUT_OF_MEMORY));
|
throw runtime_error(errorMessage(ZipError::OUT_OF_MEMORY));
|
||||||
|
|
||||||
|
|
|
@ -259,7 +259,7 @@ int main(int ac, char* av[])
|
||||||
// Check to see if the user requested info about a specific ROM,
|
// Check to see if the user requested info about a specific ROM,
|
||||||
// or the list of internal ROMs
|
// or the list of internal ROMs
|
||||||
// If so, show the information and immediately exit
|
// If so, show the information and immediately exit
|
||||||
string romfile = localOpts["ROMFILE"].toString();
|
const string romfile = localOpts["ROMFILE"].toString();
|
||||||
if(localOpts["listrominfo"].toBool())
|
if(localOpts["listrominfo"].toBool())
|
||||||
{
|
{
|
||||||
attachConsole();
|
attachConsole();
|
||||||
|
@ -272,7 +272,7 @@ int main(int ac, char* av[])
|
||||||
{
|
{
|
||||||
attachConsole();
|
attachConsole();
|
||||||
Logger::debug("Showing output from 'rominfo' ...");
|
Logger::debug("Showing output from 'rominfo' ...");
|
||||||
FSNode romnode(romfile);
|
const FSNode romnode(romfile);
|
||||||
Logger::error(theOSystem->getROMInfo(romnode));
|
Logger::error(theOSystem->getROMInfo(romnode));
|
||||||
freeConsole();
|
freeConsole();
|
||||||
return Cleanup();
|
return Cleanup();
|
||||||
|
@ -293,11 +293,11 @@ int main(int ac, char* av[])
|
||||||
// open the rom launcher in that directory.
|
// open the rom launcher in that directory.
|
||||||
// If not, use the built-in ROM launcher. In this case, we enter 'launcher'
|
// If not, use the built-in ROM launcher. In this case, we enter 'launcher'
|
||||||
// mode and let the main event loop take care of opening a new console/ROM.
|
// mode and let the main event loop take care of opening a new console/ROM.
|
||||||
FSNode romnode(romfile);
|
const FSNode romnode(romfile);
|
||||||
if(romfile.empty() || romnode.isDirectory())
|
if(romfile.empty() || romnode.isDirectory())
|
||||||
{
|
{
|
||||||
Logger::debug("Attempting to use ROM launcher ...");
|
Logger::debug("Attempting to use ROM launcher ...");
|
||||||
bool launcherOpened = !romfile.empty() ?
|
const bool launcherOpened = !romfile.empty() ?
|
||||||
theOSystem->createLauncher(romnode.getPath()) : theOSystem->createLauncher();
|
theOSystem->createLauncher(romnode.getPath()) : theOSystem->createLauncher();
|
||||||
if(!launcherOpened)
|
if(!launcherOpened)
|
||||||
{
|
{
|
||||||
|
@ -336,7 +336,7 @@ int main(int ac, char* av[])
|
||||||
if(!localOpts["break"].toString().empty())
|
if(!localOpts["break"].toString().empty())
|
||||||
{
|
{
|
||||||
Debugger& dbg = theOSystem->debugger();
|
Debugger& dbg = theOSystem->debugger();
|
||||||
uInt16 bp = uInt16(dbg.stringToValue(localOpts["break"].toString()));
|
const uInt16 bp = uInt16(dbg.stringToValue(localOpts["break"].toString()));
|
||||||
dbg.setBreakPoint(bp);
|
dbg.setBreakPoint(bp);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -23,7 +23,7 @@ using nlohmann::json;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
json jsonIfValid(const string& s) {
|
json jsonIfValid(const string& s) {
|
||||||
json parsed = json::parse(s, nullptr, false);
|
const json parsed = json::parse(s, nullptr, false);
|
||||||
|
|
||||||
return parsed.is_discarded() ? json(s) : parsed;
|
return parsed.is_discarded() ? json(s) : parsed;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ void SqliteDatabase::initialize()
|
||||||
|
|
||||||
if (!dbInitialized) {
|
if (!dbInitialized) {
|
||||||
if (myHandle) {
|
if (myHandle) {
|
||||||
string emsg = sqlite3_errmsg(myHandle);
|
const string emsg = sqlite3_errmsg(myHandle);
|
||||||
|
|
||||||
sqlite3_close_v2(myHandle);
|
sqlite3_close_v2(myHandle);
|
||||||
myHandle = nullptr;
|
myHandle = nullptr;
|
||||||
|
|
|
@ -68,7 +68,7 @@ void BilinearBlitter::free()
|
||||||
|
|
||||||
ASSERT_MAIN_THREAD;
|
ASSERT_MAIN_THREAD;
|
||||||
|
|
||||||
std::array<SDL_Texture*, 2> textures = { myTexture, mySecondaryTexture };
|
const std::array<SDL_Texture*, 2> textures = { myTexture, mySecondaryTexture };
|
||||||
for (SDL_Texture* texture: textures) {
|
for (SDL_Texture* texture: textures) {
|
||||||
if (!texture) continue;
|
if (!texture) continue;
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ void BilinearBlitter::recreateTexturesIfNecessary()
|
||||||
if (myAttributes.blending) {
|
if (myAttributes.blending) {
|
||||||
const auto blendAlpha = static_cast<uInt8>(myAttributes.blendalpha * 2.55);
|
const auto blendAlpha = static_cast<uInt8>(myAttributes.blendalpha * 2.55);
|
||||||
|
|
||||||
std::array<SDL_Texture*, 2> textures = { myTexture, mySecondaryTexture };
|
const std::array<SDL_Texture*, 2> textures = { myTexture, mySecondaryTexture };
|
||||||
for (SDL_Texture* texture: textures) {
|
for (SDL_Texture* texture: textures) {
|
||||||
if (!texture) continue;
|
if (!texture) continue;
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ void QisBlitter::free()
|
||||||
|
|
||||||
ASSERT_MAIN_THREAD;
|
ASSERT_MAIN_THREAD;
|
||||||
|
|
||||||
std::array<SDL_Texture*, 3> textures = {
|
const std::array<SDL_Texture*, 3> textures = {
|
||||||
mySrcTexture, myIntermediateTexture, mySecondaryIntermedateTexture
|
mySrcTexture, myIntermediateTexture, mySecondaryIntermedateTexture
|
||||||
};
|
};
|
||||||
for (SDL_Texture* texture: textures) {
|
for (SDL_Texture* texture: textures) {
|
||||||
|
@ -183,7 +183,7 @@ void QisBlitter::recreateTexturesIfNecessary()
|
||||||
if (myAttributes.blending) {
|
if (myAttributes.blending) {
|
||||||
const auto blendAlpha = static_cast<uInt8>(myAttributes.blendalpha * 2.55);
|
const auto blendAlpha = static_cast<uInt8>(myAttributes.blendalpha * 2.55);
|
||||||
|
|
||||||
std::array<SDL_Texture*, 3> textures = {
|
const std::array<SDL_Texture*, 3> textures = {
|
||||||
mySrcTexture, myIntermediateTexture, mySecondaryIntermedateTexture
|
mySrcTexture, myIntermediateTexture, mySecondaryIntermedateTexture
|
||||||
};
|
};
|
||||||
for (SDL_Texture* texture: textures) {
|
for (SDL_Texture* texture: textures) {
|
||||||
|
|
|
@ -343,12 +343,10 @@ void AtariNTSC::init(init_t& impl, const Setup& setup)
|
||||||
int n2 = 3;
|
int n2 = 3;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
float i = *in++;
|
*out++ = *in++;
|
||||||
float q = *in++;
|
*out++ = *in++;
|
||||||
*out++ = i;
|
|
||||||
*out++ = q;
|
|
||||||
}
|
}
|
||||||
while ( --n2 );
|
while (--n2);
|
||||||
#if 0 // burst_count is always 0
|
#if 0 // burst_count is always 0
|
||||||
if ( burst_count > 1 )
|
if ( burst_count > 1 )
|
||||||
ROTATE_IQ( s, c, 0.866025F, -0.5F ); /* +120 degrees */
|
ROTATE_IQ( s, c, 0.866025F, -0.5F ); /* +120 degrees */
|
||||||
|
@ -387,7 +385,7 @@ void AtariNTSC::initFilters(init_t& impl, const Setup& setup)
|
||||||
pow_a_n * cosf( maxh * angle ) +
|
pow_a_n * cosf( maxh * angle ) +
|
||||||
pow_a_n * rolloff * cosf( (maxh - 1) * angle );
|
pow_a_n * rolloff * cosf( (maxh - 1) * angle );
|
||||||
const float den = 1 - rolloff_cos_a - rolloff_cos_a + rolloff * rolloff;
|
const float den = 1 - rolloff_cos_a - rolloff_cos_a + rolloff * rolloff;
|
||||||
float dsf = num / den;
|
const float dsf = num / den;
|
||||||
kernels [kernel_size * 3 / 2 - kernel_half + i] = dsf - 0.5F;
|
kernels [kernel_size * 3 / 2 - kernel_half + i] = dsf - 0.5F;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,7 +395,7 @@ void AtariNTSC::initFilters(init_t& impl, const Setup& setup)
|
||||||
for ( int i = 0; i < kernel_half * 2 + 1; i++ )
|
for ( int i = 0; i < kernel_half * 2 + 1; i++ )
|
||||||
{
|
{
|
||||||
const float x = BSPF::PI_f * 2 / (kernel_half * 2) * i;
|
const float x = BSPF::PI_f * 2 / (kernel_half * 2) * i;
|
||||||
float blackman = 0.42F - 0.5F * cosf( x ) + 0.08F * cosf( x * 2 );
|
const float blackman = 0.42F - 0.5F * cosf( x ) + 0.08F * cosf( x * 2 );
|
||||||
sum += (kernels [kernel_size * 3 / 2 - kernel_half + i] *= blackman);
|
sum += (kernels [kernel_size * 3 / 2 - kernel_half + i] *= blackman);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -454,12 +452,12 @@ void AtariNTSC::initFilters(init_t& impl, const Setup& setup)
|
||||||
for ( int i = 0; i < kernel_size * 2; i++ )
|
for ( int i = 0; i < kernel_size * 2; i++ )
|
||||||
{
|
{
|
||||||
const float cur = kernels [i];
|
const float cur = kernels [i];
|
||||||
float m = cur * weight;
|
const float m = cur * weight;
|
||||||
*out++ = m + remain;
|
*out++ = m + remain;
|
||||||
remain = cur - m;
|
remain = cur - m;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while ( --n );
|
while (--n);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -101,7 +101,7 @@ bool BreakpointMap::check(const uInt16 addr, const uInt8 bank) const
|
||||||
BreakpointMap::BreakpointList BreakpointMap::getBreakpoints() const
|
BreakpointMap::BreakpointList BreakpointMap::getBreakpoints() const
|
||||||
{
|
{
|
||||||
BreakpointList map;
|
BreakpointList map;
|
||||||
std::map<Breakpoint, uInt32> ordered(myMap.begin(), myMap.end());
|
const std::map<Breakpoint, uInt32> ordered(myMap.begin(), myMap.end());
|
||||||
|
|
||||||
for(const auto& item : ordered)
|
for(const auto& item : ordered)
|
||||||
map.push_back(item.first);
|
map.push_back(item.first);
|
||||||
|
|
|
@ -386,8 +386,8 @@ bool CartDebug::fillDisassemblyList(BankInfo& info, Disassembly& disassembly,
|
||||||
disassembly.fieldwidth = 24 + myLabelLength;
|
disassembly.fieldwidth = 24 + myLabelLength;
|
||||||
// line offset must be set before calling DiStella!
|
// line offset must be set before calling DiStella!
|
||||||
auto lineOfs = static_cast<uInt32>(myDisassembly.list.size());
|
auto lineOfs = static_cast<uInt32>(myDisassembly.list.size());
|
||||||
DiStella distella(*this, disassembly.list, info, DiStella::settings,
|
const DiStella distella(*this, disassembly.list, info, DiStella::settings,
|
||||||
myDisLabels, myDisDirectives, myReserved);
|
myDisLabels, myDisDirectives, myReserved);
|
||||||
|
|
||||||
// Parts of the disassembly will be accessed later in different ways
|
// Parts of the disassembly will be accessed later in different ways
|
||||||
// We place those parts in separate maps, to speed up access
|
// We place those parts in separate maps, to speed up access
|
||||||
|
@ -812,7 +812,7 @@ string CartDebug::loadListFile()
|
||||||
// The default naming/location for list files is the ROM dir based on the
|
// The default naming/location for list files is the ROM dir based on the
|
||||||
// actual ROM filename
|
// actual ROM filename
|
||||||
|
|
||||||
FSNode lst(myOSystem.romFile().getPathWithExt(".lst"));
|
const FSNode lst(myOSystem.romFile().getPathWithExt(".lst"));
|
||||||
if(!lst.isReadable())
|
if(!lst.isReadable())
|
||||||
return DebuggerParser::red("list file \'" + lst.getShortPath() + "\' not found");
|
return DebuggerParser::red("list file \'" + lst.getShortPath() + "\' not found");
|
||||||
|
|
||||||
|
@ -873,7 +873,7 @@ string CartDebug::loadSymbolFile()
|
||||||
// The default naming/location for symbol files is the ROM dir based on the
|
// The default naming/location for symbol files is the ROM dir based on the
|
||||||
// actual ROM filename
|
// actual ROM filename
|
||||||
|
|
||||||
FSNode sym(myOSystem.romFile().getPathWithExt(".sym"));
|
const FSNode sym(myOSystem.romFile().getPathWithExt(".sym"));
|
||||||
if(!sym.isReadable())
|
if(!sym.isReadable())
|
||||||
return DebuggerParser::red("symbol file \'" + sym.getShortPath() + "\' not found");
|
return DebuggerParser::red("symbol file \'" + sym.getShortPath() + "\' not found");
|
||||||
|
|
||||||
|
@ -934,7 +934,7 @@ string CartDebug::loadConfigFile()
|
||||||
// The default naming/location for config files is the CFG dir and based
|
// The default naming/location for config files is the CFG dir and based
|
||||||
// on the actual ROM filename
|
// on the actual ROM filename
|
||||||
|
|
||||||
FSNode romNode(myOSystem.romFile().getPathWithExt(".cfg"));
|
const FSNode romNode(myOSystem.romFile().getPathWithExt(".cfg"));
|
||||||
FSNode cfg = myOSystem.cfgDir(); cfg /= romNode.getName();
|
FSNode cfg = myOSystem.cfgDir(); cfg /= romNode.getName();
|
||||||
if(!cfg.isReadable())
|
if(!cfg.isReadable())
|
||||||
return DebuggerParser::red("config file \'" + cfg.getShortPath() + "\' not found");
|
return DebuggerParser::red("config file \'" + cfg.getShortPath() + "\' not found");
|
||||||
|
@ -1073,7 +1073,7 @@ string CartDebug::saveConfigFile()
|
||||||
stringstream retVal;
|
stringstream retVal;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
FSNode romNode(myOSystem.romFile().getPathWithExt(".cfg"));
|
const FSNode romNode(myOSystem.romFile().getPathWithExt(".cfg"));
|
||||||
FSNode cfg = myOSystem.cfgDir(); cfg /= romNode.getName();
|
FSNode cfg = myOSystem.cfgDir(); cfg /= romNode.getName();
|
||||||
if(!cfg.getParent().isWritable())
|
if(!cfg.getParent().isWritable())
|
||||||
return DebuggerParser::red("config file \'" + cfg.getShortPath() + "\' not writable");
|
return DebuggerParser::red("config file \'" + cfg.getShortPath() + "\' not writable");
|
||||||
|
@ -1145,8 +1145,8 @@ string CartDebug::saveDisassembly(string path)
|
||||||
|
|
||||||
// Disassemble bank
|
// Disassemble bank
|
||||||
disasm.list.clear();
|
disasm.list.clear();
|
||||||
DiStella distella(*this, disasm.list, info, settings,
|
const DiStella distella(*this, disasm.list, info, settings,
|
||||||
myDisLabels, myDisDirectives, myReserved);
|
myDisLabels, myDisDirectives, myReserved);
|
||||||
|
|
||||||
if (myReserved.breakFound)
|
if (myReserved.breakFound)
|
||||||
addLabel("Break", myDebugger.dpeek(0xfffe));
|
addLabel("Break", myDebugger.dpeek(0xfffe));
|
||||||
|
@ -1258,7 +1258,7 @@ string CartDebug::saveDisassembly(string path)
|
||||||
|
|
||||||
if(myConsole.timing() == ConsoleTiming::ntsc)
|
if(myConsole.timing() == ConsoleTiming::ntsc)
|
||||||
{
|
{
|
||||||
string NTSC_COLOR[16] = {
|
const string NTSC_COLOR[16] = {
|
||||||
"BLACK", "YELLOW", "BROWN", "ORANGE",
|
"BLACK", "YELLOW", "BROWN", "ORANGE",
|
||||||
"RED", "MAUVE", "VIOLET", "PURPLE",
|
"RED", "MAUVE", "VIOLET", "PURPLE",
|
||||||
"BLUE", "BLUE_CYAN", "CYAN", "CYAN_GREEN",
|
"BLUE", "BLUE_CYAN", "CYAN", "CYAN_GREEN",
|
||||||
|
@ -1270,7 +1270,7 @@ string CartDebug::saveDisassembly(string path)
|
||||||
}
|
}
|
||||||
else if(myConsole.timing() == ConsoleTiming::pal)
|
else if(myConsole.timing() == ConsoleTiming::pal)
|
||||||
{
|
{
|
||||||
string PAL_COLOR[16] = {
|
const string PAL_COLOR[16] = {
|
||||||
"BLACK0", "BLACK1", "YELLOW", "GREEN_YELLOW",
|
"BLACK0", "BLACK1", "YELLOW", "GREEN_YELLOW",
|
||||||
"ORANGE", "GREEN", "RED", "CYAN_GREEN",
|
"ORANGE", "GREEN", "RED", "CYAN_GREEN",
|
||||||
"MAUVE", "CYAN", "VIOLET", "BLUE_CYAN",
|
"MAUVE", "CYAN", "VIOLET", "BLUE_CYAN",
|
||||||
|
@ -1282,7 +1282,7 @@ string CartDebug::saveDisassembly(string path)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string SECAM_COLOR[8] = {
|
const string SECAM_COLOR[8] = {
|
||||||
"BLACK", "BLUE", "RED", "PURPLE",
|
"BLACK", "BLUE", "RED", "PURPLE",
|
||||||
"GREEN", "CYAN", "YELLOW", "WHITE"
|
"GREEN", "CYAN", "YELLOW", "WHITE"
|
||||||
};
|
};
|
||||||
|
@ -1410,7 +1410,7 @@ string CartDebug::saveDisassembly(string path)
|
||||||
if(path.find_last_of('.') == string::npos)
|
if(path.find_last_of('.') == string::npos)
|
||||||
path += ".asm";
|
path += ".asm";
|
||||||
|
|
||||||
FSNode node(path);
|
const FSNode node(path);
|
||||||
stringstream retVal;
|
stringstream retVal;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -1438,7 +1438,7 @@ string CartDebug::saveRom(string path)
|
||||||
if(path.find_last_of('.') == string::npos)
|
if(path.find_last_of('.') == string::npos)
|
||||||
path += ".a26";
|
path += ".a26";
|
||||||
|
|
||||||
FSNode node(path);
|
const FSNode node(path);
|
||||||
|
|
||||||
if(myConsole.cartridge().saveROM(node))
|
if(myConsole.cartridge().saveROM(node))
|
||||||
return "saved ROM as " + node.getShortPath();
|
return "saved ROM as " + node.getShortPath();
|
||||||
|
@ -1464,7 +1464,7 @@ string CartDebug::saveAccessFile(string path)
|
||||||
if(path.find_last_of('.') == string::npos)
|
if(path.find_last_of('.') == string::npos)
|
||||||
path += ".csv";
|
path += ".csv";
|
||||||
|
|
||||||
FSNode node(path);
|
const FSNode node(path);
|
||||||
|
|
||||||
node.write(out);
|
node.write(out);
|
||||||
return "saved access counters as " + node.getShortPath();
|
return "saved access counters as " + node.getShortPath();
|
||||||
|
@ -1489,7 +1489,7 @@ string CartDebug::listConfig(int bank)
|
||||||
buf << "(items marked '*' are user-defined)" << endl;
|
buf << "(items marked '*' are user-defined)" << endl;
|
||||||
for(uInt32 b = startbank; b < endbank; ++b)
|
for(uInt32 b = startbank; b < endbank; ++b)
|
||||||
{
|
{
|
||||||
BankInfo& info = myBankInfo[b];
|
const BankInfo& info = myBankInfo[b];
|
||||||
buf << "Bank [" << b << "]" << endl;
|
buf << "Bank [" << b << "]" << endl;
|
||||||
for(const auto& i: info.directiveList)
|
for(const auto& i: info.directiveList)
|
||||||
{
|
{
|
||||||
|
|
|
@ -112,7 +112,7 @@ void Debugger::initialize()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
FBInitStatus Debugger::initializeVideo()
|
FBInitStatus Debugger::initializeVideo()
|
||||||
{
|
{
|
||||||
string title = string("Stella ") + STELLA_VERSION + ": Debugger mode";
|
const string title = string("Stella ") + STELLA_VERSION + ": Debugger mode";
|
||||||
return myOSystem.frameBuffer().createDisplay(
|
return myOSystem.frameBuffer().createDisplay(
|
||||||
title, BufferType::Debugger, mySize
|
title, BufferType::Debugger, mySize
|
||||||
);
|
);
|
||||||
|
@ -177,13 +177,13 @@ string Debugger::autoExec(StringList* history)
|
||||||
ostringstream buf;
|
ostringstream buf;
|
||||||
|
|
||||||
// autoexec.script is always run
|
// autoexec.script is always run
|
||||||
FSNode autoexec(myOSystem.baseDir().getPath() + "autoexec.script");
|
const FSNode autoexec(myOSystem.baseDir().getPath() + "autoexec.script");
|
||||||
buf << "autoExec():" << endl
|
buf << "autoExec():" << endl
|
||||||
<< myParser->exec(autoexec, history) << endl;
|
<< myParser->exec(autoexec, history) << endl;
|
||||||
|
|
||||||
// Also, "romname.script" if present
|
// Also, "romname.script" if present
|
||||||
const string path = myOSystem.userDir().getPath() + myOSystem.romFile().getNameWithExt(".script");
|
const string path = myOSystem.userDir().getPath() + myOSystem.romFile().getNameWithExt(".script");
|
||||||
FSNode romname(path);
|
const FSNode romname(path);
|
||||||
buf << myParser->exec(romname, history) << endl;
|
buf << myParser->exec(romname, history) << endl;
|
||||||
|
|
||||||
// Init builtins
|
// Init builtins
|
||||||
|
|
|
@ -165,7 +165,7 @@ string DebuggerParser::exec(const FSNode& file, StringList* history)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void DebuggerParser::outputCommandError(const string& errorMsg, int command)
|
void DebuggerParser::outputCommandError(const string& errorMsg, int command)
|
||||||
{
|
{
|
||||||
string example = commands[command].extendedDesc.substr(commands[command].extendedDesc.find("Example:"));
|
const string example = commands[command].extendedDesc.substr(commands[command].extendedDesc.find("Example:"));
|
||||||
|
|
||||||
commandResult << red(errorMsg);
|
commandResult << red(errorMsg);
|
||||||
if(!example.empty())
|
if(!example.empty())
|
||||||
|
@ -614,8 +614,8 @@ void DebuggerParser::listTraps(bool listCond)
|
||||||
string DebuggerParser::trapStatus(const Trap& trap)
|
string DebuggerParser::trapStatus(const Trap& trap)
|
||||||
{
|
{
|
||||||
stringstream result;
|
stringstream result;
|
||||||
string lblb = debugger.cartDebug().getLabel(trap.begin, !trap.write);
|
const string lblb = debugger.cartDebug().getLabel(trap.begin, !trap.write);
|
||||||
string lble = debugger.cartDebug().getLabel(trap.end, !trap.write);
|
const string lble = debugger.cartDebug().getLabel(trap.end, !trap.write);
|
||||||
|
|
||||||
if(!lblb.empty()) {
|
if(!lblb.empty()) {
|
||||||
result << " (";
|
result << " (";
|
||||||
|
@ -643,7 +643,7 @@ string DebuggerParser::trapStatus(const Trap& trap)
|
||||||
string DebuggerParser::saveScriptFile(string file)
|
string DebuggerParser::saveScriptFile(string file)
|
||||||
{
|
{
|
||||||
stringstream out;
|
stringstream out;
|
||||||
Debugger::FunctionDefMap funcs = debugger.getFunctionDefMap();
|
const Debugger::FunctionDefMap funcs = debugger.getFunctionDefMap();
|
||||||
for(const auto& [name, cmd]: funcs)
|
for(const auto& [name, cmd]: funcs)
|
||||||
if (!Debugger::isBuiltinFunction(name))
|
if (!Debugger::isBuiltinFunction(name))
|
||||||
out << "function " << name << " {" << cmd << "}" << endl;
|
out << "function " << name << " {" << cmd << "}" << endl;
|
||||||
|
@ -691,7 +691,7 @@ string DebuggerParser::saveScriptFile(string file)
|
||||||
if(file.find_first_of(FSNode::PATH_SEPARATOR) == string::npos)
|
if(file.find_first_of(FSNode::PATH_SEPARATOR) == string::npos)
|
||||||
file = debugger.myOSystem.userDir().getPath() + file;
|
file = debugger.myOSystem.userDir().getPath() + file;
|
||||||
|
|
||||||
FSNode node(file);
|
const FSNode node(file);
|
||||||
|
|
||||||
if(node.exists() || out.str().length())
|
if(node.exists() || out.str().length())
|
||||||
{
|
{
|
||||||
|
@ -770,7 +770,7 @@ void DebuggerParser::executeAud()
|
||||||
// "autoSave"
|
// "autoSave"
|
||||||
void DebuggerParser::executeAutoSave()
|
void DebuggerParser::executeAutoSave()
|
||||||
{
|
{
|
||||||
bool enable = !settings.getBool("dbg.autosave");
|
const bool enable = !settings.getBool("dbg.autosave");
|
||||||
|
|
||||||
settings.setValue("dbg.autosave", enable);
|
settings.setValue("dbg.autosave", enable);
|
||||||
commandResult << "autoSave " << (enable ? "enabled" : "disabled");
|
commandResult << "autoSave " << (enable ? "enabled" : "disabled");
|
||||||
|
@ -871,10 +871,10 @@ void DebuggerParser::executeBreak()
|
||||||
// "breakIf"
|
// "breakIf"
|
||||||
void DebuggerParser::executeBreakIf()
|
void DebuggerParser::executeBreakIf()
|
||||||
{
|
{
|
||||||
int res = YaccParser::parse(argStrings[0]);
|
const int res = YaccParser::parse(argStrings[0]);
|
||||||
if(res == 0)
|
if(res == 0)
|
||||||
{
|
{
|
||||||
string condition = argStrings[0];
|
const string condition = argStrings[0];
|
||||||
for(uInt32 i = 0; i < debugger.m6502().getCondBreakNames().size(); ++i)
|
for(uInt32 i = 0; i < debugger.m6502().getCondBreakNames().size(); ++i)
|
||||||
{
|
{
|
||||||
if(condition == debugger.m6502().getCondBreakNames()[i])
|
if(condition == debugger.m6502().getCondBreakNames()[i])
|
||||||
|
@ -1276,7 +1276,7 @@ void DebuggerParser::executeDump()
|
||||||
{
|
{
|
||||||
if(OK)
|
if(OK)
|
||||||
{
|
{
|
||||||
stringstream localOut(outStr);
|
const stringstream localOut(outStr);
|
||||||
ostringstream localResult(resultStr, std::ios_base::app);
|
ostringstream localResult(resultStr, std::ios_base::app);
|
||||||
|
|
||||||
saveDump(node, localOut, localResult);
|
saveDump(node, localOut, localResult);
|
||||||
|
@ -1350,7 +1350,7 @@ void DebuggerParser::executeFunction()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int res = YaccParser::parse(argStrings[1]);
|
const int res = YaccParser::parse(argStrings[1]);
|
||||||
if(res == 0)
|
if(res == 0)
|
||||||
{
|
{
|
||||||
debugger.addFunction(argStrings[0], argStrings[1], YaccParser::getResult());
|
debugger.addFunction(argStrings[0], argStrings[1], YaccParser::getResult());
|
||||||
|
@ -1608,8 +1608,6 @@ void DebuggerParser::executeListFunctions()
|
||||||
// "listSaveStateIfs"
|
// "listSaveStateIfs"
|
||||||
void DebuggerParser::executeListSaveStateIfs()
|
void DebuggerParser::executeListSaveStateIfs()
|
||||||
{
|
{
|
||||||
ostringstream buf;
|
|
||||||
|
|
||||||
StringList conds = debugger.m6502().getCondSaveStateNames();
|
StringList conds = debugger.m6502().getCondSaveStateNames();
|
||||||
if(!conds.empty())
|
if(!conds.empty())
|
||||||
{
|
{
|
||||||
|
@ -1629,7 +1627,7 @@ void DebuggerParser::executeListSaveStateIfs()
|
||||||
// "listTraps"
|
// "listTraps"
|
||||||
void DebuggerParser::executeListTraps()
|
void DebuggerParser::executeListTraps()
|
||||||
{
|
{
|
||||||
StringList names = debugger.m6502().getCondTrapNames();
|
const StringList names = debugger.m6502().getCondTrapNames();
|
||||||
|
|
||||||
if(myTraps.size() != names.size())
|
if(myTraps.size() != names.size())
|
||||||
{
|
{
|
||||||
|
@ -2085,10 +2083,10 @@ void DebuggerParser::executeSaveState()
|
||||||
// "saveStateIf"
|
// "saveStateIf"
|
||||||
void DebuggerParser::executeSaveStateIf()
|
void DebuggerParser::executeSaveStateIf()
|
||||||
{
|
{
|
||||||
int res = YaccParser::parse(argStrings[0]);
|
const int res = YaccParser::parse(argStrings[0]);
|
||||||
if(res == 0)
|
if(res == 0)
|
||||||
{
|
{
|
||||||
string condition = argStrings[0];
|
const string condition = argStrings[0];
|
||||||
for(uInt32 i = 0; i < debugger.m6502().getCondSaveStateNames().size(); ++i)
|
for(uInt32 i = 0; i < debugger.m6502().getCondSaveStateNames().size(); ++i)
|
||||||
{
|
{
|
||||||
if(condition == debugger.m6502().getCondSaveStateNames()[i])
|
if(condition == debugger.m6502().getCondSaveStateNames()[i])
|
||||||
|
@ -2128,7 +2126,7 @@ void DebuggerParser::executeStep()
|
||||||
// "stepWhile"
|
// "stepWhile"
|
||||||
void DebuggerParser::executeStepWhile()
|
void DebuggerParser::executeStepWhile()
|
||||||
{
|
{
|
||||||
int res = YaccParser::parse(argStrings[0]);
|
const int res = YaccParser::parse(argStrings[0]);
|
||||||
if(res != 0) {
|
if(res != 0) {
|
||||||
commandResult << red("invalid expression");
|
commandResult << red("invalid expression");
|
||||||
return;
|
return;
|
||||||
|
@ -2225,9 +2223,9 @@ void DebuggerParser::executeTrapWriteIf()
|
||||||
void DebuggerParser::executeTraps(bool read, bool write, const string& command,
|
void DebuggerParser::executeTraps(bool read, bool write, const string& command,
|
||||||
bool hasCond)
|
bool hasCond)
|
||||||
{
|
{
|
||||||
const uInt32 ofs = hasCond ? 1 : 0;
|
const uInt32 ofs = hasCond ? 1 : 0,
|
||||||
uInt32 begin = args[ofs];
|
begin = args[ofs],
|
||||||
uInt32 end = argCount == 2 + ofs ? args[1 + ofs] : begin;
|
end = argCount == 2 + ofs ? args[1 + ofs] : begin;
|
||||||
|
|
||||||
if(argCount < 1 + ofs)
|
if(argCount < 1 + ofs)
|
||||||
{
|
{
|
||||||
|
@ -2284,7 +2282,7 @@ void DebuggerParser::executeTraps(bool read, bool write, const string& command,
|
||||||
|
|
||||||
const string condition = conditionBuf.str();
|
const string condition = conditionBuf.str();
|
||||||
|
|
||||||
int res = YaccParser::parse(condition);
|
const int res = YaccParser::parse(condition);
|
||||||
if(res == 0)
|
if(res == 0)
|
||||||
{
|
{
|
||||||
// duplicates will remove each other
|
// duplicates will remove each other
|
||||||
|
@ -2309,7 +2307,7 @@ void DebuggerParser::executeTraps(bool read, bool write, const string& command,
|
||||||
}
|
}
|
||||||
if(add)
|
if(add)
|
||||||
{
|
{
|
||||||
uInt32 ret = debugger.m6502().addCondTrap(
|
const uInt32 ret = debugger.m6502().addCondTrap(
|
||||||
YaccParser::getResult(), hasCond ? argStrings[0] : "");
|
YaccParser::getResult(), hasCond ? argStrings[0] : "");
|
||||||
commandResult << "added trap " << Base::toString(ret);
|
commandResult << "added trap " << Base::toString(ret);
|
||||||
|
|
||||||
|
@ -2466,7 +2464,7 @@ void DebuggerParser::executeWatch()
|
||||||
void DebuggerParser::executeWinds(bool unwind)
|
void DebuggerParser::executeWinds(bool unwind)
|
||||||
{
|
{
|
||||||
const uInt16 states = (argCount == 0) ? 1 : args[0];
|
const uInt16 states = (argCount == 0) ? 1 : args[0];
|
||||||
string type = unwind ? "unwind" : "rewind";
|
const string type = unwind ? "unwind" : "rewind";
|
||||||
string message;
|
string message;
|
||||||
|
|
||||||
const uInt16 winds = unwind ? debugger.unwindStates(states, message)
|
const uInt16 winds = unwind ? debugger.unwindStates(states, message)
|
||||||
|
|
|
@ -1139,19 +1139,19 @@ void DiStella::outputGraphics()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void DiStella::outputColors()
|
void DiStella::outputColors()
|
||||||
{
|
{
|
||||||
string NTSC_COLOR[16] = {
|
const string NTSC_COLOR[16] = {
|
||||||
"BLACK", "YELLOW", "BROWN", "ORANGE",
|
"BLACK", "YELLOW", "BROWN", "ORANGE",
|
||||||
"RED", "MAUVE", "VIOLET", "PURPLE",
|
"RED", "MAUVE", "VIOLET", "PURPLE",
|
||||||
"BLUE", "BLUE_CYAN", "CYAN", "CYAN_GREEN",
|
"BLUE", "BLUE_CYAN", "CYAN", "CYAN_GREEN",
|
||||||
"GREEN", "GREEN_YELLOW", "GREEN_BEIGE", "BEIGE"
|
"GREEN", "GREEN_YELLOW", "GREEN_BEIGE", "BEIGE"
|
||||||
};
|
};
|
||||||
string PAL_COLOR[16] = {
|
const string PAL_COLOR[16] = {
|
||||||
"BLACK0", "BLACK1", "YELLOW", "GREEN_YELLOW",
|
"BLACK0", "BLACK1", "YELLOW", "GREEN_YELLOW",
|
||||||
"ORANGE", "GREEN", "RED", "CYAN_GREEN",
|
"ORANGE", "GREEN", "RED", "CYAN_GREEN",
|
||||||
"MAUVE", "CYAN", "VIOLET", "BLUE_CYAN",
|
"MAUVE", "CYAN", "VIOLET", "BLUE_CYAN",
|
||||||
"PURPLE", "BLUE", "BLACKE", "BLACKF"
|
"PURPLE", "BLUE", "BLACKE", "BLACKF"
|
||||||
};
|
};
|
||||||
string SECAM_COLOR[8] = {
|
const string SECAM_COLOR[8] = {
|
||||||
"BLACK", "BLUE", "RED", "PURPLE",
|
"BLACK", "BLUE", "RED", "PURPLE",
|
||||||
"GREEN", "CYAN", "YELLOW", "WHITE"
|
"GREEN", "CYAN", "YELLOW", "WHITE"
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,7 +26,7 @@ Cartridge4A50Widget::Cartridge4A50Widget(
|
||||||
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
|
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
|
||||||
myCart{cart}
|
myCart{cart}
|
||||||
{
|
{
|
||||||
string info =
|
const string info =
|
||||||
"4A50 cartridge - 128K ROM and 32K RAM, split in various bank configurations\n"
|
"4A50 cartridge - 128K ROM and 32K RAM, split in various bank configurations\n"
|
||||||
"Multiple hotspots, see documentation for further details\n"
|
"Multiple hotspots, see documentation for further details\n"
|
||||||
"Lower bank region (2K) : $F000 - $F7FF\n"
|
"Lower bank region (2K) : $F000 - $F7FF\n"
|
||||||
|
@ -55,9 +55,9 @@ Cartridge4A50Widget::Cartridge4A50Widget(
|
||||||
VarList::push_back(items256, i);
|
VarList::push_back(items256, i);
|
||||||
VarList::push_back(items256, "Inactive", "");
|
VarList::push_back(items256, "Inactive", "");
|
||||||
|
|
||||||
string lowerlabel = "Set lower 2K region ($F000 - $F7FF): ";
|
const string lowerlabel = "Set lower 2K region ($F000 - $F7FF): ";
|
||||||
string middlelabel = "Set middle 1.5K region ($F800 - $FDFF): ";
|
const string middlelabel = "Set middle 1.5K region ($F800 - $FDFF): ";
|
||||||
string highlabel = "Set high 256B region ($FE00 - $FEFF): ";
|
const string highlabel = "Set high 256B region ($FE00 - $FEFF): ";
|
||||||
const int lwidth = _font.getStringWidth(middlelabel),
|
const int lwidth = _font.getStringWidth(middlelabel),
|
||||||
fwidth = _font.getStringWidth("Inactive"),
|
fwidth = _font.getStringWidth("Inactive"),
|
||||||
flwidth = _font.getStringWidth("ROM ");
|
flwidth = _font.getStringWidth("ROM ");
|
||||||
|
|
|
@ -141,7 +141,7 @@ void CartridgeARMWidget::saveOldState()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void CartridgeARMWidget::loadConfig()
|
void CartridgeARMWidget::loadConfig()
|
||||||
{
|
{
|
||||||
bool devSettings = instance().settings().getBool("dev.settings");
|
const bool devSettings = instance().settings().getBool("dev.settings");
|
||||||
IntArray alist;
|
IntArray alist;
|
||||||
IntArray vlist;
|
IntArray vlist;
|
||||||
BoolArray changed;
|
BoolArray changed;
|
||||||
|
@ -218,16 +218,18 @@ void CartridgeARMWidget::handleCommand(CommandSender* sender,
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void CartridgeARMWidget::handleChipType()
|
void CartridgeARMWidget::handleChipType()
|
||||||
{
|
{
|
||||||
bool devSettings = instance().settings().getBool("dev.settings");
|
const bool devSettings = instance().settings().getBool("dev.settings");
|
||||||
|
|
||||||
myChipType->setEnabled(devSettings);
|
myChipType->setEnabled(devSettings);
|
||||||
|
|
||||||
if(devSettings)
|
if(devSettings)
|
||||||
{
|
{
|
||||||
instance().settings().setValue("dev.thumb.chiptype", myChipType->getSelectedTag().toInt());
|
instance().settings().setValue("dev.thumb.chiptype",
|
||||||
|
myChipType->getSelectedTag().toInt());
|
||||||
|
|
||||||
Thumbulator::ChipPropsType chipProps
|
const Thumbulator::ChipPropsType chipProps =
|
||||||
= myCart.setChipType(static_cast<Thumbulator::ChipType>(myChipType->getSelectedTag().toInt()));
|
myCart.setChipType(static_cast<Thumbulator::ChipType>
|
||||||
|
(myChipType->getSelectedTag().toInt()));
|
||||||
|
|
||||||
// update tooltip with currently selecte chip's properties
|
// update tooltip with currently selecte chip's properties
|
||||||
string tip = myChipType->getToolTip(Common::Point(0, 0));
|
string tip = myChipType->getToolTip(Common::Point(0, 0));
|
||||||
|
@ -258,10 +260,9 @@ void CartridgeARMWidget::handleMamMode()
|
||||||
// override MAM mode set by ROM
|
// override MAM mode set by ROM
|
||||||
const Int32 mode = myMamMode->getSelected();
|
const Int32 mode = myMamMode->getSelected();
|
||||||
|
|
||||||
string name = myMamMode->getSelectedName();
|
const string name = myMamMode->getSelectedName();
|
||||||
myMamMode->setSelectedName(name + "XXX");
|
myMamMode->setSelectedName(name + "XXX");
|
||||||
|
|
||||||
|
|
||||||
instance().settings().setValue("dev.thumb.mammode", mode);
|
instance().settings().setValue("dev.thumb.mammode", mode);
|
||||||
myCart.setMamMode(static_cast<Thumbulator::MamModeType>(mode));
|
myCart.setMamMode(static_cast<Thumbulator::MamModeType>(mode));
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ CartridgeARWidget::CartridgeARWidget(
|
||||||
{
|
{
|
||||||
const size_t size = myCart.mySize;
|
const size_t size = myCart.mySize;
|
||||||
|
|
||||||
string info =
|
const string info =
|
||||||
"Supercharger cartridge, four 2K slices (3 RAM, 1 ROM)\n"
|
"Supercharger cartridge, four 2K slices (3 RAM, 1 ROM)\n"
|
||||||
"\nTHIS SCHEME IS NOT FULLY IMPLEMENTED OR TESTED\n";
|
"\nTHIS SCHEME IS NOT FULLY IMPLEMENTED OR TESTED\n";
|
||||||
|
|
||||||
|
|
|
@ -207,7 +207,7 @@ CartridgeCDFWidget::CartridgeCDFWidget(
|
||||||
|
|
||||||
xpos = HBORDER + INDENT; ypos += myLineHeight + VGAP;
|
xpos = HBORDER + INDENT; ypos += myLineHeight + VGAP;
|
||||||
|
|
||||||
int lwidth2 = _font.getStringWidth("Sample Pointer ");
|
const int lwidth2 = _font.getStringWidth("Sample Pointer ");
|
||||||
new StaticTextWidget(boss, _font, xpos, ypos, "Sample Pointer");
|
new StaticTextWidget(boss, _font, xpos, ypos, "Sample Pointer");
|
||||||
|
|
||||||
mySamplePointer = new DataGridWidget(boss, _nfont, xpos + lwidth2, ypos - 2, 1, 1, 8, 32,
|
mySamplePointer = new DataGridWidget(boss, _nfont, xpos + lwidth2, ypos - 2, 1, 1, 8, 32,
|
||||||
|
|
|
@ -35,7 +35,7 @@ CartridgeCMWidget::CartridgeCMWidget(
|
||||||
{
|
{
|
||||||
constexpr uInt16 size = 4 * 4096;
|
constexpr uInt16 size = 4 * 4096;
|
||||||
|
|
||||||
string info =
|
const string info =
|
||||||
"CM cartridge, four 4K banks + 2K RAM\n"
|
"CM cartridge, four 4K banks + 2K RAM\n"
|
||||||
"2K RAM accessible @ $1800 - $1FFF in read or write-only mode "
|
"2K RAM accessible @ $1800 - $1FFF in read or write-only mode "
|
||||||
"(no separate ports)\n"
|
"(no separate ports)\n"
|
||||||
|
|
|
@ -31,7 +31,7 @@ CartridgeCTYWidget::CartridgeCTYWidget(
|
||||||
{
|
{
|
||||||
constexpr uInt16 size = 8 * 4096;
|
constexpr uInt16 size = 8 * 4096;
|
||||||
|
|
||||||
string info =
|
const string info =
|
||||||
"Chetiry cartridge, eight 4K banks (bank 0 is ARM code and is ignored)\n"
|
"Chetiry cartridge, eight 4K banks (bank 0 is ARM code and is ignored)\n"
|
||||||
"64 bytes RAM @ $F000 - $F080\n"
|
"64 bytes RAM @ $F000 - $F080\n"
|
||||||
" $F040 - $F07F (R), $F000 - $F03F (W)\n"
|
" $F040 - $F07F (R), $F000 - $F03F (W)\n"
|
||||||
|
|
|
@ -66,7 +66,8 @@ int CartDebugWidget::addBaseInformation(size_t bytes, const string& manufacturer
|
||||||
w->setEditable(false);
|
w->setEditable(false);
|
||||||
y += myLineHeight + 4;
|
y += myLineHeight + 4;
|
||||||
|
|
||||||
StringParser bs(desc, (fwidth - ScrollBarWidget::scrollBarWidth(_font)) / myFontWidth - 4);
|
const StringParser bs(desc, (fwidth - ScrollBarWidget::scrollBarWidth(_font)) /
|
||||||
|
myFontWidth - 4);
|
||||||
const StringList& sl = bs.stringList();
|
const StringList& sl = bs.stringList();
|
||||||
size_t lines = sl.size();
|
size_t lines = sl.size();
|
||||||
if(lines < 3) lines = 3;
|
if(lines < 3) lines = 3;
|
||||||
|
|
|
@ -105,13 +105,13 @@ string CartridgeEnhancedWidget::romDescription()
|
||||||
{
|
{
|
||||||
uInt16 start = (image[offset + 1] << 8) | image[offset];
|
uInt16 start = (image[offset + 1] << 8) | image[offset];
|
||||||
start -= start % 0x1000;
|
start -= start % 0x1000;
|
||||||
string hash = myCart.romBankCount() > 10 && bank < 10 ? " #" : "#";
|
const string hash = myCart.romBankCount() > 10 && bank < 10 ? " #" : "#";
|
||||||
|
|
||||||
info << "Bank " << hash << std::dec << bank << " @ $"
|
info << "Bank " << hash << std::dec << bank << " @ $"
|
||||||
<< Common::Base::HEX4 << (start + myCart.myRomOffset) << " - $" << (start + 0xFFF);
|
<< Common::Base::HEX4 << (start + myCart.myRomOffset) << " - $" << (start + 0xFFF);
|
||||||
if(myCart.hotspot() != 0)
|
if(myCart.hotspot() != 0)
|
||||||
{
|
{
|
||||||
string hs = hotspotStr(bank, 0, true);
|
const string hs = hotspotStr(bank, 0, true);
|
||||||
if(hs.length() > 22)
|
if(hs.length() > 22)
|
||||||
info << "\n ";
|
info << "\n ";
|
||||||
info << " " << hs;
|
info << " " << hs;
|
||||||
|
|
|
@ -39,8 +39,8 @@ CartRamWidget::CartRamWidget(
|
||||||
myLineHeight{lfont.getLineHeight()},
|
myLineHeight{lfont.getLineHeight()},
|
||||||
myButtonHeight{myLineHeight + 4}
|
myButtonHeight{myLineHeight + 4}
|
||||||
{
|
{
|
||||||
int lwidth = lfont.getStringWidth("Description ");
|
const int lwidth = lfont.getStringWidth("Description "),
|
||||||
const int fwidth = w - lwidth - 20;
|
fwidth = w - lwidth - 20;
|
||||||
|
|
||||||
EditTextWidget* etw = nullptr;
|
EditTextWidget* etw = nullptr;
|
||||||
ostringstream buf;
|
ostringstream buf;
|
||||||
|
|
|
@ -133,7 +133,6 @@ void DataGridWidget::setList(const IntArray& alist, const IntArray& vlist,
|
||||||
_changedList = changed;
|
_changedList = changed;
|
||||||
|
|
||||||
// An efficiency thing
|
// An efficiency thing
|
||||||
string temp;
|
|
||||||
for(size_t i = 0; i < size; ++i)
|
for(size_t i = 0; i < size; ++i)
|
||||||
_valueStringList.push_back(Common::Base::toString(_valueList[i], _base));
|
_valueStringList.push_back(Common::Base::toString(_valueList[i], _base));
|
||||||
|
|
||||||
|
@ -759,8 +758,8 @@ void DataGridWidget::endEditMode()
|
||||||
enableEditMode(false);
|
enableEditMode(false);
|
||||||
|
|
||||||
// Update the both the string representation and the real data
|
// Update the both the string representation and the real data
|
||||||
if(!editString().empty() && !(editString()[0] == '$' ||
|
if(!editString().empty() && editString()[0] != '$' &&
|
||||||
editString()[0] == '#' || editString()[0] == '\\'))
|
editString()[0] != '#' && editString()[0] != '\\')
|
||||||
{
|
{
|
||||||
switch(_base)
|
switch(_base)
|
||||||
{
|
{
|
||||||
|
|
|
@ -377,8 +377,8 @@ void DebuggerDialog::doExitRom()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void DebuggerDialog::createFont()
|
void DebuggerDialog::createFont()
|
||||||
{
|
{
|
||||||
string fontSize = instance().settings().getString("dbg.fontsize");
|
const string fontSize = instance().settings().getString("dbg.fontsize");
|
||||||
int fontStyle = instance().settings().getInt("dbg.fontstyle");
|
const int fontStyle = instance().settings().getInt("dbg.fontstyle");
|
||||||
|
|
||||||
if(fontSize == "large")
|
if(fontSize == "large")
|
||||||
{
|
{
|
||||||
|
|
|
@ -45,7 +45,7 @@ DelayQueueWidget::DelayQueueWidget(
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void DelayQueueWidget::loadConfig() {
|
void DelayQueueWidget::loadConfig() {
|
||||||
shared_ptr<DelayQueueIterator> delayQueueIterator =
|
const shared_ptr<DelayQueueIterator> delayQueueIterator =
|
||||||
instance().debugger().tiaDebug().delayQueueIterator();
|
instance().debugger().tiaDebug().delayQueueIterator();
|
||||||
|
|
||||||
using Common::Base;
|
using Common::Base;
|
||||||
|
|
|
@ -122,7 +122,7 @@ void PromptWidget::handleMouseWheel(int x, int y, int direction)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void PromptWidget::printPrompt()
|
void PromptWidget::printPrompt()
|
||||||
{
|
{
|
||||||
string watches = instance().debugger().showWatches();
|
const string watches = instance().debugger().showWatches();
|
||||||
if(watches.length() > 0)
|
if(watches.length() > 0)
|
||||||
print(watches);
|
print(watches);
|
||||||
|
|
||||||
|
@ -374,7 +374,7 @@ void PromptWidget::loadConfig()
|
||||||
_firstTime = false;
|
_firstTime = false;
|
||||||
|
|
||||||
// Display greetings & prompt
|
// Display greetings & prompt
|
||||||
string version = string("Stella ") + STELLA_VERSION + "\n";
|
const string version = string("Stella ") + STELLA_VERSION + "\n";
|
||||||
print(version);
|
print(version);
|
||||||
print(PROMPT);
|
print(PROMPT);
|
||||||
|
|
||||||
|
@ -534,9 +534,7 @@ void PromptWidget::textCut()
|
||||||
void PromptWidget::textCopy()
|
void PromptWidget::textCopy()
|
||||||
{
|
{
|
||||||
#if defined(PSEUDO_CUT_COPY_PASTE)
|
#if defined(PSEUDO_CUT_COPY_PASTE)
|
||||||
string text = getLine();
|
instance().eventHandler().copyText(getLine());
|
||||||
|
|
||||||
instance().eventHandler().copyText(text);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -598,7 +596,7 @@ void PromptWidget::addToHistory(const char* str)
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
int prevJ = j;
|
const int prevJ = j;
|
||||||
historyDir(j, +1);
|
historyDir(j, +1);
|
||||||
_history[prevJ] = _history[j];
|
_history[prevJ] = _history[j];
|
||||||
}
|
}
|
||||||
|
@ -676,13 +674,13 @@ bool PromptWidget::execute()
|
||||||
if(len > 0)
|
if(len > 0)
|
||||||
{
|
{
|
||||||
// Copy the user input to command
|
// Copy the user input to command
|
||||||
string command = getLine();
|
const string command = getLine();
|
||||||
|
|
||||||
// Add the input to the history
|
// Add the input to the history
|
||||||
addToHistory(command.c_str());
|
addToHistory(command.c_str());
|
||||||
|
|
||||||
// Pass the command to the debugger, and print the result
|
// Pass the command to the debugger, and print the result
|
||||||
string result = instance().debugger().run(command);
|
const string result = instance().debugger().run(command);
|
||||||
|
|
||||||
// This is a bit of a hack
|
// This is a bit of a hack
|
||||||
// Certain commands remove the debugger dialog from underneath us,
|
// Certain commands remove the debugger dialog from underneath us,
|
||||||
|
|
|
@ -33,7 +33,7 @@ QuadTariWidget::QuadTariWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y, Controller& controller)
|
int x, int y, Controller& controller)
|
||||||
: ControllerWidget(boss, font, x, y, controller)
|
: ControllerWidget(boss, font, x, y, controller)
|
||||||
{
|
{
|
||||||
string label = (isLeftPort() ? "Left" : "Right") + string(" (QuadTari)");
|
const string label = (isLeftPort() ? "Left" : "Right") + string(" (QuadTari)");
|
||||||
const StaticTextWidget* t = new StaticTextWidget(boss, font, x, y + 2, label);
|
const StaticTextWidget* t = new StaticTextWidget(boss, font, x, y + 2, label);
|
||||||
const QuadTari& qt = static_cast<QuadTari&>(controller);
|
const QuadTari& qt = static_cast<QuadTari&>(controller);
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ void QuadTariWidget::addController(GuiObject* boss, int x, int y,
|
||||||
widget = new NullControlWidget(boss, _font, x, y, controller, true);
|
widget = new NullControlWidget(boss, _font, x, y, controller, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
WidgetArray focusList = widget->getFocusList();
|
const WidgetArray focusList = widget->getFocusList();
|
||||||
if(!focusList.empty())
|
if(!focusList.empty())
|
||||||
addToFocusList(focusList);
|
addToFocusList(focusList);
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,7 +177,7 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
|
||||||
myLabel->setEditable(false, true);
|
myLabel->setEditable(false, true);
|
||||||
|
|
||||||
// Inputbox which will pop up when searching RAM
|
// Inputbox which will pop up when searching RAM
|
||||||
StringList labels = { "Value" };
|
const StringList labels = { "Value" };
|
||||||
myInputBox = make_unique<InputTextDialog>(boss, lfont, nfont, labels, " ");
|
myInputBox = make_unique<InputTextDialog>(boss, lfont, nfont, labels, " ");
|
||||||
myInputBox->setTarget(this);
|
myInputBox->setTarget(this);
|
||||||
|
|
||||||
|
|
|
@ -390,7 +390,7 @@ void RiotWidget::loadConfig()
|
||||||
myP0Diff->setSelectedIndex(riot.diffP0(), state.swchbReadBits[1] != oldstate.swchbReadBits[1]);
|
myP0Diff->setSelectedIndex(riot.diffP0(), state.swchbReadBits[1] != oldstate.swchbReadBits[1]);
|
||||||
myP1Diff->setSelectedIndex(riot.diffP1(), state.swchbReadBits[0] != oldstate.swchbReadBits[0]);
|
myP1Diff->setSelectedIndex(riot.diffP1(), state.swchbReadBits[0] != oldstate.swchbReadBits[0]);
|
||||||
|
|
||||||
bool devSettings = instance().settings().getBool("dev.settings");
|
const bool devSettings = instance().settings().getBool("dev.settings");
|
||||||
myConsole->setText(instance().settings().getString(devSettings ? "dev.console" : "plr.console") == "7800" ? "Atari 7800" : "Atari 2600");
|
myConsole->setText(instance().settings().getString(devSettings ? "dev.console" : "plr.console") == "7800" ? "Atari 7800" : "Atari 2600");
|
||||||
myConsole->setEditable(false, true);
|
myConsole->setEditable(false, true);
|
||||||
|
|
||||||
|
@ -565,8 +565,9 @@ RiotWidget::addControlWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
void RiotWidget::handleConsole()
|
void RiotWidget::handleConsole()
|
||||||
{
|
{
|
||||||
RiotDebug& riot = instance().debugger().riotDebug();
|
RiotDebug& riot = instance().debugger().riotDebug();
|
||||||
bool devSettings = instance().settings().getBool("dev.settings");
|
const bool devSettings = instance().settings().getBool("dev.settings");
|
||||||
bool is7800 = instance().settings().getString(devSettings ? "dev.console" : "plr.console") == "7800";
|
const bool is7800 = instance().settings().getString(
|
||||||
|
devSettings ? "dev.console" : "plr.console") == "7800";
|
||||||
|
|
||||||
myTVType->setEnabled(!is7800);
|
myTVType->setEnabled(!is7800);
|
||||||
myPause->setEnabled(is7800);
|
myPause->setEnabled(is7800);
|
||||||
|
|
|
@ -90,7 +90,7 @@ RomListWidget::RomListWidget(GuiObject* boss, const GUI::Font& lfont,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add filtering
|
// Add filtering
|
||||||
EditableWidget::TextFilter f = [&](char c)
|
const EditableWidget::TextFilter f = [&](char c)
|
||||||
{
|
{
|
||||||
switch(_base)
|
switch(_base)
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,8 +36,6 @@ RomWidget::RomWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
|
||||||
: Widget(boss, lfont, x, y, w, h),
|
: Widget(boss, lfont, x, y, w, h),
|
||||||
CommandSender(boss)
|
CommandSender(boss)
|
||||||
{
|
{
|
||||||
WidgetArray wid;
|
|
||||||
|
|
||||||
// Show current bank state
|
// Show current bank state
|
||||||
int xpos = x, ypos = y + 7;
|
int xpos = x, ypos = y + 7;
|
||||||
auto* t = new StaticTextWidget(boss, lfont, xpos, ypos, "Info ");
|
auto* t = new StaticTextWidget(boss, lfont, xpos, ypos, "Info ");
|
||||||
|
@ -165,7 +163,7 @@ void RomWidget::toggleBreak(int disasm_line)
|
||||||
|
|
||||||
if (address != 0)
|
if (address != 0)
|
||||||
{
|
{
|
||||||
Debugger& debugger = instance().debugger();
|
const Debugger& debugger = instance().debugger();
|
||||||
|
|
||||||
debugger.toggleBreakPoint(address, debugger.cartDebug().getBank(address));
|
debugger.toggleBreakPoint(address, debugger.cartDebug().getBank(address));
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ TiaInfoWidget::TiaInfoWidget(GuiObject* boss, const GUI::Font& lfont,
|
||||||
const int VGAP = lfont.getLineHeight() / 4;
|
const int VGAP = lfont.getLineHeight() / 4;
|
||||||
constexpr int VBORDER = 5 + 1;
|
constexpr int VBORDER = 5 + 1;
|
||||||
const int COLUMN_GAP = _fontWidth * 1.25;
|
const int COLUMN_GAP = _fontWidth * 1.25;
|
||||||
bool longstr = lfont.getStringWidth("Frame Cycls12345") + _fontWidth * 0.5
|
const bool longstr = lfont.getStringWidth("Frame Cycls12345") + _fontWidth * 0.5
|
||||||
+ COLUMN_GAP + lfont.getStringWidth("Scanline262262")
|
+ COLUMN_GAP + lfont.getStringWidth("Scanline262262")
|
||||||
+ EditTextWidget::calcWidth(lfont) * 3 <= max_w;
|
+ EditTextWidget::calcWidth(lfont) * 3 <= max_w;
|
||||||
const int lineHeight = lfont.getLineHeight();
|
const int lineHeight = lfont.getLineHeight();
|
||||||
|
|
|
@ -87,7 +87,7 @@ void TiaOutputWidget::saveSnapshot(int execDepth, const string& execPrefix,
|
||||||
{
|
{
|
||||||
// Determine if the file already exists, checking each successive filename
|
// Determine if the file already exists, checking each successive filename
|
||||||
// until one doesn't exist
|
// until one doesn't exist
|
||||||
FSNode node(sspath.str() + ".png");
|
const FSNode node(sspath.str() + ".png");
|
||||||
if(node.exists())
|
if(node.exists())
|
||||||
{
|
{
|
||||||
ostringstream suffix;
|
ostringstream suffix;
|
||||||
|
@ -98,7 +98,7 @@ void TiaOutputWidget::saveSnapshot(int execDepth, const string& execPrefix,
|
||||||
suffix.str("");
|
suffix.str("");
|
||||||
suffix << "_" << i;
|
suffix << "_" << i;
|
||||||
buf << sspath.str() << suffix.str() << ".png";
|
buf << sspath.str() << suffix.str() << ".png";
|
||||||
FSNode next(buf.str());
|
const FSNode next(buf.str());
|
||||||
if(!next.exists())
|
if(!next.exists())
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ void TiaOutputWidget::handleCommand(CommandSender* sender, int cmd, int data, in
|
||||||
if(lines > 0)
|
if(lines > 0)
|
||||||
{
|
{
|
||||||
command << "scanLine #" << lines;
|
command << "scanLine #" << lines;
|
||||||
string message = instance().debugger().parser().run(command.str());
|
const string message = instance().debugger().parser().run(command.str());
|
||||||
instance().frameBuffer().showTextMessage(message);
|
instance().frameBuffer().showTextMessage(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -266,7 +266,7 @@ void TiaOutputWidget::drawWidget(bool hilite)
|
||||||
for(uInt32 x = 0; x < width; ++x, ++i)
|
for(uInt32 x = 0; x < width; ++x, ++i)
|
||||||
{
|
{
|
||||||
const uInt8 shift = i >= scanoffset ? 1 : 0;
|
const uInt8 shift = i >= scanoffset ? 1 : 0;
|
||||||
uInt32 pixel = tiaSurface.mapIndexedPixel(tiaOutputBuffer[i], shift);
|
const uInt32 pixel = tiaSurface.mapIndexedPixel(tiaOutputBuffer[i], shift);
|
||||||
*line_ptr++ = pixel;
|
*line_ptr++ = pixel;
|
||||||
*line_ptr++ = pixel;
|
*line_ptr++ = pixel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -255,7 +255,7 @@ void TiaZoomWidget::handleCommand(CommandSender* sender, int cmd, int data, int
|
||||||
if(lines > 0)
|
if(lines > 0)
|
||||||
{
|
{
|
||||||
command << "scanline #" << lines;
|
command << "scanline #" << lines;
|
||||||
string message = instance().debugger().parser().run(command.str());
|
const string& message = instance().debugger().parser().run(command.str());
|
||||||
instance().frameBuffer().showTextMessage(message);
|
instance().frameBuffer().showTextMessage(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ Cartridge::Cartridge(const Settings& settings, const string& md5)
|
||||||
|
|
||||||
const uInt32 seed = to_uInt32(md5, 0) ^ to_uInt32(md5, 8) ^
|
const uInt32 seed = to_uInt32(md5, 0) ^ to_uInt32(md5, 8) ^
|
||||||
to_uInt32(md5, 16) ^ to_uInt32(md5, 24);
|
to_uInt32(md5, 16) ^ to_uInt32(md5, 24);
|
||||||
Random rand(seed);
|
const Random rand(seed);
|
||||||
for(uInt32 i = 0; i < 256; ++i)
|
for(uInt32 i = 0; i < 256; ++i)
|
||||||
myRWPRandomValues[i] = rand.next();
|
myRWPRandomValues[i] = rand.next();
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ uInt16 Cartridge::bankSize(uInt16 bank) const
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
uInt8 Cartridge::peekRAM(uInt8& dest, uInt16 address)
|
uInt8 Cartridge::peekRAM(uInt8& dest, uInt16 address)
|
||||||
{
|
{
|
||||||
uInt8 value = myRWPRandomValues[address & 0xFF];
|
const uInt8 value = myRWPRandomValues[address & 0xFF];
|
||||||
|
|
||||||
// Reading from the write port triggers an unwanted write
|
// Reading from the write port triggers an unwanted write
|
||||||
// But this only happens when in normal emulation mode
|
// But this only happens when in normal emulation mode
|
||||||
|
|
|
@ -59,7 +59,7 @@ CartridgeBUS::CartridgeBUS(const ByteBuffer& image, size_t size,
|
||||||
// Pointer to BUS driver in RAM
|
// Pointer to BUS driver in RAM
|
||||||
myDriverImage = myRAM.data();
|
myDriverImage = myRAM.data();
|
||||||
|
|
||||||
bool devSettings = settings.getBool("dev.settings");
|
const bool devSettings = settings.getBool("dev.settings");
|
||||||
|
|
||||||
if (myBUSSubtype == BUSSubtype::BUS0)
|
if (myBUSSubtype == BUSSubtype::BUS0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -99,7 +99,7 @@ CartridgeCDF::CartridgeCDF(const ByteBuffer& image, size_t size,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create Thumbulator ARM emulator
|
// Create Thumbulator ARM emulator
|
||||||
bool devSettings = settings.getBool("dev.settings");
|
const bool devSettings = settings.getBool("dev.settings");
|
||||||
myThumbEmulator = make_unique<Thumbulator>(
|
myThumbEmulator = make_unique<Thumbulator>(
|
||||||
reinterpret_cast<uInt16*>(myImage.get()),
|
reinterpret_cast<uInt16*>(myImage.get()),
|
||||||
reinterpret_cast<uInt16*>(myRAM.data()),
|
reinterpret_cast<uInt16*>(myRAM.data()),
|
||||||
|
|
|
@ -512,7 +512,7 @@ void CartridgeCTY::updateTune()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void CartridgeCTY::loadScore(uInt8 index)
|
void CartridgeCTY::loadScore(uInt8 index)
|
||||||
{
|
{
|
||||||
Serializer serializer(myEEPROMFile, Serializer::Mode::ReadOnly);
|
const Serializer serializer(myEEPROMFile, Serializer::Mode::ReadOnly);
|
||||||
if(serializer)
|
if(serializer)
|
||||||
{
|
{
|
||||||
std::array<uInt8, 256> scoreRAM;
|
std::array<uInt8, 256> scoreRAM;
|
||||||
|
|
|
@ -200,7 +200,7 @@ CartCreator::createFromMultiCart(const ByteBuffer& image, size_t& size,
|
||||||
settings.setValue("romloadcount", i);
|
settings.setValue("romloadcount", i);
|
||||||
|
|
||||||
size /= numRoms;
|
size /= numRoms;
|
||||||
ByteBuffer slice = make_unique<uInt8[]>(size);
|
const ByteBuffer slice = make_unique<uInt8[]>(size);
|
||||||
std::copy_n(image.get() + i * size, size, slice.get());
|
std::copy_n(image.get() + i * size, size, slice.get());
|
||||||
|
|
||||||
// We need a new md5 and name
|
// We need a new md5 and name
|
||||||
|
|
|
@ -48,7 +48,7 @@ CartridgeDPCPlus::CartridgeDPCPlus(const ByteBuffer& image, size_t size,
|
||||||
myFrequencyImage = myDisplayImage + 4_KB;
|
myFrequencyImage = myDisplayImage + 4_KB;
|
||||||
|
|
||||||
// Create Thumbulator ARM emulator
|
// Create Thumbulator ARM emulator
|
||||||
bool devSettings = settings.getBool("dev.settings");
|
const bool devSettings = settings.getBool("dev.settings");
|
||||||
myThumbEmulator = make_unique<Thumbulator>
|
myThumbEmulator = make_unique<Thumbulator>
|
||||||
(reinterpret_cast<uInt16*>(myImage.get()),
|
(reinterpret_cast<uInt16*>(myImage.get()),
|
||||||
reinterpret_cast<uInt16*>(myDPCRAM.data()),
|
reinterpret_cast<uInt16*>(myDPCRAM.data()),
|
||||||
|
|
|
@ -221,7 +221,7 @@ Console::Console(OSystem& osystem, unique_ptr<Cartridge>& cart,
|
||||||
|
|
||||||
setTIAProperties();
|
setTIAProperties();
|
||||||
|
|
||||||
bool joyallow4 = myOSystem.settings().getBool("joyallow4");
|
const bool joyallow4 = myOSystem.settings().getBool("joyallow4");
|
||||||
myOSystem.eventHandler().allowAllDirections(joyallow4);
|
myOSystem.eventHandler().allowAllDirections(joyallow4);
|
||||||
|
|
||||||
// Reset the system to its power-on state
|
// Reset the system to its power-on state
|
||||||
|
@ -280,7 +280,7 @@ void Console::autodetectFrameLayout(bool reset)
|
||||||
// will take over 250 frames!
|
// will take over 250 frames!
|
||||||
// The 'fastscbios' option must be changed before the system is reset
|
// The 'fastscbios' option must be changed before the system is reset
|
||||||
Settings& settings = myOSystem.settings();
|
Settings& settings = myOSystem.settings();
|
||||||
bool fastscbios = settings.getBool("fastscbios");
|
const bool fastscbios = settings.getBool("fastscbios");
|
||||||
settings.setValue("fastscbios", true);
|
settings.setValue("fastscbios", true);
|
||||||
|
|
||||||
FrameLayoutDetector frameLayoutDetector;
|
FrameLayoutDetector frameLayoutDetector;
|
||||||
|
@ -363,7 +363,7 @@ string Console::formatFromFilename() const
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
std::regex rgx(pat[0], std::regex_constants::icase);
|
const std::regex rgx(pat[0], std::regex_constants::icase);
|
||||||
if(std::regex_search(filename, rgx))
|
if(std::regex_search(filename, rgx))
|
||||||
return pat[1];
|
return pat[1];
|
||||||
}
|
}
|
||||||
|
@ -426,7 +426,6 @@ bool Console::load(Serializer& in)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void Console::selectFormat(int direction)
|
void Console::selectFormat(int direction)
|
||||||
{
|
{
|
||||||
string saveformat, message;
|
|
||||||
Int32 format = myCurrentFormat;
|
Int32 format = myCurrentFormat;
|
||||||
|
|
||||||
format = BSPF::clampw(format + direction, 0, 6);
|
format = BSPF::clampw(format + direction, 0, 6);
|
||||||
|
@ -534,8 +533,8 @@ void Console::toggleColorLoss(bool toggle)
|
||||||
myOSystem.settings().setValue(
|
myOSystem.settings().setValue(
|
||||||
myOSystem.settings().getBool("dev.settings") ? "dev.colorloss" : "plr.colorloss", colorloss);
|
myOSystem.settings().getBool("dev.settings") ? "dev.colorloss" : "plr.colorloss", colorloss);
|
||||||
|
|
||||||
string message = string("PAL color-loss ") +
|
const string message = string("PAL color-loss ") +
|
||||||
(colorloss ? "enabled" : "disabled");
|
(colorloss ? "enabled" : "disabled");
|
||||||
myOSystem.frameBuffer().showTextMessage(message);
|
myOSystem.frameBuffer().showTextMessage(message);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -576,7 +575,7 @@ void Console::toggleInter(bool toggle)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void Console::toggleTurbo()
|
void Console::toggleTurbo()
|
||||||
{
|
{
|
||||||
bool enabled = myOSystem.settings().getBool("turbo");
|
const bool enabled = myOSystem.settings().getBool("turbo");
|
||||||
|
|
||||||
myOSystem.settings().setValue("turbo", !enabled);
|
myOSystem.settings().setValue("turbo", !enabled);
|
||||||
|
|
||||||
|
@ -595,7 +594,7 @@ void Console::toggleTurbo()
|
||||||
void Console::changeSpeed(int direction)
|
void Console::changeSpeed(int direction)
|
||||||
{
|
{
|
||||||
int speed = mapSpeed(myOSystem.settings().getFloat("speed"));
|
int speed = mapSpeed(myOSystem.settings().getFloat("speed"));
|
||||||
bool turbo = myOSystem.settings().getBool("turbo");
|
const bool turbo = myOSystem.settings().getBool("turbo");
|
||||||
|
|
||||||
speed = BSPF::clamp(speed + direction * SPEED_STEP, MIN_SPEED, MAX_SPEED);
|
speed = BSPF::clamp(speed + direction * SPEED_STEP, MIN_SPEED, MAX_SPEED);
|
||||||
myOSystem.settings().setValue("speed", unmapSpeed(speed));
|
myOSystem.settings().setValue("speed", unmapSpeed(speed));
|
||||||
|
@ -674,7 +673,7 @@ FBInitStatus Console::initializeVideo(bool full)
|
||||||
Common::Size(TIAConstants::viewableWidth, TIAConstants::viewableHeight) :
|
Common::Size(TIAConstants::viewableWidth, TIAConstants::viewableHeight) :
|
||||||
Common::Size(2 * myTIA->width(), myTIA->height());
|
Common::Size(2 * myTIA->width(), myTIA->height());
|
||||||
|
|
||||||
bool devSettings = myOSystem.settings().getBool("dev.settings");
|
const bool devSettings = myOSystem.settings().getBool("dev.settings");
|
||||||
const string& title = string("Stella ") + STELLA_VERSION +
|
const string& title = string("Stella ") + STELLA_VERSION +
|
||||||
": \"" + myProperties.get(PropType::Cart_Name) + "\"";
|
": \"" + myProperties.get(PropType::Cart_Name) + "\"";
|
||||||
fbstatus = myOSystem.frameBuffer().createDisplay(title,
|
fbstatus = myOSystem.frameBuffer().createDisplay(title,
|
||||||
|
@ -827,7 +826,7 @@ void Console::setTIAProperties()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void Console::createAudioQueue()
|
void Console::createAudioQueue()
|
||||||
{
|
{
|
||||||
bool useStereo = myOSystem.settings().getBool(AudioSettings::SETTING_STEREO)
|
const bool useStereo = myOSystem.settings().getBool(AudioSettings::SETTING_STEREO)
|
||||||
|| myProperties.get(PropType::Cart_Sound) == "STEREO";
|
|| myProperties.get(PropType::Cart_Sound) == "STEREO";
|
||||||
|
|
||||||
myAudioQueue = make_shared<AudioQueue>(
|
myAudioQueue = make_shared<AudioQueue>(
|
||||||
|
@ -971,7 +970,8 @@ unique_ptr<Controller> Console::getControllerPort(const Controller::Type type,
|
||||||
case Controller::Type::PaddlesIAxDr:
|
case Controller::Type::PaddlesIAxDr:
|
||||||
{
|
{
|
||||||
// Also check if we should swap the paddles plugged into a jack
|
// Also check if we should swap the paddles plugged into a jack
|
||||||
bool swapPaddles = myProperties.get(PropType::Controller_SwapPaddles) == "YES";
|
const bool swapPaddles =
|
||||||
|
myProperties.get(PropType::Controller_SwapPaddles) == "YES";
|
||||||
bool swapAxis = false, swapDir = false;
|
bool swapAxis = false, swapDir = false;
|
||||||
if(type == Controller::Type::PaddlesIAxis)
|
if(type == Controller::Type::PaddlesIAxis)
|
||||||
swapAxis = true;
|
swapAxis = true;
|
||||||
|
@ -1002,8 +1002,9 @@ unique_ptr<Controller> Console::getControllerPort(const Controller::Type type,
|
||||||
{
|
{
|
||||||
FSNode nvramfile = myOSystem.nvramDir();
|
FSNode nvramfile = myOSystem.nvramDir();
|
||||||
nvramfile /= "atarivox_eeprom.dat";
|
nvramfile /= "atarivox_eeprom.dat";
|
||||||
Controller::onMessageCallback callback = [&os = myOSystem](const string& msg) {
|
const Controller::onMessageCallback callback = [&os = myOSystem](const string& msg)
|
||||||
bool devSettings = os.settings().getBool("dev.settings");
|
{
|
||||||
|
const bool devSettings = os.settings().getBool("dev.settings");
|
||||||
if(os.settings().getBool(devSettings ? "dev.extaccess" : "plr.extaccess"))
|
if(os.settings().getBool(devSettings ? "dev.extaccess" : "plr.extaccess"))
|
||||||
os.frameBuffer().showTextMessage(msg);
|
os.frameBuffer().showTextMessage(msg);
|
||||||
};
|
};
|
||||||
|
@ -1015,8 +1016,9 @@ unique_ptr<Controller> Console::getControllerPort(const Controller::Type type,
|
||||||
{
|
{
|
||||||
FSNode nvramfile = myOSystem.nvramDir();
|
FSNode nvramfile = myOSystem.nvramDir();
|
||||||
nvramfile /= "savekey_eeprom.dat";
|
nvramfile /= "savekey_eeprom.dat";
|
||||||
Controller::onMessageCallback callback = [&os = myOSystem](const string& msg) {
|
const Controller::onMessageCallback callback = [&os = myOSystem](const string& msg)
|
||||||
bool devSettings = os.settings().getBool("dev.settings");
|
{
|
||||||
|
const bool devSettings = os.settings().getBool("dev.settings");
|
||||||
if(os.settings().getBool(devSettings ? "dev.extaccess" : "plr.extaccess"))
|
if(os.settings().getBool(devSettings ? "dev.extaccess" : "plr.extaccess"))
|
||||||
os.frameBuffer().showTextMessage(msg);
|
os.frameBuffer().showTextMessage(msg);
|
||||||
};
|
};
|
||||||
|
@ -1029,12 +1031,14 @@ unique_ptr<Controller> Console::getControllerPort(const Controller::Type type,
|
||||||
|
|
||||||
case Controller::Type::KidVid:
|
case Controller::Type::KidVid:
|
||||||
{
|
{
|
||||||
Controller::onMessageCallbackForced callback = [&os = myOSystem](const string& msg, bool force) {
|
const Controller::onMessageCallbackForced callback =
|
||||||
bool devSettings = os.settings().getBool("dev.settings");
|
[&os = myOSystem](const string& msg, bool force) {
|
||||||
|
const bool devSettings = os.settings().getBool("dev.settings");
|
||||||
if(force || os.settings().getBool(devSettings ? "dev.extaccess" : "plr.extaccess"))
|
if(force || os.settings().getBool(devSettings ? "dev.extaccess" : "plr.extaccess"))
|
||||||
os.frameBuffer().showTextMessage(msg);
|
os.frameBuffer().showTextMessage(msg);
|
||||||
};
|
};
|
||||||
controller = make_unique<KidVid>(port, myEvent, myOSystem, *mySystem, romMd5, callback);
|
controller = make_unique<KidVid>
|
||||||
|
(port, myEvent, myOSystem, *mySystem, romMd5, callback);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1043,7 +1047,8 @@ unique_ptr<Controller> Console::getControllerPort(const Controller::Type type,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Controller::Type::Lightgun:
|
case Controller::Type::Lightgun:
|
||||||
controller = make_unique<Lightgun>(port, myEvent, *mySystem, romMd5, myOSystem.frameBuffer());
|
controller = make_unique<Lightgun>
|
||||||
|
(port, myEvent, *mySystem, romMd5, myOSystem.frameBuffer());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Controller::Type::QuadTari:
|
case Controller::Type::QuadTari:
|
||||||
|
@ -1159,7 +1164,7 @@ void Console::changePaddleAxesRange(int direction)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void Console::toggleAutoFire(bool toggle)
|
void Console::toggleAutoFire(bool toggle)
|
||||||
{
|
{
|
||||||
bool enabled = myOSystem.settings().getBool("autofire");
|
const bool enabled = myOSystem.settings().getBool("autofire");
|
||||||
|
|
||||||
if(toggle)
|
if(toggle)
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,7 +44,7 @@ EmulationWorker::~EmulationWorker()
|
||||||
{
|
{
|
||||||
// This has to run in a block in order to release the mutex before joining
|
// This has to run in a block in order to release the mutex before joining
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock(myThreadIsRunningMutex);
|
const std::unique_lock<std::mutex> lock(myThreadIsRunningMutex);
|
||||||
|
|
||||||
if (myState != State::exception) {
|
if (myState != State::exception) {
|
||||||
signalQuit();
|
signalQuit();
|
||||||
|
@ -61,7 +61,7 @@ EmulationWorker::~EmulationWorker()
|
||||||
void EmulationWorker::handlePossibleException()
|
void EmulationWorker::handlePossibleException()
|
||||||
{
|
{
|
||||||
if (myState == State::exception && myPendingException) {
|
if (myState == State::exception && myPendingException) {
|
||||||
std::exception_ptr ex = myPendingException;
|
const std::exception_ptr ex = myPendingException;
|
||||||
// Make sure that the exception is not thrown a second time (destructor!!!)
|
// Make sure that the exception is not thrown a second time (destructor!!!)
|
||||||
myPendingException = nullptr;
|
myPendingException = nullptr;
|
||||||
|
|
||||||
|
@ -78,8 +78,8 @@ void EmulationWorker::start(uInt32 cyclesPerSecond, uInt64 maxCycles, uInt64 min
|
||||||
// Run in a block to release the mutex before notifying; this avoids an unecessary
|
// Run in a block to release the mutex before notifying; this avoids an unecessary
|
||||||
// block that will waste a timeslice
|
// block that will waste a timeslice
|
||||||
{
|
{
|
||||||
// Aquire the mutex -> wait until the thread is suspended
|
// Acquire the mutex -> wait until the thread is suspended
|
||||||
std::unique_lock<std::mutex> lock(myThreadIsRunningMutex);
|
const std::unique_lock<std::mutex> lock(myThreadIsRunningMutex);
|
||||||
|
|
||||||
// Pass on possible exceptions
|
// Pass on possible exceptions
|
||||||
handlePossibleException();
|
handlePossibleException();
|
||||||
|
@ -115,7 +115,7 @@ uInt64 EmulationWorker::stop()
|
||||||
|
|
||||||
uInt64 totalCycles{0};
|
uInt64 totalCycles{0};
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock(myThreadIsRunningMutex);
|
const std::unique_lock<std::mutex> lock(myThreadIsRunningMutex);
|
||||||
|
|
||||||
// Paranoia: make sure that we don't doublecount an emulation timeslice
|
// Paranoia: make sure that we don't doublecount an emulation timeslice
|
||||||
totalCycles = myTotalCycles;
|
totalCycles = myTotalCycles;
|
||||||
|
@ -148,7 +148,7 @@ void EmulationWorker::threadMain(std::condition_variable* initializedCondition,
|
||||||
try {
|
try {
|
||||||
{
|
{
|
||||||
// Wait until our parent releases the lock and sleeps
|
// Wait until our parent releases the lock and sleeps
|
||||||
std::lock_guard<std::mutex> guard(*initializationMutex);
|
const std::lock_guard<std::mutex> guard(*initializationMutex);
|
||||||
|
|
||||||
// Update the state...
|
// Update the state...
|
||||||
myState = State::initialized;
|
myState = State::initialized;
|
||||||
|
@ -303,7 +303,7 @@ void EmulationWorker::dispatchEmulation(std::unique_lock<std::mutex>& lock)
|
||||||
void EmulationWorker::clearSignal()
|
void EmulationWorker::clearSignal()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock(mySignalChangeMutex);
|
const std::unique_lock<std::mutex> lock(mySignalChangeMutex);
|
||||||
myPendingSignal = Signal::none;
|
myPendingSignal = Signal::none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ void EmulationWorker::clearSignal()
|
||||||
void EmulationWorker::signalQuit()
|
void EmulationWorker::signalQuit()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock(mySignalChangeMutex);
|
const std::unique_lock<std::mutex> lock(mySignalChangeMutex);
|
||||||
myPendingSignal = Signal::quit;
|
myPendingSignal = Signal::quit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1539,7 +1539,7 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated)
|
||||||
{
|
{
|
||||||
StringList msg;
|
StringList msg;
|
||||||
const string saveOnExit = myOSystem.settings().getString("saveonexit");
|
const string saveOnExit = myOSystem.settings().getString("saveonexit");
|
||||||
bool activeTM = myOSystem.settings().getBool(
|
const bool activeTM = myOSystem.settings().getBool(
|
||||||
myOSystem.settings().getBool("dev.settings") ? "dev.timemachine" : "plr.timemachine");
|
myOSystem.settings().getBool("dev.settings") ? "dev.timemachine" : "plr.timemachine");
|
||||||
|
|
||||||
|
|
||||||
|
@ -1986,11 +1986,11 @@ void EventHandler::setComboMap()
|
||||||
{
|
{
|
||||||
for(const json& combo : mapping)
|
for(const json& combo : mapping)
|
||||||
{
|
{
|
||||||
int i = combo.at("combo").get<Event::Type>() - Event::Combo1,
|
const int i = combo.at("combo").get<Event::Type>() - Event::Combo1;
|
||||||
j = 0;
|
int j = 0;
|
||||||
json events = combo.at("events");
|
const json events = combo.at("events");
|
||||||
|
|
||||||
for(const json& event : events)
|
for(const json& event: events)
|
||||||
myComboTable[i][j++] = event;
|
myComboTable[i][j++] = event;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2297,7 +2297,7 @@ VariantList EventHandler::getComboList()
|
||||||
{
|
{
|
||||||
const Event::Type event = EventHandler::ourEmulActionList[i].event;
|
const Event::Type event = EventHandler::ourEmulActionList[i].event;
|
||||||
// exclude combos events
|
// exclude combos events
|
||||||
if(!(event >= Event::Combo1 && event <= Event::Combo16))
|
if(event < Event::Combo1 || event > Event::Combo16)
|
||||||
{
|
{
|
||||||
buf << i;
|
buf << i;
|
||||||
VarList::push_back(l, EventHandler::ourEmulActionList[i].action, buf.str());
|
VarList::push_back(l, EventHandler::ourEmulActionList[i].action, buf.str());
|
||||||
|
@ -2549,7 +2549,7 @@ void EventHandler::changeMouseControllerMode(int direction)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void EventHandler::changeMouseCursor(int direction)
|
void EventHandler::changeMouseCursor(int direction)
|
||||||
{
|
{
|
||||||
int cursor = BSPF::clampw(myOSystem.settings().getInt("cursor") + direction, 0, 3);
|
const int cursor = BSPF::clampw(myOSystem.settings().getInt("cursor") + direction, 0, 3);
|
||||||
|
|
||||||
myOSystem.settings().setValue("cursor", cursor);
|
myOSystem.settings().setValue("cursor", cursor);
|
||||||
myOSystem.frameBuffer().setCursorState();
|
myOSystem.frameBuffer().setCursorState();
|
||||||
|
|
|
@ -191,8 +191,8 @@ void FBSurface::drawChar(const GUI::Font& font, uInt8 chr,
|
||||||
bby = desc.bbx[chr].y; // NOLINT
|
bby = desc.bbx[chr].y; // NOLINT
|
||||||
}
|
}
|
||||||
|
|
||||||
uInt32 cx = tx + bbx;
|
const uInt32 cx = tx + bbx;
|
||||||
uInt32 cy = ty + desc.ascent - bby - bbh;
|
const uInt32 cy = ty + desc.ascent - bby - bbh;
|
||||||
|
|
||||||
if(!checkBounds(cx , cy) || !checkBounds(cx + bbw - 1, cy + bbh - 1))
|
if(!checkBounds(cx , cy) || !checkBounds(cx + bbw - 1, cy + bbh - 1))
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -85,7 +85,7 @@ bool FSNode::getAllChildren(FSList& fslist, ListMode mode,
|
||||||
{
|
{
|
||||||
if(BSPF::endsWithIgnoreCase(i.getPath(), ".zip"))
|
if(BSPF::endsWithIgnoreCase(i.getPath(), ".zip"))
|
||||||
{
|
{
|
||||||
FSNodeZIP zipNode(i.getPath());
|
const FSNodeZIP zipNode(i.getPath());
|
||||||
i.setName(zipNode.getName());
|
i.setName(zipNode.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,9 +108,9 @@ bool FSNode::getAllChildren(FSList& fslist, ListMode mode,
|
||||||
if(BSPF::endsWithIgnoreCase(i.getPath(), ".zip"))
|
if(BSPF::endsWithIgnoreCase(i.getPath(), ".zip"))
|
||||||
{
|
{
|
||||||
// Force ZIP c'tor to be called
|
// Force ZIP c'tor to be called
|
||||||
AbstractFSNodePtr ptr = FSNodeFactory::create(
|
const AbstractFSNodePtr ptr = FSNodeFactory::create(
|
||||||
i.getPath(), FSNodeFactory::Type::ZIP);
|
i.getPath(), FSNodeFactory::Type::ZIP);
|
||||||
FSNode zipNode(ptr);
|
const FSNode zipNode(ptr);
|
||||||
i = zipNode;
|
i = zipNode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ bool FSNode::getChildren(FSList& fslist, ListMode mode,
|
||||||
{
|
{
|
||||||
if(BSPF::endsWithIgnoreCase(i->getPath(), ".zip"))
|
if(BSPF::endsWithIgnoreCase(i->getPath(), ".zip"))
|
||||||
{
|
{
|
||||||
FSNodeZIP node(i->getPath());
|
const FSNodeZIP node(i->getPath());
|
||||||
i->setName(node.getName());
|
i->setName(node.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -184,9 +184,9 @@ bool FSNode::getChildren(FSList& fslist, ListMode mode,
|
||||||
if (BSPF::endsWithIgnoreCase(i->getPath(), ".zip"))
|
if (BSPF::endsWithIgnoreCase(i->getPath(), ".zip"))
|
||||||
{
|
{
|
||||||
// Force ZIP c'tor to be called
|
// Force ZIP c'tor to be called
|
||||||
AbstractFSNodePtr ptr = FSNodeFactory::create(
|
const AbstractFSNodePtr ptr = FSNodeFactory::create(
|
||||||
i->getPath(), FSNodeFactory::Type::ZIP);
|
i->getPath(), FSNodeFactory::Type::ZIP);
|
||||||
FSNode zipNode(ptr);
|
const FSNode zipNode(ptr);
|
||||||
|
|
||||||
if(filter(zipNode))
|
if(filter(zipNode))
|
||||||
{
|
{
|
||||||
|
@ -195,7 +195,7 @@ bool FSNode::getChildren(FSList& fslist, ListMode mode,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// filter by zip node but add file node
|
// filter by zip node but add file node
|
||||||
FSNode node(i);
|
const FSNode node(i);
|
||||||
fslist.emplace_back(node);
|
fslist.emplace_back(node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ bool FSNode::getChildren(FSList& fslist, ListMode mode,
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
FSNode node(i);
|
const FSNode node(i);
|
||||||
|
|
||||||
if(includeChildDirectories)
|
if(includeChildDirectories)
|
||||||
{
|
{
|
||||||
|
|
|
@ -170,10 +170,12 @@ void FrameBuffer::setupFonts()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
constexpr int NUM_FONTS = 7;
|
constexpr int NUM_FONTS = 7;
|
||||||
FontDesc FONT_DESC[NUM_FONTS] = {GUI::consoleDesc, GUI::consoleMediumDesc, GUI::stellaMediumDesc,
|
const FontDesc FONT_DESC[NUM_FONTS] = {
|
||||||
GUI::stellaLargeDesc, GUI::stella12x24tDesc, GUI::stella14x28tDesc, GUI::stella16x32tDesc};
|
GUI::consoleDesc, GUI::consoleMediumDesc, GUI::stellaMediumDesc,
|
||||||
|
GUI::stellaLargeDesc, GUI::stella12x24tDesc, GUI::stella14x28tDesc,
|
||||||
|
GUI::stella16x32tDesc};
|
||||||
const string& dialogFont = myOSystem.settings().getString("dialogfont");
|
const string& dialogFont = myOSystem.settings().getString("dialogfont");
|
||||||
FontDesc fd = getFontDesc(dialogFont);
|
const FontDesc fd = getFontDesc(dialogFont);
|
||||||
|
|
||||||
// The general font used in all UI elements
|
// The general font used in all UI elements
|
||||||
myFont = make_unique<GUI::Font>(fd); // default: 9x18
|
myFont = make_unique<GUI::Font>(fd); // default: 9x18
|
||||||
|
@ -274,9 +276,9 @@ FBInitStatus FrameBuffer::createDisplay(const string& title, BufferType type,
|
||||||
if(myBufferType == BufferType::Emulator)
|
if(myBufferType == BufferType::Emulator)
|
||||||
{
|
{
|
||||||
// Determine possible TIA windowed zoom levels
|
// Determine possible TIA windowed zoom levels
|
||||||
float currentTIAZoom = myOSystem.settings().getFloat("tia.zoom");
|
const float currentTIAZoom = myOSystem.settings().getFloat("tia.zoom");
|
||||||
myOSystem.settings().setValue("tia.zoom",
|
myOSystem.settings().setValue("tia.zoom",
|
||||||
BSPF::clampw(currentTIAZoom, supportedTIAMinZoom(), supportedTIAMaxZoom()));
|
BSPF::clampw(currentTIAZoom, supportedTIAMinZoom(), supportedTIAMaxZoom()));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GUI_SUPPORT // TODO: put message stuff in its own class
|
#ifdef GUI_SUPPORT // TODO: put message stuff in its own class
|
||||||
|
@ -311,7 +313,7 @@ FBInitStatus FrameBuffer::createDisplay(const string& title, BufferType type,
|
||||||
myVidModeHandler.setImageSize(size);
|
myVidModeHandler.setImageSize(size);
|
||||||
|
|
||||||
// Initialize video subsystem
|
// Initialize video subsystem
|
||||||
string pre_about = myBackend->about();
|
const string pre_about = myBackend->about();
|
||||||
const FBInitStatus status = applyVideoMode();
|
const FBInitStatus status = applyVideoMode();
|
||||||
|
|
||||||
// Only set phosphor once when ROM is started
|
// Only set phosphor once when ROM is started
|
||||||
|
@ -344,7 +346,7 @@ FBInitStatus FrameBuffer::createDisplay(const string& title, BufferType type,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string post_about = myBackend->about();
|
const string post_about = myBackend->about();
|
||||||
if(post_about != pre_about)
|
if(post_about != pre_about)
|
||||||
Logger::info(post_about);
|
Logger::info(post_about);
|
||||||
}
|
}
|
||||||
|
@ -383,7 +385,7 @@ void FrameBuffer::update(UpdateMode mode)
|
||||||
case EventHandlerState::PAUSE:
|
case EventHandlerState::PAUSE:
|
||||||
{
|
{
|
||||||
// Show a pause message immediately and then every 7 seconds
|
// Show a pause message immediately and then every 7 seconds
|
||||||
bool shade = myOSystem.settings().getBool("pausedim");
|
const bool shade = myOSystem.settings().getBool("pausedim");
|
||||||
|
|
||||||
if(myPausedCount-- <= 0)
|
if(myPausedCount-- <= 0)
|
||||||
{
|
{
|
||||||
|
@ -1214,7 +1216,7 @@ void FrameBuffer::switchVideoMode(int direction)
|
||||||
// is irrelevant
|
// is irrelevant
|
||||||
if(direction == +1 || direction == -1)
|
if(direction == +1 || direction == -1)
|
||||||
{
|
{
|
||||||
bool stretch = myOSystem.settings().getBool("tia.fs_stretch");
|
const bool stretch = myOSystem.settings().getBool("tia.fs_stretch");
|
||||||
myOSystem.settings().setValue("tia.fs_stretch", !stretch);
|
myOSystem.settings().setValue("tia.fs_stretch", !stretch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1366,7 +1368,7 @@ bool FrameBuffer::grabMouseAllowed()
|
||||||
const bool alwaysUseMouse = BSPF::equalsIgnoreCase("always", myOSystem.settings().getString("usemouse"));
|
const bool alwaysUseMouse = BSPF::equalsIgnoreCase("always", myOSystem.settings().getString("usemouse"));
|
||||||
|
|
||||||
// Disable grab while cursor is shown in emulation
|
// Disable grab while cursor is shown in emulation
|
||||||
bool cursorHidden = !(myOSystem.settings().getInt("cursor") & 1);
|
const bool cursorHidden = !(myOSystem.settings().getInt("cursor") & 1);
|
||||||
|
|
||||||
return emulation && (analog || usesLightgun || alwaysUseMouse) && cursorHidden;
|
return emulation && (analog || usesLightgun || alwaysUseMouse) && cursorHidden;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ void KidVid::update()
|
||||||
{
|
{
|
||||||
// Continue playing song after state load
|
// Continue playing song after state load
|
||||||
const uInt8 temp = ourSongPositions[mySongPointer - 1] & 0x7f;
|
const uInt8 temp = ourSongPositions[mySongPointer - 1] & 0x7f;
|
||||||
const uInt32 songLength = ourSongStart[temp + 1] - ourSongStart[temp];
|
const uInt32 songLength = ourSongStart[temp + 1] - ourSongStart[temp] - (262 * ClickFrames);
|
||||||
|
|
||||||
// Play the remaining WAV file
|
// Play the remaining WAV file
|
||||||
const string& fileName = myOSystem.baseDir().getPath() + ((temp < 10) ? "KVSHARED.WAV" : getFileName());
|
const string& fileName = myOSystem.baseDir().getPath() + ((temp < 10) ? "KVSHARED.WAV" : getFileName());
|
||||||
|
@ -140,6 +140,10 @@ void KidVid::update()
|
||||||
{
|
{
|
||||||
setPin(DigitalPin::Four, (ourData[myIdx >> 3] << (myIdx & 0x07)) & 0x80);
|
setPin(DigitalPin::Four, (ourData[myIdx >> 3] << (myIdx & 0x07)) & 0x80);
|
||||||
|
|
||||||
|
#ifdef DEBUG_BUILD
|
||||||
|
cerr << (DigitalPin::Four, (ourData[myIdx >> 3] << (myIdx & 0x07)) & 0x80 ? "X" : ".");
|
||||||
|
#endif
|
||||||
|
|
||||||
// increase to next bit
|
// increase to next bit
|
||||||
++myIdx;
|
++myIdx;
|
||||||
--myBlockIdx;
|
--myBlockIdx;
|
||||||
|
@ -172,7 +176,7 @@ void KidVid::update()
|
||||||
if(mySongPlaying)
|
if(mySongPlaying)
|
||||||
{
|
{
|
||||||
mySongLength = myOSystem.sound().wavSize();
|
mySongLength = myOSystem.sound().wavSize();
|
||||||
myTapeBusy = (mySongLength > 262 * ClickFrames) || !myBeep;
|
myTapeBusy = (mySongLength > 262 * TapeFrames) || !myBeep;
|
||||||
// Check for end of played sample
|
// Check for end of played sample
|
||||||
if(mySongLength == 0)
|
if(mySongLength == 0)
|
||||||
{
|
{
|
||||||
|
@ -188,7 +192,7 @@ void KidVid::update()
|
||||||
if(mySongLength)
|
if(mySongLength)
|
||||||
{
|
{
|
||||||
--mySongLength;
|
--mySongLength;
|
||||||
myTapeBusy = (mySongLength > ClickFrames);
|
myTapeBusy = (mySongLength > TapeFrames);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -259,6 +263,7 @@ void KidVid::openSampleFiles()
|
||||||
44 + 38 + 42 + 62
|
44 + 38 + 42 + 62
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef SOUND_SUPPORT
|
||||||
if(!myFilesFound)
|
if(!myFilesFound)
|
||||||
{
|
{
|
||||||
int i = myGame == Game::Smurfs ? myTape - 1 : myTape + 2;
|
int i = myGame == Game::Smurfs ? myTape - 1 : myTape + 2;
|
||||||
|
@ -267,13 +272,14 @@ void KidVid::openSampleFiles()
|
||||||
myFilesFound = FSNode(myOSystem.baseDir().getPath() + getFileName()).exists() &&
|
myFilesFound = FSNode(myOSystem.baseDir().getPath() + getFileName()).exists() &&
|
||||||
FSNode(myOSystem.baseDir().getPath() + "KVSHARED.WAV").exists();
|
FSNode(myOSystem.baseDir().getPath() + "KVSHARED.WAV").exists();
|
||||||
|
|
||||||
#ifdef DEBUG_BUILD
|
#ifdef DEBUG_BUILD
|
||||||
if(myFilesFound)
|
if(myFilesFound)
|
||||||
cerr << endl
|
cerr << endl
|
||||||
<< "found file: " << getFileName() << endl
|
<< "found file: " << getFileName() << endl
|
||||||
<< "found file: " << "KVSHARED.WAV" << endl;
|
<< "found file: " << "KVSHARED.WAV" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
mySongLength = 0;
|
mySongLength = 0;
|
||||||
mySongPointer = firstSongPointer[i];
|
mySongPointer = firstSongPointer[i];
|
||||||
}
|
}
|
||||||
|
@ -288,7 +294,7 @@ void KidVid::setNextSong()
|
||||||
myBeep = (ourSongPositions[mySongPointer] & 0x80) == 0;
|
myBeep = (ourSongPositions[mySongPointer] & 0x80) == 0;
|
||||||
|
|
||||||
const uInt8 temp = ourSongPositions[mySongPointer] & 0x7f;
|
const uInt8 temp = ourSongPositions[mySongPointer] & 0x7f;
|
||||||
mySongLength = ourSongStart[temp + 1] - ourSongStart[temp];
|
mySongLength = ourSongStart[temp + 1] - ourSongStart[temp] - (262 * ClickFrames);
|
||||||
|
|
||||||
// Play the WAV file
|
// Play the WAV file
|
||||||
const string& fileName = (temp < 10) ? "KVSHARED.WAV" : getFileName();
|
const string& fileName = (temp < 10) ? "KVSHARED.WAV" : getFileName();
|
||||||
|
@ -298,9 +304,9 @@ void KidVid::setNextSong()
|
||||||
msg << "Read song #" << mySongPointer << " (" << fileName << ")";
|
msg << "Read song #" << mySongPointer << " (" << fileName << ")";
|
||||||
myCallback(msg.str(), false);
|
myCallback(msg.str(), false);
|
||||||
|
|
||||||
#ifdef DEBUG_BUILD
|
#ifdef DEBUG_BUILD
|
||||||
cerr << fileName << ": " << (ourSongPositions[mySongPointer] & 0x7f) << endl;
|
cerr << fileName << ": " << (ourSongPositions[mySongPointer] & 0x7f) << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mySongPlaying = myTapeBusy = true;
|
mySongPlaying = myTapeBusy = true;
|
||||||
++mySongPointer;
|
++mySongPointer;
|
||||||
|
@ -309,7 +315,7 @@ void KidVid::setNextSong()
|
||||||
{
|
{
|
||||||
myBeep = true;
|
myBeep = true;
|
||||||
myTapeBusy = true;
|
myTapeBusy = true;
|
||||||
mySongLength = 80; /* delay needed for Harmony without tape */
|
mySongLength = TapeFrames + 32; /* delay needed for Harmony without tape */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -438,14 +444,14 @@ const std::array<uInt32, KidVid::SongStartSize> KidVid::ourSongStart = {
|
||||||
3059116,
|
3059116,
|
||||||
|
|
||||||
/* kvs1 */
|
/* kvs1 */
|
||||||
44, /* Harmony into 1 */
|
44, /* Harmony intro 1 */
|
||||||
164685, /* falling notes (into 2) */
|
164685, /* falling notes (intro 2) */
|
||||||
395182, /* instructions */
|
395182, /* instructions */
|
||||||
750335, /* high notes are high */
|
750335, /* high notes are high */
|
||||||
962016, /* my hat's off to you */
|
962016, /* my hat's off to you */
|
||||||
1204273, /* 1 2 3 do re mi */
|
1204273, /* 1 2 3 do re mi */
|
||||||
1538258, /* Harmony */
|
1538258, /* Harmony */
|
||||||
1801683, /* concratulations (all of the Smurfs voted) */
|
1801683, /* congratulations (all of the Smurfs voted) */
|
||||||
2086276, /* line or space */
|
2086276, /* line or space */
|
||||||
2399093, /* hooray */
|
2399093, /* hooray */
|
||||||
2589606, /* hear yeeh */
|
2589606, /* hear yeeh */
|
||||||
|
|
|
@ -111,7 +111,8 @@ class KidVid : public Controller
|
||||||
NumBlockBits = NumBlocks * 8, // number of bits / block
|
NumBlockBits = NumBlocks * 8, // number of bits / block
|
||||||
SongPosSize = 44 + 38 + 42 + 62 + 80 + 62,
|
SongPosSize = 44 + 38 + 42 + 62 + 80 + 62,
|
||||||
SongStartSize = 104,
|
SongStartSize = 104,
|
||||||
ClickFrames = 48 // eliminate click noise at song end
|
TapeFrames = 60,
|
||||||
|
ClickFrames = 3 // eliminate click noise at song end
|
||||||
;
|
;
|
||||||
|
|
||||||
// Whether the KidVid device is enabled (only for games that it
|
// Whether the KidVid device is enabled (only for games that it
|
||||||
|
|
|
@ -103,9 +103,8 @@ bool Lightgun::read(DigitalPin pin)
|
||||||
if (xTia < 0)
|
if (xTia < 0)
|
||||||
xTia += TIAConstants::H_CLOCKS;
|
xTia += TIAConstants::H_CLOCKS;
|
||||||
|
|
||||||
const bool enable = !((xTia - xMouse) >= 0 && (xTia - xMouse) < 15 && (yTia - yMouse) >= 0);
|
return (xTia - xMouse) < 0 || (xTia - xMouse) >= 15 ||
|
||||||
|
(yTia - yMouse) < 0;
|
||||||
return enable;
|
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return Controller::read(pin);
|
return Controller::read(pin);
|
||||||
|
|
|
@ -65,7 +65,7 @@ void M6502::reset()
|
||||||
myExecutionStatus = 0;
|
myExecutionStatus = 0;
|
||||||
|
|
||||||
// Set registers to random or default values
|
// Set registers to random or default values
|
||||||
bool devSettings = mySettings.getBool("dev.settings");
|
const bool devSettings = mySettings.getBool("dev.settings");
|
||||||
const string& cpurandom = mySettings.getString(devSettings ? "dev.cpurandom" : "plr.cpurandom");
|
const string& cpurandom = mySettings.getString(devSettings ? "dev.cpurandom" : "plr.cpurandom");
|
||||||
SP = BSPF::containsIgnoreCase(cpurandom, "S") ?
|
SP = BSPF::containsIgnoreCase(cpurandom, "S") ?
|
||||||
mySystem->randGenerator().next() : 0xfd;
|
mySystem->randGenerator().next() : 0xfd;
|
||||||
|
|
|
@ -47,7 +47,7 @@ void M6532::reset()
|
||||||
};
|
};
|
||||||
|
|
||||||
// Initialize the 128 bytes of memory
|
// Initialize the 128 bytes of memory
|
||||||
bool devSettings = mySettings.getBool("dev.settings");
|
const bool devSettings = mySettings.getBool("dev.settings");
|
||||||
if(mySettings.getString(devSettings ? "dev.console" : "plr.console") == "7800")
|
if(mySettings.getString(devSettings ? "dev.console" : "plr.console") == "7800")
|
||||||
std::copy_n(RAM_7800.begin(), RAM_7800.size(), myRAM.begin());
|
std::copy_n(RAM_7800.begin(), RAM_7800.size(), myRAM.begin());
|
||||||
else if(mySettings.getBool(devSettings ? "dev.ramrandom" : "plr.ramrandom"))
|
else if(mySettings.getBool(devSettings ? "dev.ramrandom" : "plr.ramrandom"))
|
||||||
|
|
|
@ -143,7 +143,7 @@ static void MD5Update(MD5_CTX* context, const uInt8* const input,
|
||||||
auto index = static_cast<uInt32>((context->count[0] >> 3) & 0x3F);
|
auto index = static_cast<uInt32>((context->count[0] >> 3) & 0x3F);
|
||||||
|
|
||||||
/* Update number of bits */
|
/* Update number of bits */
|
||||||
if ((context->count[0] += (inputLen << 3)) < (inputLen << 3))
|
if ((context->count[0] += (inputLen << 3)) < (inputLen << 3)) // NOLINT
|
||||||
context->count[1]++;
|
context->count[1]++;
|
||||||
context->count[1] += (inputLen >> 29);
|
context->count[1] += (inputLen >> 29);
|
||||||
|
|
||||||
|
|
|
@ -474,9 +474,10 @@ string OSystem::createConsole(const FSNode& rom, const string& md5sum,
|
||||||
}
|
}
|
||||||
myConsole->initializeAudio();
|
myConsole->initializeAudio();
|
||||||
|
|
||||||
string saveOnExit = settings().getString("saveonexit");
|
const string saveOnExit = settings().getString("saveonexit");
|
||||||
bool devSettings = settings().getBool("dev.settings");
|
const bool devSettings = settings().getBool("dev.settings");
|
||||||
bool activeTM = settings().getBool(devSettings ? "dev.timemachine" : "plr.timemachine");
|
const bool activeTM = settings().getBool(
|
||||||
|
devSettings ? "dev.timemachine" : "plr.timemachine");
|
||||||
|
|
||||||
if (saveOnExit == "all" && activeTM)
|
if (saveOnExit == "all" && activeTM)
|
||||||
myEventHandler->handleEvent(Event::LoadAllStates);
|
myEventHandler->handleEvent(Event::LoadAllStates);
|
||||||
|
@ -492,7 +493,7 @@ string OSystem::createConsole(const FSNode& rom, const string& md5sum,
|
||||||
}
|
}
|
||||||
buf << "Game console created:" << endl
|
buf << "Game console created:" << endl
|
||||||
<< " ROM file: " << myRomFile.getShortPath() << endl;
|
<< " ROM file: " << myRomFile.getShortPath() << endl;
|
||||||
FSNode propsFile(myRomFile.getPathWithExt(".pro"));
|
const FSNode propsFile(myRomFile.getPathWithExt(".pro"));
|
||||||
if(propsFile.exists())
|
if(propsFile.exists())
|
||||||
buf << " PRO file: " << propsFile.getShortPath() << endl;
|
buf << " PRO file: " << propsFile.getShortPath() << endl;
|
||||||
buf << endl << getROMInfo(*myConsole);
|
buf << endl << getROMInfo(*myConsole);
|
||||||
|
@ -528,7 +529,7 @@ string OSystem::createConsole(const FSNode& rom, const string& md5sum,
|
||||||
constexpr int ID_LEN = 32;
|
constexpr int ID_LEN = 32;
|
||||||
const char* HEX_DIGITS = "0123456789ABCDEF";
|
const char* HEX_DIGITS = "0123456789ABCDEF";
|
||||||
char id_chr[ID_LEN] = { 0 };
|
char id_chr[ID_LEN] = { 0 };
|
||||||
Random rnd;
|
const Random rnd;
|
||||||
|
|
||||||
for(char& c : id_chr)
|
for(char& c : id_chr)
|
||||||
c = HEX_DIGITS[rnd.next() % 16];
|
c = HEX_DIGITS[rnd.next() % 16];
|
||||||
|
@ -667,7 +668,7 @@ unique_ptr<Console> OSystem::openConsole(const FSNode& romfile, string& md5)
|
||||||
const string& type = props.get(PropType::Cart_Type);
|
const string& type = props.get(PropType::Cart_Type);
|
||||||
const Cartridge::messageCallback callback = [&os = *this](const string& msg)
|
const Cartridge::messageCallback callback = [&os = *this](const string& msg)
|
||||||
{
|
{
|
||||||
bool devSettings = os.settings().getBool("dev.settings");
|
const bool devSettings = os.settings().getBool("dev.settings");
|
||||||
|
|
||||||
if(os.settings().getBool(devSettings ? "dev.extaccess" : "plr.extaccess"))
|
if(os.settings().getBool(devSettings ? "dev.extaccess" : "plr.extaccess"))
|
||||||
os.frameBuffer().showTextMessage(msg);
|
os.frameBuffer().showTextMessage(msg);
|
||||||
|
|
|
@ -215,7 +215,7 @@ Paddles::getReadOut(int lastAxis,int& newAxis, int center)
|
||||||
|
|
||||||
// dejitter, suppress small changes only
|
// dejitter, suppress small changes only
|
||||||
const float dejitter = powf(baseFactor, std::abs(newAxis - lastAxis) * diffFactor);
|
const float dejitter = powf(baseFactor, std::abs(newAxis - lastAxis) * diffFactor);
|
||||||
int newVal = newAxis * (1 - dejitter) + lastAxis * dejitter;
|
const int newVal = newAxis * (1 - dejitter) + lastAxis * dejitter;
|
||||||
|
|
||||||
// only use new dejittered value for larger differences
|
// only use new dejittered value for larger differences
|
||||||
if(abs(newVal - newAxis) > 10)
|
if(abs(newVal - newAxis) > 10)
|
||||||
|
|
|
@ -90,7 +90,7 @@ class PlusROMRequest {
|
||||||
<< "nick=" << myId.nick;
|
<< "nick=" << myId.nick;
|
||||||
|
|
||||||
httplib::Client client(myDestination.host);
|
httplib::Client client(myDestination.host);
|
||||||
httplib::Headers headers = {
|
const httplib::Headers headers = {
|
||||||
{"PlusROM-Info", content.str()}
|
{"PlusROM-Info", content.str()}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -375,7 +375,7 @@ bool PlusROM::isValidHost(const string& host)
|
||||||
// of each part between '.' in the range 1 .. 63
|
// of each part between '.' in the range 1 .. 63
|
||||||
// Perhaps a better function will be included with whatever network
|
// Perhaps a better function will be included with whatever network
|
||||||
// library we decide to use
|
// library we decide to use
|
||||||
static std::regex rgx(R"(^(([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])$)", std::regex_constants::icase);
|
static const std::regex rgx(R"(^(([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])$)", std::regex_constants::icase);
|
||||||
|
|
||||||
return std::regex_match(host, rgx);
|
return std::regex_match(host, rgx);
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,14 +60,14 @@ ProfilingRunner::ProfilingRunner(int argc, char* argv[])
|
||||||
for (int i = 2; i < argc; i++) {
|
for (int i = 2; i < argc; i++) {
|
||||||
ProfilingRun& run(profilingRuns[i-2]);
|
ProfilingRun& run(profilingRuns[i-2]);
|
||||||
|
|
||||||
string arg = argv[i];
|
const string arg = argv[i];
|
||||||
const size_t splitPoint = arg.find_first_of(':');
|
const size_t splitPoint = arg.find_first_of(':');
|
||||||
|
|
||||||
run.romFile = splitPoint == string::npos ? arg : arg.substr(0, splitPoint);
|
run.romFile = splitPoint == string::npos ? arg : arg.substr(0, splitPoint);
|
||||||
|
|
||||||
if (splitPoint == string::npos) run.runtime = RUNTIME_DEFAULT;
|
if (splitPoint == string::npos) run.runtime = RUNTIME_DEFAULT;
|
||||||
else {
|
else {
|
||||||
int runtime = BSPF::stringToInt(arg.substr(splitPoint+1, string::npos));
|
const int runtime = BSPF::stringToInt(arg.substr(splitPoint+1, string::npos));
|
||||||
run.runtime = runtime > 0 ? runtime : RUNTIME_DEFAULT;
|
run.runtime = runtime > 0 ? runtime : RUNTIME_DEFAULT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ bool ProfilingRunner::run()
|
||||||
// stacksize '16384'. Consider moving some data to heap.
|
// stacksize '16384'. Consider moving some data to heap.
|
||||||
bool ProfilingRunner::runOne(const ProfilingRun& run)
|
bool ProfilingRunner::runOne(const ProfilingRun& run)
|
||||||
{
|
{
|
||||||
FSNode imageFile(run.romFile);
|
const FSNode imageFile(run.romFile);
|
||||||
|
|
||||||
if (!imageFile.isFile()) {
|
if (!imageFile.isFile()) {
|
||||||
cout << "ERROR: " << run.romFile << " is not a ROM image" << endl;
|
cout << "ERROR: " << run.romFile << " is not a ROM image" << endl;
|
||||||
|
@ -110,7 +110,7 @@ bool ProfilingRunner::runOne(const ProfilingRun& run)
|
||||||
}
|
}
|
||||||
|
|
||||||
string md5 = MD5::hash(image, size);
|
string md5 = MD5::hash(image, size);
|
||||||
string type;
|
const string type;
|
||||||
unique_ptr<Cartridge> cartridge = CartCreator::create(
|
unique_ptr<Cartridge> cartridge = CartCreator::create(
|
||||||
imageFile, image, size, md5, type, mySettings);
|
imageFile, image, size, md5, type, mySettings);
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ bool ProfilingRunner::runOne(const ProfilingRun& run)
|
||||||
|
|
||||||
IO consoleIO;
|
IO consoleIO;
|
||||||
Random rng(0);
|
Random rng(0);
|
||||||
Event event;
|
const Event event;
|
||||||
|
|
||||||
M6502 cpu(mySettings);
|
M6502 cpu(mySettings);
|
||||||
M6532 riot(consoleIO, mySettings);
|
M6532 riot(consoleIO, mySettings);
|
||||||
|
|
|
@ -154,7 +154,7 @@ void PropertiesSet::loadPerROM(const FSNode& rom, const string& md5)
|
||||||
|
|
||||||
// First, does this ROM have a per-ROM properties entry?
|
// First, does this ROM have a per-ROM properties entry?
|
||||||
// If so, load it into the database
|
// If so, load it into the database
|
||||||
FSNode propsNode(rom.getPathWithExt(".pro"));
|
const FSNode propsNode(rom.getPathWithExt(".pro"));
|
||||||
if (propsNode.exists()) {
|
if (propsNode.exists()) {
|
||||||
KeyValueRepositoryPropertyFile repo(propsNode);
|
KeyValueRepositoryPropertyFile repo(propsNode);
|
||||||
props.load(repo);
|
props.load(repo);
|
||||||
|
|
|
@ -69,18 +69,19 @@ QuadTari::QuadTari(Jack jack, const OSystem& osystem, const System& system,
|
||||||
unique_ptr<Controller> QuadTari::addController(const Controller::Type type, bool second)
|
unique_ptr<Controller> QuadTari::addController(const Controller::Type type, bool second)
|
||||||
{
|
{
|
||||||
FSNode nvramfile = myOSystem.nvramDir();
|
FSNode nvramfile = myOSystem.nvramDir();
|
||||||
Controller::onMessageCallback callback = [&os = myOSystem](const string& msg) {
|
const Controller::onMessageCallback callback = [&os = myOSystem]
|
||||||
bool devSettings = os.settings().getBool("dev.settings");
|
(const string& msg) {
|
||||||
if(os.settings().getBool(devSettings ? "dev.extaccess" : "plr.extaccess"))
|
const bool devSettings = os.settings().getBool("dev.settings");
|
||||||
os.frameBuffer().showTextMessage(msg);
|
if(os.settings().getBool(devSettings ? "dev.extaccess" : "plr.extaccess"))
|
||||||
};
|
os.frameBuffer().showTextMessage(msg);
|
||||||
|
};
|
||||||
|
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
case Controller::Type::Paddles:
|
case Controller::Type::Paddles:
|
||||||
{
|
{
|
||||||
// Check if we should swap the paddles plugged into a jack
|
// Check if we should swap the paddles plugged into a jack
|
||||||
bool swapPaddles = myProperties.get(PropType::Controller_SwapPaddles) == "YES";
|
const bool swapPaddles = myProperties.get(PropType::Controller_SwapPaddles) == "YES";
|
||||||
|
|
||||||
return make_unique<Paddles>(myJack, myEvent, mySystem, swapPaddles,
|
return make_unique<Paddles>(myJack, myEvent, mySystem, swapPaddles,
|
||||||
false, false, second);
|
false, false, second);
|
||||||
|
|
|
@ -26,7 +26,7 @@ Serializer::Serializer(const string& filename, Mode m)
|
||||||
{
|
{
|
||||||
if(m == Mode::ReadOnly)
|
if(m == Mode::ReadOnly)
|
||||||
{
|
{
|
||||||
FSNode node(filename);
|
const FSNode node(filename);
|
||||||
if(node.isFile() && node.isReadable())
|
if(node.isFile() && node.isReadable())
|
||||||
{
|
{
|
||||||
unique_ptr<fstream> str = make_unique<fstream>(filename, ios::in | ios::binary);
|
unique_ptr<fstream> str = make_unique<fstream>(filename, ios::in | ios::binary);
|
||||||
|
|
|
@ -306,7 +306,7 @@ void Settings::setRepository(shared_ptr<KeyValueRepository> repository)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void Settings::load(const Options& options)
|
void Settings::load(const Options& options)
|
||||||
{
|
{
|
||||||
Options fromFile = myRespository->load();
|
const 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);
|
||||||
|
|
||||||
|
@ -330,7 +330,7 @@ void Settings::save()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void Settings::validate()
|
void Settings::validate()
|
||||||
{
|
{
|
||||||
float f = getFloat("speed");
|
const float f = getFloat("speed");
|
||||||
if (f <= 0) setValue("speed", "1.0");
|
if (f <= 0) setValue("speed", "1.0");
|
||||||
|
|
||||||
int i = getInt("tia.vsizeadjust");
|
int i = getInt("tia.vsizeadjust");
|
||||||
|
|
|
@ -114,8 +114,8 @@ class Sound
|
||||||
|
|
||||||
@return True, if the WAV file can be played
|
@return True, if the WAV file can be played
|
||||||
*/
|
*/
|
||||||
virtual bool playWav(const string& fileName, uInt32 position = 0,
|
virtual bool playWav(const string& fileName, const uInt32 position = 0,
|
||||||
uInt32 length = 0) { return false; }
|
const uInt32 length = 0) { return false; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Stop any currently playing WAV file.
|
Stop any currently playing WAV file.
|
||||||
|
|
|
@ -188,7 +188,7 @@ bool Switches::load(Serializer& in)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
bool Switches::check7800Mode(const Settings& settings)
|
bool Switches::check7800Mode(const Settings& settings)
|
||||||
{
|
{
|
||||||
bool devSettings = settings.getBool("dev.settings");
|
const bool devSettings = settings.getBool("dev.settings");
|
||||||
myIs7800 = (settings.getString(devSettings ? "dev.console" : "plr.console") == "7800");
|
myIs7800 = (settings.getString(devSettings ? "dev.console" : "plr.console") == "7800");
|
||||||
|
|
||||||
return myIs7800;
|
return myIs7800;
|
||||||
|
|
|
@ -3088,7 +3088,7 @@ bool Thumbulator::isMamBuffered(uInt32 addr, AccessType accessType)
|
||||||
else // e.g. LPC2104_05_06
|
else // e.g. LPC2104_05_06
|
||||||
{
|
{
|
||||||
// dual Flash bank
|
// dual Flash bank
|
||||||
uInt32 bank = (addr & 0x80) ? 1 : 0;
|
const uInt32 bank = (addr & 0x80) ? 1 : 0;
|
||||||
|
|
||||||
addr &= ~0x7F; // 128-bit address line
|
addr &= ~0x7F; // 128-bit address line
|
||||||
|
|
||||||
|
|
|
@ -191,9 +191,10 @@ void TIA::initialize()
|
||||||
applyDeveloperSettings();
|
applyDeveloperSettings();
|
||||||
|
|
||||||
// Must be done last, after all other items have reset
|
// Must be done last, after all other items have reset
|
||||||
bool devSettings = mySettings.getBool("dev.settings");
|
const bool devSettings = mySettings.getBool("dev.settings");
|
||||||
setFixedColorPalette(mySettings.getString("tia.dbgcolors"));
|
setFixedColorPalette(mySettings.getString("tia.dbgcolors"));
|
||||||
enableFixedColors(mySettings.getBool(devSettings ? "dev.debugcolors" : "plr.debugcolors"));
|
enableFixedColors(
|
||||||
|
mySettings.getBool(devSettings ? "dev.debugcolors" : "plr.debugcolors"));
|
||||||
|
|
||||||
#ifdef DEBUGGER_SUPPORT
|
#ifdef DEBUGGER_SUPPORT
|
||||||
createAccessArrays();
|
createAccessArrays();
|
||||||
|
@ -941,10 +942,11 @@ bool TIA::loadDisplay(const Serializer& in)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void TIA::applyDeveloperSettings()
|
void TIA::applyDeveloperSettings()
|
||||||
{
|
{
|
||||||
bool devSettings = mySettings.getBool("dev.settings");
|
const bool devSettings = mySettings.getBool("dev.settings");
|
||||||
if(devSettings)
|
if(devSettings)
|
||||||
{
|
{
|
||||||
bool custom = BSPF::equalsIgnoreCase("custom", mySettings.getString("dev.tia.type"));
|
const bool custom =
|
||||||
|
BSPF::equalsIgnoreCase("custom", mySettings.getString("dev.tia.type"));
|
||||||
|
|
||||||
setPlInvertedPhaseClock(custom
|
setPlInvertedPhaseClock(custom
|
||||||
? mySettings.getBool("dev.tia.plinvphase")
|
? mySettings.getBool("dev.tia.plinvphase")
|
||||||
|
|
|
@ -65,14 +65,16 @@ AboutDialog::AboutDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
addCancelWidget(b);
|
addCancelWidget(b);
|
||||||
|
|
||||||
xpos = HBORDER; ypos = _th + VBORDER + (buttonHeight - fontHeight) / 2;
|
xpos = HBORDER; ypos = _th + VBORDER + (buttonHeight - fontHeight) / 2;
|
||||||
int bwidth = font.getStringWidth("What's New" + ELLIPSIS) + fontWidth * 2.5;
|
const int bwidth = font.getStringWidth("What's New" + ELLIPSIS) + fontWidth * 2.5;
|
||||||
|
|
||||||
myTitle = new StaticTextWidget(this, font, xpos + bwidth, ypos, _w - (xpos + bwidth) * 2,
|
myTitle = new StaticTextWidget(this, font, xpos + bwidth, ypos,
|
||||||
|
_w - (xpos + bwidth) * 2,
|
||||||
fontHeight, "", TextAlign::Center);
|
fontHeight, "", TextAlign::Center);
|
||||||
myTitle->setTextColor(kTextColorEm);
|
myTitle->setTextColor(kTextColorEm);
|
||||||
|
|
||||||
myWhatsNewButton =
|
myWhatsNewButton =
|
||||||
new ButtonWidget(this, font, _w - HBORDER - bwidth, ypos - (buttonHeight - fontHeight) / 2,
|
new ButtonWidget(this, font, _w - HBORDER - bwidth,
|
||||||
|
ypos - (buttonHeight - fontHeight) / 2,
|
||||||
bwidth, buttonHeight, "What's New" + ELLIPSIS, kWhatsNew);
|
bwidth, buttonHeight, "What's New" + ELLIPSIS, kWhatsNew);
|
||||||
wid.push_back(myWhatsNewButton);
|
wid.push_back(myWhatsNewButton);
|
||||||
|
|
||||||
|
@ -320,7 +322,7 @@ string AboutDialog::getUrl(const string& text)
|
||||||
|
|
||||||
for(size_t i = 0; i < text.size(); ++i)
|
for(size_t i = 0; i < text.size(); ++i)
|
||||||
{
|
{
|
||||||
string remainder = text.substr(i);
|
const string remainder = text.substr(i);
|
||||||
const char ch = text[i];
|
const char ch = text[i];
|
||||||
|
|
||||||
if(!isUrl
|
if(!isUrl
|
||||||
|
|
|
@ -167,7 +167,7 @@ void BrowserDialog::show(const string& startpath,
|
||||||
if(_mode != Mode::Directories)
|
if(_mode != Mode::Directories)
|
||||||
{
|
{
|
||||||
// split startpath into path and filename
|
// split startpath into path and filename
|
||||||
FSNode fs = FSNode(startpath);
|
const FSNode fs = FSNode(startpath);
|
||||||
fileName = fs.getName();
|
fileName = fs.getName();
|
||||||
directory = fs.isDirectory() ? "" : fs.getParent().getPath();
|
directory = fs.isDirectory() ? "" : fs.getParent().getPath();
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,7 +137,7 @@ void ContextMenu::setSelected(const Variant& tag, const Variant& defaultTag)
|
||||||
};
|
};
|
||||||
|
|
||||||
// First try searching for a valid tag
|
// First try searching for a valid tag
|
||||||
bool tagSelected = tag != "" && SEARCH_AND_SELECT(tag);
|
const bool tagSelected = tag != "" && SEARCH_AND_SELECT(tag);
|
||||||
|
|
||||||
// Otherwise use the default tag
|
// Otherwise use the default tag
|
||||||
if(!tagSelected)
|
if(!tagSelected)
|
||||||
|
|
|
@ -98,7 +98,7 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font)
|
||||||
int ypos = VBORDER;
|
int ypos = VBORDER;
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
VariantList items;
|
VariantList items;
|
||||||
int tabID = myTab->addTab(" Emulation ", TabWidget::AUTO_WIDTH);
|
const int tabID = myTab->addTab(" Emulation ", TabWidget::AUTO_WIDTH);
|
||||||
|
|
||||||
// settings set
|
// settings set
|
||||||
mySettingsGroupEmulation = new RadioButtonGroup();
|
mySettingsGroupEmulation = new RadioButtonGroup();
|
||||||
|
@ -139,8 +139,8 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font)
|
||||||
items.clear();
|
items.clear();
|
||||||
VarList::push_back(items, "Atari 2600", "2600");
|
VarList::push_back(items, "Atari 2600", "2600");
|
||||||
VarList::push_back(items, "Atari 7800", "7800");
|
VarList::push_back(items, "Atari 7800", "7800");
|
||||||
int lwidth = font.getStringWidth("Console ");
|
const int lwidth = font.getStringWidth("Console ");
|
||||||
int pwidth = font.getStringWidth("Atari 2600");
|
const int pwidth = font.getStringWidth("Atari 2600");
|
||||||
|
|
||||||
myConsoleWidget = new PopUpWidget(myTab, font, HBORDER + INDENT * 1, ypos, pwidth, lineHeight, items,
|
myConsoleWidget = new PopUpWidget(myTab, font, HBORDER + INDENT * 1, ypos, pwidth, lineHeight, items,
|
||||||
"Console ", lwidth, kConsole);
|
"Console ", lwidth, kConsole);
|
||||||
|
@ -232,10 +232,10 @@ void DeveloperDialog::addTiaTab(const GUI::Font& font)
|
||||||
VGAP = Dialog::vGap(),
|
VGAP = Dialog::vGap(),
|
||||||
INDENT = Dialog::indent();
|
INDENT = Dialog::indent();
|
||||||
int ypos = VBORDER;
|
int ypos = VBORDER;
|
||||||
int pwidth = font.getStringWidth("Faulty Cosmic Ark stars");
|
const int pwidth = font.getStringWidth("Faulty Cosmic Ark stars");
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
VariantList items;
|
VariantList items;
|
||||||
int tabID = myTab->addTab(" TIA ", TabWidget::AUTO_WIDTH);
|
const int tabID = myTab->addTab(" TIA ", TabWidget::AUTO_WIDTH);
|
||||||
|
|
||||||
wid.clear();
|
wid.clear();
|
||||||
|
|
||||||
|
@ -354,7 +354,7 @@ void DeveloperDialog::addVideoTab(const GUI::Font& font)
|
||||||
int pwidth = fontWidth * 6;
|
int pwidth = fontWidth * 6;
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
VariantList items;
|
VariantList items;
|
||||||
int tabID = myTab->addTab(" Video ", TabWidget::AUTO_WIDTH);
|
const int tabID = myTab->addTab(" Video ", TabWidget::AUTO_WIDTH);
|
||||||
|
|
||||||
wid.clear();
|
wid.clear();
|
||||||
|
|
||||||
|
@ -516,7 +516,7 @@ void DeveloperDialog::addTimeMachineTab(const GUI::Font& font)
|
||||||
lwidth = fontWidth * 11;
|
lwidth = fontWidth * 11;
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
VariantList items;
|
VariantList items;
|
||||||
int tabID = myTab->addTab(" Time Machine ", TabWidget::AUTO_WIDTH);
|
const int tabID = myTab->addTab(" Time Machine ", TabWidget::AUTO_WIDTH);
|
||||||
|
|
||||||
// settings set
|
// settings set
|
||||||
mySettingsGroupTM = new RadioButtonGroup();
|
mySettingsGroupTM = new RadioButtonGroup();
|
||||||
|
@ -574,7 +574,7 @@ void DeveloperDialog::addTimeMachineTab(const GUI::Font& font)
|
||||||
items.clear();
|
items.clear();
|
||||||
for(int i = 0; i < NUM_INTERVALS; ++i)
|
for(int i = 0; i < NUM_INTERVALS; ++i)
|
||||||
VarList::push_back(items, INTERVALS[i], INT_SETTINGS[i]);
|
VarList::push_back(items, INTERVALS[i], INT_SETTINGS[i]);
|
||||||
int pwidth = font.getStringWidth("10 seconds");
|
const int pwidth = font.getStringWidth("10 seconds");
|
||||||
myStateIntervalWidget = new PopUpWidget(myTab, font, xpos, ypos, pwidth,
|
myStateIntervalWidget = new PopUpWidget(myTab, font, xpos, ypos, pwidth,
|
||||||
lineHeight, items, "Interval ", 0, kIntervalChanged);
|
lineHeight, items, "Interval ", 0, kIntervalChanged);
|
||||||
myStateIntervalWidget->setToolTip("Define the interval between each saved state.");
|
myStateIntervalWidget->setToolTip("Define the interval between each saved state.");
|
||||||
|
@ -606,7 +606,7 @@ void DeveloperDialog::addTimeMachineTab(const GUI::Font& font)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
|
void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
|
||||||
{
|
{
|
||||||
int tabID = myTab->addTab(" Debugger ", TabWidget::AUTO_WIDTH);
|
const int tabID = myTab->addTab(" Debugger ", TabWidget::AUTO_WIDTH);
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
|
|
||||||
#ifdef DEBUGGER_SUPPORT
|
#ifdef DEBUGGER_SUPPORT
|
||||||
|
@ -816,7 +816,7 @@ void DeveloperDialog::setWidgetStates(SettingsSet set)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void DeveloperDialog::loadConfig()
|
void DeveloperDialog::loadConfig()
|
||||||
{
|
{
|
||||||
bool devSettings = instance().settings().getBool("dev.settings");
|
const bool devSettings = instance().settings().getBool("dev.settings");
|
||||||
handleSettings(devSettings);
|
handleSettings(devSettings);
|
||||||
mySettings = devSettings;
|
mySettings = devSettings;
|
||||||
mySettingsGroupEmulation->setSelected(devSettings ? 1 : 0);
|
mySettingsGroupEmulation->setSelected(devSettings ? 1 : 0);
|
||||||
|
@ -842,11 +842,11 @@ void DeveloperDialog::loadConfig()
|
||||||
myDebuggerHeightSlider->setValue(h);
|
myDebuggerHeightSlider->setValue(h);
|
||||||
|
|
||||||
// Debugger font size
|
// Debugger font size
|
||||||
string size = instance().settings().getString("dbg.fontsize");
|
const string size = instance().settings().getString("dbg.fontsize");
|
||||||
myDebuggerFontSize->setSelected(size, "medium");
|
myDebuggerFontSize->setSelected(size, "medium");
|
||||||
|
|
||||||
// Debugger font style
|
// Debugger font style
|
||||||
int style = instance().settings().getInt("dbg.fontstyle");
|
const int style = instance().settings().getInt("dbg.fontstyle");
|
||||||
myDebuggerFontStyle->setSelected(style, "0");
|
myDebuggerFontStyle->setSelected(style, "0");
|
||||||
|
|
||||||
// Ghost reads trap
|
// Ghost reads trap
|
||||||
|
@ -1121,7 +1121,7 @@ void DeveloperDialog::handleSettings(bool devSettings)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void DeveloperDialog::handleTVJitterChange()
|
void DeveloperDialog::handleTVJitterChange()
|
||||||
{
|
{
|
||||||
bool enable = myTVJitterWidget->getState();
|
const bool enable = myTVJitterWidget->getState();
|
||||||
|
|
||||||
myTVJitterSenseWidget->setEnabled(enable);
|
myTVJitterSenseWidget->setEnabled(enable);
|
||||||
myTVJitterRecWidget->setEnabled(enable);
|
myTVJitterRecWidget->setEnabled(enable);
|
||||||
|
|
|
@ -167,7 +167,8 @@ void Dialog::initHelp()
|
||||||
{
|
{
|
||||||
if(_helpWidget == nullptr)
|
if(_helpWidget == nullptr)
|
||||||
{
|
{
|
||||||
string key = instance().eventHandler().getMappingDesc(Event::UIHelp, EventMode::kMenuMode);
|
const string key = instance().eventHandler().getMappingDesc(
|
||||||
|
Event::UIHelp, EventMode::kMenuMode);
|
||||||
|
|
||||||
_helpWidget = new ButtonWidget(this, _font,
|
_helpWidget = new ButtonWidget(this, _font,
|
||||||
_w - _font.getMaxCharWidth() * 3.5, 0,
|
_w - _font.getMaxCharWidth() * 3.5, 0,
|
||||||
|
|
|
@ -412,7 +412,7 @@ bool EditableWidget::handleKeyDown(StellaKey key, StellaMod mod)
|
||||||
case Event::Undo:
|
case Event::Undo:
|
||||||
case Event::Redo:
|
case Event::Redo:
|
||||||
{
|
{
|
||||||
string oldString = _editString;
|
const string oldString = _editString;
|
||||||
|
|
||||||
myUndoHandler->endChars(_editString);
|
myUndoHandler->endChars(_editString);
|
||||||
// Reverse Y and Z for QWERTZ keyboards
|
// Reverse Y and Z for QWERTZ keyboards
|
||||||
|
@ -846,7 +846,7 @@ bool EditableWidget::cutSelectedText()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
bool EditableWidget::copySelectedText()
|
bool EditableWidget::copySelectedText()
|
||||||
{
|
{
|
||||||
string selected = selectString();
|
const string selected = selectString();
|
||||||
|
|
||||||
// only copy if anything is selected, else keep old copied text
|
// only copy if anything is selected, else keep old copied text
|
||||||
if(!selected.empty())
|
if(!selected.empty())
|
||||||
|
@ -860,7 +860,7 @@ bool EditableWidget::copySelectedText()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
bool EditableWidget::pasteSelectedText()
|
bool EditableWidget::pasteSelectedText()
|
||||||
{
|
{
|
||||||
bool selected = !selectString().empty();
|
const bool selected = !selectString().empty();
|
||||||
string pasted;
|
string pasted;
|
||||||
|
|
||||||
myUndoHandler->endChars(_editString);
|
myUndoHandler->endChars(_editString);
|
||||||
|
|
|
@ -74,9 +74,8 @@ EmulationDialog::EmulationDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
HBORDER = Dialog::hBorder(),
|
HBORDER = Dialog::hBorder(),
|
||||||
VGAP = Dialog::vGap(),
|
VGAP = Dialog::vGap(),
|
||||||
INDENT = Dialog::indent();
|
INDENT = Dialog::indent();
|
||||||
int lwidth = font.getStringWidth("Emulation speed ");
|
const int lwidth = font.getStringWidth("Emulation speed ");
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
VariantList items;
|
|
||||||
const int swidth = fontWidth * 10;
|
const int swidth = fontWidth * 10;
|
||||||
|
|
||||||
// Set real dimensions
|
// Set real dimensions
|
||||||
|
@ -174,7 +173,7 @@ void EmulationDialog::loadConfig()
|
||||||
const Settings& settings = instance().settings();
|
const Settings& settings = instance().settings();
|
||||||
|
|
||||||
// Emulation speed
|
// Emulation speed
|
||||||
int speed = mapSpeed(settings.getFloat("speed"));
|
const int speed = mapSpeed(settings.getFloat("speed"));
|
||||||
mySpeed->setValue(speed);
|
mySpeed->setValue(speed);
|
||||||
mySpeed->setValueLabel(formatSpeed(speed));
|
mySpeed->setValueLabel(formatSpeed(speed));
|
||||||
|
|
||||||
|
@ -200,7 +199,7 @@ void EmulationDialog::loadConfig()
|
||||||
myConfirmExitWidget->setState(settings.getBool("confirmexit"));
|
myConfirmExitWidget->setState(settings.getBool("confirmexit"));
|
||||||
|
|
||||||
// Save on exit
|
// Save on exit
|
||||||
string saveOnExit = settings.getString("saveonexit");
|
const string saveOnExit = settings.getString("saveonexit");
|
||||||
mySaveOnExitGroup->setSelected(saveOnExit == "all" ? 2 : saveOnExit == "current" ? 1 : 0);
|
mySaveOnExitGroup->setSelected(saveOnExit == "all" ? 2 : saveOnExit == "current" ? 1 : 0);
|
||||||
// Automatically change save state slots
|
// Automatically change save state slots
|
||||||
myAutoSlotWidget->setState(settings.getBool("autoslot"));
|
myAutoSlotWidget->setState(settings.getBool("autoslot"));
|
||||||
|
|
|
@ -121,8 +121,7 @@ EventMappingWidget::EventMappingWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
myComboButton->setTarget(this);
|
myComboButton->setTarget(this);
|
||||||
addFocusWidget(myComboButton);
|
addFocusWidget(myComboButton);
|
||||||
|
|
||||||
VariantList combolist = EventHandler::getComboList();
|
myComboDialog = make_unique<ComboDialog>(boss, font, EventHandler::getComboList());
|
||||||
myComboDialog = make_unique<ComboDialog>(boss, font, combolist);
|
|
||||||
|
|
||||||
// Show message for currently selected event
|
// Show message for currently selected event
|
||||||
xpos = HBORDER;
|
xpos = HBORDER;
|
||||||
|
@ -166,9 +165,7 @@ void EventMappingWidget::updateActions()
|
||||||
? EventMode::kMenuMode
|
? EventMode::kMenuMode
|
||||||
: EventMode::kEmulationMode;
|
: EventMode::kEmulationMode;
|
||||||
|
|
||||||
StringList actions = EventHandler::getActionList(myEventGroup);
|
myActionsList->setList(EventHandler::getActionList(myEventGroup));
|
||||||
|
|
||||||
myActionsList->setList(actions);
|
|
||||||
myActionSelected = myActionsList->getSelected();
|
myActionSelected = myActionsList->getSelected();
|
||||||
drawKeyMapping();
|
drawKeyMapping();
|
||||||
enableButtons(true);
|
enableButtons(true);
|
||||||
|
|
|
@ -42,10 +42,10 @@ void FavoritesManager::load()
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
const json& jUser = json::parse(serializedUser);
|
const json& jUser = json::parse(serializedUser);
|
||||||
for (const auto& u : jUser)
|
for (const auto& u: jUser)
|
||||||
{
|
{
|
||||||
const string& path = u.get<string>();
|
const string& path = u.get<string>();
|
||||||
FSNode node(path);
|
const FSNode node(path);
|
||||||
if (node.exists())
|
if (node.exists())
|
||||||
addUser(path);
|
addUser(path);
|
||||||
}
|
}
|
||||||
|
@ -66,10 +66,10 @@ void FavoritesManager::load()
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
const json& jRecent = json::parse(serializedRecent);
|
const json& jRecent = json::parse(serializedRecent);
|
||||||
for (const auto& r : jRecent)
|
for (const auto& r: jRecent)
|
||||||
{
|
{
|
||||||
const string& path = r.get<string>();
|
const string& path = r.get<string>();
|
||||||
FSNode node(path);
|
const FSNode node(path);
|
||||||
if (node.exists())
|
if (node.exists())
|
||||||
addRecent(path);
|
addRecent(path);
|
||||||
}
|
}
|
||||||
|
@ -89,11 +89,11 @@ void FavoritesManager::load()
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
const json& jPopular = json::parse(serializedPopular);
|
const json& jPopular = json::parse(serializedPopular);
|
||||||
for (const auto& p : jPopular)
|
for (const auto& p: jPopular)
|
||||||
{
|
{
|
||||||
const string& path = p[0].get<string>();
|
const string& path = p[0].get<string>();
|
||||||
const uInt32 count = p[1].get<uInt32>();
|
const uInt32 count = p[1].get<uInt32>();
|
||||||
FSNode node(path);
|
const FSNode node(path);
|
||||||
if (node.exists())
|
if (node.exists())
|
||||||
myPopularMap.emplace(path, count);
|
myPopularMap.emplace(path, count);
|
||||||
}
|
}
|
||||||
|
@ -186,9 +186,10 @@ const FavoritesManager::UserList& FavoritesManager::userList() const
|
||||||
[](const string& a, const string& b)
|
[](const string& a, const string& b)
|
||||||
{
|
{
|
||||||
// Sort without path
|
// Sort without path
|
||||||
FSNode aNode(a);
|
const FSNode aNode(a);
|
||||||
FSNode bNode(b);
|
const FSNode bNode(b);
|
||||||
const bool realDir = aNode.isDirectory() && !BSPF::endsWithIgnoreCase(aNode.getPath(), ".zip");
|
const bool realDir = aNode.isDirectory() &&
|
||||||
|
!BSPF::endsWithIgnoreCase(aNode.getPath(), ".zip");
|
||||||
|
|
||||||
if(realDir != (bNode.isDirectory() && !BSPF::endsWithIgnoreCase(bNode.getPath(), ".zip")))
|
if(realDir != (bNode.isDirectory() && !BSPF::endsWithIgnoreCase(bNode.getPath(), ".zip")))
|
||||||
return realDir;
|
return realDir;
|
||||||
|
@ -237,7 +238,7 @@ void FavoritesManager::removeAllRecent()
|
||||||
const FavoritesManager::RecentList& FavoritesManager::recentList() const
|
const FavoritesManager::RecentList& FavoritesManager::recentList() const
|
||||||
{
|
{
|
||||||
static RecentList sortedList;
|
static RecentList sortedList;
|
||||||
bool sortByName = mySettings.getBool("altsorting");
|
const bool sortByName = mySettings.getBool("altsorting");
|
||||||
|
|
||||||
sortedList.clear();
|
sortedList.clear();
|
||||||
if(sortByName)
|
if(sortByName)
|
||||||
|
@ -248,8 +249,8 @@ const FavoritesManager::RecentList& FavoritesManager::recentList() const
|
||||||
[](const string& a, const string& b)
|
[](const string& a, const string& b)
|
||||||
{
|
{
|
||||||
// Sort alphabetical, without path
|
// Sort alphabetical, without path
|
||||||
FSNode aNode(a);
|
const FSNode aNode(a);
|
||||||
FSNode bNode(b);
|
const FSNode bNode(b);
|
||||||
return BSPF::compareIgnoreCase(aNode.getName(), bNode.getName()) < 0;
|
return BSPF::compareIgnoreCase(aNode.getName(), bNode.getName()) < 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -288,7 +289,7 @@ void FavoritesManager::incPopular(const string& path)
|
||||||
// Limit number of entries and age data
|
// Limit number of entries and age data
|
||||||
if(myPopularMap.size() >= max_popular)
|
if(myPopularMap.size() >= max_popular)
|
||||||
{
|
{
|
||||||
PopularList sortedList = sortedPopularList(); // sorted by frequency!
|
const PopularList& sortedList = sortedPopularList(); // sorted by frequency!
|
||||||
for(const auto& item: sortedList)
|
for(const auto& item: sortedList)
|
||||||
{
|
{
|
||||||
const auto entry = myPopularMap.find(item.first);
|
const auto entry = myPopularMap.find(item.first);
|
||||||
|
@ -313,7 +314,8 @@ const FavoritesManager::PopularList& FavoritesManager::popularList() const
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
const FavoritesManager::PopularList& FavoritesManager::sortedPopularList(bool sortByName) const
|
const FavoritesManager::PopularList&
|
||||||
|
FavoritesManager::sortedPopularList(bool sortByName) const
|
||||||
{
|
{
|
||||||
// Return most to least popular or sorted by name
|
// Return most to least popular or sorted by name
|
||||||
static PopularList sortedList;
|
static PopularList sortedList;
|
||||||
|
@ -329,8 +331,8 @@ const FavoritesManager::PopularList& FavoritesManager::sortedPopularList(bool so
|
||||||
return a.second > b.second;
|
return a.second > b.second;
|
||||||
|
|
||||||
// 2. Sort alphabetical, without path
|
// 2. Sort alphabetical, without path
|
||||||
FSNode aNode(a.first);
|
const FSNode aNode(a.first);
|
||||||
FSNode bNode(b.first);
|
const FSNode bNode(b.first);
|
||||||
return BSPF::compareIgnoreCase(aNode.getName(), bNode.getName()) < 0;
|
return BSPF::compareIgnoreCase(aNode.getName(), bNode.getName()) < 0;
|
||||||
});
|
});
|
||||||
return sortedList;
|
return sortedList;
|
||||||
|
|
|
@ -94,7 +94,7 @@ void FileListWidget::setLocation(const FSNode& node, const string& select)
|
||||||
// Now fill the list widget with the names from the file list,
|
// Now fill the list widget with the names from the file list,
|
||||||
// even if cancelled
|
// even if cancelled
|
||||||
StringList list;
|
StringList list;
|
||||||
size_t orgLen = _node.getShortPath().length();
|
const size_t orgLen = _node.getShortPath().length();
|
||||||
|
|
||||||
_dirList.clear();
|
_dirList.clear();
|
||||||
_iconTypeList.clear();
|
_iconTypeList.clear();
|
||||||
|
@ -193,7 +193,7 @@ void FileListWidget::selectParent()
|
||||||
if(_node.hasParent())
|
if(_node.hasParent())
|
||||||
{
|
{
|
||||||
string name = _node.getName();
|
string name = _node.getName();
|
||||||
FSNode parent(_node.getParent());
|
const FSNode parent(_node.getParent());
|
||||||
|
|
||||||
_currentHistory->selected = selected().getName();
|
_currentHistory->selected = selected().getName();
|
||||||
addHistory(parent);
|
addHistory(parent);
|
||||||
|
@ -672,10 +672,10 @@ const FileListWidget::Icon* FileListWidget::getIcon(int i) const
|
||||||
0b11111111111'11111111110
|
0b11111111111'11111111110
|
||||||
};
|
};
|
||||||
const int idx = static_cast<int>(IconType::numTypes);
|
const int idx = static_cast<int>(IconType::numTypes);
|
||||||
static const Icon* small_icons[idx] = {
|
static const Icon* const small_icons[idx] = {
|
||||||
&unknown_small, &rom_small, &directory_small, &zip_small, &up_small
|
&unknown_small, &rom_small, &directory_small, &zip_small, &up_small
|
||||||
};
|
};
|
||||||
static const Icon* large_icons[idx] = {
|
static const Icon* const large_icons[idx] = {
|
||||||
&unknown_large, &rom_large, &directory_large, &zip_large, &up_large,
|
&unknown_large, &rom_large, &directory_large, &zip_large, &up_large,
|
||||||
};
|
};
|
||||||
const bool smallIcon = iconWidth() < 24;
|
const bool smallIcon = iconWidth() < 24;
|
||||||
|
|
|
@ -114,7 +114,7 @@ void GameInfoDialog::addEmulationTab()
|
||||||
VariantList items;
|
VariantList items;
|
||||||
|
|
||||||
// 1) Emulation properties
|
// 1) Emulation properties
|
||||||
int tabID = myTab->addTab("Emulation", TabWidget::AUTO_WIDTH);
|
const int tabID = myTab->addTab("Emulation", TabWidget::AUTO_WIDTH);
|
||||||
|
|
||||||
int ypos = VBORDER;
|
int ypos = VBORDER;
|
||||||
|
|
||||||
|
@ -209,11 +209,11 @@ void GameInfoDialog::addConsoleTab()
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
|
|
||||||
// 2) Console properties
|
// 2) Console properties
|
||||||
int tabID = myTab->addTab(" Console ", TabWidget::AUTO_WIDTH);
|
const int tabID = myTab->addTab(" Console ", TabWidget::AUTO_WIDTH);
|
||||||
|
|
||||||
const int xpos = HBORDER;
|
const int xpos = HBORDER;
|
||||||
int ypos = VBORDER;
|
int ypos = VBORDER;
|
||||||
int lwidth = _font.getStringWidth(GUI::RIGHT_DIFFICULTY + " ");
|
const int lwidth = _font.getStringWidth(GUI::RIGHT_DIFFICULTY + " ");
|
||||||
|
|
||||||
new StaticTextWidget(myTab, _font, xpos, ypos + 1, "TV type");
|
new StaticTextWidget(myTab, _font, xpos, ypos + 1, "TV type");
|
||||||
myTVTypeGroup = new RadioButtonGroup();
|
myTVTypeGroup = new RadioButtonGroup();
|
||||||
|
@ -275,7 +275,7 @@ void GameInfoDialog::addControllersTab()
|
||||||
|
|
||||||
// 3) Controller properties
|
// 3) Controller properties
|
||||||
wid.clear();
|
wid.clear();
|
||||||
int tabID = myTab->addTab("Controllers", TabWidget::AUTO_WIDTH);
|
const int tabID = myTab->addTab("Controllers", TabWidget::AUTO_WIDTH);
|
||||||
|
|
||||||
items.clear();
|
items.clear();
|
||||||
VarList::push_back(items, "Auto-detect", "AUTO");
|
VarList::push_back(items, "Auto-detect", "AUTO");
|
||||||
|
@ -429,15 +429,14 @@ void GameInfoDialog::addCartridgeTab()
|
||||||
VGAP = Dialog::vGap(),
|
VGAP = Dialog::vGap(),
|
||||||
HGAP = Dialog::fontWidth() / 4;
|
HGAP = Dialog::fontWidth() / 4;
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
VariantList items;
|
|
||||||
|
|
||||||
wid.clear();
|
wid.clear();
|
||||||
int tabID = myTab->addTab("Cartridge", TabWidget::AUTO_WIDTH);
|
const int tabID = myTab->addTab("Cartridge", TabWidget::AUTO_WIDTH);
|
||||||
|
|
||||||
const int xpos = HBORDER;
|
const int xpos = HBORDER;
|
||||||
int ypos = VBORDER;
|
int ypos = VBORDER;
|
||||||
int lwidth = _font.getStringWidth("Manufacturer ");
|
const int lwidth = _font.getStringWidth("Manufacturer "),
|
||||||
const int fwidth = _w - lwidth - HBORDER * 2 - 2;
|
fwidth = _w - lwidth - HBORDER * 2 - 2;
|
||||||
new StaticTextWidget(myTab, _font, xpos, ypos + 1, lwidth, fontHeight, "Name");
|
new StaticTextWidget(myTab, _font, xpos, ypos + 1, lwidth, fontHeight, "Name");
|
||||||
myName = new EditTextWidget(myTab, _font, xpos + lwidth, ypos - 1,
|
myName = new EditTextWidget(myTab, _font, xpos + lwidth, ypos - 1,
|
||||||
fwidth, lineHeight, "");
|
fwidth, lineHeight, "");
|
||||||
|
@ -503,21 +502,20 @@ void GameInfoDialog::addHighScoresTab()
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
VariantList items;
|
VariantList items;
|
||||||
|
|
||||||
int tabID = myTab->addTab("High Scores", TabWidget::AUTO_WIDTH);
|
const int tabID = myTab->addTab("High Scores", TabWidget::AUTO_WIDTH);
|
||||||
|
|
||||||
EditableWidget::TextFilter fAddr = [](char c) {
|
const EditableWidget::TextFilter fAddr = [](char c) {
|
||||||
return (c >= 'a' && c <= 'f') || (c >= '0' && c <= '9');
|
return (c >= 'a' && c <= 'f') || (c >= '0' && c <= '9');
|
||||||
};
|
};
|
||||||
EditableWidget::TextFilter fVars = [](char c) {
|
const EditableWidget::TextFilter fVars = [](char c) {
|
||||||
return (c >= '0' && c <= '9');
|
return (c >= '0' && c <= '9');
|
||||||
};
|
};
|
||||||
|
const EditableWidget::TextFilter fText = [](char c) {
|
||||||
EditableWidget::TextFilter fText = [](char c) {
|
|
||||||
return (c >= 'a' && c <= 'z') || (c >= ' ' && c < ',') || (c > ',' && c < '@');
|
return (c >= 'a' && c <= 'z') || (c >= ' ' && c < ',') || (c > ',' && c < '@');
|
||||||
};
|
};
|
||||||
|
|
||||||
int xpos = HBORDER, ypos = VBORDER;
|
int xpos = HBORDER, ypos = VBORDER;
|
||||||
int lwidth = _font.getStringWidth("Variations ");
|
const int lwidth = _font.getStringWidth("Variations ");
|
||||||
|
|
||||||
myHighScores = new CheckboxWidget(myTab, _font, xpos, ypos + 1, "Enable High Scores",
|
myHighScores = new CheckboxWidget(myTab, _font, xpos, ypos + 1, "Enable High Scores",
|
||||||
kHiScoresChanged);
|
kHiScoresChanged);
|
||||||
|
@ -976,7 +974,7 @@ void GameInfoDialog::saveProperties()
|
||||||
if(myMouseControl->getState())
|
if(myMouseControl->getState())
|
||||||
mcontrol = myMouseX->getSelectedTag().toString() +
|
mcontrol = myMouseX->getSelectedTag().toString() +
|
||||||
myMouseY->getSelectedTag().toString();
|
myMouseY->getSelectedTag().toString();
|
||||||
string range = myMouseRange->getValueLabel();
|
const string range = myMouseRange->getValueLabel();
|
||||||
if(range != "100")
|
if(range != "100")
|
||||||
mcontrol += " " + range;
|
mcontrol += " " + range;
|
||||||
myGameProperties.set(PropType::Controller_MouseAxis, mcontrol);
|
myGameProperties.set(PropType::Controller_MouseAxis, mcontrol);
|
||||||
|
@ -1073,7 +1071,7 @@ void GameInfoDialog::saveHighScoresProperties()
|
||||||
info.scoreAddr[a] = stringToIntBase16(strAddr, HSM::DEFAULT_ADDRESS);
|
info.scoreAddr[a] = stringToIntBase16(strAddr, HSM::DEFAULT_ADDRESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
string strVars = myVariations->getText();
|
const string strVars = myVariations->getText();
|
||||||
|
|
||||||
HighScoresManager::set(myGameProperties, stringToInt(strVars,
|
HighScoresManager::set(myGameProperties, stringToInt(strVars,
|
||||||
HSM::DEFAULT_VARIATION), info);
|
HSM::DEFAULT_VARIATION), info);
|
||||||
|
@ -1322,7 +1320,7 @@ void GameInfoDialog::eraseEEPROM()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void GameInfoDialog::updateLink()
|
void GameInfoDialog::updateLink()
|
||||||
{
|
{
|
||||||
string link = myUrl->getText();
|
const string link = myUrl->getText();
|
||||||
const bool enable = startsWithIgnoreCase(link, "http://")
|
const bool enable = startsWithIgnoreCase(link, "http://")
|
||||||
|| startsWithIgnoreCase(link, "https://")
|
|| startsWithIgnoreCase(link, "https://")
|
||||||
|| startsWithIgnoreCase(link, "www.");
|
|| startsWithIgnoreCase(link, "www.");
|
||||||
|
@ -1401,7 +1399,7 @@ void GameInfoDialog::updateHighScoresWidgets()
|
||||||
if(a < numAddr)
|
if(a < numAddr)
|
||||||
{
|
{
|
||||||
setAddressVal(myScoreAddress[a], myScoreAddressVal[a]);
|
setAddressVal(myScoreAddress[a], myScoreAddressVal[a]);
|
||||||
string strAddr = myScoreAddress[a]->getText();
|
const string strAddr = myScoreAddress[a]->getText();
|
||||||
scoreAddr[a] = stringToIntBase16(strAddr, HSM::DEFAULT_ADDRESS);
|
scoreAddr[a] = stringToIntBase16(strAddr, HSM::DEFAULT_ADDRESS);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -39,8 +39,8 @@ GlobalPropsDialog::GlobalPropsDialog(GuiObject* boss, const GUI::Font& font)
|
||||||
VBORDER = Dialog::vBorder(),
|
VBORDER = Dialog::vBorder(),
|
||||||
HBORDER = Dialog::hBorder(),
|
HBORDER = Dialog::hBorder(),
|
||||||
VGAP = Dialog::vGap();
|
VGAP = Dialog::vGap();
|
||||||
int lwidth = font.getStringWidth("Right difficulty "),
|
const int lwidth = font.getStringWidth("Right difficulty ");
|
||||||
pwidth = font.getStringWidth("CM (SpectraVideo CompuMate)");
|
int pwidth = font.getStringWidth("CM (SpectraVideo CompuMate)");
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
VariantList items;
|
VariantList items;
|
||||||
const GUI::Font& infofont = instance().frameBuffer().infoFont();
|
const GUI::Font& infofont = instance().frameBuffer().infoFont();
|
||||||
|
|
|
@ -60,7 +60,7 @@ HelpDialog::HelpDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
|
|
||||||
xpos += buttonWidth + fontWidth;
|
xpos += buttonWidth + fontWidth;
|
||||||
|
|
||||||
int updButtonWidth = Dialog::buttonWidth("Check for Update" + ELLIPSIS);
|
const int updButtonWidth = Dialog::buttonWidth("Check for Update" + ELLIPSIS);
|
||||||
myUpdateButton =
|
myUpdateButton =
|
||||||
new ButtonWidget(this, font, xpos, ypos, updButtonWidth, buttonHeight,
|
new ButtonWidget(this, font, xpos, ypos, updButtonWidth, buttonHeight,
|
||||||
"Check for Update" + ELLIPSIS, kUpdateCmd);
|
"Check for Update" + ELLIPSIS, kUpdateCmd);
|
||||||
|
|
|
@ -117,16 +117,16 @@ HighScoresDialog::HighScoresDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
HBORDER = Dialog::hBorder(),
|
HBORDER = Dialog::hBorder(),
|
||||||
VGAP = Dialog::vGap();
|
VGAP = Dialog::vGap();
|
||||||
const int xposRank = HBORDER;
|
const int xposRank = HBORDER;
|
||||||
int xposScore = xposRank + _font.getStringWidth("Rank");
|
const int xposScore = xposRank + _font.getStringWidth("Rank");
|
||||||
int xposSpecial = xposScore + _font.getStringWidth(" Score ");
|
const int xposSpecial = xposScore + _font.getStringWidth(" Score ");
|
||||||
int xposName = xposSpecial + _font.getStringWidth("Round ");
|
const int xposName = xposSpecial + _font.getStringWidth("Round ");
|
||||||
int xposDate = xposName + _font.getStringWidth("Name ");
|
const int xposDate = xposName + _font.getStringWidth("Name ");
|
||||||
int xposDelete = xposDate + _font.getStringWidth("YY-MM-DD HH:MM ");
|
const int xposDelete = xposDate + _font.getStringWidth("YY-MM-DD HH:MM ");
|
||||||
int nWidth = _font.getStringWidth("ABC") + fontWidth * 0.75;
|
const int nWidth = _font.getStringWidth("ABC") + fontWidth * 0.75;
|
||||||
const bool smallFont = _font.getFontHeight() < 24;
|
const bool smallFont = _font.getFontHeight() < 24;
|
||||||
const int buttonSize = smallFont ? BUTTON_GFX_H : BUTTON_GFX_H_LARGE;
|
const int buttonSize = smallFont ? BUTTON_GFX_H : BUTTON_GFX_H_LARGE;
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
VariantList items;
|
const VariantList items;
|
||||||
|
|
||||||
const int xpos = HBORDER;
|
const int xpos = HBORDER;
|
||||||
int ypos = VBORDER + _th;
|
int ypos = VBORDER + _th;
|
||||||
|
@ -542,7 +542,7 @@ string HighScoresDialog::cartName() const
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
string HighScoresDialog::now()
|
string HighScoresDialog::now()
|
||||||
{
|
{
|
||||||
std::tm now = BSPF::localTime();
|
const std::tm now = BSPF::localTime();
|
||||||
ostringstream ss;
|
ostringstream ss;
|
||||||
|
|
||||||
ss << std::setfill('0') << std::right
|
ss << std::setfill('0') << std::right
|
||||||
|
|
|
@ -66,7 +66,7 @@ InputDialog::InputDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
addTabWidget(myTab);
|
addTabWidget(myTab);
|
||||||
|
|
||||||
// 1) Event mapper
|
// 1) Event mapper
|
||||||
int tabID = myTab->addTab(" Event Mappings ", TabWidget::AUTO_WIDTH);
|
const int tabID = myTab->addTab(" Event Mappings ", TabWidget::AUTO_WIDTH);
|
||||||
myEventMapper = new EventMappingWidget(myTab, _font, 2, 2,
|
myEventMapper = new EventMappingWidget(myTab, _font, 2, 2,
|
||||||
myTab->getWidth(),
|
myTab->getWidth(),
|
||||||
myTab->getHeight() - VGAP);
|
myTab->getHeight() - VGAP);
|
||||||
|
@ -110,7 +110,7 @@ void InputDialog::addDevicePortTab()
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
|
|
||||||
// Devices/ports
|
// Devices/ports
|
||||||
int tabID = myTab->addTab(" Devices & Ports ", TabWidget::AUTO_WIDTH);
|
const int tabID = myTab->addTab(" Devices & Ports ", TabWidget::AUTO_WIDTH);
|
||||||
|
|
||||||
int xpos = HBORDER, ypos = VBORDER;
|
int xpos = HBORDER, ypos = VBORDER;
|
||||||
int lwidth = _font.getStringWidth("Digital paddle sensitivity ");
|
int lwidth = _font.getStringWidth("Digital paddle sensitivity ");
|
||||||
|
@ -282,11 +282,11 @@ void InputDialog::addMouseTab()
|
||||||
VariantList items;
|
VariantList items;
|
||||||
|
|
||||||
// Mouse
|
// Mouse
|
||||||
int tabID = myTab->addTab(" Mouse ", TabWidget::AUTO_WIDTH);
|
const int tabID = myTab->addTab(" Mouse ", TabWidget::AUTO_WIDTH);
|
||||||
|
|
||||||
int xpos = HBORDER, ypos = VBORDER;
|
int xpos = HBORDER, ypos = VBORDER;
|
||||||
int lwidth = _font.getStringWidth("Use mouse as a controller ");
|
int lwidth = _font.getStringWidth("Use mouse as a controller ");
|
||||||
int pwidth = _font.getStringWidth("-UI, -Emulation");
|
const int pwidth = _font.getStringWidth("-UI, -Emulation");
|
||||||
|
|
||||||
// Use mouse as controller
|
// Use mouse as controller
|
||||||
VarList::push_back(items, "Always", "always");
|
VarList::push_back(items, "Always", "always");
|
||||||
|
|
|
@ -31,7 +31,7 @@ Launcher::Launcher(OSystem& osystem)
|
||||||
mySize{myOSystem.settings().getSize("launcherres")}
|
mySize{myOSystem.settings().getSize("launcherres")}
|
||||||
{
|
{
|
||||||
const Common::Size& d = myOSystem.frameBuffer().desktopSize(BufferType::Launcher);
|
const Common::Size& d = myOSystem.frameBuffer().desktopSize(BufferType::Launcher);
|
||||||
double overscan = 1 - myOSystem.settings().getInt("tia.fs_overscan") / 100.0;
|
const double overscan = 1 - myOSystem.settings().getInt("tia.fs_overscan") / 100.0;
|
||||||
|
|
||||||
// The launcher dialog is resizable, within certain bounds
|
// The launcher dialog is resizable, within certain bounds
|
||||||
// We check those bounds now
|
// We check those bounds now
|
||||||
|
@ -54,7 +54,7 @@ Launcher::~Launcher()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
FBInitStatus Launcher::initializeVideo()
|
FBInitStatus Launcher::initializeVideo()
|
||||||
{
|
{
|
||||||
string title = string("Stella ") + STELLA_VERSION;
|
const string title = string("Stella ") + STELLA_VERSION;
|
||||||
return myOSystem.frameBuffer().createDisplay(
|
return myOSystem.frameBuffer().createDisplay(
|
||||||
title, BufferType::Launcher, mySize
|
title, BufferType::Launcher, mySize
|
||||||
);
|
);
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue