[common] log modified settings first (#3132)
basically i want to see the modified options first :) one of the few times i use deque without resorting to boost::container::deque, haha Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3132 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: DraVee <dravee@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
bd7d0e0466
commit
cbb92e75d3
|
|
@ -5,7 +5,6 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include <version>
|
#include <version>
|
||||||
#include "common/settings_enums.h"
|
|
||||||
#if __cpp_lib_chrono >= 201907L
|
#if __cpp_lib_chrono >= 201907L
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
@ -17,8 +16,10 @@
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
#include <deque>
|
||||||
#include <fmt/core.h>
|
#include <fmt/core.h>
|
||||||
|
|
||||||
|
#include "common/settings_enums.h"
|
||||||
#include "common/assert.h"
|
#include "common/assert.h"
|
||||||
#include "common/fs/fs_util.h"
|
#include "common/fs/fs_util.h"
|
||||||
#include "common/fs/path_util.h"
|
#include "common/fs/path_util.h"
|
||||||
|
|
@ -110,36 +111,38 @@ std::string GetTimeZoneString(TimeZone time_zone) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogSettings() {
|
void LogSettings() {
|
||||||
const auto log_setting = [](std::string_view name, const auto& value) {
|
std::deque<std::string> settings_list;
|
||||||
LOG_INFO(Config, "{}: {}", name, value);
|
|
||||||
};
|
|
||||||
|
|
||||||
const auto log_path = [](std::string_view name, const std::filesystem::path& path) {
|
|
||||||
LOG_INFO(Config, "{}: {}", name, Common::FS::PathToUTF8String(path));
|
|
||||||
};
|
|
||||||
|
|
||||||
LOG_INFO(Config, "Eden Configuration:");
|
|
||||||
for (auto& [category, settings] : values.linkage.by_category) {
|
for (auto& [category, settings] : values.linkage.by_category) {
|
||||||
for (const auto& setting : settings) {
|
for (const auto& setting : settings) {
|
||||||
if (setting->Id() == values.eden_token.Id()) {
|
// Hide the token secret, for security reasons.
|
||||||
// Hide the token secret, for security reasons.
|
if (setting->Id() != values.eden_token.Id()) {
|
||||||
continue;
|
auto const is_default = setting->ToString() == setting->DefaultToString();
|
||||||
|
auto const name = fmt::format(
|
||||||
|
"{:c}{:c} {}.{}",
|
||||||
|
is_default ? '-' : 'M',
|
||||||
|
setting->UsingGlobal() ? '-' : 'C', TranslateCategory(category),
|
||||||
|
setting->GetLabel());
|
||||||
|
if (is_default)
|
||||||
|
settings_list.push_back(fmt::format("{}: {}\n", name, setting->Canonicalize()));
|
||||||
|
else
|
||||||
|
settings_list.push_front(fmt::format("{}: {}\n", name, setting->Canonicalize()));
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto name = fmt::format(
|
|
||||||
"{:c}{:c} {}.{}", setting->ToString() == setting->DefaultToString() ? '-' : 'M',
|
|
||||||
setting->UsingGlobal() ? '-' : 'C', TranslateCategory(category),
|
|
||||||
setting->GetLabel());
|
|
||||||
|
|
||||||
log_setting(name, setting->Canonicalize());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log_path("DataStorage_CacheDir", Common::FS::GetEdenPath(Common::FS::EdenPath::CacheDir));
|
|
||||||
log_path("DataStorage_ConfigDir", Common::FS::GetEdenPath(Common::FS::EdenPath::ConfigDir));
|
std::string settings_str{};
|
||||||
log_path("DataStorage_LoadDir", Common::FS::GetEdenPath(Common::FS::EdenPath::LoadDir));
|
for (auto const& e : settings_list)
|
||||||
log_path("DataStorage_NANDDir", Common::FS::GetEdenPath(Common::FS::EdenPath::NANDDir));
|
settings_str += e;
|
||||||
log_path("DataStorage_SaveDir", Common::FS::GetEdenPath(Common::FS::EdenPath::SaveDir));
|
LOG_INFO(Config, "Eden Configuration:\n{}", settings_str);
|
||||||
log_path("DataStorage_SDMCDir", Common::FS::GetEdenPath(Common::FS::EdenPath::SDMCDir));
|
#define LOG_PATH(NAME) \
|
||||||
|
LOG_INFO(Config, #NAME ": {}", Common::FS::PathToUTF8String(Common::FS::GetEdenPath(Common::FS::EdenPath::NAME)))
|
||||||
|
LOG_PATH(CacheDir);
|
||||||
|
LOG_PATH(ConfigDir);
|
||||||
|
LOG_PATH(LoadDir);
|
||||||
|
LOG_PATH(NANDDir);
|
||||||
|
LOG_PATH(SaveDir);
|
||||||
|
LOG_PATH(SDMCDir);
|
||||||
|
#undef LOG_PATH
|
||||||
}
|
}
|
||||||
|
|
||||||
bool getDebugKnobAt(u8 i) {
|
bool getDebugKnobAt(u8 i) {
|
||||||
|
|
@ -171,12 +174,10 @@ bool IsDMALevelSafe() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsFastmemEnabled() {
|
bool IsFastmemEnabled() {
|
||||||
if (values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Debugging) {
|
if (values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Debugging)
|
||||||
return bool(values.cpuopt_fastmem);
|
return bool(values.cpuopt_fastmem);
|
||||||
}
|
else if (values.cpu_accuracy.GetValue() == CpuAccuracy::Unsafe)
|
||||||
if (values.cpu_accuracy.GetValue() == CpuAccuracy::Unsafe) {
|
|
||||||
return bool(values.cpuopt_unsafe_host_mmu);
|
return bool(values.cpuopt_unsafe_host_mmu);
|
||||||
}
|
|
||||||
#if !defined(__APPLE__) && !defined(__linux__) && !defined(__ANDROID__) && !defined(_WIN32)
|
#if !defined(__APPLE__) && !defined(__linux__) && !defined(__ANDROID__) && !defined(_WIN32)
|
||||||
return false;
|
return false;
|
||||||
#else
|
#else
|
||||||
|
|
@ -341,10 +342,7 @@ void TranslateResolutionInfo(ResolutionSetup setup, ResolutionScalingInfo& info)
|
||||||
info.down_shift = 0;
|
info.down_shift = 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(false);
|
UNREACHABLE();
|
||||||
info.up_scale = 1;
|
|
||||||
info.down_shift = 0;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
info.up_factor = static_cast<f32>(info.up_scale) / (1U << info.down_shift);
|
info.up_factor = static_cast<f32>(info.up_scale) / (1U << info.down_shift);
|
||||||
info.down_factor = static_cast<f32>(1U << info.down_shift) / info.up_scale;
|
info.down_factor = static_cast<f32>(1U << info.down_shift) / info.up_scale;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue