Compare commits

..

7 Commits

Author SHA1 Message Date
af787d680d Android 258 2024-02-21 00:56:51 +00:00
c4a46402f0 Merge yuzu-emu#13075 2024-02-21 00:56:51 +00:00
a9b0e8f6d3 Merge yuzu-emu#13000 2024-02-21 00:56:51 +00:00
c792c0ec95 Merge yuzu-emu#12982 2024-02-21 00:56:51 +00:00
03025c3bff Merge yuzu-emu#12749 2024-02-21 00:56:51 +00:00
e2c44f34fc Merge yuzu-emu#12461 2024-02-21 00:56:51 +00:00
d525df98a0 Merge yuzu-emu#10529 2024-02-21 00:56:50 +00:00
11 changed files with 57 additions and 97 deletions

View File

@ -1,12 +1,11 @@
| Pull Request | Commit | Title | Author | Merged? | | Pull Request | Commit | Title | Author | Merged? |
|----|----|----|----|----| |----|----|----|----|----|
| [10529](https://github.com/yuzu-emu/yuzu//pull/10529) | [`368bf2211`](https://github.com/yuzu-emu/yuzu//pull/10529/files) | caches: make critical reclamation less eager and possible in more cases | [liamwhite](https://github.com/liamwhite/) | Yes |
| [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 | | [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 | | [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 |
| [12982](https://github.com/yuzu-emu/yuzu//pull/12982) | [`ef5027712`](https://github.com/yuzu-emu/yuzu//pull/12982/files) | fs: Add FileSystemAccessor and use cmif serialization | [FearlessTobi](https://github.com/FearlessTobi/) | Yes | | [12982](https://github.com/yuzu-emu/yuzu//pull/12982) | [`ef5027712`](https://github.com/yuzu-emu/yuzu//pull/12982/files) | fs: Add FileSystemAccessor and use cmif serialization | [FearlessTobi](https://github.com/FearlessTobi/) | Yes |
| [13000](https://github.com/yuzu-emu/yuzu//pull/13000) | [`461eaca7e`](https://github.com/yuzu-emu/yuzu//pull/13000/files) | device_memory_manager: skip unregistered interfaces on invalidate | [liamwhite](https://github.com/liamwhite/) | Yes | | [13000](https://github.com/yuzu-emu/yuzu//pull/13000) | [`461eaca7e`](https://github.com/yuzu-emu/yuzu//pull/13000/files) | device_memory_manager: skip unregistered interfaces on invalidate | [liamwhite](https://github.com/liamwhite/) | Yes |
| [13075](https://github.com/yuzu-emu/yuzu//pull/13075) | [`f46dc3168`](https://github.com/yuzu-emu/yuzu//pull/13075/files) | shader_recompiler: throw on missing geometry streams in geometry shaders | [liamwhite](https://github.com/liamwhite/) | Yes | | [13075](https://github.com/yuzu-emu/yuzu//pull/13075) | [`f46dc3168`](https://github.com/yuzu-emu/yuzu//pull/13075/files) | shader_recompiler: throw on missing geometry streams in geometry shaders | [liamwhite](https://github.com/liamwhite/) | 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 |
| [13105](https://github.com/yuzu-emu/yuzu//pull/13105) | [`de5422b1f`](https://github.com/yuzu-emu/yuzu//pull/13105/files) | android: Misc controller fixes | [t895](https://github.com/t895/) | Yes |
End of merge log. You can find the original README.md below the break. End of merge log. You can find the original README.md below the break.

View File

@ -64,17 +64,17 @@ data class PlayerInput(
fun hasMapping(): Boolean { fun hasMapping(): Boolean {
var hasMapping = false var hasMapping = false
buttons.forEach { buttons.forEach {
if (it != "[empty]" && it.isNotEmpty()) { if (it != "[empty]") {
hasMapping = true hasMapping = true
} }
} }
analogs.forEach { analogs.forEach {
if (it != "[empty]" && it.isNotEmpty()) { if (it != "[empty]") {
hasMapping = true hasMapping = true
} }
} }
motions.forEach { motions.forEach {
if (it != "[empty]" && it.isNotEmpty()) { if (it != "[empty]") {
hasMapping = true hasMapping = true
} }
} }

View File

@ -780,7 +780,7 @@ class SettingsFragmentPresenter(
playerIndex: Int, playerIndex: Int,
paramName: String, paramName: String,
stick: NativeAnalog, stick: NativeAnalog,
defaultValue: Float defaultValue: Int
): AbstractIntSetting = ): AbstractIntSetting =
object : AbstractIntSetting { object : AbstractIntSetting {
val params get() = NativeInput.getStickParam(playerIndex, stick) val params get() = NativeInput.getStickParam(playerIndex, stick)
@ -788,7 +788,7 @@ class SettingsFragmentPresenter(
override val key = "" override val key = ""
override fun getInt(needsGlobal: Boolean): Int = override fun getInt(needsGlobal: Boolean): Int =
(params.get(paramName, defaultValue) * 100).toInt() (params.get(paramName, 0.15f) * 100).toInt()
override fun setInt(value: Int) { override fun setInt(value: Int) {
val tempParams = params val tempParams = params
@ -796,12 +796,12 @@ class SettingsFragmentPresenter(
NativeInput.setStickParam(playerIndex, stick, tempParams) NativeInput.setStickParam(playerIndex, stick, tempParams)
} }
override val defaultValue = (defaultValue * 100).toInt() override val defaultValue = defaultValue
override fun getValueAsString(needsGlobal: Boolean): String = override fun getValueAsString(needsGlobal: Boolean): String =
getInt(needsGlobal).toString() getInt(needsGlobal).toString()
override fun reset() = setInt(this.defaultValue) override fun reset() = setInt(defaultValue)
} }
private fun getExtraStickSettings( private fun getExtraStickSettings(
@ -811,11 +811,11 @@ class SettingsFragmentPresenter(
val stickIsController = val stickIsController =
NativeInput.isController(NativeInput.getStickParam(playerIndex, nativeAnalog)) NativeInput.isController(NativeInput.getStickParam(playerIndex, nativeAnalog))
val modifierRangeSetting = val modifierRangeSetting =
getStickIntSettingFromParam(playerIndex, "modifier_scale", nativeAnalog, 0.5f) getStickIntSettingFromParam(playerIndex, "modifier_scale", nativeAnalog, 50)
val stickRangeSetting = val stickRangeSetting =
getStickIntSettingFromParam(playerIndex, "range", nativeAnalog, 0.95f) getStickIntSettingFromParam(playerIndex, "range", nativeAnalog, 95)
val stickDeadzoneSetting = val stickDeadzoneSetting =
getStickIntSettingFromParam(playerIndex, "deadzone", nativeAnalog, 0.15f) getStickIntSettingFromParam(playerIndex, "deadzone", nativeAnalog, 15)
val out = mutableListOf<SettingsItem>().apply { val out = mutableListOf<SettingsItem>().apply {
if (stickIsController) { if (stickIsController) {

View File

@ -292,9 +292,6 @@ void EmulationSession::ShutdownEmulation() {
// Unload user input. // Unload user input.
m_system.HIDCore().UnloadInputDevices(); m_system.HIDCore().UnloadInputDevices();
// Enable all controllers
m_system.HIDCore().SetSupportedStyleTag({Core::HID::NpadStyleSet::All});
// Shutdown the main emulated process // Shutdown the main emulated process
if (m_load_result == Core::SystemResultStatus::Success) { if (m_load_result == Core::SystemResultStatus::Success) {
m_system.DetachDebugger(); m_system.DetachDebugger();

View File

@ -102,50 +102,8 @@ void ApplyControllerConfig(size_t player_index,
} }
} }
std::vector<s32> GetSupportedStyles(int player_index) {
auto& hid_core = EmulationSession::GetInstance().System().HIDCore();
const auto npad_style_set = hid_core.GetSupportedStyleTag();
std::vector<s32> supported_indexes;
if (npad_style_set.fullkey == 1) {
supported_indexes.push_back(static_cast<s32>(Core::HID::NpadStyleIndex::Fullkey));
}
if (npad_style_set.joycon_dual == 1) {
supported_indexes.push_back(static_cast<s32>(Core::HID::NpadStyleIndex::JoyconDual));
}
if (npad_style_set.joycon_left == 1) {
supported_indexes.push_back(static_cast<s32>(Core::HID::NpadStyleIndex::JoyconLeft));
}
if (npad_style_set.joycon_right == 1) {
supported_indexes.push_back(static_cast<s32>(Core::HID::NpadStyleIndex::JoyconRight));
}
if (player_index == 0 && npad_style_set.handheld == 1) {
supported_indexes.push_back(static_cast<s32>(Core::HID::NpadStyleIndex::Handheld));
}
if (npad_style_set.gamecube == 1) {
supported_indexes.push_back(static_cast<s32>(Core::HID::NpadStyleIndex::GameCube));
}
return supported_indexes;
}
void ConnectController(size_t player_index, bool connected) { void ConnectController(size_t player_index, bool connected) {
auto& hid_core = EmulationSession::GetInstance().System().HIDCore(); auto& hid_core = EmulationSession::GetInstance().System().HIDCore();
ApplyControllerConfig(player_index, [&](Core::HID::EmulatedController* controller) {
auto supported_styles = GetSupportedStyles(player_index);
auto controller_style = controller->GetNpadStyleIndex(true);
auto style = std::find(supported_styles.begin(), supported_styles.end(),
static_cast<int>(controller_style));
if (style == supported_styles.end() && !supported_styles.empty()) {
controller->SetNpadStyleIndex(
static_cast<Core::HID::NpadStyleIndex>(supported_styles[0]));
}
});
if (player_index == 0) { if (player_index == 0) {
auto* handheld = hid_core.GetEmulatedController(Core::HID::NpadIdType::Handheld); auto* handheld = hid_core.GetEmulatedController(Core::HID::NpadIdType::Handheld);
auto* player_one = hid_core.GetEmulatedController(Core::HID::NpadIdType::Player1); auto* player_one = hid_core.GetEmulatedController(Core::HID::NpadIdType::Player1);
@ -564,10 +522,36 @@ jint Java_org_yuzu_yuzu_1emu_features_input_NativeInput_getButtonNameImpl(JNIEnv
jintArray Java_org_yuzu_yuzu_1emu_features_input_NativeInput_getSupportedStyleTagsImpl( jintArray Java_org_yuzu_yuzu_1emu_features_input_NativeInput_getSupportedStyleTagsImpl(
JNIEnv* env, jobject j_obj, jint j_player_index) { JNIEnv* env, jobject j_obj, jint j_player_index) {
auto supported_styles = GetSupportedStyles(j_player_index); auto& hid_core = EmulationSession::GetInstance().System().HIDCore();
jintArray j_supported_indexes = env->NewIntArray(supported_styles.size()); const auto npad_style_set = hid_core.GetSupportedStyleTag();
env->SetIntArrayRegion(j_supported_indexes, 0, supported_styles.size(), std::vector<s32> supported_indexes;
supported_styles.data()); if (npad_style_set.fullkey == 1) {
supported_indexes.push_back(static_cast<u32>(Core::HID::NpadStyleIndex::Fullkey));
}
if (npad_style_set.joycon_dual == 1) {
supported_indexes.push_back(static_cast<u32>(Core::HID::NpadStyleIndex::JoyconDual));
}
if (npad_style_set.joycon_left == 1) {
supported_indexes.push_back(static_cast<u32>(Core::HID::NpadStyleIndex::JoyconLeft));
}
if (npad_style_set.joycon_right == 1) {
supported_indexes.push_back(static_cast<u32>(Core::HID::NpadStyleIndex::JoyconRight));
}
if (j_player_index == 0 && npad_style_set.handheld == 1) {
supported_indexes.push_back(static_cast<u32>(Core::HID::NpadStyleIndex::Handheld));
}
if (npad_style_set.gamecube == 1) {
supported_indexes.push_back(static_cast<u32>(Core::HID::NpadStyleIndex::GameCube));
}
jintArray j_supported_indexes = env->NewIntArray(supported_indexes.size());
env->SetIntArrayRegion(j_supported_indexes, 0, supported_indexes.size(),
supported_indexes.data());
return j_supported_indexes; return j_supported_indexes;
} }

View File

@ -436,14 +436,14 @@ Result IApplicationManagerInterface::GetApplicationViewWithPromotionInfo(
Result IApplicationManagerInterface::GetApplicationRightsOnClient( Result IApplicationManagerInterface::GetApplicationRightsOnClient(
OutArray<ApplicationRightsOnClient, BufferAttr_HipcMapAlias> out_rights, Out<u32> out_count, OutArray<ApplicationRightsOnClient, BufferAttr_HipcMapAlias> out_rights, Out<u32> out_count,
u32 flags, u64 application_id, Uid account_id) { Common::UUID account_id, u32 flags, u64 application_id) {
LOG_WARNING(Service_NS, "(STUBBED) called, flags={}, application_id={:016X}, account_id={}", LOG_WARNING(Service_NS, "(STUBBED) called, flags={}, application_id={:016X}, account_id={}",
flags, application_id, account_id.uuid.FormattedString()); flags, application_id, account_id.FormattedString());
if (!out_rights.empty()) { if (!out_rights.empty()) {
ApplicationRightsOnClient rights{}; ApplicationRightsOnClient rights{};
rights.application_id = application_id; rights.application_id = application_id;
rights.uid = account_id.uuid; rights.uid = account_id;
rights.flags = 0; rights.flags = 0;
rights.flags2 = 0; rights.flags2 = 0;

View File

@ -37,7 +37,7 @@ public:
InArray<u64, BufferAttr_HipcMapAlias> application_ids); InArray<u64, BufferAttr_HipcMapAlias> application_ids);
Result GetApplicationRightsOnClient( Result GetApplicationRightsOnClient(
OutArray<ApplicationRightsOnClient, BufferAttr_HipcMapAlias> out_rights, Out<u32> out_count, OutArray<ApplicationRightsOnClient, BufferAttr_HipcMapAlias> out_rights, Out<u32> out_count,
u32 flags, u64 application_id, Uid account_id); Common::UUID account_id, u32 flags, u64 application_id);
Result CheckSdCardMountStatus(); Result CheckSdCardMountStatus();
Result GetSdCardMountStatusChangedEvent(OutCopyHandle<Kernel::KReadableEvent> out_event); Result GetSdCardMountStatusChangedEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
Result GetFreeSpaceSize(Out<s64> out_free_space_size, FileSys::StorageId storage_id); Result GetFreeSpaceSize(Out<s64> out_free_space_size, FileSys::StorageId storage_id);

View File

@ -108,9 +108,4 @@ struct ContentPath {
}; };
static_assert(sizeof(ContentPath) == 0x10, "ContentPath has incorrect size."); static_assert(sizeof(ContentPath) == 0x10, "ContentPath has incorrect size.");
struct Uid {
alignas(8) Common::UUID uuid;
};
static_assert(sizeof(Uid) == 0x10, "Uid has incorrect size.");
} // namespace Service::NS } // namespace Service::NS

View File

@ -41,7 +41,8 @@ IQueryService::IQueryService(Core::System& system_) : ServiceFramework{system_,
IQueryService::~IQueryService() = default; IQueryService::~IQueryService() = default;
Result IQueryService::QueryPlayStatisticsByApplicationIdAndUserAccountId( Result IQueryService::QueryPlayStatisticsByApplicationIdAndUserAccountId(
Out<PlayStatistics> out_play_statistics, bool unknown, u64 application_id, Uid account_id) { Out<PlayStatistics> out_play_statistics, bool unknown, Common::UUID account_id,
u64 application_id) {
// TODO(German77): Read statistics of the game // TODO(German77): Read statistics of the game
*out_play_statistics = { *out_play_statistics = {
.application_id = application_id, .application_id = application_id,
@ -49,7 +50,7 @@ Result IQueryService::QueryPlayStatisticsByApplicationIdAndUserAccountId(
}; };
LOG_WARNING(Service_NS, "(STUBBED) called. unknown={}. application_id={:016X}, account_id={}", LOG_WARNING(Service_NS, "(STUBBED) called. unknown={}. application_id={:016X}, account_id={}",
unknown, application_id, account_id.uuid.FormattedString()); unknown, application_id, account_id.FormattedString());
R_SUCCEED(); R_SUCCEED();
} }

View File

@ -5,7 +5,6 @@
#include "common/uuid.h" #include "common/uuid.h"
#include "core/hle/service/cmif_types.h" #include "core/hle/service/cmif_types.h"
#include "core/hle/service/ns/ns_types.h"
#include "core/hle/service/service.h" #include "core/hle/service/service.h"
namespace Service::NS { namespace Service::NS {
@ -30,7 +29,8 @@ public:
private: private:
Result QueryPlayStatisticsByApplicationIdAndUserAccountId( Result QueryPlayStatisticsByApplicationIdAndUserAccountId(
Out<PlayStatistics> out_play_statistics, bool unknown, u64 application_id, Uid account_id); Out<PlayStatistics> out_play_statistics, bool unknown, Common::UUID account_id,
u64 application_id);
}; };
} // namespace Service::NS } // namespace Service::NS

View File

@ -72,19 +72,12 @@ TextureCache<P>::TextureCache(Runtime& runtime_, Tegra::MaxwellDeviceMemoryManag
template <class P> template <class P>
void TextureCache<P>::RunGarbageCollector() { void TextureCache<P>::RunGarbageCollector() {
bool high_priority_mode = false; bool high_priority_mode = total_used_memory >= expected_memory;
bool aggressive_mode = false; bool aggressive_mode = total_used_memory >= critical_memory;
u64 ticks_to_destroy = 0; const u64 ticks_to_destroy = aggressive_mode ? 10ULL : high_priority_mode ? 25ULL : 50ULL;
size_t num_iterations = 0; size_t num_iterations = aggressive_mode ? 40 : (high_priority_mode ? 20 : 10);
const auto clean_up = [this, &num_iterations, &high_priority_mode,
const auto Configure = [&](bool allow_aggressive) { &aggressive_mode](ImageId image_id) {
high_priority_mode = total_used_memory >= expected_memory;
aggressive_mode = allow_aggressive && total_used_memory >= critical_memory;
ticks_to_destroy = aggressive_mode ? 10ULL : high_priority_mode ? 25ULL : 50ULL;
num_iterations = aggressive_mode ? 40 : (high_priority_mode ? 20 : 10);
};
const auto Cleanup = [this, &num_iterations, &high_priority_mode,
&aggressive_mode](ImageId image_id) {
if (num_iterations == 0) { if (num_iterations == 0) {
return true; return true;
} }
@ -130,16 +123,7 @@ void TextureCache<P>::RunGarbageCollector() {
} }
return false; return false;
}; };
lru_cache.ForEachItemBelow(frame_tick - ticks_to_destroy, clean_up);
// Try to remove anything old enough and not high priority.
Configure(false);
lru_cache.ForEachItemBelow(frame_tick - ticks_to_destroy, Cleanup);
// If pressure is still too high, prune aggressively.
if (total_used_memory >= critical_memory) {
Configure(true);
lru_cache.ForEachItemBelow(frame_tick - ticks_to_destroy, Cleanup);
}
} }
template <class P> template <class P>