summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-12-28 18:20:29 -0500
committerGravatar Zach Hilman2018-12-28 18:20:29 -0500
commitcb930c4b5a3f8f3931ba93ef35d4000558ffa79e (patch)
treeb897717a33fc0ba28134be25a9ba52e84b21d122 /src
parentcmake: Add USE_QT_WEB_ENGINE flag and update build system (diff)
downloadyuzu-cb930c4b5a3f8f3931ba93ef35d4000558ffa79e.tar.gz
yuzu-cb930c4b5a3f8f3931ba93ef35d4000558ffa79e.tar.xz
yuzu-cb930c4b5a3f8f3931ba93ef35d4000558ffa79e.zip
web_browser: Add bounds checking to applet interface
Diffstat (limited to 'src')
-rw-r--r--src/core/core.cpp5
-rw-r--r--src/core/hle/service/am/applets/web_browser.cpp14
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp6
-rw-r--r--src/core/hle/service/hid/controllers/npad.h2
-rw-r--r--src/core/hle/service/hid/hid.cpp244
-rw-r--r--src/core/loader/nsp.h1
-rw-r--r--src/core/loader/xci.h1
-rw-r--r--src/yuzu/applets/web_browser.cpp18
-rw-r--r--src/yuzu/applets/web_browser.h10
-rw-r--r--src/yuzu/main.h5
10 files changed, 160 insertions, 146 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 373dff2e6..715172771 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -203,6 +203,11 @@ struct System::Impl {
203 // Close app loader 203 // Close app loader
204 app_loader.reset(); 204 app_loader.reset();
205 205
206 // Clear all applets
207 profile_selector.reset();
208 software_keyboard.reset();
209 web_browser.reset();
210
206 LOG_DEBUG(Core, "Shutdown OK"); 211 LOG_DEBUG(Core, "Shutdown OK");
207 } 212 }
208 213
diff --git a/src/core/hle/service/am/applets/web_browser.cpp b/src/core/hle/service/am/applets/web_browser.cpp
index 53118324b..d975207f5 100644
--- a/src/core/hle/service/am/applets/web_browser.cpp
+++ b/src/core/hle/service/am/applets/web_browser.cpp
@@ -49,17 +49,20 @@ static_assert(sizeof(WebArgumentResult) == 0x1010, "WebArgumentResult has incorr
49 49
50static std::vector<u8> GetArgumentDataForTagType(const std::vector<u8>& data, u16 type) { 50static std::vector<u8> GetArgumentDataForTagType(const std::vector<u8>& data, u16 type) {
51 WebBufferHeader header; 51 WebBufferHeader header;
52 ASSERT(sizeof(WebBufferHeader) <= data.size());
52 std::memcpy(&header, data.data(), sizeof(WebBufferHeader)); 53 std::memcpy(&header, data.data(), sizeof(WebBufferHeader));
53 54
54 u64 offset = sizeof(WebBufferHeader); 55 u64 offset = sizeof(WebBufferHeader);
55 for (u16 i = 0; i < header.count; ++i) { 56 for (u16 i = 0; i < header.count; ++i) {
56 WebArgumentHeader arg; 57 WebArgumentHeader arg;
58 ASSERT(offset + sizeof(WebArgumentHeader) <= data.size());
57 std::memcpy(&arg, data.data() + offset, sizeof(WebArgumentHeader)); 59 std::memcpy(&arg, data.data() + offset, sizeof(WebArgumentHeader));
58 offset += sizeof(WebArgumentHeader); 60 offset += sizeof(WebArgumentHeader);
59 61
60 if (arg.type == type) { 62 if (arg.type == type) {
61 std::vector<u8> out(arg.size); 63 std::vector<u8> out(arg.size);
62 offset += arg.offset; 64 offset += arg.offset;
65 ASSERT(offset + arg.size <= data.size());
63 std::memcpy(out.data(), data.data() + offset, out.size()); 66 std::memcpy(out.data(), data.data() + offset, out.size());
64 return out; 67 return out;
65 } 68 }
@@ -91,19 +94,17 @@ WebBrowser::WebBrowser() = default;
91WebBrowser::~WebBrowser() = default; 94WebBrowser::~WebBrowser() = default;
92 95
93void WebBrowser::Initialize() { 96void WebBrowser::Initialize() {
97 Applet::Initialize();
98
94 complete = false; 99 complete = false;
95 temporary_dir.clear(); 100 temporary_dir.clear();
96 filename.clear(); 101 filename.clear();
97 status = RESULT_SUCCESS; 102 status = RESULT_SUCCESS;
98 103
99 Applet::Initialize();
100
101 const auto web_arg_storage = broker.PopNormalDataToApplet(); 104 const auto web_arg_storage = broker.PopNormalDataToApplet();
102 ASSERT(web_arg_storage != nullptr); 105 ASSERT(web_arg_storage != nullptr);
103 const auto& web_arg = web_arg_storage->GetData(); 106 const auto& web_arg = web_arg_storage->GetData();
104 107
105 LOG_CRITICAL(Service_AM, "{}", Common::HexVectorToString(web_arg));
106
107 const auto url_data = GetArgumentDataForTagType(web_arg, WEB_ARGUMENT_URL_TYPE); 108 const auto url_data = GetArgumentDataForTagType(web_arg, WEB_ARGUMENT_URL_TYPE);
108 filename = Common::StringFromFixedZeroTerminatedBuffer( 109 filename = Common::StringFromFixedZeroTerminatedBuffer(
109 reinterpret_cast<const char*>(url_data.data()), url_data.size()); 110 reinterpret_cast<const char*>(url_data.data()), url_data.size());
@@ -133,7 +134,7 @@ ResultCode WebBrowser::GetStatus() const {
133} 134}
134 135
135void WebBrowser::ExecuteInteractive() { 136void WebBrowser::ExecuteInteractive() {
136 UNIMPLEMENTED_MSG(Service_AM, "Unexpected interactive data recieved!"); 137 UNIMPLEMENTED_MSG("Unexpected interactive data recieved!");
137} 138}
138 139
139void WebBrowser::Execute() { 140void WebBrowser::Execute() {
@@ -147,8 +148,7 @@ void WebBrowser::Execute() {
147 148
148 const auto& frontend{Core::System::GetInstance().GetWebBrowser()}; 149 const auto& frontend{Core::System::GetInstance().GetWebBrowser()};
149 150
150 frontend.OpenPage( 151 frontend.OpenPage(filename, [this] { UnpackRomFS(); }, [this] { Finalize(); });
151 filename, [this] { UnpackRomFS(); }, [this] { Finalize(); });
152} 152}
153 153
154void WebBrowser::UnpackRomFS() { 154void WebBrowser::UnpackRomFS() {
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index 2829f64e9..04c8c35a8 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -638,10 +638,8 @@ void Controller_NPad::ClearAllControllers() {
638 }); 638 });
639} 639}
640 640
641u32 Controller_NPad::GetPressState() { 641u32 Controller_NPad::GetAndResetPressState() {
642 const auto res = press_state; 642 return std::exchange(press_state, 0);
643 press_state = 0;
644 return res;
645} 643}
646 644
647bool Controller_NPad::IsControllerSupported(NPadControllerType controller) const { 645bool Controller_NPad::IsControllerSupported(NPadControllerType controller) const {
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h
index 6906d9ffb..106cf58c8 100644
--- a/src/core/hle/service/hid/controllers/npad.h
+++ b/src/core/hle/service/hid/controllers/npad.h
@@ -126,7 +126,7 @@ public:
126 126
127 // Logical OR for all buttons presses on all controllers 127 // Logical OR for all buttons presses on all controllers
128 // Specifically for cheat engine and other features. 128 // Specifically for cheat engine and other features.
129 u32 GetPressState(); 129 u32 GetAndResetPressState();
130 130
131 static std::size_t NPadIdToIndex(u32 npad_id); 131 static std::size_t NPadIdToIndex(u32 npad_id);
132 static u32 IndexToNPad(std::size_t index); 132 static u32 IndexToNPad(std::size_t index);
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index acb4152a4..008bf3f02 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -136,131 +136,135 @@ private:
136}; 136};
137 137
138std::shared_ptr<IAppletResource> Hid::GetAppletResource() { 138std::shared_ptr<IAppletResource> Hid::GetAppletResource() {
139 if (applet_resource == nullptr) {
140 applet_resource = std::make_shared<IAppletResource>();
141 }
142
139 return applet_resource; 143 return applet_resource;
140} 144}
141 145
142Hid::Hid() : ServiceFramework("hid") { 146Hid::Hid() : ServiceFramework("hid") {
143 // clang-format off 147 // clang-format off
144 static const FunctionInfo functions[] = { 148 static const FunctionInfo functions[] = {
145 {0, &Hid::CreateAppletResource, "CreateAppletResource"}, 149 {0, &Hid::CreateAppletResource, "CreateAppletResource"},
146 {1, &Hid::ActivateDebugPad, "ActivateDebugPad"}, 150 {1, &Hid::ActivateDebugPad, "ActivateDebugPad"},
147 {11, &Hid::ActivateTouchScreen, "ActivateTouchScreen"}, 151 {11, &Hid::ActivateTouchScreen, "ActivateTouchScreen"},
148 {21, &Hid::ActivateMouse, "ActivateMouse"}, 152 {21, &Hid::ActivateMouse, "ActivateMouse"},
149 {31, &Hid::ActivateKeyboard, "ActivateKeyboard"}, 153 {31, &Hid::ActivateKeyboard, "ActivateKeyboard"},
150 {32, nullptr, "SendKeyboardLockKeyEvent"}, 154 {32, nullptr, "SendKeyboardLockKeyEvent"},
151 {40, nullptr, "AcquireXpadIdEventHandle"}, 155 {40, nullptr, "AcquireXpadIdEventHandle"},
152 {41, nullptr, "ReleaseXpadIdEventHandle"}, 156 {41, nullptr, "ReleaseXpadIdEventHandle"},
153 {51, &Hid::ActivateXpad, "ActivateXpad"}, 157 {51, &Hid::ActivateXpad, "ActivateXpad"},
154 {55, nullptr, "GetXpadIds"}, 158 {55, nullptr, "GetXpadIds"},
155 {56, nullptr, "ActivateJoyXpad"}, 159 {56, nullptr, "ActivateJoyXpad"},
156 {58, nullptr, "GetJoyXpadLifoHandle"}, 160 {58, nullptr, "GetJoyXpadLifoHandle"},
157 {59, nullptr, "GetJoyXpadIds"}, 161 {59, nullptr, "GetJoyXpadIds"},
158 {60, nullptr, "ActivateSixAxisSensor"}, 162 {60, nullptr, "ActivateSixAxisSensor"},
159 {61, nullptr, "DeactivateSixAxisSensor"}, 163 {61, nullptr, "DeactivateSixAxisSensor"},
160 {62, nullptr, "GetSixAxisSensorLifoHandle"}, 164 {62, nullptr, "GetSixAxisSensorLifoHandle"},
161 {63, nullptr, "ActivateJoySixAxisSensor"}, 165 {63, nullptr, "ActivateJoySixAxisSensor"},
162 {64, nullptr, "DeactivateJoySixAxisSensor"}, 166 {64, nullptr, "DeactivateJoySixAxisSensor"},
163 {65, nullptr, "GetJoySixAxisSensorLifoHandle"}, 167 {65, nullptr, "GetJoySixAxisSensorLifoHandle"},
164 {66, &Hid::StartSixAxisSensor, "StartSixAxisSensor"}, 168 {66, &Hid::StartSixAxisSensor, "StartSixAxisSensor"},
165 {67, &Hid::StopSixAxisSensor, "StopSixAxisSensor"}, 169 {67, &Hid::StopSixAxisSensor, "StopSixAxisSensor"},
166 {68, nullptr, "IsSixAxisSensorFusionEnabled"}, 170 {68, nullptr, "IsSixAxisSensorFusionEnabled"},
167 {69, nullptr, "EnableSixAxisSensorFusion"}, 171 {69, nullptr, "EnableSixAxisSensorFusion"},
168 {70, nullptr, "SetSixAxisSensorFusionParameters"}, 172 {70, nullptr, "SetSixAxisSensorFusionParameters"},
169 {71, nullptr, "GetSixAxisSensorFusionParameters"}, 173 {71, nullptr, "GetSixAxisSensorFusionParameters"},
170 {72, nullptr, "ResetSixAxisSensorFusionParameters"}, 174 {72, nullptr, "ResetSixAxisSensorFusionParameters"},
171 {73, nullptr, "SetAccelerometerParameters"}, 175 {73, nullptr, "SetAccelerometerParameters"},
172 {74, nullptr, "GetAccelerometerParameters"}, 176 {74, nullptr, "GetAccelerometerParameters"},
173 {75, nullptr, "ResetAccelerometerParameters"}, 177 {75, nullptr, "ResetAccelerometerParameters"},
174 {76, nullptr, "SetAccelerometerPlayMode"}, 178 {76, nullptr, "SetAccelerometerPlayMode"},
175 {77, nullptr, "GetAccelerometerPlayMode"}, 179 {77, nullptr, "GetAccelerometerPlayMode"},
176 {78, nullptr, "ResetAccelerometerPlayMode"}, 180 {78, nullptr, "ResetAccelerometerPlayMode"},
177 {79, &Hid::SetGyroscopeZeroDriftMode, "SetGyroscopeZeroDriftMode"}, 181 {79, &Hid::SetGyroscopeZeroDriftMode, "SetGyroscopeZeroDriftMode"},
178 {80, nullptr, "GetGyroscopeZeroDriftMode"}, 182 {80, nullptr, "GetGyroscopeZeroDriftMode"},
179 {81, nullptr, "ResetGyroscopeZeroDriftMode"}, 183 {81, nullptr, "ResetGyroscopeZeroDriftMode"},
180 {82, &Hid::IsSixAxisSensorAtRest, "IsSixAxisSensorAtRest"}, 184 {82, &Hid::IsSixAxisSensorAtRest, "IsSixAxisSensorAtRest"},
181 {83, nullptr, "IsFirmwareUpdateAvailableForSixAxisSensor"}, 185 {83, nullptr, "IsFirmwareUpdateAvailableForSixAxisSensor"},
182 {91, &Hid::ActivateGesture, "ActivateGesture"}, 186 {91, &Hid::ActivateGesture, "ActivateGesture"},
183 {100, &Hid::SetSupportedNpadStyleSet, "SetSupportedNpadStyleSet"}, 187 {100, &Hid::SetSupportedNpadStyleSet, "SetSupportedNpadStyleSet"},
184 {101, &Hid::GetSupportedNpadStyleSet, "GetSupportedNpadStyleSet"}, 188 {101, &Hid::GetSupportedNpadStyleSet, "GetSupportedNpadStyleSet"},
185 {102, &Hid::SetSupportedNpadIdType, "SetSupportedNpadIdType"}, 189 {102, &Hid::SetSupportedNpadIdType, "SetSupportedNpadIdType"},
186 {103, &Hid::ActivateNpad, "ActivateNpad"}, 190 {103, &Hid::ActivateNpad, "ActivateNpad"},
187 {104, nullptr, "DeactivateNpad"}, 191 {104, nullptr, "DeactivateNpad"},
188 {106, &Hid::AcquireNpadStyleSetUpdateEventHandle, "AcquireNpadStyleSetUpdateEventHandle"}, 192 {106, &Hid::AcquireNpadStyleSetUpdateEventHandle, "AcquireNpadStyleSetUpdateEventHandle"},
189 {107, &Hid::DisconnectNpad, "DisconnectNpad"}, 193 {107, &Hid::DisconnectNpad, "DisconnectNpad"},
190 {108, &Hid::GetPlayerLedPattern, "GetPlayerLedPattern"}, 194 {108, &Hid::GetPlayerLedPattern, "GetPlayerLedPattern"},
191 {109, &Hid::ActivateNpadWithRevision, "ActivateNpadWithRevision"}, 195 {109, &Hid::ActivateNpadWithRevision, "ActivateNpadWithRevision"},
192 {120, &Hid::SetNpadJoyHoldType, "SetNpadJoyHoldType"}, 196 {120, &Hid::SetNpadJoyHoldType, "SetNpadJoyHoldType"},
193 {121, &Hid::GetNpadJoyHoldType, "GetNpadJoyHoldType"}, 197 {121, &Hid::GetNpadJoyHoldType, "GetNpadJoyHoldType"},
194 {122, &Hid::SetNpadJoyAssignmentModeSingleByDefault, "SetNpadJoyAssignmentModeSingleByDefault"}, 198 {122, &Hid::SetNpadJoyAssignmentModeSingleByDefault, "SetNpadJoyAssignmentModeSingleByDefault"},
195 {123, nullptr, "SetNpadJoyAssignmentModeSingleByDefault"}, 199 {123, nullptr, "SetNpadJoyAssignmentModeSingleByDefault"},
196 {124, &Hid::SetNpadJoyAssignmentModeDual, "SetNpadJoyAssignmentModeDual"}, 200 {124, &Hid::SetNpadJoyAssignmentModeDual, "SetNpadJoyAssignmentModeDual"},
197 {125, &Hid::MergeSingleJoyAsDualJoy, "MergeSingleJoyAsDualJoy"}, 201 {125, &Hid::MergeSingleJoyAsDualJoy, "MergeSingleJoyAsDualJoy"},
198 {126, nullptr, "StartLrAssignmentMode"}, 202 {126, nullptr, "StartLrAssignmentMode"},
199 {127, nullptr, "StopLrAssignmentMode"}, 203 {127, nullptr, "StopLrAssignmentMode"},
200 {128, &Hid::SetNpadHandheldActivationMode, "SetNpadHandheldActivationMode"}, 204 {128, &Hid::SetNpadHandheldActivationMode, "SetNpadHandheldActivationMode"},
201 {129, nullptr, "GetNpadHandheldActivationMode"}, 205 {129, nullptr, "GetNpadHandheldActivationMode"},
202 {130, nullptr, "SwapNpadAssignment"}, 206 {130, nullptr, "SwapNpadAssignment"},
203 {131, nullptr, "IsUnintendedHomeButtonInputProtectionEnabled"}, 207 {131, nullptr, "IsUnintendedHomeButtonInputProtectionEnabled"},
204 {132, nullptr, "EnableUnintendedHomeButtonInputProtection"}, 208 {132, nullptr, "EnableUnintendedHomeButtonInputProtection"},
205 {133, nullptr, "SetNpadJoyAssignmentModeSingleWithDestination"}, 209 {133, nullptr, "SetNpadJoyAssignmentModeSingleWithDestination"},
206 {200, &Hid::GetVibrationDeviceInfo, "GetVibrationDeviceInfo"}, 210 {200, &Hid::GetVibrationDeviceInfo, "GetVibrationDeviceInfo"},
207 {201, &Hid::SendVibrationValue, "SendVibrationValue"}, 211 {201, &Hid::SendVibrationValue, "SendVibrationValue"},
208 {202, &Hid::GetActualVibrationValue, "GetActualVibrationValue"}, 212 {202, &Hid::GetActualVibrationValue, "GetActualVibrationValue"},
209 {203, &Hid::CreateActiveVibrationDeviceList, "CreateActiveVibrationDeviceList"}, 213 {203, &Hid::CreateActiveVibrationDeviceList, "CreateActiveVibrationDeviceList"},
210 {204, nullptr, "PermitVibration"}, 214 {204, nullptr, "PermitVibration"},
211 {205, nullptr, "IsVibrationPermitted"}, 215 {205, nullptr, "IsVibrationPermitted"},
212 {206, &Hid::SendVibrationValues, "SendVibrationValues"}, 216 {206, &Hid::SendVibrationValues, "SendVibrationValues"},
213 {207, nullptr, "SendVibrationGcErmCommand"}, 217 {207, nullptr, "SendVibrationGcErmCommand"},
214 {208, nullptr, "GetActualVibrationGcErmCommand"}, 218 {208, nullptr, "GetActualVibrationGcErmCommand"},
215 {209, &Hid::BeginPermitVibrationSession, "BeginPermitVibrationSession"}, 219 {209, &Hid::BeginPermitVibrationSession, "BeginPermitVibrationSession"},
216 {210, &Hid::EndPermitVibrationSession, "EndPermitVibrationSession"}, 220 {210, &Hid::EndPermitVibrationSession, "EndPermitVibrationSession"},
217 {300, &Hid::ActivateConsoleSixAxisSensor, "ActivateConsoleSixAxisSensor"}, 221 {300, &Hid::ActivateConsoleSixAxisSensor, "ActivateConsoleSixAxisSensor"},
218 {301, &Hid::StartConsoleSixAxisSensor, "StartConsoleSixAxisSensor"}, 222 {301, &Hid::StartConsoleSixAxisSensor, "StartConsoleSixAxisSensor"},
219 {302, nullptr, "StopConsoleSixAxisSensor"}, 223 {302, nullptr, "StopConsoleSixAxisSensor"},
220 {303, nullptr, "ActivateSevenSixAxisSensor"}, 224 {303, nullptr, "ActivateSevenSixAxisSensor"},
221 {304, nullptr, "StartSevenSixAxisSensor"}, 225 {304, nullptr, "StartSevenSixAxisSensor"},
222 {305, nullptr, "StopSevenSixAxisSensor"}, 226 {305, nullptr, "StopSevenSixAxisSensor"},
223 {306, nullptr, "InitializeSevenSixAxisSensor"}, 227 {306, nullptr, "InitializeSevenSixAxisSensor"},
224 {307, nullptr, "FinalizeSevenSixAxisSensor"}, 228 {307, nullptr, "FinalizeSevenSixAxisSensor"},
225 {308, nullptr, "SetSevenSixAxisSensorFusionStrength"}, 229 {308, nullptr, "SetSevenSixAxisSensorFusionStrength"},
226 {309, nullptr, "GetSevenSixAxisSensorFusionStrength"}, 230 {309, nullptr, "GetSevenSixAxisSensorFusionStrength"},
227 {310, nullptr, "ResetSevenSixAxisSensorTimestamp"}, 231 {310, nullptr, "ResetSevenSixAxisSensorTimestamp"},
228 {400, nullptr, "IsUsbFullKeyControllerEnabled"}, 232 {400, nullptr, "IsUsbFullKeyControllerEnabled"},
229 {401, nullptr, "EnableUsbFullKeyController"}, 233 {401, nullptr, "EnableUsbFullKeyController"},
230 {402, nullptr, "IsUsbFullKeyControllerConnected"}, 234 {402, nullptr, "IsUsbFullKeyControllerConnected"},
231 {403, nullptr, "HasBattery"}, 235 {403, nullptr, "HasBattery"},
232 {404, nullptr, "HasLeftRightBattery"}, 236 {404, nullptr, "HasLeftRightBattery"},
233 {405, nullptr, "GetNpadInterfaceType"}, 237 {405, nullptr, "GetNpadInterfaceType"},
234 {406, nullptr, "GetNpadLeftRightInterfaceType"}, 238 {406, nullptr, "GetNpadLeftRightInterfaceType"},
235 {500, nullptr, "GetPalmaConnectionHandle"}, 239 {500, nullptr, "GetPalmaConnectionHandle"},
236 {501, nullptr, "InitializePalma"}, 240 {501, nullptr, "InitializePalma"},
237 {502, nullptr, "AcquirePalmaOperationCompleteEvent"}, 241 {502, nullptr, "AcquirePalmaOperationCompleteEvent"},
238 {503, nullptr, "GetPalmaOperationInfo"}, 242 {503, nullptr, "GetPalmaOperationInfo"},
239 {504, nullptr, "PlayPalmaActivity"}, 243 {504, nullptr, "PlayPalmaActivity"},
240 {505, nullptr, "SetPalmaFrModeType"}, 244 {505, nullptr, "SetPalmaFrModeType"},
241 {506, nullptr, "ReadPalmaStep"}, 245 {506, nullptr, "ReadPalmaStep"},
242 {507, nullptr, "EnablePalmaStep"}, 246 {507, nullptr, "EnablePalmaStep"},
243 {508, nullptr, "ResetPalmaStep"}, 247 {508, nullptr, "ResetPalmaStep"},
244 {509, nullptr, "ReadPalmaApplicationSection"}, 248 {509, nullptr, "ReadPalmaApplicationSection"},
245 {510, nullptr, "WritePalmaApplicationSection"}, 249 {510, nullptr, "WritePalmaApplicationSection"},
246 {511, nullptr, "ReadPalmaUniqueCode"}, 250 {511, nullptr, "ReadPalmaUniqueCode"},
247 {512, nullptr, "SetPalmaUniqueCodeInvalid"}, 251 {512, nullptr, "SetPalmaUniqueCodeInvalid"},
248 {513, nullptr, "WritePalmaActivityEntry"}, 252 {513, nullptr, "WritePalmaActivityEntry"},
249 {514, nullptr, "WritePalmaRgbLedPatternEntry"}, 253 {514, nullptr, "WritePalmaRgbLedPatternEntry"},
250 {515, nullptr, "WritePalmaWaveEntry"}, 254 {515, nullptr, "WritePalmaWaveEntry"},
251 {516, nullptr, "SetPalmaDataBaseIdentificationVersion"}, 255 {516, nullptr, "SetPalmaDataBaseIdentificationVersion"},
252 {517, nullptr, "GetPalmaDataBaseIdentificationVersion"}, 256 {517, nullptr, "GetPalmaDataBaseIdentificationVersion"},
253 {518, nullptr, "SuspendPalmaFeature"}, 257 {518, nullptr, "SuspendPalmaFeature"},
254 {519, nullptr, "GetPalmaOperationResult"}, 258 {519, nullptr, "GetPalmaOperationResult"},
255 {520, nullptr, "ReadPalmaPlayLog"}, 259 {520, nullptr, "ReadPalmaPlayLog"},
256 {521, nullptr, "ResetPalmaPlayLog"}, 260 {521, nullptr, "ResetPalmaPlayLog"},
257 {522, &Hid::SetIsPalmaAllConnectable, "SetIsPalmaAllConnectable"}, 261 {522, &Hid::SetIsPalmaAllConnectable, "SetIsPalmaAllConnectable"},
258 {523, nullptr, "SetIsPalmaPairedConnectable"}, 262 {523, nullptr, "SetIsPalmaPairedConnectable"},
259 {524, nullptr, "PairPalma"}, 263 {524, nullptr, "PairPalma"},
260 {525, &Hid::SetPalmaBoostMode, "SetPalmaBoostMode"}, 264 {525, &Hid::SetPalmaBoostMode, "SetPalmaBoostMode"},
261 {1000, nullptr, "SetNpadCommunicationMode"}, 265 {1000, nullptr, "SetNpadCommunicationMode"},
262 {1001, nullptr, "GetNpadCommunicationMode"}, 266 {1001, nullptr, "GetNpadCommunicationMode"},
263 }; 267 };
264 // clang-format on 268 // clang-format on
265 269
266 RegisterHandlers(functions); 270 RegisterHandlers(functions);
diff --git a/src/core/loader/nsp.h b/src/core/loader/nsp.h
index 0841578d4..b6b309400 100644
--- a/src/core/loader/nsp.h
+++ b/src/core/loader/nsp.h
@@ -44,7 +44,6 @@ public:
44 ResultStatus ReadIcon(std::vector<u8>& buffer) override; 44 ResultStatus ReadIcon(std::vector<u8>& buffer) override;
45 ResultStatus ReadTitle(std::string& title) override; 45 ResultStatus ReadTitle(std::string& title) override;
46 ResultStatus ReadControlData(FileSys::NACP& nacp) override; 46 ResultStatus ReadControlData(FileSys::NACP& nacp) override;
47 ResultStatus ReadDeveloper(std::string& developer) override;
48 ResultStatus ReadManualRomFS(FileSys::VirtualFile& file) override; 47 ResultStatus ReadManualRomFS(FileSys::VirtualFile& file) override;
49 48
50private: 49private:
diff --git a/src/core/loader/xci.h b/src/core/loader/xci.h
index 3e6e19a44..e18531c93 100644
--- a/src/core/loader/xci.h
+++ b/src/core/loader/xci.h
@@ -44,7 +44,6 @@ public:
44 ResultStatus ReadIcon(std::vector<u8>& buffer) override; 44 ResultStatus ReadIcon(std::vector<u8>& buffer) override;
45 ResultStatus ReadTitle(std::string& title) override; 45 ResultStatus ReadTitle(std::string& title) override;
46 ResultStatus ReadControlData(FileSys::NACP& control) override; 46 ResultStatus ReadControlData(FileSys::NACP& control) override;
47 ResultStatus ReadDeveloper(std::string& developer) override;
48 ResultStatus ReadManualRomFS(FileSys::VirtualFile& file) override; 47 ResultStatus ReadManualRomFS(FileSys::VirtualFile& file) override;
49 48
50private: 49private:
diff --git a/src/yuzu/applets/web_browser.cpp b/src/yuzu/applets/web_browser.cpp
index e1a34bb5f..c59b7ade1 100644
--- a/src/yuzu/applets/web_browser.cpp
+++ b/src/yuzu/applets/web_browser.cpp
@@ -10,15 +10,17 @@
10#include "yuzu/applets/web_browser.h" 10#include "yuzu/applets/web_browser.h"
11#include "yuzu/main.h" 11#include "yuzu/main.h"
12 12
13#ifdef YUZU_USE_QT_WEB_ENGINE
14
13constexpr char NX_SHIM_INJECT_SCRIPT[] = R"( 15constexpr char NX_SHIM_INJECT_SCRIPT[] = R"(
14 window.nx = {}; 16 window.nx = {};
15 window.nx.playReport = {}; 17 window.nx.playReport = {};
16 window.nx.playReport.setCounterSetIdentifier = function () { 18 window.nx.playReport.setCounterSetIdentifier = function () {
17 console.log("nx.footer.setCounterSetIdentifier called - unimplemented"); 19 console.log("nx.playReport.setCounterSetIdentifier called - unimplemented");
18 }; 20 };
19 21
20 window.nx.playReport.incrementCounter = function () { 22 window.nx.playReport.incrementCounter = function () {
21 console.log("nx.footer.incrementCounter called - unimplemented"); 23 console.log("nx.playReport.incrementCounter called - unimplemented");
22 }; 24 };
23 25
24 window.nx.footer = {}; 26 window.nx.footer = {};
@@ -56,6 +58,12 @@ constexpr char NX_SHIM_INJECT_SCRIPT[] = R"(
56 }; 58 };
57)"; 59)";
58 60
61QString GetNXShimInjectionScript() {
62 return QString::fromStdString(NX_SHIM_INJECT_SCRIPT);
63}
64
65NXInputWebEngineView::NXInputWebEngineView(QWidget* parent) : QWebEngineView(parent) {}
66
59void NXInputWebEngineView::keyPressEvent(QKeyEvent* event) { 67void NXInputWebEngineView::keyPressEvent(QKeyEvent* event) {
60 parent()->event(event); 68 parent()->event(event);
61} 69}
@@ -64,11 +72,7 @@ void NXInputWebEngineView::keyReleaseEvent(QKeyEvent* event) {
64 parent()->event(event); 72 parent()->event(event);
65} 73}
66 74
67QString GetNXShimInjectionScript() { 75#endif
68 return QString::fromStdString(NX_SHIM_INJECT_SCRIPT);
69}
70
71NXInputWebEngineView::NXInputWebEngineView(QWidget* parent) : QWebEngineView(parent) {}
72 76
73QtWebBrowser::QtWebBrowser(GMainWindow& main_window) { 77QtWebBrowser::QtWebBrowser(GMainWindow& main_window) {
74 connect(this, &QtWebBrowser::MainWindowOpenPage, &main_window, &GMainWindow::WebBrowserOpenPage, 78 connect(this, &QtWebBrowser::MainWindowOpenPage, &main_window, &GMainWindow::WebBrowserOpenPage,
diff --git a/src/yuzu/applets/web_browser.h b/src/yuzu/applets/web_browser.h
index 74f6698be..bba273767 100644
--- a/src/yuzu/applets/web_browser.h
+++ b/src/yuzu/applets/web_browser.h
@@ -6,22 +6,30 @@
6 6
7#include <functional> 7#include <functional>
8#include <QObject> 8#include <QObject>
9
10#ifdef YUZU_USE_QT_WEB_ENGINE
9#include <QWebEngineView> 11#include <QWebEngineView>
12#endif
13
10#include "core/frontend/applets/web_browser.h" 14#include "core/frontend/applets/web_browser.h"
11 15
12class GMainWindow; 16class GMainWindow;
13 17
18#ifdef YUZU_USE_QT_WEB_ENGINE
19
14QString GetNXShimInjectionScript(); 20QString GetNXShimInjectionScript();
15 21
16class NXInputWebEngineView : public QWebEngineView { 22class NXInputWebEngineView : public QWebEngineView {
17public: 23public:
18 NXInputWebEngineView(QWidget* parent = nullptr); 24 explicit NXInputWebEngineView(QWidget* parent = nullptr);
19 25
20protected: 26protected:
21 void keyPressEvent(QKeyEvent* event) override; 27 void keyPressEvent(QKeyEvent* event) override;
22 void keyReleaseEvent(QKeyEvent* event) override; 28 void keyReleaseEvent(QKeyEvent* event) override;
23}; 29};
24 30
31#endif
32
25class QtWebBrowser final : public QObject, public Core::Frontend::WebBrowserApplet { 33class QtWebBrowser final : public QObject, public Core::Frontend::WebBrowserApplet {
26 Q_OBJECT 34 Q_OBJECT
27 35
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index 3af5fa1f3..8a0485de9 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -13,6 +13,7 @@
13 13
14#include "common/common_types.h" 14#include "common/common_types.h"
15#include "core/core.h" 15#include "core/core.h"
16#include "core/hle/service/acc/profile_manager.h"
16#include "ui_main.h" 17#include "ui_main.h"
17#include "yuzu/compatibility_list.h" 18#include "yuzu/compatibility_list.h"
18#include "yuzu/hotkeys.h" 19#include "yuzu/hotkeys.h"
@@ -39,10 +40,6 @@ class RegisteredCacheUnion;
39class VfsFilesystem; 40class VfsFilesystem;
40} // namespace FileSys 41} // namespace FileSys
41 42
42namespace Service::Account {
43struct UUID;
44} // namespace Service::Account
45
46namespace Tegra { 43namespace Tegra {
47class DebugContext; 44class DebugContext;
48} 45}