mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-02 11:03:34 -06:00
Vblank frequency setting fix + utf 8 encoding for paths (#4174)
* vblank frequency setting fix * force utf-8 encoding upon json serialization/deserialization for path strings
This commit is contained in:
parent
3cc56bf84c
commit
650652db42
@ -25,10 +25,13 @@ namespace nlohmann {
|
||||
template <>
|
||||
struct adl_serializer<std::filesystem::path> {
|
||||
static void to_json(json& j, const std::filesystem::path& p) {
|
||||
j = p.string();
|
||||
const auto u8 = p.u8string();
|
||||
j = std::string(reinterpret_cast<const char*>(u8.data()), u8.size());
|
||||
}
|
||||
static void from_json(const json& j, std::filesystem::path& p) {
|
||||
p = j.get<std::string>();
|
||||
const std::string s = j.get<std::string>();
|
||||
p = std::filesystem::path(
|
||||
std::u8string_view(reinterpret_cast<const char8_t*>(s.data()), s.size()));
|
||||
}
|
||||
};
|
||||
} // namespace nlohmann
|
||||
@ -647,4 +650,4 @@ std::vector<std::string> EmulatorSettingsImpl::GetAllOverrideableKeys() const {
|
||||
addGroup(m_gpu.GetOverrideableFields());
|
||||
addGroup(m_vulkan.GetOverrideableFields());
|
||||
return keys;
|
||||
}
|
||||
}
|
||||
|
||||
@ -594,16 +594,17 @@ public:
|
||||
SETTING_FORWARD_BOOL_READONLY(m_gpu, PatchShaders, patch_shaders)
|
||||
|
||||
u32 GetVblankFrequency() {
|
||||
if (m_gpu.vblank_frequency.value < 60) {
|
||||
m_gpu.vblank_frequency.value = 60;
|
||||
if (m_gpu.vblank_frequency.value < 30) {
|
||||
return 30;
|
||||
}
|
||||
return m_gpu.vblank_frequency.value;
|
||||
return m_gpu.vblank_frequency.get();
|
||||
}
|
||||
void SetVblankFrequency(const u32& v) {
|
||||
if (v < 60) {
|
||||
m_gpu.vblank_frequency.value = 60;
|
||||
void SetVblankFrequency(const u32& v, bool is_specific = false) {
|
||||
u32 val = v < 30 ? 30 : v;
|
||||
if (is_specific) {
|
||||
m_gpu.vblank_frequency.game_specific_value = val;
|
||||
} else {
|
||||
m_gpu.vblank_frequency.value = v;
|
||||
m_gpu.vblank_frequency.value = val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user