diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e33c5f..c494372 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -291,6 +291,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) # System imported libraries # ======================================================================= +add_subdirectory(externals) + # Enforce the search mode of non-required packages for better and shorter failure messages find_package(Boost 1.79.0 REQUIRED context) find_package(enet 1.3 MODULE) @@ -700,7 +702,6 @@ if (SUDACHI_USE_FASTER_LD AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") endif() endif() -add_subdirectory(externals) add_subdirectory(src) # Set sudachi project or sudachi-cmd project as default StartUp Project in Visual Studio depending on whether QT is enabled or not diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index a9855d5..aee1b11 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -596,6 +596,8 @@ add_library(core STATIC hle/service/caps/caps_types.h hle/service/caps/caps_u.cpp hle/service/caps/caps_u.h + hle/service/diag/diag.cpp + hle/service/diag/diag.h hle/service/cmif_serialization.h hle/service/cmif_types.h hle/service/erpt/erpt.cpp diff --git a/src/core/hle/service/diag/diag.cpp b/src/core/hle/service/diag/diag.cpp new file mode 100644 index 0000000..68a9e7f --- /dev/null +++ b/src/core/hle/service/diag/diag.cpp @@ -0,0 +1,55 @@ +#include "common/logging/log.h" +#include "core/core.h" +#include "core/hle/kernel/k_event.h" +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/diag/diag.h" +#include "core/hle/service/ipc_helpers.h" +#include "core/hle/service/kernel_helpers.h" +#include "core/hle/service/server_manager.h" +#include "core/hle/service/service.h" +#include "core/hle/service/sm/sm.h" + +namespace Service::Diag { + +class IDetailDriver final : public ServiceFramework { +public: + explicit IDetailDriver(Core::System& system_) : ServiceFramework{system_, "detail"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "LogImpl"}, + {1, nullptr, "AbortImpl"}, + {2, nullptr, "AbortImpl1"} + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +class IDiagDriver final : public ServiceFramework { +public: + explicit IDiagDriver(Core::System& system_) : ServiceFramework{system_, "diag"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetBacktrace"}, + {1, nullptr, "GetBacktrace1"}, + {2, nullptr, "GetSymbolName"}, + {3, nullptr, "GetRequiredBufferSizeForGetAllModuleInfo"}, + {4, nullptr, "GetAllModuleInfo"}, + {5, nullptr, "GetSymbolSize"} + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +void LoopProcess(Core::System& system) { + auto server_manager = std::make_unique(system); + + server_manager->RegisterNamedService("diag", std::make_shared(system)); + server_manager->RegisterNamedService("detail", std::make_shared(system)); + ServerManager::RunServer(std::move(server_manager)); +} + +} // namespace Service::Diag diff --git a/src/core/hle/service/diag/diag.h b/src/core/hle/service/diag/diag.h new file mode 100644 index 0000000..ad2d89b --- /dev/null +++ b/src/core/hle/service/diag/diag.h @@ -0,0 +1,15 @@ +#pragma once + +namespace Service::SM { +class ServiceManager; +} + +namespace Core { +class System; +} + +namespace Service::Diag { + +void LoopProcess(Core::System& system); + +} // namespace Service::Diag diff --git a/src/core/hle/service/services.cpp b/src/core/hle/service/services.cpp index 1f9575f..847d180 100644 --- a/src/core/hle/service/services.cpp +++ b/src/core/hle/service/services.cpp @@ -13,6 +13,7 @@ #include "core/hle/service/btdrv/btdrv.h" #include "core/hle/service/btm/btm.h" #include "core/hle/service/caps/caps.h" +#include "core/hle/service/diag/diag.h" #include "core/hle/service/erpt/erpt.h" #include "core/hle/service/es/es.h" #include "core/hle/service/eupld/eupld.h" @@ -80,6 +81,7 @@ Services::Services(std::shared_ptr& sm, Core::System& system kernel.RunOnHostCoreProcess("bsdsocket", [&] { Sockets::LoopProcess(system); }).detach(); kernel.RunOnHostCoreProcess("vi", [&, token] { VI::LoopProcess(system, token); }).detach(); + kernel.RunOnGuestCoreProcess("diag", [&] { Diag::LoopProcess(system); }); kernel.RunOnGuestCoreProcess("sm", [&] { SM::LoopProcess(system); }); kernel.RunOnGuestCoreProcess("account", [&] { Account::LoopProcess(system); }); kernel.RunOnGuestCoreProcess("am", [&] { AM::LoopProcess(system); }); diff --git a/src/core/hle/service/set/system_settings_server.cpp b/src/core/hle/service/set/system_settings_server.cpp index 6284a2d..8e1d9af 100644 --- a/src/core/hle/service/set/system_settings_server.cpp +++ b/src/core/hle/service/set/system_settings_server.cpp @@ -27,7 +27,7 @@ namespace Service::Set { namespace { constexpr u32 SETTINGS_VERSION{4u}; -constexpr auto SETTINGS_MAGIC = Common::MakeMagic('y', 'u', 'z', 'u', '_', 's', 'e', 't'); +constexpr auto SETTINGS_MAGIC = Common::MakeMagic('s', 'u', 'd', 'a', '_', 's', 'e', 't'); struct SettingsHeader { u64 magic; u32 version; diff --git a/src/sudachi/bootmanager.cpp b/src/sudachi/bootmanager.cpp index c63df6f..f35e7ca 100644 --- a/src/sudachi/bootmanager.cpp +++ b/src/sudachi/bootmanager.cpp @@ -736,19 +736,19 @@ void GRenderWindow::wheelEvent(QWheelEvent* event) { } void GRenderWindow::TouchBeginEvent(const QTouchEvent* event) { - QList touch_points = event->touchPoints(); + QList touch_points = event->points(); for (const auto& touch_point : touch_points) { - const auto [x, y] = ScaleTouch(touch_point.pos()); + const auto [x, y] = ScaleTouch(touch_point.position()); const auto [touch_x, touch_y] = MapToTouchScreen(x, y); input_subsystem->GetTouchScreen()->TouchPressed(touch_x, touch_y, touch_point.id()); } } void GRenderWindow::TouchUpdateEvent(const QTouchEvent* event) { - QList touch_points = event->touchPoints(); + QList touch_points = event->points(); input_subsystem->GetTouchScreen()->ClearActiveFlag(); for (const auto& touch_point : touch_points) { - const auto [x, y] = ScaleTouch(touch_point.pos()); + const auto [x, y] = ScaleTouch(touch_point.position()); const auto [touch_x, touch_y] = MapToTouchScreen(x, y); input_subsystem->GetTouchScreen()->TouchMoved(touch_x, touch_y, touch_point.id()); } diff --git a/src/sudachi/configuration/configure_touch_from_button.cpp b/src/sudachi/configuration/configure_touch_from_button.cpp index db3fa83..7cf5832 100644 --- a/src/sudachi/configuration/configure_touch_from_button.cpp +++ b/src/sudachi/configuration/configure_touch_from_button.cpp @@ -11,9 +11,9 @@ #include "common/settings.h" #include "core/frontend/framebuffer_layout.h" #include "input_common/main.h" -#include "ui_configure_touch_from_button.h" #include "sudachi/configuration/configure_touch_from_button.h" #include "sudachi/configuration/configure_touch_widget.h" +#include "ui_configure_touch_from_button.h" static QString GetKeyName(int key_code) { switch (key_code) { @@ -505,7 +505,7 @@ void TouchScreenPreview::mouseMoveEvent(QMouseEvent* event) { if (!coord_label) { return; } - const auto pos = MapToDeviceCoords(event->x(), event->y()); + const auto pos = MapToDeviceCoords(event->position().x(), event->position().y()); if (pos) { coord_label->setText(QStringLiteral("X: %1, Y: %2").arg(pos->x()).arg(pos->y())); } else { @@ -523,7 +523,7 @@ void TouchScreenPreview::mousePressEvent(QMouseEvent* event) { if (event->button() != Qt::MouseButton::LeftButton) { return; } - const auto pos = MapToDeviceCoords(event->x(), event->y()); + const auto pos = MapToDeviceCoords(event->position().x(), event->position().y()); if (pos) { emit DotAdded(*pos); } @@ -539,7 +539,7 @@ bool TouchScreenPreview::eventFilter(QObject* obj, QEvent* event) { emit DotSelected(obj->property(PropId).toInt()); drag_state.dot = qobject_cast(obj); - drag_state.start_pos = mouse_event->globalPos(); + drag_state.start_pos = mouse_event->globalPosition().toPoint(); return true; } case QEvent::Type::MouseMove: { @@ -548,14 +548,13 @@ bool TouchScreenPreview::eventFilter(QObject* obj, QEvent* event) { } const auto mouse_event = static_cast(event); if (!drag_state.active) { - drag_state.active = - (mouse_event->globalPos() - drag_state.start_pos).manhattanLength() >= - QApplication::startDragDistance(); + drag_state.active = (mouse_event->globalPosition().toPoint() - drag_state.start_pos) + .manhattanLength() >= QApplication::startDragDistance(); if (!drag_state.active) { break; } } - auto current_pos = mapFromGlobal(mouse_event->globalPos()); + auto current_pos = mapFromGlobal(mouse_event->globalPosition().toPoint()); current_pos.setX(std::clamp(current_pos.x(), contentsMargins().left(), contentsMargins().left() + contentsRect().width() - 1)); current_pos.setY(std::clamp(current_pos.y(), contentsMargins().top(), diff --git a/src/sudachi/configuration/configure_ui.cpp b/src/sudachi/configuration/configure_ui.cpp index cb660ae..179ace4 100644 --- a/src/sudachi/configuration/configure_ui.cpp +++ b/src/sudachi/configuration/configure_ui.cpp @@ -256,8 +256,8 @@ void ConfigureUi::InitializeLanguageComboBox() { locale.truncate(locale.lastIndexOf(QLatin1Char{'.'})); locale.remove(0, locale.lastIndexOf(QLatin1Char{'/'}) + 1); const QString lang = QLocale::languageToString(QLocale(locale).language()); - const QString country = QLocale::countryToString(QLocale(locale).country()); - ui->language_combobox->addItem(QStringLiteral("%1 (%2)").arg(lang, country), locale); + const QString territory = QLocale::territoryToString(QLocale(locale).territory()); + ui->language_combobox->addItem(QStringLiteral("%1 (%2)").arg(lang, territory), locale); } // Unlike other configuration changes, interface language changes need to be reflected on the diff --git a/src/sudachi/game_list.cpp b/src/sudachi/game_list.cpp index 363e557..eeaf6cd 100644 --- a/src/sudachi/game_list.cpp +++ b/src/sudachi/game_list.cpp @@ -235,7 +235,8 @@ void GameList::OnTextChanged(const QString& new_text) { file_path.mid(file_path.lastIndexOf(QLatin1Char{'/'}) + 1) + QLatin1Char{' '} + file_title; if (ContainsAllWords(file_name, edit_filter_text) || - (file_program_id.count() == 16 && file_program_id.contains(edit_filter_text))) { + (file_program_id.length() == 16 && + file_program_id.contains(edit_filter_text))) { tree_view->setRowHidden(j, folder_index, false); ++result_count; } else { diff --git a/src/sudachi/main.cpp b/src/sudachi/main.cpp index 149da0b..64a68e5 100644 --- a/src/sudachi/main.cpp +++ b/src/sudachi/main.cpp @@ -5245,8 +5245,8 @@ static void SetHighDPIAttributes() { Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); #endif - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); + // QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + // QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); } int main(int argc, char* argv[]) { diff --git a/src/sudachi/main.ui b/src/sudachi/main.ui index 820ef8f..cbbd02a 100644 --- a/src/sudachi/main.ui +++ b/src/sudachi/main.ui @@ -18,7 +18,7 @@ :/img/sudachi.ico:/img/sudachi.ico - QTabWidget::Rounded + QTabWidget::TabShape::Rounded true @@ -45,7 +45,7 @@ 0 0 1280 - 21 + 38 @@ -257,7 +257,7 @@ Con&figure... - QAction::PreferencesRole + QAction::MenuRole::PreferencesRole @@ -422,7 +422,7 @@ &Configure TAS... - QAction::NoRole + QAction::MenuRole::NoRole @@ -433,7 +433,7 @@ Configure C&urrent Game... - QAction::NoRole + QAction::MenuRole::NoRole