diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/telemetry.h | 4 | ||||
-rw-r--r-- | src/core/hle/service/sm/controller.cpp | 8 | ||||
-rw-r--r-- | src/core/hle/service/sm/controller.h | 1 | ||||
-rw-r--r-- | src/core/loader/nro.cpp | 29 | ||||
-rw-r--r-- | src/input_common/sdl/sdl.cpp | 2 | ||||
-rw-r--r-- | src/yuzu/bootmanager.cpp | 3 | ||||
-rw-r--r-- | src/yuzu/bootmanager.h | 10 | ||||
-rw-r--r-- | src/yuzu/game_list.cpp | 4 | ||||
-rw-r--r-- | src/yuzu/game_list.h | 2 | ||||
-rw-r--r-- | src/yuzu/hotkeys.cpp | 1 |
10 files changed, 30 insertions, 34 deletions
diff --git a/src/common/telemetry.h b/src/common/telemetry.h index dd6bbd759..3694c76f2 100644 --- a/src/common/telemetry.h +++ b/src/common/telemetry.h @@ -53,10 +53,10 @@ template <typename T> class Field : public FieldInterface { public: Field(FieldType type, std::string name, const T& value) - : type(type), name(std::move(name)), value(value) {} + : name(std::move(name)), type(type), value(value) {} Field(FieldType type, std::string name, T&& value) - : type(type), name(std::move(name)), value(std::move(value)) {} + : name(std::move(name)), type(type), value(std::move(value)) {} Field(const Field& other) : Field(other.type, other.name, other.value) {} diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp index e8f5d0e4a..7b1c8ee37 100644 --- a/src/core/hle/service/sm/controller.cpp +++ b/src/core/hle/service/sm/controller.cpp @@ -32,6 +32,12 @@ void Controller::DuplicateSession(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service, "called"); } +void Controller::DuplicateSessionEx(Kernel::HLERequestContext& ctx) { + DuplicateSession(ctx); + + LOG_WARNING(Service, "(STUBBED) called, using DuplicateSession"); +} + void Controller::QueryPointerBufferSize(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); @@ -46,7 +52,7 @@ Controller::Controller() : ServiceFramework("IpcController") { {0x00000001, nullptr, "ConvertDomainToSession"}, {0x00000002, &Controller::DuplicateSession, "DuplicateSession"}, {0x00000003, &Controller::QueryPointerBufferSize, "QueryPointerBufferSize"}, - {0x00000004, nullptr, "DuplicateSessionEx"}, + {0x00000004, &Controller::DuplicateSessionEx, "DuplicateSessionEx"}, }; RegisterHandlers(functions); } diff --git a/src/core/hle/service/sm/controller.h b/src/core/hle/service/sm/controller.h index 0b873b492..7b4bc4b75 100644 --- a/src/core/hle/service/sm/controller.h +++ b/src/core/hle/service/sm/controller.h @@ -17,6 +17,7 @@ public: private: void ConvertSessionToDomain(Kernel::HLERequestContext& ctx); void DuplicateSession(Kernel::HLERequestContext& ctx); + void DuplicateSessionEx(Kernel::HLERequestContext& ctx); void QueryPointerBufferSize(Kernel::HLERequestContext& ctx); }; diff --git a/src/core/loader/nro.cpp b/src/core/loader/nro.cpp index 66c61b038..6864a1926 100644 --- a/src/core/loader/nro.cpp +++ b/src/core/loader/nro.cpp @@ -62,20 +62,6 @@ static constexpr u32 PageAlignSize(u32 size) { return (size + Memory::PAGE_MASK) & ~Memory::PAGE_MASK; } -static std::vector<u8> ReadSegment(FileUtil::IOFile& file, const NroSegmentHeader& header) { - std::vector<u8> data; - data.resize(header.size); - - file.Seek(header.offset + sizeof(NroHeader), SEEK_SET); - size_t bytes_read{file.ReadBytes(data.data(), header.size)}; - if (header.size != PageAlignSize(static_cast<u32>(bytes_read))) { - LOG_CRITICAL(Loader, "Failed to read NRO segment bytes", header.size); - return {}; - } - - return data; -} - bool AppLoader_NRO::LoadNro(const std::string& path, VAddr load_base) { FileUtil::IOFile file(path, "rb"); if (!file.IsOpen()) { @@ -95,7 +81,7 @@ bool AppLoader_NRO::LoadNro(const std::string& path, VAddr load_base) { // Build program image Kernel::SharedPtr<Kernel::CodeSet> codeset = Kernel::CodeSet::Create("", 0); std::vector<u8> program_image; - program_image.resize(PageAlignSize(nro_header.file_size + nro_header.bss_size)); + program_image.resize(PageAlignSize(nro_header.file_size)); file.Seek(0, SEEK_SET); file.ReadBytes(program_image.data(), nro_header.file_size); @@ -107,15 +93,16 @@ bool AppLoader_NRO::LoadNro(const std::string& path, VAddr load_base) { // Read MOD header ModHeader mod_header{}; - u32 bss_size{Memory::PAGE_SIZE}; // Default .bss to page size if MOD0 section doesn't exist + // Default .bss to NRO header bss size if MOD0 section doesn't exist + u32 bss_size{PageAlignSize(nro_header.bss_size)}; std::memcpy(&mod_header, program_image.data() + nro_header.module_header_offset, sizeof(ModHeader)); const bool has_mod_header{mod_header.magic == Common::MakeMagic('M', 'O', 'D', '0')}; if (has_mod_header) { // Resize program image to include .bss section and page align each section bss_size = PageAlignSize(mod_header.bss_end_offset - mod_header.bss_start_offset); - codeset->data.size += bss_size; } + codeset->data.size += bss_size; program_image.resize(PageAlignSize(static_cast<u32>(program_image.size()) + bss_size)); // Load codeset for current process @@ -134,9 +121,11 @@ ResultStatus AppLoader_NRO::Load(Kernel::SharedPtr<Kernel::Process>& process) { return ResultStatus::Error; } - // Load and relocate "main" and "sdk" NSO - static constexpr VAddr base_addr{Memory::PROCESS_IMAGE_VADDR}; process = Kernel::Process::Create("main"); + + // Load NRO + static constexpr VAddr base_addr{Memory::PROCESS_IMAGE_VADDR}; + if (!LoadNro(filepath, base_addr)) { return ResultStatus::ErrorInvalidFormat; } @@ -145,7 +134,7 @@ ResultStatus AppLoader_NRO::Load(Kernel::SharedPtr<Kernel::Process>& process) { process->address_mappings = default_address_mappings; process->resource_limit = Kernel::ResourceLimit::GetForCategory(Kernel::ResourceLimitCategory::APPLICATION); - process->Run(base_addr, 48, Kernel::DEFAULT_STACK_SIZE); + process->Run(base_addr + sizeof(NroHeader), 48, Kernel::DEFAULT_STACK_SIZE); is_loaded = true; return ResultStatus::Success; diff --git a/src/input_common/sdl/sdl.cpp b/src/input_common/sdl/sdl.cpp index 88b557c5d..3b87d6b65 100644 --- a/src/input_common/sdl/sdl.cpp +++ b/src/input_common/sdl/sdl.cpp @@ -425,7 +425,7 @@ std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> GetPollers( pollers.push_back(std::make_unique<SDLButtonPoller>()); break; } - return std::move(pollers); + return pollers; } } // namespace Polling } // namespace SDL diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 61d678c9b..b9dc4943a 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp @@ -15,8 +15,7 @@ #include "input_common/motion_emu.h" #include "yuzu/bootmanager.h" -EmuThread::EmuThread(GRenderWindow* render_window) - : exec_step(false), running(false), stop_run(false), render_window(render_window) {} +EmuThread::EmuThread(GRenderWindow* render_window) : render_window(render_window) {} void EmuThread::run() { render_window->MakeCurrent(); diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h index 6974edcbb..130bc613b 100644 --- a/src/yuzu/bootmanager.h +++ b/src/yuzu/bootmanager.h @@ -58,7 +58,7 @@ public: * @return True if the emulation thread is running, otherwise false * @note This function is thread-safe */ - bool IsRunning() { + bool IsRunning() const { return running; } @@ -68,12 +68,12 @@ public: void RequestStop() { stop_run = true; SetRunning(false); - }; + } private: - bool exec_step; - bool running; - std::atomic<bool> stop_run; + bool exec_step = false; + bool running = false; + std::atomic<bool> stop_run{false}; std::mutex running_mutex; std::condition_variable running_cv; diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index 679c89828..6d7c409d0 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp @@ -137,8 +137,8 @@ GameList::SearchField::SearchField(GameList* parent) : QWidget{parent} { * Checks if all words separated by spaces are contained in another string * This offers a word order insensitive search function * - * @param String that gets checked if it contains all words of the userinput string - * @param String containing all words getting checked + * @param haystack String that gets checked if it contains all words of the userinput string + * @param userinput String containing all words getting checked * @return true if the haystack contains all words of userinput */ bool GameList::containsAllWords(QString haystack, QString userinput) { diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h index 4823a1296..7aff597b7 100644 --- a/src/yuzu/game_list.h +++ b/src/yuzu/game_list.h @@ -49,7 +49,7 @@ public: QString edit_filter_text_old; protected: - bool eventFilter(QObject* obj, QEvent* event); + bool eventFilter(QObject* obj, QEvent* event) override; }; QHBoxLayout* layout_filter = nullptr; QTreeView* tree_view = nullptr; diff --git a/src/yuzu/hotkeys.cpp b/src/yuzu/hotkeys.cpp index 42f026464..61acb38ee 100644 --- a/src/yuzu/hotkeys.cpp +++ b/src/yuzu/hotkeys.cpp @@ -5,6 +5,7 @@ #include <map> #include <QKeySequence> #include <QShortcut> +#include <QTreeWidgetItem> #include <QtGlobal> #include "yuzu/hotkeys.h" #include "yuzu/ui_settings.h" |