diff --git a/src/citra_qt/game_list_worker.cpp b/src/citra_qt/game_list_worker.cpp index 1ae2e2f38b..42d748ece3 100644 --- a/src/citra_qt/game_list_worker.cpp +++ b/src/citra_qt/game_list_worker.cpp @@ -49,6 +49,11 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsign if (!loader) return true; + bool executable = false; + loader->IsExecutable(executable); + if (!executable) + return true; + u64 program_id = 0; loader->ReadProgramId(program_id); diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h index 1a8e158234..20e84c6a9d 100644 --- a/src/core/loader/loader.h +++ b/src/core/loader/loader.h @@ -112,6 +112,16 @@ public: return std::make_pair(2, ResultStatus::Success); } + /** + * Get whether this application is executable. + * @param out_executable Reference to store the executable flag into. + * @return ResultStatus result of function + */ + virtual ResultStatus IsExecutable(bool& out_executable) { + out_executable = true; + return ResultStatus::Success; + } + /** * Get the code (typically .code section) of the application * @param buffer Reference to buffer to store data diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp index 286eadaab2..016a11ef2b 100644 --- a/src/core/loader/ncch.cpp +++ b/src/core/loader/ncch.cpp @@ -198,6 +198,15 @@ ResultStatus AppLoader_NCCH::Load(std::shared_ptr& process) { return ResultStatus::Success; } +ResultStatus AppLoader_NCCH::IsExecutable(bool& out_executable) { + Loader::ResultStatus result = overlay_ncch->Load(); + if (result != Loader::ResultStatus::Success) + return result; + + out_executable = overlay_ncch->ncch_header.is_executable != 0; + return ResultStatus::Success; +} + ResultStatus AppLoader_NCCH::ReadCode(std::vector& buffer) { return overlay_ncch->LoadSectionExeFS(".code", buffer); } diff --git a/src/core/loader/ncch.h b/src/core/loader/ncch.h index d45ae8781b..7c86f85d8a 100644 --- a/src/core/loader/ncch.h +++ b/src/core/loader/ncch.h @@ -41,6 +41,8 @@ public: */ std::pair, ResultStatus> LoadKernelSystemMode() override; + ResultStatus IsExecutable(bool& out_executable) override; + ResultStatus ReadCode(std::vector& buffer) override; ResultStatus ReadIcon(std::vector& buffer) override;