diff options
35 files changed, 125 insertions, 114 deletions
diff --git a/.gitmodules b/.gitmodules index 07479dd78..d5a7ade4f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -19,3 +19,6 @@  [submodule "lz4"]      path = externals/lz4      url = http://github.com/lz4/lz4.git +[submodule "unicorn"] +    path = externals/unicorn +    url = https://github.com/yuzu-emu/unicorn diff --git a/.travis.yml b/.travis.yml index 8bad23208..2051d225c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ matrix:  deploy:    provider: releases    api_key: -    secure: Mck15DIWaJdxDiS3aYVlM9N3G6y8VKUI1rnwII7/iolfm1s94U+tgvbheZDmT7SSbFyaGaYO/E8HrV/uZR9Vvs7ev20sHsTN1u60OTWfDIIyHs9SqjhcGbtq95m9/dMFschOYqTOR+gAs5BsxjuoeAotHdhpQEwvkO2oo5oR0zhGy45gjFnVvtcxT/IfpZBIpVgcK3aLb9zT6ekcJbSiPmEB15iLq3xXd0nFUNtEZdX3D6Veye4n5jB6n72qN8JVoKvPZAwaC2K0pZxpcGJaXDchLsw1q+4eCvdz6UJfUemeQ/uMAmjfeQ3wrzYGXe3nCM3WmX5wosCsB0mw4zYatzl3si6CZ1W+0GkV4Rwlx03dfp7v3EeFhTsXYCaXqhwuLZnWOLUik8t9vaSoFUx4nUIRwfO9kAMUJQSpLuHNO2nT01s3GxvqxzczuLQ9he5nGSi0RRodUzDwek1qUp6I4uV3gRHKz4B07YIc1i2fK88NLXjyQ0uLVZ+7Oq1+kgDp6+N7vvXXZ5qZ17tdaysSbKEE0Y8zsoXw7Rk1tPN19vrCS+TSpomNMyQyne1k+I5iZ/qkxPTLAS5qI6Utc2dL3GJdxWRAEfGNO9AIX3GV/jmmKfdcvwGsCYP8hxqs5vLYfgacw3D8NLf1941lQUwavC17jm9EV9g5G3Pn1Cp516E= +    secure: IuTT8DjxzNgOtaEsyOpz1JaSmtDtHSsWZnJKmSBwXAzgP2ZU4Ja3/q0z5PwbC5Ql7kuFahuYTE5oi7lbJBuu2P3y1Wj2zvFozGUkA3JUvEXDNOPS9QTJ1EYd6O+wenZoj7d/Pn+ZeIgyEafnnZsGBb8lMQnV9MfIHgYlZQ5EyF3n4XikT2h1UbDBYx74ciXZIxFEulx68kDr9Q4/U+zIYQmYv2N+lgXSLDkFrCJ046gRcujPYGPqE6jVw0kKni80CTTpuDF5prU8yIBeiffjkJ3Qx1a17G07eZ4r83P4XUOlaHbRBmA/8ywZvLF2Gep3wGKfSFgMWbPxBJk5ZSYcOOAgMsEcg0+gBK9gLTwO4pbmc2GvqP21yRQBzgtbFoEtAHLu5lVPBkZU7kZuRMJtRdqvFIwOLhpnRS8IknFOD5vjtaFiNdGWaK9ePdsGvplijnXcPafkumakc4+eVEiXb6/KzdX1zXdur5tuUPFytm0Oy6IJcGIf8FHXGvUlmWsnPzwfusij9JgeQOP+uegc9PdBfL+h7L5rk+ilELt3cXD5K7wgov/4hkl5istNJ2bm0IioIstWss8QQQTkyscGoeh/oXmUpOL4FdsTvsWhDR3QKeq8nSzgDkqLe0iSbplQGnC7o7ytNbldmxJvf3nylwglA8w3HlqLHtZLkUOcuQ0=    file_glob: true    file: "artifacts/*"    skip_cleanup: true diff --git a/.travis/linux/docker.sh b/.travis/linux/docker.sh index a85225c5a..8a23b54b1 100755 --- a/.travis/linux/docker.sh +++ b/.travis/linux/docker.sh @@ -1,22 +1,16 @@  #!/bin/bash -ex  apt-get update -apt-get install -y build-essential git libcurl4-openssl-dev libqt5opengl5-dev libsdl2-dev libssl-dev python qtbase5-dev wget +apt-get install -y build-essential git libqt5opengl5-dev libsdl2-dev libssl-dev python qtbase5-dev wget  # Get a recent version of CMake  wget https://cmake.org/files/v3.10/cmake-3.10.1-Linux-x86_64.sh  sh cmake-3.10.1-Linux-x86_64.sh --exclude-subdir --prefix=/ --skip-license -mkdir /unicorn -cd /unicorn -git clone https://github.com/yuzu-emu/unicorn . -UNICORN_ARCHS=aarch64 ./make.sh -./make.sh install -  cd /yuzu  mkdir build && cd build -cmake .. -DUSE_SYSTEM_CURL=ON -DCMAKE_BUILD_TYPE=Release +cmake .. -DYUZU_BUILD_UNICORN=ON -DCMAKE_BUILD_TYPE=Release  make -j4  ctest -VV -C Release diff --git a/.travis/macos/build.sh b/.travis/macos/build.sh index e1c54af55..177e8ac3b 100755 --- a/.travis/macos/build.sh +++ b/.travis/macos/build.sh @@ -8,7 +8,7 @@ export UNICORNDIR=$(pwd)/externals/unicorn  mkdir build && cd build  cmake --version -cmake .. -DUSE_SYSTEM_CURL=ON -DCMAKE_OSX_ARCHITECTURES="x86_64;x86_64h" -DCMAKE_BUILD_TYPE=Release +cmake .. -DYUZU_BUILD_UNICORN=ON -DCMAKE_OSX_ARCHITECTURES="x86_64;x86_64h" -DCMAKE_BUILD_TYPE=Release  make -j4  ctest -VV -C Release diff --git a/.travis/macos/deps.sh b/.travis/macos/deps.sh index 7dea80438..3cd13a39b 100755 --- a/.travis/macos/deps.sh +++ b/.travis/macos/deps.sh @@ -2,9 +2,4 @@  brew update  brew install dylibbundler p7zip qt5 sdl2 - -mkdir externals/unicorn -pushd externals/unicorn -git clone https://github.com/yuzu-emu/unicorn . -UNICORN_ARCHS=aarch64 ./make.sh macos-universal-no -popd +brew outdated cmake || brew upgrade cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 3da8465b9..d814bb74f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,8 +12,6 @@ option(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 binaries" OFF)  option(ENABLE_QT "Enable the Qt frontend" ON)  option(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" OFF) -option(YUZU_USE_BUNDLED_UNICORN "Download bundled Unicorn binaries" OFF) -  if(NOT EXISTS ${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit)      message(STATUS "Copying pre-commit hook")      file(COPY hooks/pre-commit @@ -29,7 +27,7 @@ function(check_submodules_present)      foreach(module ${gitmodules})          string(REGEX REPLACE "path *= *" "" module ${module})          if (NOT EXISTS "${CMAKE_SOURCE_DIR}/${module}/.git") -            message(SEND_ERROR "Git submodule ${module} not found." +            message(FATAL_ERROR "Git submodule ${module} not found. "                      "Please run: git submodule update --init --recursive")          endif()      endforeach() @@ -204,34 +202,65 @@ else()      set(SDL2_FOUND NO)  endif() -if (YUZU_USE_BUNDLED_UNICORN) -    # Detect toolchain and platform -    if (MSVC14 AND ARCHITECTURE_x86_64) -        set(UNICORN_VER "unicorn-yuzu") -    else() -        message(FATAL_ERROR "No bundled Unicorn binaries for your toolchain. Disable YUZU_USE_BUNDLED_UNICORN and provide your own.") -    endif() +# If unicorn isn't found, msvc -> download bundled unicorn; everyone else -> build external +find_package(Unicorn QUIET) +if (NOT UNICORN_FOUND) +    if (MSVC) +        message(STATUS "unicorn not found, falling back to bundled") +        # Detect toolchain and platform +        if (MSVC14 AND ARCHITECTURE_x86_64) +            set(UNICORN_VER "unicorn-yuzu") +        else() +            message(FATAL_ERROR "No bundled Unicorn binaries for your toolchain. Disable YUZU_USE_BUNDLED_UNICORN and provide your own.") +        endif() -    if (DEFINED UNICORN_VER) -        download_bundled_external("unicorn/" ${UNICORN_VER} UNICORN_PREFIX) -    endif() +        if (DEFINED UNICORN_VER) +            download_bundled_external("unicorn/" ${UNICORN_VER} UNICORN_PREFIX) +        endif() -    if (DEFINED UNICORN_VER) -        download_bundled_external("unicorn/" ${UNICORN_VER} UNICORN_PREFIX) -    endif() +        if (DEFINED UNICORN_VER) +            download_bundled_external("unicorn/" ${UNICORN_VER} UNICORN_PREFIX) +        endif() -    set(UNICORN_FOUND YES) -    set(LIBUNICORN_INCLUDE_DIR "${UNICORN_PREFIX}/include" CACHE PATH "Path to Unicorn headers") -    set(LIBUNICORN_LIBRARY "${UNICORN_PREFIX}/lib/x64/unicorn_dynload.lib" CACHE PATH "Path to Unicorn library") -    set(UNICORN_DLL_DIR "${UNICORN_PREFIX}/lib/x64/" CACHE PATH "Path to unicorn.dll") -else() -    find_package(Unicorn REQUIRED) +        set(UNICORN_FOUND YES) +        set(LIBUNICORN_INCLUDE_DIR "${UNICORN_PREFIX}/include" CACHE PATH "Path to Unicorn headers" FORCE) +        set(LIBUNICORN_LIBRARY "${UNICORN_PREFIX}/lib/x64/unicorn_dynload.lib" CACHE PATH "Path to Unicorn library" FORCE) +        set(UNICORN_DLL_DIR "${UNICORN_PREFIX}/lib/x64/" CACHE PATH "Path to unicorn.dll" FORCE) +    else() +        message(STATUS "unicorn not found, falling back to externals") +        if (MINGW) +            set(UNICORN_LIB_NAME "unicorn.a") +        else() +            set(UNICORN_LIB_NAME "libunicorn.a") +        endif() + +        set(UNICORN_FOUND YES) +        set(UNICORN_PREFIX ${CMAKE_SOURCE_DIR}/externals/unicorn) +        set(LIBUNICORN_LIBRARY "${UNICORN_PREFIX}/${UNICORN_LIB_NAME}" CACHE PATH "Path to Unicorn library" FORCE) +        set(LIBUNICORN_INCLUDE_DIR "${UNICORN_PREFIX}/include" CACHE PATH "Path to Unicorn headers" FORCE) +        set(UNICORN_DLL_DIR "${UNICORN_PREFIX}/" CACHE PATH "Path to unicorn dynamic library" FORCE) + +        find_package(PythonInterp 2.7 REQUIRED) + +        add_custom_command(OUTPUT ${LIBUNICORN_LIBRARY} +            COMMAND ${CMAKE_COMMAND} -E env UNICORN_ARCHS="aarch64" PYTHON="${PYTHON_EXECUTABLE}" /bin/sh make.sh +            WORKING_DIRECTORY ${UNICORN_PREFIX} +        ) +        # ALL makes this custom target build every time +        # but it won't actually build if LIBUNICORN_LIBRARY is up to date +        add_custom_target(unicorn-build ALL +            DEPENDS ${LIBUNICORN_LIBRARY} +        ) +        unset(UNICORN_LIB_NAME) +    endif()  endif()  if (UNICORN_FOUND)      add_library(unicorn INTERFACE)      target_link_libraries(unicorn INTERFACE "${LIBUNICORN_LIBRARY}")      target_include_directories(unicorn INTERFACE "${LIBUNICORN_INCLUDE_DIR}") +else() +    message(FATAL_ERROR "Could not find or build unicorn which is required.")  endif()  if (ENABLE_QT) @@ -1,6 +1,7 @@  yuzu emulator  =============  [](https://travis-ci.org/yuzu-emu/yuzu) +[](https://ci.appveyor.com/project/bunnei/yuzu)  yuzu is an experimental open-source emulator for the Nintendo Switch from the creators of [Citra](https://citra-emu.org/). diff --git a/appveyor.yml b/appveyor.yml index f491e5f0b..954be4e8f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -28,7 +28,6 @@ install:          if ($env:BUILD_TYPE -eq 'mingw') {            $dependencies = "mingw64/mingw-w64-x86_64-cmake",                            "mingw64/mingw-w64-x86_64-qt5", -                          "mingw64/mingw-w64-x86_64-curl",                            "mingw64/mingw-w64-x86_64-SDL2"            # redirect err to null to prevent warnings from becoming errors            # workaround to prevent pacman from failing due to cyclical dependencies @@ -42,9 +41,9 @@ before_build:    - ps: |          if ($env:BUILD_TYPE -eq 'msvc') {            # redirect stderr and change the exit code to prevent powershell from cancelling the build if cmake prints a warning -          cmd /C 'cmake -G "Visual Studio 15 2017 Win64" -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_BUNDLED_UNICORN=1 -DCMAKE_USE_OPENSSL=0 .. 2>&1 && exit 0' +          cmd /C 'cmake -G "Visual Studio 15 2017 Win64" -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_BUNDLED_UNICORN=1 .. 2>&1 && exit 0'          } else { -          C:\msys64\usr\bin\bash.exe -lc "cmake -G 'MSYS Makefiles' -DUSE_SYSTEM_CURL=1 -DYUZU_USE_BUNDLED_CURL=1 -DCMAKE_BUILD_TYPE=Release .. 2>&1" +          C:\msys64\usr\bin\bash.exe -lc "cmake -G 'MSYS Makefiles' -DYUZU_BUILD_UNICORN=1 -DCMAKE_BUILD_TYPE=Release .. 2>&1"          }    - cd .. @@ -81,11 +80,12 @@ after_build:            $env:BUILD_SYMBOLS = $MSVC_BUILD_PDB            $env:BUILD_UPDATE = $MSVC_SEVENZIP -          7z a -tzip $MSVC_BUILD_PDB .\msvc_build\bin\release\*.pdb -          rm .\msvc_build\bin\release\*.pdb +          mkdir pdb +          Get-ChildItem ".\msvc_build\bin\" -Recurse -Filter "*.pdb" | Copy-Item -destination .\pdb +          7z a -tzip $MSVC_BUILD_PDB .\pdb\*.pdb            mkdir $RELEASE_DIST -          Copy-Item .\msvc_build\bin\release\* -Destination $RELEASE_DIST -Recurse +          Get-ChildItem ".\msvc_build\bin\" -Recurse -Filter "yuzu*.exe" | Copy-Item -destination $RELEASE_DIST            Copy-Item .\license.txt -Destination $RELEASE_DIST            Copy-Item .\README.md -Destination $RELEASE_DIST            7z a -tzip $MSVC_BUILD_ZIP $RELEASE_DIST\* @@ -104,16 +104,14 @@ after_build:            $env:BUILD_UPDATE = $MINGW_SEVENZIP            $CMAKE_SOURCE_DIR = "$env:APPVEYOR_BUILD_FOLDER" -          $CMAKE_BINARY_DIR = "$CMAKE_SOURCE_DIR/mingw_build" +          $CMAKE_BINARY_DIR = "$CMAKE_SOURCE_DIR/mingw_build/bin"            $RELEASE_DIST = $RELEASE_DIST + "-mingw"            mkdir $RELEASE_DIST            mkdir $RELEASE_DIST/platforms            # copy the compiled binaries and other release files to the release folder -          Get-ChildItem "$CMAKE_BINARY_DIR" -Recurse -Filter "yuzu*.exe" | Copy-Item -destination $RELEASE_DIST -          # copy the libcurl dll -          Get-ChildItem "$CMAKE_BINARY_DIR" -Recurse -Filter "libcurl.dll" | Copy-Item -destination $RELEASE_DIST +          Get-ChildItem "$CMAKE_BINARY_DIR" -Filter "yuzu*.exe" | Copy-Item -destination $RELEASE_DIST            Copy-Item -path "$CMAKE_SOURCE_DIR/license.txt" -destination $RELEASE_DIST            Copy-Item -path "$CMAKE_SOURCE_DIR/README.md" -destination $RELEASE_DIST            # copy all the dll dependencies to the release folder @@ -122,7 +120,7 @@ after_build:                         # QT dll dependencies                         "libbz2-*.dll","libicudt*.dll","libicuin*.dll","libicuuc*.dll","libffi-*.dll",                         "libfreetype-*.dll","libglib-*.dll","libgobject-*.dll","libgraphite2.dll","libiconv-*.dll", -                       "libharfbuzz-*.dll","libintl-*.dll","libpcre-*.dll","libpcre16-*.dll","libpng16-*.dll", +                       "libharfbuzz-*.dll","libintl-*.dll","libpcre-*.dll","libpcre2-16-*.dll","libpcre16-*.dll","libpng16-*.dll",                         # Runtime/Other dependencies                         "libgcc_s_seh-*.dll","libstdc++-*.dll","libwinpthread-*.dll","SDL2.dll","zlib1.dll"            foreach ($file in $MingwDLLs) { @@ -165,7 +163,7 @@ deploy:    provider: GitHub    release: $(appveyor_repo_tag_name)    auth_token: -    secure: "dbpsMC/MgPKWFNJCXpQl4cR8FYhepkPLjgNp/pRMktZ8oLKTqPYErfreaIxb/4P1" +    secure: "argb6oi2TYLB4wDy+HoCC8PuGAmsnocSk12CQ5614XAPO+NVPndlkLv1utnDFfg2"    artifact: update,build    draft: false    prerelease: false diff --git a/externals/unicorn b/externals/unicorn new file mode 160000 +Subproject 73f45735354396766a4bfb26d0b96b06e5cf31b diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index 531875006..5ae60214e 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h @@ -39,7 +39,8 @@ public:          Run(1);      } -    virtual void MapBackingMemory(VAddr address, size_t size, u8* memory, Kernel::VMAPermission perms) {} +    virtual void MapBackingMemory(VAddr address, size_t size, u8* memory, +                                  Kernel::VMAPermission perms) {}      /// Clear all instruction cache      virtual void ClearInstructionCache() = 0; diff --git a/src/core/arm/unicorn/arm_unicorn.cpp b/src/core/arm/unicorn/arm_unicorn.cpp index 13f6c658c..fd64eab39 100644 --- a/src/core/arm/unicorn/arm_unicorn.cpp +++ b/src/core/arm/unicorn/arm_unicorn.cpp @@ -11,7 +11,7 @@  #include "core/hle/kernel/svc.h"  // Load Unicorn DLL once on Windows using RAII -#ifdef _WIN32 +#ifdef _MSC_VER  #include <unicorn_dynload.h>  struct LoadDll {  private: diff --git a/src/core/hle/ipc.h b/src/core/hle/ipc.h index ec08be0f4..88ba105e5 100644 --- a/src/core/hle/ipc.h +++ b/src/core/hle/ipc.h @@ -19,7 +19,6 @@ constexpr size_t COMMAND_BUFFER_LENGTH = 0x100 / sizeof(u32);  // TODO(yuriks): These will probably go away once translation is implemented inside the kernel.  constexpr auto ERR_INVALID_HANDLE = Kernel::ERR_INVALID_HANDLE_OS; -  enum class ControlCommand : u32 {      ConvertSessionToDomain = 0,      ConvertDomainToSession = 1, @@ -81,13 +80,13 @@ struct BufferDescriptorX {      u32_le address_bits_0_31;      u32_le Counter() const { -        u32_le counter{ counter_bits_0_5 }; +        u32_le counter{counter_bits_0_5};          counter |= counter_bits_9_11 << 9;          return counter;      }      VAddr Address() const { -        VAddr address{ address_bits_0_31 }; +        VAddr address{address_bits_0_31};          address |= static_cast<VAddr>(address_bits_32_35) << 32;          address |= static_cast<VAddr>(address_bits_36_38) << 36;          return address; @@ -107,14 +106,14 @@ struct BufferDescriptorABW {      };      VAddr Address() const { -        VAddr address{ address_bits_0_31 }; +        VAddr address{address_bits_0_31};          address |= static_cast<VAddr>(address_bits_32_35) << 32;          address |= static_cast<VAddr>(address_bits_36_38) << 36;          return address;      }      u64 Size() const { -        u64 size{ size_bits_0_31 }; +        u64 size{size_bits_0_31};          size |= static_cast<u64>(size_bits_32_35) << 32;          return size;      } @@ -130,7 +129,7 @@ struct BufferDescriptorC {      };      VAddr Address() const { -        VAddr address{ address_bits_0_31 }; +        VAddr address{address_bits_0_31};          address |= static_cast<VAddr>(address_bits_32_47) << 32;          return address;      } diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index 09caa43df..164c6db69 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h @@ -151,13 +151,13 @@ public:          return domain != nullptr;      } -    template<typename T> +    template <typename T>      SharedPtr<T> GetCopyObject(size_t index) {          ASSERT(index < copy_objects.size());          return DynamicObjectCast<T>(copy_objects[index]);      } -    template<typename T> +    template <typename T>      SharedPtr<T> GetMoveObject(size_t index) {          ASSERT(index < move_objects.size());          return DynamicObjectCast<T>(move_objects[index]); diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index df3b4083e..4d9549e45 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -105,7 +105,6 @@ public:          UNREACHABLE();      } -  public:      static unsigned int next_object_id; diff --git a/src/core/hle/kernel/memory.cpp b/src/core/hle/kernel/memory.cpp index d990d0569..d2600cdd7 100644 --- a/src/core/hle/kernel/memory.cpp +++ b/src/core/hle/kernel/memory.cpp @@ -95,10 +95,8 @@ MemoryRegionInfo* GetMemoryRegion(MemoryRegion region) {      }  } -void HandleSpecialMapping(VMManager& address_space, const AddressMapping& mapping) { -} +void HandleSpecialMapping(VMManager& address_space, const AddressMapping& mapping) {} -void MapSharedPages(VMManager& address_space) { -} +void MapSharedPages(VMManager& address_space) {}  } // namespace Kernel diff --git a/src/core/hle/kernel/mutex.h b/src/core/hle/kernel/mutex.h index 49b6b454e..38db21005 100644 --- a/src/core/hle/kernel/mutex.h +++ b/src/core/hle/kernel/mutex.h @@ -41,9 +41,9 @@ public:          return HANDLE_TYPE;      } -    u32 priority;                     ///< The priority of the mutex, used for priority inheritance. -    std::string name;                 ///< Name of mutex (optional) -    VAddr guest_addr;                 ///< Address of the guest mutex value +    u32 priority;     ///< The priority of the mutex, used for priority inheritance. +    std::string name; ///< Name of mutex (optional) +    VAddr guest_addr; ///< Address of the guest mutex value      /**       * Elevate the mutex priority to the best priority diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 9c60576c1..6b3fd13c9 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -255,9 +255,8 @@ static ResultCode CancelSynchronization(Handle thread_handle) {  /// Attempts to locks a mutex, creating it if it does not already exist  static ResultCode LockMutex(Handle holding_thread_handle, VAddr mutex_addr,                              Handle requesting_thread_handle) { -    LOG_TRACE(Kernel_SVC, -              "called holding_thread_handle=0x%08X, mutex_addr=0x%llx, " -              "requesting_current_thread_handle=0x%08X", +    LOG_TRACE(Kernel_SVC, "called holding_thread_handle=0x%08X, mutex_addr=0x%llx, " +                          "requesting_current_thread_handle=0x%08X",                holding_thread_handle, mutex_addr, requesting_thread_handle);      SharedPtr<Thread> holding_thread = g_handle_table.Get<Thread>(holding_thread_handle); @@ -522,9 +521,8 @@ static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, V      Core::System::GetInstance().PrepareReschedule(); -    LOG_TRACE(Kernel_SVC, -              "called entrypoint=0x%08X (%s), arg=0x%08X, stacktop=0x%08X, " -              "threadpriority=0x%08X, processorid=0x%08X : created handle=0x%08X", +    LOG_TRACE(Kernel_SVC, "called entrypoint=0x%08X (%s), arg=0x%08X, stacktop=0x%08X, " +                          "threadpriority=0x%08X, processorid=0x%08X : created handle=0x%08X",                entry_point, name.c_str(), arg, stack_top, priority, processor_id, *out_handle);      return RESULT_SUCCESS; diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp index dca637dde..650d47925 100644 --- a/src/core/hle/kernel/vm_manager.cpp +++ b/src/core/hle/kernel/vm_manager.cpp @@ -6,9 +6,9 @@  #include "common/assert.h"  #include "common/logging/log.h"  #include "core/arm/arm_interface.h" +#include "core/core.h"  #include "core/hle/kernel/errors.h"  #include "core/hle/kernel/vm_manager.h" -#include "core/core.h"  #include "core/memory.h"  #include "core/memory_setup.h"  #include "core/mmio.h" @@ -86,7 +86,8 @@ ResultVal<VMManager::VMAHandle> VMManager::MapMemoryBlock(VAddr target,      VirtualMemoryArea& final_vma = vma_handle->second;      ASSERT(final_vma.size == size); -    Core::CPU().MapBackingMemory(target, size, block->data() + offset, VMAPermission::ReadWriteExecute); +    Core::CPU().MapBackingMemory(target, size, block->data() + offset, +                                 VMAPermission::ReadWriteExecute);      final_vma.type = VMAType::AllocatedMemoryBlock;      final_vma.permissions = VMAPermission::ReadWrite; diff --git a/src/core/hle/service/apm/apm.cpp b/src/core/hle/service/apm/apm.cpp index f70b9fc10..957abdd66 100644 --- a/src/core/hle/service/apm/apm.cpp +++ b/src/core/hle/service/apm/apm.cpp @@ -15,8 +15,7 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {  APM::APM() : ServiceFramework("apm") {      static const FunctionInfo functions[] = { -        {0x00000000, nullptr, "OpenSession"}, -        {0x00000001, nullptr, "GetPerformanceMode"}, +        {0x00000000, nullptr, "OpenSession"}, {0x00000001, nullptr, "GetPerformanceMode"},      };      RegisterHandlers(functions);  } diff --git a/src/core/hle/service/nvdrv/nvdrv.h b/src/core/hle/service/nvdrv/nvdrv.h index 7530d80ad..a1c050416 100644 --- a/src/core/hle/service/nvdrv/nvdrv.h +++ b/src/core/hle/service/nvdrv/nvdrv.h @@ -26,6 +26,7 @@ public:      VAddr GetObjectAddress(u32 handle) const;      u32 ioctl(u32 command, const std::vector<u8>& input, std::vector<u8>& output) override; +  private:      // Represents an nvmap object.      struct Object { diff --git a/src/core/loader/linker.cpp b/src/core/loader/linker.cpp index f82c6f4b4..87cc65e91 100644 --- a/src/core/loader/linker.cpp +++ b/src/core/loader/linker.cpp @@ -48,9 +48,9 @@ struct Elf64_Sym {  };  static_assert(sizeof(Elf64_Sym) == 0x18, "Elf64_Sym has incorrect size."); -void Linker::WriteRelocations(std::vector<u8>& program_image, -                                  const std::vector<Symbol>& symbols, u64 relocation_offset, -                                  u64 size, bool is_jump_relocation, VAddr load_base) { +void Linker::WriteRelocations(std::vector<u8>& program_image, const std::vector<Symbol>& symbols, +                              u64 relocation_offset, u64 size, bool is_jump_relocation, +                              VAddr load_base) {      for (u64 i = 0; i < size; i += sizeof(Elf64_Rela)) {          Elf64_Rela rela;          std::memcpy(&rela, &program_image[relocation_offset + i], sizeof(Elf64_Rela)); @@ -90,8 +90,7 @@ void Linker::WriteRelocations(std::vector<u8>& program_image,      }  } -void Linker::Relocate(std::vector<u8>& program_image, u32 dynamic_section_offset, -                          VAddr load_base) { +void Linker::Relocate(std::vector<u8>& program_image, u32 dynamic_section_offset, VAddr load_base) {      std::map<u64, u64> dynamic;      while (dynamic_section_offset < program_image.size()) {          Elf64_Dyn dyn; @@ -141,8 +140,7 @@ void Linker::ResolveImports() {          const auto& search = exports.find(import.first);          if (search != exports.end()) {              Memory::Write64(import.second.ea, search->second + import.second.addend); -        } -        else { +        } else {              LOG_ERROR(Loader, "Unresolved import: %s", import.first.c_str());          }      } diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 833399511..ff96e129b 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp @@ -161,7 +161,8 @@ ResultStatus AppLoader_NSO::Load(Kernel::SharedPtr<Kernel::Process>& process) {      // Load NSO modules      VAddr next_load_addr{Memory::PROCESS_IMAGE_VADDR}; -    for (const auto& module : {"rtld", "sdk", "subsdk0", "subsdk1", "subsdk2", "subsdk3", "subsdk4"}) { +    for (const auto& module : +         {"rtld", "sdk", "subsdk0", "subsdk1", "subsdk2", "subsdk3", "subsdk4"}) {          const std::string path = filepath.substr(0, filepath.find_last_of("/\\")) + "/" + module;          const VAddr load_addr = next_load_addr;          next_load_addr = LoadNso(path, load_addr); diff --git a/src/core/loader/nso.h b/src/core/loader/nso.h index 28df00384..03424e70d 100644 --- a/src/core/loader/nso.h +++ b/src/core/loader/nso.h @@ -18,8 +18,7 @@ namespace Loader {  class AppLoader_NSO final : public AppLoader, Linker {  public:      AppLoader_NSO(FileUtil::IOFile&& file, std::string filepath) -        : AppLoader(std::move(file)), filepath(std::move(filepath)) { -    } +        : AppLoader(std::move(file)), filepath(std::move(filepath)) {}      /**       * Returns the type of the file diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h index dd01e1b1a..db6c355a5 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h @@ -61,7 +61,8 @@ private:      // Loads framebuffer from emulated memory into the display information structure      void LoadFBToScreenInfo(const FramebufferInfo& framebuffer_info, ScreenInfo& screen_info);      // Fills active OpenGL texture with the given RGBA color. -    void LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b, u8 color_a, const TextureInfo& texture); +    void LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b, u8 color_a, +                                    const TextureInfo& texture);      EmuWindow* render_window; ///< Handle to render window diff --git a/src/yuzu/about_dialog.cpp b/src/yuzu/about_dialog.cpp index 0f1b6cdc6..da3429822 100644 --- a/src/yuzu/about_dialog.cpp +++ b/src/yuzu/about_dialog.cpp @@ -9,7 +9,7 @@  AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) {      ui->setupUi(this);      ui->labelBuildInfo->setText(ui->labelBuildInfo->text().arg( -Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc)); +        Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc));  }  AboutDialog::~AboutDialog() {} diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 923a7c53f..6a40f035c 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -18,10 +18,10 @@ Config::Config() {  }  const std::array<int, Settings::NativeButton::NumButtons> Config::default_buttons = { -    Qt::Key_A, Qt::Key_S, Qt::Key_Z, Qt::Key_X, Qt::Key_3, Qt::Key_4, Qt::Key_Q, Qt::Key_W, -    Qt::Key_1, Qt::Key_2, Qt::Key_N, Qt::Key_M, Qt::Key_F, Qt::Key_T, Qt::Key_H, Qt::Key_G, -    Qt::Key_Left, Qt::Key_Up, Qt::Key_Right, Qt::Key_Down, Qt::Key_J, Qt::Key_I, Qt::Key_L, -    Qt::Key_K, Qt::Key_D, Qt::Key_C, Qt::Key_B, Qt::Key_V, +    Qt::Key_A, Qt::Key_S, Qt::Key_Z,    Qt::Key_X,  Qt::Key_3,     Qt::Key_4,    Qt::Key_Q, +    Qt::Key_W, Qt::Key_1, Qt::Key_2,    Qt::Key_N,  Qt::Key_M,     Qt::Key_F,    Qt::Key_T, +    Qt::Key_H, Qt::Key_G, Qt::Key_Left, Qt::Key_Up, Qt::Key_Right, Qt::Key_Down, Qt::Key_J, +    Qt::Key_I, Qt::Key_L, Qt::Key_K,    Qt::Key_D,  Qt::Key_C,     Qt::Key_B,    Qt::Key_V,  };  const std::array<std::array<int, 5>, Settings::NativeAnalog::NumAnalogs> Config::default_analogs{{ diff --git a/src/yuzu/configuration/configure_debug.cpp b/src/yuzu/configuration/configure_debug.cpp index 9eb71c593..a45edd510 100644 --- a/src/yuzu/configuration/configure_debug.cpp +++ b/src/yuzu/configuration/configure_debug.cpp @@ -6,7 +6,6 @@  #include "ui_configure_debug.h"  #include "yuzu/configuration/configure_debug.h" -  ConfigureDebug::ConfigureDebug(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureDebug) {      ui->setupUi(this);      this->setConfiguration(); diff --git a/src/yuzu/configuration/configure_dialog.cpp b/src/yuzu/configuration/configure_dialog.cpp index 23e5687d0..358f33005 100644 --- a/src/yuzu/configuration/configure_dialog.cpp +++ b/src/yuzu/configuration/configure_dialog.cpp @@ -7,7 +7,6 @@  #include "yuzu/configuration/config.h"  #include "yuzu/configuration/configure_dialog.h" -  ConfigureDialog::ConfigureDialog(QWidget* parent) : QDialog(parent), ui(new Ui::ConfigureDialog) {      ui->setupUi(this);      this->setConfiguration(); diff --git a/src/yuzu/configuration/configure_input.cpp b/src/yuzu/configuration/configure_input.cpp index cd7520f29..c7f0b613b 100644 --- a/src/yuzu/configuration/configure_input.cpp +++ b/src/yuzu/configuration/configure_input.cpp @@ -50,13 +50,13 @@ ConfigureInput::ConfigureInput(QWidget* parent)      setFocusPolicy(Qt::ClickFocus);      button_map = { -        ui->buttonA,          ui->buttonB,         ui->buttonX,           ui->buttonY, -        ui->buttonLStick,     ui->buttonRStick,    ui->buttonL,           ui->buttonR, -        ui->buttonZL,         ui->buttonZR,        ui->buttonPlus,        ui->buttonMinus, -        ui->buttonDpadLeft,   ui->buttonDpadUp,    ui->buttonDpadRight,   ui->buttonDpadDown, -        ui->buttonLStickLeft, ui->buttonLStickUp,  ui->buttonLStickRight, ui->buttonLStickDown, -        ui->buttonRStickLeft, ui->buttonRStickUp,  ui->buttonRStickRight, ui->buttonRStickDown, -        ui->buttonSL,         ui->buttonSR,        ui->buttonHome,        ui->buttonScreenshot, +        ui->buttonA,          ui->buttonB,        ui->buttonX,           ui->buttonY, +        ui->buttonLStick,     ui->buttonRStick,   ui->buttonL,           ui->buttonR, +        ui->buttonZL,         ui->buttonZR,       ui->buttonPlus,        ui->buttonMinus, +        ui->buttonDpadLeft,   ui->buttonDpadUp,   ui->buttonDpadRight,   ui->buttonDpadDown, +        ui->buttonLStickLeft, ui->buttonLStickUp, ui->buttonLStickRight, ui->buttonLStickDown, +        ui->buttonRStickLeft, ui->buttonRStickUp, ui->buttonRStickRight, ui->buttonRStickDown, +        ui->buttonSL,         ui->buttonSR,       ui->buttonHome,        ui->buttonScreenshot,      };      analog_map_buttons = {{ diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp index 417afef87..d198e38ae 100644 --- a/src/yuzu/configuration/configure_system.cpp +++ b/src/yuzu/configuration/configure_system.cpp @@ -8,7 +8,6 @@  #include "yuzu/configuration/configure_system.h"  #include "yuzu/ui_settings.h" -  static const std::array<int, 12> days_in_month = {{      31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,  }}; diff --git a/src/yuzu/debugger/registers.cpp b/src/yuzu/debugger/registers.cpp index a52725075..06e2d1647 100644 --- a/src/yuzu/debugger/registers.cpp +++ b/src/yuzu/debugger/registers.cpp @@ -8,7 +8,6 @@  #include "yuzu/debugger/registers.h"  #include "yuzu/util/util.h" -  RegistersWidget::RegistersWidget(QWidget* parent) : QDockWidget(parent) {      cpu_regs_ui.setupUi(this); diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h index e40cd38b3..a758b77aa 100644 --- a/src/yuzu/game_list_p.h +++ b/src/yuzu/game_list_p.h @@ -9,8 +9,8 @@  #include <QRunnable>  #include <QStandardItem>  #include <QString> -#include "yuzu/util/util.h"  #include "common/string_util.h" +#include "yuzu/util/util.h"  /**   * Gets the default icon (for games without valid SMDH) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 7c711158a..31f2825ee 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -122,8 +122,9 @@ void GMainWindow::InitializeWidgets() {      statusBar()->addPermanentWidget(message_label, 1);      emu_speed_label = new QLabel(); -    emu_speed_label->setToolTip(tr("Current emulation speed. Values higher or lower than 100% " -                                   "indicate emulation is running faster or slower than a Switch.")); +    emu_speed_label->setToolTip( +        tr("Current emulation speed. Values higher or lower than 100% " +           "indicate emulation is running faster or slower than a Switch."));      game_fps_label = new QLabel();      game_fps_label->setToolTip(tr("How many frames per second the game is currently displaying. "                                    "This will vary from game to game and scene to scene.")); @@ -185,8 +186,8 @@ void GMainWindow::InitializeRecentFileMenuActions() {  void GMainWindow::InitializeHotkeys() {      RegisterHotkey("Main Window", "Load File", QKeySequence::Open);      RegisterHotkey("Main Window", "Start Emulation"); -    RegisterHotkey( "Main Window", "Fullscreen", QKeySequence::FullScreen ); -    RegisterHotkey( "Main Window", "Exit Fullscreen", QKeySequence::Cancel, Qt::ApplicationShortcut ); +    RegisterHotkey("Main Window", "Fullscreen", QKeySequence::FullScreen); +    RegisterHotkey("Main Window", "Exit Fullscreen", QKeySequence::Cancel, Qt::ApplicationShortcut);      LoadHotkeys();      connect(GetHotkey("Main Window", "Load File", this), SIGNAL(activated()), this, @@ -194,9 +195,9 @@ void GMainWindow::InitializeHotkeys() {      connect(GetHotkey("Main Window", "Start Emulation", this), SIGNAL(activated()), this,              SLOT(OnStartGame()));      connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activated, -             ui.action_Fullscreen, &QAction::trigger); +            ui.action_Fullscreen, &QAction::trigger);      connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activatedAmbiguously, -             ui.action_Fullscreen, &QAction::trigger); +            ui.action_Fullscreen, &QAction::trigger);      connect(GetHotkey("Main Window", "Exit Fullscreen", this), &QShortcut::activated, this, [&] {          if (emulation_running) {              ui.action_Fullscreen->setChecked(false); diff --git a/src/yuzu/util/spinbox.cpp b/src/yuzu/util/spinbox.cpp index ede6fe0a8..92753ec1c 100644 --- a/src/yuzu/util/spinbox.cpp +++ b/src/yuzu/util/spinbox.cpp @@ -31,8 +31,8 @@  #include <cstdlib>  #include <QLineEdit>  #include <QRegExpValidator> -#include "yuzu/util/spinbox.h"  #include "common/assert.h" +#include "yuzu/util/spinbox.h"  CSpinBox::CSpinBox(QWidget* parent)      : QAbstractSpinBox(parent), min_value(-100), max_value(100), value(0), base(10), num_digits(0) { diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 785d96672..8f7c75796 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp @@ -37,7 +37,6 @@  #include "yuzu_cmd/config.h"  #include "yuzu_cmd/emu_window/emu_window_sdl2.h" -  static void PrintHelp(const char* argv0) {      std::cout << "Usage: " << argv0                << " [options] <filename>\n"  | 
