aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpineappleEA <pineaea@gmail.com>2024-02-21 05:33:37 +0100
committerpineappleEA <pineaea@gmail.com>2024-02-21 05:33:37 +0100
commit4565d8fcd8bf8cb1f11ddde057afe510f63f7a89 (patch)
tree38c670ee1751110e98f71a6d88287fe1b90a4345
parentb86c4f1e6680f971f0979c0544e7e20fa1145fa3 (diff)
early-access version 4156EA-4156
-rwxr-xr-xREADME.md2
-rwxr-xr-xsrc/core/hle/service/ns/application_manager_interface.cpp6
-rwxr-xr-xsrc/core/hle/service/ns/application_manager_interface.h2
-rwxr-xr-xsrc/core/hle/service/ns/ns_types.h5
-rwxr-xr-xsrc/core/hle/service/ns/query_service.cpp5
-rwxr-xr-xsrc/core/hle/service/ns/query_service.h4
-rwxr-xr-xsrc/video_core/texture_cache/texture_cache.h30
7 files changed, 37 insertions, 17 deletions
diff --git a/README.md b/README.md
index 9370bfe1e..c733bba80 100755
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
1yuzu emulator early access 1yuzu emulator early access
2============= 2=============
3 3
4This is the source code for early-access 4155. 4This is the source code for early-access 4156.
5 5
6## Legal Notice 6## Legal Notice
7 7
diff --git a/src/core/hle/service/ns/application_manager_interface.cpp b/src/core/hle/service/ns/application_manager_interface.cpp
index 2e3a44c0d..7a91727f9 100755
--- a/src/core/hle/service/ns/application_manager_interface.cpp
+++ b/src/core/hle/service/ns/application_manager_interface.cpp
@@ -436,14 +436,14 @@ Result IApplicationManagerInterface::GetApplicationViewWithPromotionInfo(
436 436
437Result IApplicationManagerInterface::GetApplicationRightsOnClient( 437Result IApplicationManagerInterface::GetApplicationRightsOnClient(
438 OutArray<ApplicationRightsOnClient, BufferAttr_HipcMapAlias> out_rights, Out<u32> out_count, 438 OutArray<ApplicationRightsOnClient, BufferAttr_HipcMapAlias> out_rights, Out<u32> out_count,
439 Common::UUID account_id, u32 flags, u64 application_id) { 439 u32 flags, u64 application_id, Uid account_id) {
440 LOG_WARNING(Service_NS, "(STUBBED) called, flags={}, application_id={:016X}, account_id={}", 440 LOG_WARNING(Service_NS, "(STUBBED) called, flags={}, application_id={:016X}, account_id={}",
441 flags, application_id, account_id.FormattedString()); 441 flags, application_id, account_id.uuid.FormattedString());
442 442
443 if (!out_rights.empty()) { 443 if (!out_rights.empty()) {
444 ApplicationRightsOnClient rights{}; 444 ApplicationRightsOnClient rights{};
445 rights.application_id = application_id; 445 rights.application_id = application_id;
446 rights.uid = account_id; 446 rights.uid = account_id.uuid;
447 rights.flags = 0; 447 rights.flags = 0;
448 rights.flags2 = 0; 448 rights.flags2 = 0;
449 449
diff --git a/src/core/hle/service/ns/application_manager_interface.h b/src/core/hle/service/ns/application_manager_interface.h
index 350ec37ce..f33d269b3 100755
--- a/src/core/hle/service/ns/application_manager_interface.h
+++ b/src/core/hle/service/ns/application_manager_interface.h
@@ -37,7 +37,7 @@ public:
37 InArray<u64, BufferAttr_HipcMapAlias> application_ids); 37 InArray<u64, BufferAttr_HipcMapAlias> application_ids);
38 Result GetApplicationRightsOnClient( 38 Result GetApplicationRightsOnClient(
39 OutArray<ApplicationRightsOnClient, BufferAttr_HipcMapAlias> out_rights, Out<u32> out_count, 39 OutArray<ApplicationRightsOnClient, BufferAttr_HipcMapAlias> out_rights, Out<u32> out_count,
40 Common::UUID account_id, u32 flags, u64 application_id); 40 u32 flags, u64 application_id, Uid account_id);
41 Result CheckSdCardMountStatus(); 41 Result CheckSdCardMountStatus();
42 Result GetSdCardMountStatusChangedEvent(OutCopyHandle<Kernel::KReadableEvent> out_event); 42 Result GetSdCardMountStatusChangedEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
43 Result GetFreeSpaceSize(Out<s64> out_free_space_size, FileSys::StorageId storage_id); 43 Result GetFreeSpaceSize(Out<s64> out_free_space_size, FileSys::StorageId storage_id);
diff --git a/src/core/hle/service/ns/ns_types.h b/src/core/hle/service/ns/ns_types.h
index 38421b0f4..2dd664c4e 100755
--- a/src/core/hle/service/ns/ns_types.h
+++ b/src/core/hle/service/ns/ns_types.h
@@ -108,4 +108,9 @@ struct ContentPath {
108}; 108};
109static_assert(sizeof(ContentPath) == 0x10, "ContentPath has incorrect size."); 109static_assert(sizeof(ContentPath) == 0x10, "ContentPath has incorrect size.");
110 110
111struct Uid {
112 alignas(8) Common::UUID uuid;
113};
114static_assert(sizeof(Uid) == 0x10, "Uid has incorrect size.");
115
111} // namespace Service::NS 116} // namespace Service::NS
diff --git a/src/core/hle/service/ns/query_service.cpp b/src/core/hle/service/ns/query_service.cpp
index 946b7fa23..138400541 100755
--- a/src/core/hle/service/ns/query_service.cpp
+++ b/src/core/hle/service/ns/query_service.cpp
@@ -41,8 +41,7 @@ IQueryService::IQueryService(Core::System& system_) : ServiceFramework{system_,
41IQueryService::~IQueryService() = default; 41IQueryService::~IQueryService() = default;
42 42
43Result IQueryService::QueryPlayStatisticsByApplicationIdAndUserAccountId( 43Result IQueryService::QueryPlayStatisticsByApplicationIdAndUserAccountId(
44 Out<PlayStatistics> out_play_statistics, bool unknown, Common::UUID account_id, 44 Out<PlayStatistics> out_play_statistics, bool unknown, u64 application_id, Uid account_id) {
45 u64 application_id) {
46 // TODO(German77): Read statistics of the game 45 // TODO(German77): Read statistics of the game
47 *out_play_statistics = { 46 *out_play_statistics = {
48 .application_id = application_id, 47 .application_id = application_id,
@@ -50,7 +49,7 @@ Result IQueryService::QueryPlayStatisticsByApplicationIdAndUserAccountId(
50 }; 49 };
51 50
52 LOG_WARNING(Service_NS, "(STUBBED) called. unknown={}. application_id={:016X}, account_id={}", 51 LOG_WARNING(Service_NS, "(STUBBED) called. unknown={}. application_id={:016X}, account_id={}",
53 unknown, application_id, account_id.FormattedString()); 52 unknown, application_id, account_id.uuid.FormattedString());
54 R_SUCCEED(); 53 R_SUCCEED();
55} 54}
56 55
diff --git a/src/core/hle/service/ns/query_service.h b/src/core/hle/service/ns/query_service.h
index 6cdbfa277..c4c82b752 100755
--- a/src/core/hle/service/ns/query_service.h
+++ b/src/core/hle/service/ns/query_service.h
@@ -5,6 +5,7 @@
5 5
6#include "common/uuid.h" 6#include "common/uuid.h"
7#include "core/hle/service/cmif_types.h" 7#include "core/hle/service/cmif_types.h"
8#include "core/hle/service/ns/ns_types.h"
8#include "core/hle/service/service.h" 9#include "core/hle/service/service.h"
9 10
10namespace Service::NS { 11namespace Service::NS {
@@ -29,8 +30,7 @@ public:
29 30
30private: 31private:
31 Result QueryPlayStatisticsByApplicationIdAndUserAccountId( 32 Result QueryPlayStatisticsByApplicationIdAndUserAccountId(
32 Out<PlayStatistics> out_play_statistics, bool unknown, Common::UUID account_id, 33 Out<PlayStatistics> out_play_statistics, bool unknown, u64 application_id, Uid account_id);
33 u64 application_id);
34}; 34};
35 35
36} // namespace Service::NS 36} // namespace Service::NS
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index f790897ef..13f056214 100755
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -72,12 +72,19 @@ TextureCache<P>::TextureCache(Runtime& runtime_, Tegra::MaxwellDeviceMemoryManag
72 72
73template <class P> 73template <class P>
74void TextureCache<P>::RunGarbageCollector() { 74void TextureCache<P>::RunGarbageCollector() {
75 bool high_priority_mode = total_used_memory >= expected_memory; 75 bool high_priority_mode = false;
76 bool aggressive_mode = total_used_memory >= critical_memory; 76 bool aggressive_mode = false;
77 const u64 ticks_to_destroy = aggressive_mode ? 10ULL : high_priority_mode ? 25ULL : 50ULL; 77 u64 ticks_to_destroy = 0;
78 size_t num_iterations = aggressive_mode ? 40 : (high_priority_mode ? 20 : 10); 78 size_t num_iterations = 0;
79 const auto clean_up = [this, &num_iterations, &high_priority_mode, 79
80 &aggressive_mode](ImageId image_id) { 80 const auto Configure = [&](bool allow_aggressive) {
81 high_priority_mode = total_used_memory >= expected_memory;
82 aggressive_mode = allow_aggressive && total_used_memory >= critical_memory;
83 ticks_to_destroy = aggressive_mode ? 10ULL : high_priority_mode ? 25ULL : 50ULL;
84 num_iterations = aggressive_mode ? 40 : (high_priority_mode ? 20 : 10);
85 };
86 const auto Cleanup = [this, &num_iterations, &high_priority_mode,
87 &aggressive_mode](ImageId image_id) {
81 if (num_iterations == 0) { 88 if (num_iterations == 0) {
82 return true; 89 return true;
83 } 90 }
@@ -123,7 +130,16 @@ void TextureCache<P>::RunGarbageCollector() {
123 } 130 }
124 return false; 131 return false;
125 }; 132 };
126 lru_cache.ForEachItemBelow(frame_tick - ticks_to_destroy, clean_up); 133
134 // Try to remove anything old enough and not high priority.
135 Configure(false);
136 lru_cache.ForEachItemBelow(frame_tick - ticks_to_destroy, Cleanup);
137
138 // If pressure is still too high, prune aggressively.
139 if (total_used_memory >= critical_memory) {
140 Configure(true);
141 lru_cache.ForEachItemBelow(frame_tick - ticks_to_destroy, Cleanup);
142 }
127} 143}
128 144
129template <class P> 145template <class P>