summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/CMakeLists.txt5
-rw-r--r--src/core/hle/ipc.h4
-rw-r--r--src/core/hle/ipc_helpers.h4
-rw-r--r--src/core/hle/kernel/hle_ipc.cpp34
-rw-r--r--src/core/hle/kernel/hle_ipc.h6
-rw-r--r--src/core/hle/service/am/applet_oe.cpp86
-rw-r--r--src/core/hle/service/lm/lm.cpp7
-rw-r--r--src/core/hle/service/service.cpp2
-rw-r--r--src/core/hle/service/sockets/bsd_u.cpp67
-rw-r--r--src/core/hle/service/sockets/bsd_u.h29
-rw-r--r--src/core/hle/service/sockets/sfdnsres.h22
-rw-r--r--src/core/hle/service/sockets/sockets.cpp18
-rw-r--r--src/core/hle/service/sockets/sockets.h16
-rw-r--r--src/yuzu/bootmanager.cpp4
-rw-r--r--src/yuzu/configuration/configure.ui2
-rw-r--r--src/yuzu/configuration/configure_input.ui132
-rw-r--r--src/yuzu/debugger/profiler.cpp5
-rw-r--r--src/yuzu/game_list.cpp5
-rw-r--r--src/yuzu/main.cpp46
-rw-r--r--src/yuzu/util/spinbox.cpp2
20 files changed, 391 insertions, 105 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 98fd2a4cc..57f578bae 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -128,6 +128,11 @@ add_library(core STATIC
hle/service/sm/controller.h
hle/service/sm/sm.cpp
hle/service/sm/sm.h
+ hle/service/sockets/bsd_u.cpp
+ hle/service/sockets/bsd_u.h
+ hle/service/sockets/sfdnsres.h
+ hle/service/sockets/sockets.cpp
+ hle/service/sockets/sockets.h
hle/service/time/time.cpp
hle/service/time/time.h
hle/service/time/time_s.cpp
diff --git a/src/core/hle/ipc.h b/src/core/hle/ipc.h
index 1840fac12..0dcaede67 100644
--- a/src/core/hle/ipc.h
+++ b/src/core/hle/ipc.h
@@ -133,6 +133,10 @@ struct BufferDescriptorC {
address |= static_cast<VAddr>(address_bits_32_47) << 32;
return address;
}
+
+ u64 Size() const {
+ return static_cast<u64>(size);
+ }
};
static_assert(sizeof(BufferDescriptorC) == 8, "BufferDescriptorC size is incorrect");
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h
index 25530a3c8..4c9b0de28 100644
--- a/src/core/hle/ipc_helpers.h
+++ b/src/core/hle/ipc_helpers.h
@@ -54,6 +54,10 @@ public:
unsigned GetCurrentOffset() const {
return static_cast<unsigned>(index);
}
+
+ void SetCurrentOffset(unsigned offset) {
+ index = static_cast<ptrdiff_t>(offset);
+ }
};
class RequestBuilder : public RequestHelperBase {
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp
index ac62a0d5a..73bb6a8be 100644
--- a/src/core/hle/kernel/hle_ipc.cpp
+++ b/src/core/hle/kernel/hle_ipc.cpp
@@ -81,13 +81,8 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) {
for (unsigned i = 0; i < command_header->num_buf_w_descriptors; ++i) {
buffer_w_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>());
}
- if (command_header->buf_c_descriptor_flags !=
- IPC::CommandHeader::BufferDescriptorCFlag::Disabled) {
- if (command_header->buf_c_descriptor_flags !=
- IPC::CommandHeader::BufferDescriptorCFlag::OneDescriptor) {
- UNIMPLEMENTED();
- }
- }
+
+ buffer_c_offset = rp.GetCurrentOffset() + command_header->data_size;
// Padding to align to 16 bytes
rp.AlignWithPadding();
@@ -117,6 +112,31 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) {
ASSERT(data_payload_header->magic == Common::MakeMagic('S', 'F', 'C', 'O'));
}
+ rp.SetCurrentOffset(buffer_c_offset);
+
+ // For Inline buffers, the response data is written directly to buffer_c_offset
+ // and in this case we don't have any BufferDescriptorC on the request.
+ if (command_header->buf_c_descriptor_flags >
+ IPC::CommandHeader::BufferDescriptorCFlag::InlineDescriptor) {
+ if (command_header->buf_c_descriptor_flags ==
+ IPC::CommandHeader::BufferDescriptorCFlag::OneDescriptor) {
+ buffer_c_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorC>());
+ } else {
+ unsigned num_buf_c_descriptors =
+ static_cast<unsigned>(command_header->buf_c_descriptor_flags.Value()) - 2;
+
+ // This is used to detect possible underflows, in case something is broken
+ // with the two ifs above and the flags value is == 0 || == 1.
+ ASSERT(num_buf_c_descriptors < 14);
+
+ for (unsigned i = 0; i < num_buf_c_descriptors; ++i) {
+ buffer_c_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorC>());
+ }
+ }
+ }
+
+ rp.SetCurrentOffset(data_payload_offset);
+
command = rp.Pop<u32_le>();
rp.Skip(1, false); // The command is actually an u64, but we don't use the high part.
}
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h
index 6dceb766d..80fa48d7f 100644
--- a/src/core/hle/kernel/hle_ipc.h
+++ b/src/core/hle/kernel/hle_ipc.h
@@ -143,6 +143,10 @@ public:
return buffer_b_desciptors;
}
+ const std::vector<IPC::BufferDescriptorC>& BufferDescriptorC() const {
+ return buffer_c_desciptors;
+ }
+
const std::unique_ptr<IPC::DomainMessageHeader>& GetDomainMessageHeader() const {
return domain_message_header;
}
@@ -200,8 +204,10 @@ private:
std::vector<IPC::BufferDescriptorABW> buffer_a_desciptors;
std::vector<IPC::BufferDescriptorABW> buffer_b_desciptors;
std::vector<IPC::BufferDescriptorABW> buffer_w_desciptors;
+ std::vector<IPC::BufferDescriptorC> buffer_c_desciptors;
unsigned data_payload_offset{};
+ unsigned buffer_c_offset{};
u32_le command{};
};
diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cpp
index b360e7e5f..0d7f9c03d 100644
--- a/src/core/hle/service/am/applet_oe.cpp
+++ b/src/core/hle/service/am/applet_oe.cpp
@@ -201,10 +201,76 @@ private:
Kernel::SharedPtr<Kernel::Event> event;
};
+class IStorageAccessor final : public ServiceFramework<IStorageAccessor> {
+public:
+ explicit IStorageAccessor(std::vector<u8> buffer)
+ : ServiceFramework("IStorageAccessor"), buffer(std::move(buffer)) {
+ static const FunctionInfo functions[] = {
+ {0, &IStorageAccessor::GetSize, "GetSize"},
+ {11, &IStorageAccessor::Read, "Read"},
+ };
+ RegisterHandlers(functions);
+ }
+
+private:
+ std::vector<u8> buffer;
+
+ void GetSize(Kernel::HLERequestContext& ctx) {
+ IPC::RequestBuilder rb{ctx, 4};
+
+ rb.Push(RESULT_SUCCESS);
+ rb.Push(static_cast<u64>(buffer.size()));
+
+ LOG_DEBUG(Service, "called");
+ }
+
+ void Read(Kernel::HLERequestContext& ctx) {
+ IPC::RequestParser rp{ctx};
+
+ u64 offset = rp.Pop<u64>();
+
+ const auto& output_buffer = ctx.BufferDescriptorC()[0];
+
+ ASSERT(offset + output_buffer.Size() <= buffer.size());
+
+ Memory::WriteBlock(output_buffer.Address(), buffer.data() + offset, output_buffer.Size());
+
+ IPC::RequestBuilder rb{ctx, 2};
+
+ rb.Push(RESULT_SUCCESS);
+
+ LOG_DEBUG(Service, "called");
+ }
+};
+
+class IStorage final : public ServiceFramework<IStorage> {
+public:
+ explicit IStorage(std::vector<u8> buffer)
+ : ServiceFramework("IStorage"), buffer(std::move(buffer)) {
+ static const FunctionInfo functions[] = {
+ {0, &IStorage::Open, "Open"},
+ };
+ RegisterHandlers(functions);
+ }
+
+private:
+ std::vector<u8> buffer;
+
+ void Open(Kernel::HLERequestContext& ctx) {
+ IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+
+ rb.Push(RESULT_SUCCESS);
+ rb.PushIpcInterface<AM::IStorageAccessor>(buffer);
+
+ LOG_DEBUG(Service, "called");
+ }
+};
+
class IApplicationFunctions final : public ServiceFramework<IApplicationFunctions> {
public:
IApplicationFunctions() : ServiceFramework("IApplicationFunctions") {
static const FunctionInfo functions[] = {
+ {1, &IApplicationFunctions::PopLaunchParameter, "PopLaunchParameter"},
{22, &IApplicationFunctions::SetTerminateResult, "SetTerminateResult"},
{66, &IApplicationFunctions::InitializeGamePlayRecording,
"InitializeGamePlayRecording"},
@@ -215,6 +281,26 @@ public:
}
private:
+ void PopLaunchParameter(Kernel::HLERequestContext& ctx) {
+ constexpr u8 data[0x88] = {
+ 0xca, 0x97, 0x94, 0xc7, // Magic
+ 1, 0, 0, 0, // IsAccountSelected (bool)
+ 1, 0, 0, 0, // User Id (word 0)
+ 0, 0, 0, 0, // User Id (word 1)
+ 0, 0, 0, 0, // User Id (word 2)
+ 0, 0, 0, 0 // User Id (word 3)
+ };
+
+ std::vector<u8> buffer(data, data + sizeof(data));
+
+ IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+
+ rb.Push(RESULT_SUCCESS);
+ rb.PushIpcInterface<AM::IStorage>(buffer);
+
+ LOG_DEBUG(Service, "called");
+ }
+
void SetTerminateResult(Kernel::HLERequestContext& ctx) {
// Takes an input u32 Result, no output.
// For example, in some cases official apps use this with error 0x2A2 then uses svcBreak.
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp
index 2d0d2fb65..13c9ee3d3 100644
--- a/src/core/hle/service/lm/lm.cpp
+++ b/src/core/hle/service/lm/lm.cpp
@@ -47,6 +47,7 @@ private:
/// Log field type
enum class Field : u8 {
+ Skip = 1,
Message = 2,
Line = 3,
Filename = 4,
@@ -85,6 +86,11 @@ private:
while (addr < end_addr) {
const Field field{static_cast<Field>(Memory::Read8(addr++))};
size_t length{Memory::Read8(addr++)};
+
+ if (static_cast<Field>(Memory::Read8(addr)) == Field::Skip) {
+ ++addr;
+ }
+
switch (field) {
case Field::Message:
message = Memory::ReadCString(addr, length);
@@ -99,6 +105,7 @@ private:
function = Memory::ReadCString(addr, length);
break;
}
+
addr += length;
}
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index fe76b381c..9a49d9e9c 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -26,6 +26,7 @@
#include "core/hle/service/service.h"
#include "core/hle/service/sm/controller.h"
#include "core/hle/service/sm/sm.h"
+#include "core/hle/service/sockets/sockets.h"
#include "core/hle/service/time/time.h"
#include "core/hle/service/vi/vi.h"
@@ -174,6 +175,7 @@ void Init() {
LM::InstallInterfaces(*SM::g_service_manager);
Nvidia::InstallInterfaces(*SM::g_service_manager);
PCTL::InstallInterfaces(*SM::g_service_manager);
+ Sockets::InstallInterfaces(*SM::g_service_manager);
Time::InstallInterfaces(*SM::g_service_manager);
VI::InstallInterfaces(*SM::g_service_manager);
diff --git a/src/core/hle/service/sockets/bsd_u.cpp b/src/core/hle/service/sockets/bsd_u.cpp
new file mode 100644
index 000000000..a819acc96
--- /dev/null
+++ b/src/core/hle/service/sockets/bsd_u.cpp
@@ -0,0 +1,67 @@
+// Copyright 2018 yuzu emulator team
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#include "core/hle/ipc_helpers.h"
+#include "core/hle/service/sockets/bsd_u.h"
+
+namespace Service {
+namespace Sockets {
+
+void BSD_U::RegisterClient(Kernel::HLERequestContext& ctx) {
+ LOG_WARNING(Service, "(STUBBED) called");
+
+ IPC::RequestBuilder rb{ctx, 3};
+
+ rb.Push(RESULT_SUCCESS);
+ rb.Push<u32>(0); // bsd errno
+}
+
+void BSD_U::Socket(Kernel::HLERequestContext& ctx) {
+ IPC::RequestParser rp{ctx};
+
+ u32 domain = rp.Pop<u32>();
+ u32 type = rp.Pop<u32>();
+ u32 protocol = rp.Pop<u32>();
+
+ LOG_WARNING(Service, "(STUBBED) called domain=%u type=%u protocol=%u", domain, type, protocol);
+
+ u32 fd = next_fd++;
+
+ IPC::RequestBuilder rb{ctx, 4};
+
+ rb.Push(RESULT_SUCCESS);
+ rb.Push<u32>(fd);
+ rb.Push<u32>(0); // bsd errno
+}
+
+void BSD_U::Connect(Kernel::HLERequestContext& ctx) {
+ LOG_WARNING(Service, "(STUBBED) called");
+
+ IPC::RequestBuilder rb{ctx, 4};
+
+ rb.Push(RESULT_SUCCESS);
+ rb.Push<u32>(0); // ret
+ rb.Push<u32>(0); // bsd errno
+}
+
+void BSD_U::SendTo(Kernel::HLERequestContext& ctx) {
+ LOG_WARNING(Service, "(STUBBED) called");
+
+ IPC::RequestBuilder rb{ctx, 4};
+
+ rb.Push(RESULT_SUCCESS);
+ rb.Push<u32>(0); // ret
+ rb.Push<u32>(0); // bsd errno
+}
+
+BSD_U::BSD_U() : ServiceFramework("bsd:u") {
+ static const FunctionInfo functions[] = {{0, &BSD_U::RegisterClient, "RegisterClient"},
+ {2, &BSD_U::Socket, "Socket"},
+ {11, &BSD_U::SendTo, "SendTo"},
+ {14, &BSD_U::Connect, "Connect"}};
+ RegisterHandlers(functions);
+}
+
+} // namespace Sockets
+} // namespace Service
diff --git a/src/core/hle/service/sockets/bsd_u.h b/src/core/hle/service/sockets/bsd_u.h
new file mode 100644
index 000000000..1fe96d850
--- /dev/null
+++ b/src/core/hle/service/sockets/bsd_u.h
@@ -0,0 +1,29 @@
+// Copyright 2018 yuzu emulator team
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include "core/hle/kernel/hle_ipc.h"
+#include "core/hle/service/service.h"
+
+namespace Service {
+namespace Sockets {
+
+class BSD_U final : public ServiceFramework<BSD_U> {
+public:
+ BSD_U();
+ ~BSD_U() = default;
+
+private:
+ void RegisterClient(Kernel::HLERequestContext& ctx);
+ void Socket(Kernel::HLERequestContext& ctx);
+ void Connect(Kernel::HLERequestContext& ctx);
+ void SendTo(Kernel::HLERequestContext& ctx);
+
+ /// Id to use for the next open file descriptor.
+ u32 next_fd = 1;
+};
+
+} // namespace Sockets
+} // namespace Service
diff --git a/src/core/hle/service/sockets/sfdnsres.h b/src/core/hle/service/sockets/sfdnsres.h
new file mode 100644
index 000000000..32a3ac8c5
--- /dev/null
+++ b/src/core/hle/service/sockets/sfdnsres.h
@@ -0,0 +1,22 @@
+// Copyright 2018 yuzu emulator team
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include "core/hle/kernel/hle_ipc.h"
+#include "core/hle/service/service.h"
+
+namespace Service {
+namespace Sockets {
+
+class SFDNSRES final : public ServiceFramework<SFDNSRES> {
+public:
+ SFDNSRES() : ServiceFramework("sfdnsres") {}
+ ~SFDNSRES() = default;
+
+private:
+};
+
+} // namespace Sockets
+} // namespace Service
diff --git a/src/core/hle/service/sockets/sockets.cpp b/src/core/hle/service/sockets/sockets.cpp
new file mode 100644
index 000000000..f1396eaa1
--- /dev/null
+++ b/src/core/hle/service/sockets/sockets.cpp
@@ -0,0 +1,18 @@
+// Copyright 2018 yuzu emulator team
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#include "core/hle/service/sockets/bsd_u.h"
+#include "core/hle/service/sockets/sfdnsres.h"
+#include "core/hle/service/sockets/sockets.h"
+
+namespace Service {
+namespace Sockets {
+
+void InstallInterfaces(SM::ServiceManager& service_manager) {
+ std::make_shared<BSD_U>()->InstallAsService(service_manager);
+ std::make_shared<SFDNSRES>()->InstallAsService(service_manager);
+}
+
+} // namespace Sockets
+} // namespace Service
diff --git a/src/core/hle/service/sockets/sockets.h b/src/core/hle/service/sockets/sockets.h
new file mode 100644
index 000000000..7e89c8d2c
--- /dev/null
+++ b/src/core/hle/service/sockets/sockets.h
@@ -0,0 +1,16 @@
+// Copyright 2018 yuzu emulator team
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include "core/hle/service/service.h"
+
+namespace Service {
+namespace Sockets {
+
+/// Registers all Sockets services with the specified service manager.
+void InstallInterfaces(SM::ServiceManager& service_manager);
+
+} // namespace Sockets
+} // namespace Service
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index b9dc4943a..469988d63 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -289,6 +289,6 @@ void GRenderWindow::showEvent(QShowEvent* event) {
QWidget::showEvent(event);
// windowHandle() is not initialized until the Window is shown, so we connect it here.
- connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this,
- SLOT(OnFramebufferSizeChanged()), Qt::UniqueConnection);
+ connect(windowHandle(), &QWindow::screenChanged, this, &GRenderWindow::OnFramebufferSizeChanged,
+ Qt::UniqueConnection);
}
diff --git a/src/yuzu/configuration/configure.ui b/src/yuzu/configuration/configure.ui
index babd583a2..c5303851c 100644
--- a/src/yuzu/configuration/configure.ui
+++ b/src/yuzu/configuration/configure.ui
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
- <width>740</width>
+ <width>461</width>
<height>500</height>
</rect>
</property>
diff --git a/src/yuzu/configuration/configure_input.ui b/src/yuzu/configuration/configure_input.ui
index c162ca02c..377b79c77 100644
--- a/src/yuzu/configuration/configure_input.ui
+++ b/src/yuzu/configuration/configure_input.ui
@@ -15,9 +15,9 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
- <layout class="QGridLayout" name="gridLayout_7">
+ <layout class="QGridLayout" name="buttons">
<item row="3" column="1">
- <widget class="QGroupBox" name="faceButtons_6">
+ <widget class="QGroupBox" name="misc">
<property name="title">
<string>Misc.</string>
</property>
@@ -29,9 +29,9 @@
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
- <layout class="QVBoxLayout" name="verticalLayout_25">
+ <layout class="QVBoxLayout" name="buttonMiscPlusVerticalLayout">
<item>
- <widget class="QLabel" name="label_29">
+ <widget class="QLabel" name="labelPlus">
<property name="text">
<string>Plus:</string>
</property>
@@ -47,9 +47,9 @@
</layout>
</item>
<item row="0" column="1">
- <layout class="QVBoxLayout" name="verticalLayout_26">
+ <layout class="QVBoxLayout" name="buttonMiscMinusVerticalLayout">
<item>
- <widget class="QLabel" name="label_30">
+ <widget class="QLabel" name="labelMinus">
<property name="text">
<string>Minus:</string>
</property>
@@ -65,9 +65,9 @@
</layout>
</item>
<item row="1" column="0">
- <layout class="QVBoxLayout" name="verticalLayout_27">
+ <layout class="QVBoxLayout" name="buttonMiscHomeVerticalLayout">
<item>
- <widget class="QLabel" name="label_31">
+ <widget class="QLabel" name="labelHome">
<property name="text">
<string>Home:</string>
</property>
@@ -83,9 +83,9 @@
</layout>
</item>
<item row="1" column="1">
- <layout class="QVBoxLayout" name="verticalLayout_28">
+ <layout class="QVBoxLayout" name="buttonMiscScrCapVerticalLayout">
<item>
- <widget class="QLabel" name="label_11">
+ <widget class="QLabel" name="labelScrCap">
<property name="text">
<string>Screen
Capture:</string>
@@ -130,9 +130,9 @@ Capture:</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
- <layout class="QVBoxLayout" name="verticalLayout">
+ <layout class="QVBoxLayout" name="buttonFaceButtonsAVerticalLayout">
<item>
- <widget class="QLabel" name="label">
+ <widget class="QLabel" name="labelA">
<property name="text">
<string>A:</string>
</property>
@@ -148,9 +148,9 @@ Capture:</string>
</layout>
</item>
<item row="0" column="1">
- <layout class="QVBoxLayout" name="verticalLayout_2">
+ <layout class="QVBoxLayout" name="buttonFaceButtonsBVerticalLayout">
<item>
- <widget class="QLabel" name="label_2">
+ <widget class="QLabel" name="labelB">
<property name="text">
<string>B:</string>
</property>
@@ -166,9 +166,9 @@ Capture:</string>
</layout>
</item>
<item row="1" column="0">
- <layout class="QVBoxLayout" name="verticalLayout_3">
+ <layout class="QVBoxLayout" name="buttonFaceButtonsXVerticalLayout">
<item>
- <widget class="QLabel" name="label_3">
+ <widget class="QLabel" name="labelX">
<property name="text">
<string>X:</string>
</property>
@@ -184,9 +184,9 @@ Capture:</string>
</layout>
</item>
<item row="1" column="1">
- <layout class="QVBoxLayout" name="verticalLayout_4">
+ <layout class="QVBoxLayout" name="buttonFaceButtonsYVerticalLayout">
<item>
- <widget class="QLabel" name="label_4">
+ <widget class="QLabel" name="labelY">
<property name="text">
<string>Y:</string>
</property>
@@ -205,7 +205,7 @@ Capture:</string>
</widget>
</item>
<item row="0" column="1">
- <widget class="QGroupBox" name="faceButtons_2">
+ <widget class="QGroupBox" name="Dpad">
<property name="title">
<string>Directional Pad</string>
</property>
@@ -217,9 +217,9 @@ Capture:</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0">
- <layout class="QVBoxLayout" name="verticalLayout_12">
+ <layout class="QVBoxLayout" name="buttonDpadUpVerticalLayout">
<item>
- <widget class="QLabel" name="label_34">
+ <widget class="QLabel" name="labelDpadUp">
<property name="text">
<string>Up:</string>
</property>
@@ -235,9 +235,9 @@ Capture:</string>
</layout>
</item>
<item row="1" column="1">
- <layout class="QVBoxLayout" name="verticalLayout_9">
+ <layout class="QVBoxLayout" name="buttonDpadDownVerticalLayout">
<item>
- <widget class="QLabel" name="label_35">
+ <widget class="QLabel" name="labelDpadDown">
<property name="text">
<string>Down:</string>
</property>
@@ -253,9 +253,9 @@ Capture:</string>
</layout>
</item>
<item row="0" column="0">
- <layout class="QVBoxLayout" name="verticalLayout_10">
+ <layout class="QVBoxLayout" name="buttonDpadLeftVerticalLayout">
<item>
- <widget class="QLabel" name="label_32">
+ <widget class="QLabel" name="labelDpadLeft">
<property name="text">
<string>Left:</string>
</property>
@@ -271,9 +271,9 @@ Capture:</string>
</layout>
</item>
<item row="0" column="1">
- <layout class="QVBoxLayout" name="verticalLayout_11">
+ <layout class="QVBoxLayout" name="buttonDpadRightVerticalLayout">
<item>
- <widget class="QLabel" name="label_33">
+ <widget class="QLabel" name="labelDpadRight">
<property name="text">
<string>Right:</string>
</property>
@@ -292,7 +292,7 @@ Capture:</string>
</widget>
</item>
<item row="3" column="0">
- <widget class="QGroupBox" name="faceButtons_3">
+ <widget class="QGroupBox" name="shoulderButtons">
<property name="title">
<string>Shoulder Buttons</string>
</property>
@@ -304,9 +304,9 @@ Capture:</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
- <layout class="QVBoxLayout" name="verticalLayout_13">
+ <layout class="QVBoxLayout" name="buttonShoulderButtonsLVerticalLayout">
<item>
- <widget class="QLabel" name="label_17">
+ <widget class="QLabel" name="labelL">
<property name="text">
<string>L:</string>
</property>
@@ -322,9 +322,9 @@ Capture:</string>
</layout>
</item>
<item row="0" column="1">
- <layout class="QVBoxLayout" name="verticalLayout_14">
+ <layout class="QVBoxLayout" name="buttonShoulderButtonsRVerticalLayout">
<item>
- <widget class="QLabel" name="label_19">
+ <widget class="QLabel" name="labelR">
<property name="text">
<string>R:</string>
</property>
@@ -340,9 +340,9 @@ Capture:</string>
</layout>
</item>
<item row="1" column="0">
- <layout class="QVBoxLayout" name="verticalLayout_15">
+ <layout class="QVBoxLayout" name="buttonShoulderButtonsZLVerticalLayout">
<item>
- <widget class="QLabel" name="label_20">
+ <widget class="QLabel" name="labelZL">
<property name="text">
<string>ZL:</string>
</property>
@@ -358,9 +358,9 @@ Capture:</string>
</layout>
</item>
<item row="1" column="1">
- <layout class="QVBoxLayout" name="verticalLayout_16">
+ <layout class="QVBoxLayout" name="buttonShoulderButtonsZRVerticalLayout">
<item>
- <widget class="QLabel" name="label_18">
+ <widget class="QLabel" name="labelZR">
<property name="text">
<string>ZR:</string>
</property>
@@ -376,9 +376,9 @@ Capture:</string>
</layout>
</item>
<item row="2" column="0">
- <layout class="QVBoxLayout" name="verticalLayout_8">
+ <layout class="QVBoxLayout" name="buttonShoulderButtonsSLVerticalLayout">
<item>
- <widget class="QLabel" name="label_7">
+ <widget class="QLabel" name="labelSL">
<property name="text">
<string>SL:</string>
</property>
@@ -394,9 +394,9 @@ Capture:</string>
</layout>
</item>
<item row="2" column="1">
- <layout class="QVBoxLayout" name="verticalLayout_29">
+ <layout class="QVBoxLayout" name="buttonShoulderButtonsSRVerticalLayout">
<item>
- <widget class="QLabel" name="label_8">
+ <widget class="QLabel" name="labelSR">
<property name="text">
<string>SR:</string>
</property>
@@ -415,7 +415,7 @@ Capture:</string>
</widget>
</item>
<item row="1" column="1">
- <widget class="QGroupBox" name="faceButtons_5">
+ <widget class="QGroupBox" name="RStick">
<property name="title">
<string>Right Stick</string>
</property>
@@ -430,9 +430,9 @@ Capture:</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="1" column="1">
- <layout class="QVBoxLayout" name="verticalLayout_24">
+ <layout class="QVBoxLayout" name="buttonRStickDownVerticalLayout">
<item>
- <widget class="QLabel" name="label_26">
+ <widget class="QLabel" name="labelRStickDown">
<property name="text">
<string>Down:</string>
</property>
@@ -448,9 +448,9 @@ Capture:</string>
</layout>
</item>
<item row="0" column="1">
- <layout class="QVBoxLayout" name="verticalLayout_22">
+ <layout class="QVBoxLayout" name="buttonRStickRightVerticalLayout">
<item>
- <widget class="QLabel" name="label_27">
+ <widget class="QLabel" name="labelRStickRight">
<property name="text">
<string>Right:</string>
</property>
@@ -473,9 +473,9 @@ Capture:</string>
</widget>
</item>
<item row="1" column="0">
- <layout class="QVBoxLayout" name="verticalLayout_21">
+ <layout class="QVBoxLayout" name="buttonRStickLeftVerticalLayout">
<item>
- <widget class="QLabel" name="label_25">
+ <widget class="QLabel" name="labelRStickLeft">
<property name="text">
<string>Left:</string>
</property>
@@ -491,9 +491,9 @@ Capture:</string>
</layout>
</item>
<item row="0" column="0">
- <layout class="QVBoxLayout" name="verticalLayout_25">
+ <layout class="QVBoxLayout" name="buttonRStickUpVerticalLayout">
<item>
- <widget class="QLabel" name="label_28">
+ <widget class="QLabel" name="labelRStickUp">
<property name="text">
<string>Up:</string>
</property>
@@ -509,9 +509,9 @@ Capture:</string>
</layout>
</item>
<item row="2" column="0">
- <layout class="QVBoxLayout" name="verticalLayout_6">
+ <layout class="QVBoxLayout" name="buttonRStickPressedVerticalLayout">
<item>
- <widget class="QLabel" name="label_5">
+ <widget class="QLabel" name="labelRStickPressed">
<property name="text">
<string>Pressed:</string>
</property>
@@ -527,9 +527,9 @@ Capture:</string>
</layout>
</item>
<item row="2" column="1">
- <layout class="QVBoxLayout" name="verticalLayout_32">
+ <layout class="QVBoxLayout" name="buttonRStickModVerticalLayout">
<item>
- <widget class="QLabel" name="label_10">
+ <widget class="QLabel" name="labelRStickMod">
<property name="text">
<string>Modifier:</string>
</property>
@@ -548,7 +548,7 @@ Capture:</string>
</widget>
</item>
<item row="1" column="0">
- <widget class="QGroupBox" name="faceButtons_4">
+ <widget class="QGroupBox" name="LStick">
<property name="title">
<string>Left Stick</string>
</property>
@@ -560,9 +560,9 @@ Capture:</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="1" column="1">
- <layout class="QVBoxLayout" name="verticalLayout_20">
+ <layout class="QVBoxLayout" name="buttonLStickDownVerticalLayout">
<item>
- <widget class="QLabel" name="label_22">
+ <widget class="QLabel" name="labelLStickDown">
<property name="text">
<string>Down:</string>
</property>
@@ -585,9 +585,9 @@ Capture:</string>
</widget>
</item>
<item row="0" column="1">
- <layout class="QVBoxLayout" name="verticalLayout_18">
+ <layout class="QVBoxLayout" name="buttonLStickRightVerticalLayout">
<item>
- <widget class="QLabel" name="label_23">
+ <widget class="QLabel" name="labelLStickRight">
<property name="text">
<string>Right:</string>
</property>
@@ -603,9 +603,9 @@ Capture:</string>
</layout>
</item>
<item row="0" column="0">
- <layout class="QVBoxLayout" name="verticalLayout_17">
+ <layout class="QVBoxLayout" name="buttonLStickLeftVerticalLayout">
<item>
- <widget class="QLabel" name="label_21">
+ <widget class="QLabel" name="labelLStickLeft">
<property name="text">
<string>Left:</string>
</property>
@@ -621,9 +621,9 @@ Capture:</string>
</layout>
</item>
<item row="1" column="0">
- <layout class="QVBoxLayout" name="verticalLayout_19">
+ <layout class="QVBoxLayout" name="buttonLStickUpVerticalLayout">
<item>
- <widget class="QLabel" name="label_24">
+ <widget class="QLabel" name="labelLStickUp">
<property name="text">
<string>Up:</string>
</property>
@@ -639,9 +639,9 @@ Capture:</string>
</layout>
</item>
<item row="3" column="0">
- <layout class="QVBoxLayout" name="verticalLayout_31">
+ <layout class="QVBoxLayout" name="buttonLStickModVerticalLayout">
<item>
- <widget class="QLabel" name="label_9">
+ <widget class="QLabel" name="labelLStickMod">
<property name="text">
<string>Modifier:</string>
</property>
@@ -657,9 +657,9 @@ Capture:</string>
</layout>
</item>
<item row="3" column="1">
- <layout class="QVBoxLayout" name="verticalLayout_7" stretch="0,0">
+ <layout class="QVBoxLayout" name="buttonLStickPressedVerticalLayout" stretch="0,0">
<item>
- <widget class="QLabel" name="label_6">
+ <widget class="QLabel" name="labelLStickPressed">
<property name="text">
<string>Pressed:</string>
</property>
diff --git a/src/yuzu/debugger/profiler.cpp b/src/yuzu/debugger/profiler.cpp
index cc9babe84..8b30e0a85 100644
--- a/src/yuzu/debugger/profiler.cpp
+++ b/src/yuzu/debugger/profiler.cpp
@@ -74,7 +74,7 @@ QAction* MicroProfileDialog::toggleViewAction() {
toggle_view_action = new QAction(windowTitle(), this);
toggle_view_action->setCheckable(true);
toggle_view_action->setChecked(isVisible());
- connect(toggle_view_action, SIGNAL(toggled(bool)), SLOT(setVisible(bool)));
+ connect(toggle_view_action, &QAction::toggled, this, &MicroProfileDialog::setVisible);
}
return toggle_view_action;
@@ -107,7 +107,8 @@ MicroProfileWidget::MicroProfileWidget(QWidget* parent) : QWidget(parent) {
MicroProfileSetDisplayMode(1); // Timers screen
MicroProfileInitUI();
- connect(&update_timer, SIGNAL(timeout()), SLOT(update()));
+ connect(&update_timer, &QTimer::timeout, this,
+ static_cast<void (MicroProfileWidget::*)()>(&MicroProfileWidget::update));
}
void MicroProfileWidget::paintEvent(QPaintEvent* ev) {
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index 6d7c409d0..76ced4de4 100644
--- a/src/yuzu/game_list.cpp
+++ b/src/yuzu/game_list.cpp
@@ -114,8 +114,7 @@ GameList::SearchField::SearchField(GameList* parent) : QWidget{parent} {
edit_filter->setPlaceholderText(tr("Enter pattern to filter"));
edit_filter->installEventFilter(keyReleaseEater);
edit_filter->setClearButtonEnabled(true);
- connect(edit_filter, SIGNAL(textChanged(const QString&)), parent,
- SLOT(onTextChanged(const QString&)));
+ connect(edit_filter, &QLineEdit::textChanged, parent, &GameList::onTextChanged);
label_filter_result = new QLabel;
button_filter_close = new QToolButton(this);
button_filter_close->setText("X");
@@ -124,7 +123,7 @@ GameList::SearchField::SearchField(GameList* parent) : QWidget{parent} {
"#000000; font-weight: bold; background: #F0F0F0; }"
"QToolButton:hover{ border: none; padding: 0px; color: "
"#EEEEEE; font-weight: bold; background: #E81123}");
- connect(button_filter_close, SIGNAL(clicked()), parent, SLOT(onFilterCloseClicked()));
+ connect(button_filter_close, &QToolButton::clicked, parent, &GameList::onFilterCloseClicked);
layout_filter->setSpacing(10);
layout_filter->addWidget(label_filter);
layout_filter->addWidget(edit_filter);
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 31f2825ee..e5252abdc 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -175,7 +175,7 @@ void GMainWindow::InitializeRecentFileMenuActions() {
for (int i = 0; i < max_recent_files_item; ++i) {
actions_recent_files[i] = new QAction(this);
actions_recent_files[i]->setVisible(false);
- connect(actions_recent_files[i], SIGNAL(triggered()), this, SLOT(OnMenuRecentFile()));
+ connect(actions_recent_files[i], &QAction::triggered, this, &GMainWindow::OnMenuRecentFile);
ui.menu_recent_files->addAction(actions_recent_files[i]);
}
@@ -190,10 +190,10 @@ void GMainWindow::InitializeHotkeys() {
RegisterHotkey("Main Window", "Exit Fullscreen", QKeySequence::Cancel, Qt::ApplicationShortcut);
LoadHotkeys();
- connect(GetHotkey("Main Window", "Load File", this), SIGNAL(activated()), this,
- SLOT(OnMenuLoadFile()));
- connect(GetHotkey("Main Window", "Start Emulation", this), SIGNAL(activated()), this,
- SLOT(OnStartGame()));
+ connect(GetHotkey("Main Window", "Load File", this), &QShortcut::activated, this,
+ &GMainWindow::OnMenuLoadFile);
+ connect(GetHotkey("Main Window", "Start Emulation", this), &QShortcut::activated, this,
+ &GMainWindow::OnStartGame);
connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activated,
ui.action_Fullscreen, &QAction::trigger);
connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activatedAmbiguously,
@@ -245,13 +245,14 @@ void GMainWindow::RestoreUIState() {
}
void GMainWindow::ConnectWidgetEvents() {
- connect(game_list, SIGNAL(GameChosen(QString)), this, SLOT(OnGameListLoadFile(QString)));
- connect(game_list, SIGNAL(OpenSaveFolderRequested(u64)), this,
- SLOT(OnGameListOpenSaveFolder(u64)));
+ connect(game_list, &GameList::GameChosen, this, &GMainWindow::OnGameListLoadFile);
+ connect(game_list, &GameList::OpenSaveFolderRequested, this,
+ &GMainWindow::OnGameListOpenSaveFolder);
- connect(this, SIGNAL(EmulationStarting(EmuThread*)), render_window,
- SLOT(OnEmulationStarting(EmuThread*)));
- connect(this, SIGNAL(EmulationStopping()), render_window, SLOT(OnEmulationStopping()));
+ connect(this, &GMainWindow::EmulationStarting, render_window,
+ &GRenderWindow::OnEmulationStarting);
+ connect(this, &GMainWindow::EmulationStopping, render_window,
+ &GRenderWindow::OnEmulationStopping);
connect(&status_bar_update_timer, &QTimer::timeout, this, &GMainWindow::UpdateStatusBar);
}
@@ -398,17 +399,17 @@ void GMainWindow::BootGame(const QString& filename) {
render_window->moveContext();
emu_thread->start();
- connect(render_window, SIGNAL(Closed()), this, SLOT(OnStopGame()));
+ connect(render_window, &GRenderWindow::Closed, this, &GMainWindow::OnStopGame);
// BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views
// before the CPU continues
- connect(emu_thread.get(), SIGNAL(DebugModeEntered()), registersWidget,
- SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection);
- connect(emu_thread.get(), SIGNAL(DebugModeEntered()), waitTreeWidget,
- SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection);
- connect(emu_thread.get(), SIGNAL(DebugModeLeft()), registersWidget, SLOT(OnDebugModeLeft()),
- Qt::BlockingQueuedConnection);
- connect(emu_thread.get(), SIGNAL(DebugModeLeft()), waitTreeWidget, SLOT(OnDebugModeLeft()),
- Qt::BlockingQueuedConnection);
+ connect(emu_thread.get(), &EmuThread::DebugModeEntered, registersWidget,
+ &RegistersWidget::OnDebugModeEntered, Qt::BlockingQueuedConnection);
+ connect(emu_thread.get(), &EmuThread::DebugModeEntered, waitTreeWidget,
+ &WaitTreeWidget::OnDebugModeEntered, Qt::BlockingQueuedConnection);
+ connect(emu_thread.get(), &EmuThread::DebugModeLeft, registersWidget,
+ &RegistersWidget::OnDebugModeLeft, Qt::BlockingQueuedConnection);
+ connect(emu_thread.get(), &EmuThread::DebugModeLeft, waitTreeWidget,
+ &WaitTreeWidget::OnDebugModeLeft, Qt::BlockingQueuedConnection);
// Update the GUI
registersWidget->OnDebugModeEntered();
@@ -437,7 +438,7 @@ void GMainWindow::ShutdownGame() {
emu_thread = nullptr;
// The emulation is stopped, so closing the window or not does not matter anymore
- disconnect(render_window, SIGNAL(Closed()), this, SLOT(OnStopGame()));
+ disconnect(render_window, &GRenderWindow::Closed, this, &GMainWindow::OnStopGame);
// Update the GUI
ui.action_Start->setEnabled(false);
@@ -548,8 +549,7 @@ void GMainWindow::OnStartGame() {
emu_thread->SetRunning(true);
qRegisterMetaType<Core::System::ResultStatus>("Core::System::ResultStatus");
qRegisterMetaType<std::string>("std::string");
- connect(emu_thread.get(), SIGNAL(ErrorThrown(Core::System::ResultStatus, std::string)), this,
- SLOT(OnCoreError(Core::System::ResultStatus, std::string)));
+ connect(emu_thread.get(), &EmuThread::ErrorThrown, this, &GMainWindow::OnCoreError);
ui.action_Start->setEnabled(false);
ui.action_Start->setText(tr("Continue"));
diff --git a/src/yuzu/util/spinbox.cpp b/src/yuzu/util/spinbox.cpp
index 92753ec1c..14ef1e884 100644
--- a/src/yuzu/util/spinbox.cpp
+++ b/src/yuzu/util/spinbox.cpp
@@ -39,7 +39,7 @@ CSpinBox::CSpinBox(QWidget* parent)
// TODO: Might be nice to not immediately call the slot.
// Think of an address that is being replaced by a different one, in which case a lot
// invalid intermediate addresses would be read from during editing.
- connect(lineEdit(), SIGNAL(textEdited(QString)), this, SLOT(OnEditingFinished()));
+ connect(lineEdit(), &QLineEdit::textEdited, this, &CSpinBox::OnEditingFinished);
UpdateText();
}