diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/android/app/build.gradle.kts | 2 | ||||
-rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GameHelper.kt | 35 | ||||
-rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp | 4 | ||||
-rw-r--r-- | src/core/hle/service/service.h | 4 | ||||
-rw-r--r-- | src/core/hle/service/sockets/bsd.cpp | 5 | ||||
-rw-r--r-- | src/core/hle/service/sockets/bsd.h | 3 | ||||
-rw-r--r-- | src/yuzu/game_list_worker.cpp | 23 |
7 files changed, 54 insertions, 22 deletions
diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts index a8db70511..fe79a701c 100644 --- a/src/android/app/build.gradle.kts +++ b/src/android/app/build.gradle.kts @@ -95,6 +95,7 @@ android { // builds a release build that doesn't need signing // Attaches 'debug' suffix to version and package name, allowing installation alongside the release build. register("relWithDebInfo") { + isDefault = true resValue("string", "app_name_suffixed", "yuzu Debug Release") signingConfig = signingConfigs.getByName("debug") isMinifyEnabled = true @@ -122,6 +123,7 @@ android { flavorDimensions.add("version") productFlavors { create("mainline") { + isDefault = true dimension = "version" buildConfigField("Boolean", "PREMIUM", "false") } diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GameHelper.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GameHelper.kt index f8e7eeca7..f71d0a098 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GameHelper.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GameHelper.kt @@ -11,6 +11,7 @@ import kotlinx.serialization.json.Json import org.yuzu.yuzu_emu.NativeLibrary import org.yuzu.yuzu_emu.YuzuApplication import org.yuzu.yuzu_emu.model.Game +import org.yuzu.yuzu_emu.model.MinimalDocumentFile object GameHelper { const val KEY_GAME_PATH = "game_path" @@ -29,15 +30,7 @@ object GameHelper { // Ensure keys are loaded so that ROM metadata can be decrypted. NativeLibrary.reloadKeys() - val children = FileUtil.listFiles(context, gamesUri) - for (file in children) { - if (!file.isDirectory) { - // Check that the file has an extension we care about before trying to read out of it. - if (Game.extensions.contains(FileUtil.getExtension(file.uri))) { - games.add(getGame(file.uri)) - } - } - } + addGamesRecursive(games, FileUtil.listFiles(context, gamesUri), 3) // Cache list of games found on disk val serializedGames = mutableSetOf<String>() @@ -52,6 +45,30 @@ object GameHelper { return games.toList() } + private fun addGamesRecursive( + games: MutableList<Game>, + files: Array<MinimalDocumentFile>, + depth: Int + ) { + if (depth <= 0) { + return + } + + files.forEach { + if (it.isDirectory) { + addGamesRecursive( + games, + FileUtil.listFiles(YuzuApplication.appContext, it.uri), + depth - 1 + ) + } else { + if (Game.extensions.contains(FileUtil.getExtension(it.uri))) { + games.add(getGame(it.uri)) + } + } + } + } + private fun getGame(uri: Uri): Game { val filePath = uri.toString() var name = NativeLibrary.getTitle(filePath) diff --git a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp index 07e570a9f..7d7bb8687 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp @@ -204,9 +204,11 @@ void nvhost_as_gpu::FreeMappingLocked(u64 offset) { if (!mapping->fixed) { auto& allocator{mapping->big_page ? *vm.big_page_allocator : *vm.small_page_allocator}; u32 page_size_bits{mapping->big_page ? vm.big_page_size_bits : VM::PAGE_SIZE_BITS}; + u32 page_size{mapping->big_page ? vm.big_page_size : VM::YUZU_PAGESIZE}; + u64 aligned_size{Common::AlignUp(mapping->size, page_size)}; allocator.Free(static_cast<u32>(mapping->offset >> page_size_bits), - static_cast<u32>(mapping->size >> page_size_bits)); + static_cast<u32>(aligned_size >> page_size_bits)); } // Sparse mappings shouldn't be fully unmapped, just returned to their sparse state diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index 45b2c43b7..d539ed0f4 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -79,8 +79,8 @@ protected: using HandlerFnP = void (Self::*)(HLERequestContext&); /// Used to gain exclusive access to the service members, e.g. from CoreTiming thread. - [[nodiscard]] std::scoped_lock<std::mutex> LockService() { - return std::scoped_lock{lock_service}; + [[nodiscard]] virtual std::unique_lock<std::mutex> LockService() { + return std::unique_lock{lock_service}; } /// System context that the service operates under. diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp index 11f8efbac..d8509c1dd 100644 --- a/src/core/hle/service/sockets/bsd.cpp +++ b/src/core/hle/service/sockets/bsd.cpp @@ -1029,6 +1029,11 @@ BSD::~BSD() { } } +std::unique_lock<std::mutex> BSD::LockService() { + // Do not lock socket IClient instances. + return {}; +} + BSDCFG::BSDCFG(Core::System& system_) : ServiceFramework{system_, "bsdcfg"} { // clang-format off static const FunctionInfo functions[] = { diff --git a/src/core/hle/service/sockets/bsd.h b/src/core/hle/service/sockets/bsd.h index 430edb97c..161f22b9b 100644 --- a/src/core/hle/service/sockets/bsd.h +++ b/src/core/hle/service/sockets/bsd.h @@ -186,6 +186,9 @@ private: // Callback identifier for the OnProxyPacketReceived event. Network::RoomMember::CallbackHandle<Network::ProxyPacket> proxy_packet_received; + +protected: + virtual std::unique_lock<std::mutex> LockService() override; }; class BSDCFG final : public ServiceFramework<BSDCFG> { diff --git a/src/yuzu/game_list_worker.cpp b/src/yuzu/game_list_worker.cpp index 9404365b4..e7fb8a282 100644 --- a/src/yuzu/game_list_worker.cpp +++ b/src/yuzu/game_list_worker.cpp @@ -191,8 +191,9 @@ QString FormatPatchNameVersions(const FileSys::PatchManager& patch_manager, } QList<QStandardItem*> MakeGameListEntry(const std::string& path, const std::string& name, - const std::vector<u8>& icon, Loader::AppLoader& loader, - u64 program_id, const CompatibilityList& compatibility_list, + const std::size_t size, const std::vector<u8>& icon, + Loader::AppLoader& loader, u64 program_id, + const CompatibilityList& compatibility_list, const FileSys::PatchManager& patch) { const auto it = FindMatchingCompatibilityEntry(compatibility_list, program_id); @@ -210,7 +211,7 @@ QList<QStandardItem*> MakeGameListEntry(const std::string& path, const std::stri file_type_string, program_id), new GameListItemCompat(compatibility), new GameListItem(file_type_string), - new GameListItemSize(Common::FS::GetSize(path)), + new GameListItemSize(size), }; const auto patch_versions = GetGameListCachedObject( @@ -278,8 +279,8 @@ void GameListWorker::AddTitlesToGameList(GameListDir* parent_dir) { GetMetadataFromControlNCA(patch, *control, icon, name); } - emit EntryReady(MakeGameListEntry(file->GetFullPath(), name, icon, *loader, program_id, - compatibility_list, patch), + emit EntryReady(MakeGameListEntry(file->GetFullPath(), name, file->GetSize(), icon, *loader, + program_id, compatibility_list, patch), parent_dir); } } @@ -354,8 +355,9 @@ void GameListWorker::ScanFileSystem(ScanTarget target, const std::string& dir_pa const FileSys::PatchManager patch{id, system.GetFileSystemController(), system.GetContentProvider()}; - emit EntryReady(MakeGameListEntry(physical_name, name, icon, *loader, id, - compatibility_list, patch), + emit EntryReady(MakeGameListEntry(physical_name, name, + Common::FS::GetSize(physical_name), icon, + *loader, id, compatibility_list, patch), parent_dir); } } else { @@ -368,9 +370,10 @@ void GameListWorker::ScanFileSystem(ScanTarget target, const std::string& dir_pa const FileSys::PatchManager patch{program_id, system.GetFileSystemController(), system.GetContentProvider()}; - emit EntryReady(MakeGameListEntry(physical_name, name, icon, *loader, - program_id, compatibility_list, patch), - parent_dir); + emit EntryReady( + MakeGameListEntry(physical_name, name, Common::FS::GetSize(physical_name), + icon, *loader, program_id, compatibility_list, patch), + parent_dir); } } } else if (is_dir) { |