summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/loader/nro.cpp9
-rw-r--r--src/core/loader/nso.cpp10
-rw-r--r--src/core/loader/nso.h2
-rw-r--r--src/yuzu/bootmanager.cpp14
4 files changed, 3 insertions, 32 deletions
diff --git a/src/core/loader/nro.cpp b/src/core/loader/nro.cpp
index a5d09512b..66c61b038 100644
--- a/src/core/loader/nro.cpp
+++ b/src/core/loader/nro.cpp
@@ -118,13 +118,6 @@ bool AppLoader_NRO::LoadNro(const std::string& path, VAddr load_base) {
118 } 118 }
119 program_image.resize(PageAlignSize(static_cast<u32>(program_image.size()) + bss_size)); 119 program_image.resize(PageAlignSize(static_cast<u32>(program_image.size()) + bss_size));
120 120
121 // Relocate symbols if there was a proper MOD header - This must happen after the image has been
122 // loaded into memory
123 if (has_mod_header) {
124 Relocate(program_image, nro_header.module_header_offset + mod_header.dynamic_offset,
125 load_base);
126 }
127
128 // Load codeset for current process 121 // Load codeset for current process
129 codeset->name = path; 122 codeset->name = path;
130 codeset->memory = std::make_shared<std::vector<u8>>(std::move(program_image)); 123 codeset->memory = std::make_shared<std::vector<u8>>(std::move(program_image));
@@ -154,8 +147,6 @@ ResultStatus AppLoader_NRO::Load(Kernel::SharedPtr<Kernel::Process>& process) {
154 Kernel::ResourceLimit::GetForCategory(Kernel::ResourceLimitCategory::APPLICATION); 147 Kernel::ResourceLimit::GetForCategory(Kernel::ResourceLimitCategory::APPLICATION);
155 process->Run(base_addr, 48, Kernel::DEFAULT_STACK_SIZE); 148 process->Run(base_addr, 48, Kernel::DEFAULT_STACK_SIZE);
156 149
157 ResolveImports();
158
159 is_loaded = true; 150 is_loaded = true;
160 return ResultStatus::Success; 151 return ResultStatus::Success;
161} 152}
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp
index ff96e129b..ef769dd91 100644
--- a/src/core/loader/nso.cpp
+++ b/src/core/loader/nso.cpp
@@ -88,7 +88,7 @@ static constexpr u32 PageAlignSize(u32 size) {
88 return (size + Memory::PAGE_MASK) & ~Memory::PAGE_MASK; 88 return (size + Memory::PAGE_MASK) & ~Memory::PAGE_MASK;
89} 89}
90 90
91VAddr AppLoader_NSO::LoadNso(const std::string& path, VAddr load_base, bool relocate) { 91VAddr AppLoader_NSO::LoadNso(const std::string& path, VAddr load_base) {
92 FileUtil::IOFile file(path, "rb"); 92 FileUtil::IOFile file(path, "rb");
93 if (!file.IsOpen()) { 93 if (!file.IsOpen()) {
94 return {}; 94 return {};
@@ -135,12 +135,6 @@ VAddr AppLoader_NSO::LoadNso(const std::string& path, VAddr load_base, bool relo
135 const u32 image_size{PageAlignSize(static_cast<u32>(program_image.size()) + bss_size)}; 135 const u32 image_size{PageAlignSize(static_cast<u32>(program_image.size()) + bss_size)};
136 program_image.resize(image_size); 136 program_image.resize(image_size);
137 137
138 // Relocate symbols if there was a proper MOD header - This must happen after the image has been
139 // loaded into memory
140 if (has_mod_header && relocate) {
141 Relocate(program_image, module_offset + mod_header.dynamic_offset, load_base);
142 }
143
144 // Load codeset for current process 138 // Load codeset for current process
145 codeset->name = path; 139 codeset->name = path;
146 codeset->memory = std::make_shared<std::vector<u8>>(std::move(program_image)); 140 codeset->memory = std::make_shared<std::vector<u8>>(std::move(program_image));
@@ -181,8 +175,6 @@ ResultStatus AppLoader_NSO::Load(Kernel::SharedPtr<Kernel::Process>& process) {
181 Kernel::ResourceLimit::GetForCategory(Kernel::ResourceLimitCategory::APPLICATION); 175 Kernel::ResourceLimit::GetForCategory(Kernel::ResourceLimitCategory::APPLICATION);
182 process->Run(Memory::PROCESS_IMAGE_VADDR, 48, Kernel::DEFAULT_STACK_SIZE); 176 process->Run(Memory::PROCESS_IMAGE_VADDR, 48, Kernel::DEFAULT_STACK_SIZE);
183 177
184 ResolveImports();
185
186 is_loaded = true; 178 is_loaded = true;
187 return ResultStatus::Success; 179 return ResultStatus::Success;
188} 180}
diff --git a/src/core/loader/nso.h b/src/core/loader/nso.h
index 03424e70d..a24bcdc24 100644
--- a/src/core/loader/nso.h
+++ b/src/core/loader/nso.h
@@ -34,7 +34,7 @@ public:
34 ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) override; 34 ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) override;
35 35
36private: 36private:
37 VAddr LoadNso(const std::string& path, VAddr load_base, bool relocate = false); 37 VAddr LoadNso(const std::string& path, VAddr load_base);
38 38
39 std::string filepath; 39 std::string filepath;
40}; 40};
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index 843ac6ad7..61d678c9b 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -1,12 +1,8 @@
1#include <QApplication> 1#include <QApplication>
2#include <QHBoxLayout> 2#include <QHBoxLayout>
3#include <QKeyEvent> 3#include <QKeyEvent>
4
5#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
6// Required for screen DPI information
7#include <QScreen> 4#include <QScreen>
8#include <QWindow> 5#include <QWindow>
9#endif
10 6
11#include "common/microprofile.h" 7#include "common/microprofile.h"
12#include "common/scm_rev.h" 8#include "common/scm_rev.h"
@@ -120,15 +116,13 @@ GRenderWindow::~GRenderWindow() {
120 116
121void GRenderWindow::moveContext() { 117void GRenderWindow::moveContext() {
122 DoneCurrent(); 118 DoneCurrent();
123// We need to move GL context to the swapping thread in Qt5 119
124#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
125 // If the thread started running, move the GL Context to the new thread. Otherwise, move it 120 // If the thread started running, move the GL Context to the new thread. Otherwise, move it
126 // back. 121 // back.
127 auto thread = (QThread::currentThread() == qApp->thread() && emu_thread != nullptr) 122 auto thread = (QThread::currentThread() == qApp->thread() && emu_thread != nullptr)
128 ? emu_thread 123 ? emu_thread
129 : qApp->thread(); 124 : qApp->thread();
130 child->context()->moveToThread(thread); 125 child->context()->moveToThread(thread);
131#endif
132} 126}
133 127
134void GRenderWindow::SwapBuffers() { 128void GRenderWindow::SwapBuffers() {
@@ -191,12 +185,8 @@ QByteArray GRenderWindow::saveGeometry() {
191} 185}
192 186
193qreal GRenderWindow::windowPixelRatio() { 187qreal GRenderWindow::windowPixelRatio() {
194#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
195 // windowHandle() might not be accessible until the window is displayed to screen. 188 // windowHandle() might not be accessible until the window is displayed to screen.
196 return windowHandle() ? windowHandle()->screen()->devicePixelRatio() : 1.0f; 189 return windowHandle() ? windowHandle()->screen()->devicePixelRatio() : 1.0f;
197#else
198 return 1.0f;
199#endif
200} 190}
201 191
202void GRenderWindow::closeEvent(QCloseEvent* event) { 192void GRenderWindow::closeEvent(QCloseEvent* event) {
@@ -299,9 +289,7 @@ void GRenderWindow::OnEmulationStopping() {
299void GRenderWindow::showEvent(QShowEvent* event) { 289void GRenderWindow::showEvent(QShowEvent* event) {
300 QWidget::showEvent(event); 290 QWidget::showEvent(event);
301 291
302#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
303 // windowHandle() is not initialized until the Window is shown, so we connect it here. 292 // windowHandle() is not initialized until the Window is shown, so we connect it here.
304 connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this, 293 connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this,
305 SLOT(OnFramebufferSizeChanged()), Qt::UniqueConnection); 294 SLOT(OnFramebufferSizeChanged()), Qt::UniqueConnection);
306#endif
307} 295}