Compare commits

..

17 Commits

Author SHA1 Message Date
a9e31e7261 Android 268 2024-02-25 00:57:12 +00:00
7821ae4d43 Merge yuzu-emu#13154 2024-02-25 00:57:12 +00:00
d2ee9c6056 Merge yuzu-emu#13096 2024-02-25 00:57:12 +00:00
46668db138 Merge yuzu-emu#12749 2024-02-25 00:57:11 +00:00
f872f4c2b0 Merge yuzu-emu#12461 2024-02-25 00:57:11 +00:00
a93d249ac1 Merge pull request #13155 from german77/GetSettingsItemValue
service: set: Fix GetSettingsItemValue
2024-02-24 16:24:01 -05:00
9fccccedee service: set: Fix GetSettingsItemValue 2024-02-24 14:44:21 -06:00
05f94dc5fc Merge pull request #13153 from german77/defaultset
service: set: Enable nfc and others by default and bump version
2024-02-24 12:48:31 -05:00
dcf7698924 Merge pull request #13081 from FearlessTobi/aoc-ipc
aoc: Migrate to use cmif serialization
2024-02-24 12:48:26 -05:00
7b68d7d467 Merge pull request #13150 from liamwhite/region
set: fix region code for system settings
2024-02-24 11:40:31 -06:00
4741e50047 service: set: Enable nfc and others by default and bump version 2024-02-24 11:19:51 -06:00
7836c0867d set: fix region code for system settings 2024-02-24 00:48:44 -05:00
d1e0039bc8 Merge pull request #13142 from t895/vibration-queue
android: Play vibrations asynchronously
2024-02-24 00:38:13 -05:00
0369c65870 android: Play vibrations asynchronously 2024-02-23 16:41:59 -05:00
2786d34dd7 aoc: Rename AOC_U to IAddOnContentManager 2024-02-23 01:19:18 +01:00
a2a0be4246 aoc: Migrate to use cmif serialization 2024-02-19 17:20:02 +01:00
aa6532cf34 core/aoc: Move IPurchaseEventManager to separate file 2024-02-19 16:36:24 +01:00
10 changed files with 51 additions and 30 deletions

View File

@ -2,10 +2,8 @@
|----|----|----|----|----|
| [12461](https://github.com/yuzu-emu/yuzu//pull/12461) | [`2831f5dc6`](https://github.com/yuzu-emu/yuzu//pull/12461/files) | Rework Nvdec and VIC to fix out-of-order videos, and speed up decoding. | [Kelebek1](https://github.com/Kelebek1/) | Yes |
| [12749](https://github.com/yuzu-emu/yuzu//pull/12749) | [`aad4b0d6f`](https://github.com/yuzu-emu/yuzu//pull/12749/files) | general: workarounds for SMMU syncing issues | [liamwhite](https://github.com/liamwhite/) | Yes |
| [13081](https://github.com/yuzu-emu/yuzu//pull/13081) | [`2786d34dd`](https://github.com/yuzu-emu/yuzu//pull/13081/files) | aoc: Migrate to use cmif serialization | [FearlessTobi](https://github.com/FearlessTobi/) | Yes |
| [13096](https://github.com/yuzu-emu/yuzu//pull/13096) | [`0a8759057`](https://github.com/yuzu-emu/yuzu//pull/13096/files) | texture_cache: use two-pass collection for costly load resources | [liamwhite](https://github.com/liamwhite/) | Yes |
| [13122](https://github.com/yuzu-emu/yuzu//pull/13122) | [`505b3e4a7`](https://github.com/yuzu-emu/yuzu//pull/13122/files) | vk_rasterizer: flip scissor y on lower left origin mode | [liamwhite](https://github.com/liamwhite/) | Yes |
| [13142](https://github.com/yuzu-emu/yuzu//pull/13142) | [`0369c6587`](https://github.com/yuzu-emu/yuzu//pull/13142/files) | android: Play vibrations asynchronously | [t895](https://github.com/t895/) | Yes |
| [13154](https://github.com/yuzu-emu/yuzu//pull/13154) | [`ca7f949ee`](https://github.com/yuzu-emu/yuzu//pull/13154/files) | core: hid: Reintroduce vibration filter | [german77](https://github.com/german77/) | Yes |
End of merge log. You can find the original README.md below the break.

View File

@ -26,12 +26,9 @@ Service::PSC::Time::SystemClockContext g_report_ephemeral_clock_context{};
template <typename T>
T GetSettingsItemValue(std::shared_ptr<Service::Set::ISystemSettingsServer>& set_sys,
const char* category, const char* name) {
std::vector<u8> interval_buf;
auto res = set_sys->GetSettingsItemValueImpl(interval_buf, category, name);
ASSERT(res == ResultSuccess);
T v{};
std::memcpy(&v, interval_buf.data(), sizeof(T));
auto res = set_sys->GetSettingsItemValueImpl(v, category, name);
ASSERT(res == ResultSuccess);
return v;
}

View File

@ -52,6 +52,10 @@ SystemSettings DefaultSystemSettings() {
settings.battery_percentage_flag = true;
settings.chinese_traditional_input_method = ChineseTraditionalInputMethod::Unknown0;
settings.vibration_master_volume = 1.0f;
settings.touch_screen_mode = TouchScreenMode::Standard;
settings.nfc_enable_flag = true;
settings.bluetooth_enable_flag = true;
settings.wireless_lan_enable_flag = true;
const auto language_code =
available_language_codes[static_cast<s32>(::Settings::values.language_index.GetValue())];

View File

@ -26,7 +26,7 @@
namespace Service::Set {
namespace {
constexpr u32 SETTINGS_VERSION{3u};
constexpr u32 SETTINGS_VERSION{4u};
constexpr auto SETTINGS_MAGIC = Common::MakeMagic('y', 'u', 'z', 'u', '_', 's', 'e', 't');
struct SettingsHeader {
u64 magic;
@ -307,6 +307,9 @@ ISystemSettingsServer::ISystemSettingsServer(Core::System& system_)
SetupSettings();
m_system_settings.region_code =
static_cast<SystemRegionCode>(::Settings::values.region_index.GetValue());
// TODO: Remove this when starter applet is fully functional
EulaVersion eula_version{
.version = 0x10000,
@ -712,7 +715,7 @@ Result ISystemSettingsServer::GetSettingsItemValueSize(
}
Result ISystemSettingsServer::GetSettingsItemValue(
OutBuffer<BufferAttr_HipcMapAlias> out_data,
Out<u64> out_size, OutBuffer<BufferAttr_HipcMapAlias> out_data,
InLargeData<SettingItemName, BufferAttr_HipcPointer> setting_category_buffer,
InLargeData<SettingItemName, BufferAttr_HipcPointer> setting_name_buffer) {
const std::string setting_category{Common::StringFromBuffer(*setting_category_buffer)};
@ -720,7 +723,7 @@ Result ISystemSettingsServer::GetSettingsItemValue(
LOG_INFO(Service_SET, "called, category={}, name={}", setting_category, setting_name);
R_RETURN(GetSettingsItemValueImpl(out_data, setting_category, setting_name));
R_RETURN(GetSettingsItemValueImpl(out_data, *out_size, setting_category, setting_name));
}
Result ISystemSettingsServer::GetTvSettings(Out<TvSettings> out_tv_settings) {
@ -1360,13 +1363,16 @@ void ISystemSettingsServer::SetSaveNeeded() {
m_save_needed = true;
}
Result ISystemSettingsServer::GetSettingsItemValueImpl(std::vector<u8>& out_value,
Result ISystemSettingsServer::GetSettingsItemValueImpl(std::span<u8> out_value, u64& out_size,
const std::string& category,
const std::string& name) {
auto settings{GetSettings()};
R_UNLESS(settings.contains(category) && settings[category].contains(name), ResultUnknown);
out_value = settings[category][name];
ASSERT_MSG(out_value.size() >= settings[category][name].size(),
"Stored type is bigger than requested type");
out_size = std::min<u64>(settings[category][name].size(), out_value.size());
std::memcpy(out_value.data(), settings[category][name].data(), out_size);
R_SUCCEED();
}

View File

@ -34,20 +34,17 @@ public:
explicit ISystemSettingsServer(Core::System& system_);
~ISystemSettingsServer() override;
Result GetSettingsItemValueImpl(std::vector<u8>& out_value, const std::string& category,
const std::string& name);
Result GetSettingsItemValueImpl(std::span<u8> out_value, u64& out_size,
const std::string& category, const std::string& name);
template <typename T>
Result GetSettingsItemValueImpl(T& value, const std::string& category,
Result GetSettingsItemValueImpl(T& out_value, const std::string& category,
const std::string& name) {
std::vector<u8> data;
const auto result = GetSettingsItemValueImpl(data, category, name);
if (result.IsError()) {
return result;
}
ASSERT(data.size() >= sizeof(T));
std::memcpy(&value, data.data(), sizeof(T));
return result;
u64 data_size{};
std::vector<u8> data(sizeof(T));
R_TRY(GetSettingsItemValueImpl(data, data_size, category, name));
std::memcpy(&out_value, data.data(), data_size);
R_SUCCEED();
}
public:
@ -84,7 +81,7 @@ public:
InLargeData<SettingItemName, BufferAttr_HipcPointer> setting_category_buffer,
InLargeData<SettingItemName, BufferAttr_HipcPointer> setting_name_buf);
Result GetSettingsItemValue(
OutBuffer<BufferAttr_HipcMapAlias> out_data,
Out<u64> out_size, OutBuffer<BufferAttr_HipcMapAlias> out_data,
InLargeData<SettingItemName, BufferAttr_HipcPointer> setting_category_buffer,
InLargeData<SettingItemName, BufferAttr_HipcPointer> setting_name_buffer);
Result GetTvSettings(Out<TvSettings> out_tv_settings);

View File

@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include <algorithm>
#include <chrono>
#include <common/scope_exit.h>
#include "common/polyfill_ranges.h"
@ -1287,6 +1288,22 @@ bool EmulatedController::SetVibration(DeviceIndex device_index, const VibrationV
return false;
}
if (!Settings::values.enable_accurate_vibrations.GetValue()) {
using std::chrono::duration_cast;
using std::chrono::milliseconds;
using std::chrono::steady_clock;
const auto now = steady_clock::now();
// Filter out non-zero vibrations that are within 15ms of each other.
if ((vibration.low_amplitude != 0.0f || vibration.high_amplitude != 0.0f) &&
duration_cast<milliseconds>(now - last_vibration_timepoint[index]) < milliseconds(15)) {
return false;
}
last_vibration_timepoint[index] = now;
}
// Exponential amplification is too strong at low amplitudes. Switch to a linear
// amplification if strength is set below 0.7f
const Common::Input::VibrationAmplificationType type =

View File

@ -583,6 +583,7 @@ private:
std::size_t nfc_handles{0};
std::array<VibrationValue, 2> last_vibration_value{DEFAULT_VIBRATION_VALUE,
DEFAULT_VIBRATION_VALUE};
std::array<std::chrono::steady_clock::time_point, 2> last_vibration_timepoint{};
// Temporary values to avoid doing changes while the controller is in configuring mode
NpadStyleIndex tmp_npad_type{NpadStyleIndex::None};

View File

@ -638,7 +638,11 @@ struct VibrationValue {
if (low_amplitude != b.low_amplitude || high_amplitude != b.high_amplitude) {
return false;
}
if (low_frequency != b.low_amplitude || high_frequency != b.high_frequency) {
// Changes in frequency without amplitude don't have any effect
if (low_amplitude == 0 && high_amplitude == 0) {
return true;
}
if (low_frequency != b.low_frequency || high_frequency != b.high_frequency) {
return false;
}
return true;

View File

@ -3,7 +3,6 @@
#include <algorithm>
#include <array>
#include <chrono>
#include <cstring>
#include "common/assert.h"

View File

@ -125,11 +125,9 @@ VkRect2D GetScissorState(const Maxwell& regs, size_t index, u32 up_scale = 1, u3
return value < 0 ? std::min<s32>(converted_value - acumm, -1)
: std::max<s32>(converted_value + acumm, 1);
};
const bool lower_left = regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft;
const s32 y_adj = lower_left ? scale_up(regs.surface_clip.height - (src.max_y - src.min_y)) : 0;
if (src.enable) {
scissor.offset.x = scale_up(static_cast<s32>(src.min_x));
scissor.offset.y = scale_up(static_cast<s32>(src.min_y)) + y_adj;
scissor.offset.y = scale_up(static_cast<s32>(src.min_y));
scissor.extent.width = scale_up(src.max_x - src.min_x);
scissor.extent.height = scale_up(src.max_y - src.min_y);
} else {