diff --git a/.github/ISSUE_TEMPLATE/bug-report-feature-request.md b/.github/ISSUE_TEMPLATE/bug-report-feature-request.md new file mode 100644 index 00000000..05eebe54 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report-feature-request.md @@ -0,0 +1,34 @@ +--- +name: Bug Report / Feature Request +about: Tech support does not belong here. You should only file an issue here if you think you have experienced an actual bug with Cemu or you are requesting a feature you believe would make Cemu better. +title: '' +labels: '' +assignees: '' + +--- + + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..d33d87ed --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Cemu Discord + url: https://discord.com/invite/5psYsup + about: If you are experiencing an issue with Cemu, and you need tech support, or if you have a general question, try asking in the official Cemu Discord linked here. Piracy is not allowed. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8455c57..7a2457aa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,9 +26,6 @@ env: jobs: build-ubuntu: runs-on: ubuntu-20.04 - env: - install_vulkan_folder: "$GITHUB_WORKSPACE/vulkan_sdk" - install_vulkan_version: "1.3.216.0" steps: - name: "Checkout repo" uses: actions/checkout@v3 @@ -53,13 +50,9 @@ jobs: run: | sudo apt update -qq sudo apt install -y ninja-build cmake libgtk-3-dev libsecret-1-dev libgcrypt20-dev libsystemd-dev freeglut3-dev clang-12 nasm - wget https://sdk.lunarg.com/sdk/download/${{ env.install_vulkan_version }}/linux/vulkansdk-linux-x86_64-${{ env.install_vulkan_version }}.tar.gz -q -O vulkansdk.tar.gz - mkdir -p "${{ env.install_vulkan_folder }}" - tar -xf vulkansdk.tar.gz --directory ${{ env.install_vulkan_folder }} - name: "Bootstrap vcpkg" run: | - export VULKAN_SDK="${{ env.install_vulkan_folder }}/${{ env.install_vulkan_version }}/x86_64" bash ./dependencies/vcpkg/bootstrap-vcpkg.sh - name: 'Setup NuGet Credentials for vcpkg' @@ -78,7 +71,6 @@ jobs: - name: "cmake" run: | - export VULKAN_SDK="${{ env.install_vulkan_folder }}/${{ env.install_vulkan_version }}/x86_64" mkdir -p build cd build cmake .. ${{ env.BUILD_FLAGS }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_MODE }} -DCMAKE_C_COMPILER=/usr/bin/clang-12 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-12 -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja @@ -98,9 +90,6 @@ jobs: build-windows: runs-on: windows-2022 - env: - install_vulkan_folder: "$GITHUB_WORKSPACE/vulkan_sdk" - install_vulkan_version: "1.3.216.0" steps: - name: "Checkout repo" uses: actions/checkout@v3 @@ -121,12 +110,6 @@ jobs: echo "BUILD_FLAGS=" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append echo "Build mode is debug" - - name: Prepare Vulkan SDK - uses: humbletim/setup-vulkan-sdk@v1.2.0 - with: - vulkan-query-version: 1.3.216.0 - vulkan-components: Vulkan-Headers, Vulkan-Loader - vulkan-use-cache: false - name: Workaround run: | diff --git a/.gitignore b/.gitignore index fe0c7726..6040affa 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ build/ out/ +.cache/ # Cemu bin files otp.bin diff --git a/.gitmodules b/.gitmodules index 04f01186..dd32088b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ path = dependencies/vcpkg url = https://github.com/microsoft/vcpkg shallow = true +[submodule "dependencies/Vulkan-Headers"] + path = dependencies/Vulkan-Headers + url = https://github.com/KhronosGroup/Vulkan-Headers diff --git a/BUILD.md b/BUILD.md index 2fd6dbef..ab0dd10d 100644 --- a/BUILD.md +++ b/BUILD.md @@ -5,13 +5,12 @@ Prerequisites: - A recent version of Visual Studio 2022 with CMake tools component - git -- Vulkan SDK ([https://vulkan.lunarg.com/](https://vulkan.lunarg.com/)). Don't forget to restart after installing. Instructions: 1) Run `git clone --recursive https://github.com/cemu-project/Cemu` -2) Launch `Cemu/build_vs_solution.bat`. If you installed VS to a custom location you may need to manually adjust the path inside the bat file -3) Wait until done, then open build/Cemu.sln in Visual Studio +2) Launch `Cemu/generate_vs_solution.bat`. If you installed VS to a custom location you may need to manually adjust the path inside the bat file +3) Wait until done, then open `Cemu/build/Cemu.sln` in Visual Studio 4) Right click 'CemuBin' project -> Set as startup project 5) Then build the solution and once finished you can run and debug it @@ -23,12 +22,11 @@ To compile Cemu, a recent enough compiler and STL with C++20 support is required For ubuntu and most derivatives: -1) Make sure vulkansdk is installed and the VULKAN_SDK environment variable is set correctly. -2) `sudo apt install -y libgtk-3-dev libsecret-1-dev libgcrypt20-dev libsystemd-dev freeglut3-dev clang-12 nasm` -3) Run `git clone --recursive https://github.com/cemu-project/Cemu` -4) `cd Cemu` -5) `mkdir build && cd build` -6) `cmake .. -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang-12 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-12 -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja` -8) `ninja` +1) `sudo apt install -y libgtk-3-dev libsecret-1-dev libgcrypt20-dev libsystemd-dev freeglut3-dev clang-12 nasm ninja-build` +2) Run `git clone --recursive https://github.com/cemu-project/Cemu` +3) `cd Cemu` +4) `mkdir build && cd build` +5) `cmake .. -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang-12 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-12 -G Ninja` +6) `ninja` Build instructions for other distributions will be added in the future! diff --git a/CMakeLists.txt b/CMakeLists.txt index fb516da3..387b1985 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,8 +70,7 @@ find_package(ZLIB REQUIRED) find_package(zstd CONFIG REQUIRED) if (ENABLE_VULKAN) - find_package(Vulkan REQUIRED) - include_directories("${Vulkan_INCLUDE_DIRS}") + include_directories("dependencies/Vulkan-Headers/include") endif() if (ENABLE_OPENGL) diff --git a/README.md b/README.md index 318c8d6e..232e4325 100644 --- a/README.md +++ b/README.md @@ -22,13 +22,13 @@ Cemu is currently only available for 64-bit Windows and Linux devices. ## Download -You can download the latest Cemu releases from the [Github Releases](https://github.com/cemu-project/Cemu/releases/) or from [Cemu's website](http://cemu.info). +You can download the latest Cemu releases from the [Github Releases](https://github.com/cemu-project/Cemu/releases/) or from [Cemu's website](https://cemu.info). Cemu is currently only available in a portable format so no installation is required besides extracting it in a safe place. See [Current State Of Linux builds](https://github.com/cemu-project/Cemu/issues/1) for information on using Cemu natively on Linux. -Pre-2.0 releases can be found on Cemu's [changelog page](http://cemu.info/changelog.html). +Pre-2.0 releases can be found on Cemu's [changelog page](https://cemu.info/changelog.html). ## Build Instructions diff --git a/dependencies/Vulkan-Headers b/dependencies/Vulkan-Headers new file mode 160000 index 00000000..71567370 --- /dev/null +++ b/dependencies/Vulkan-Headers @@ -0,0 +1 @@ +Subproject commit 715673702f5b18ffb8e5832e67cf731468d32ac6 diff --git a/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp b/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp index 3bc6699b..b7aedad1 100644 --- a/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp +++ b/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp @@ -432,7 +432,7 @@ void LatteShaderCache_ShowProgress(const std::function & loadUpdateF } ImGui::SetCursorPosX(width - ImGui::CalcTextSize(text.c_str()).x / 2); - ImGui::Text(text.c_str()); + ImGui::Text("%s", text.c_str()); float percentLoaded; if(isPipelines) @@ -446,7 +446,7 @@ void LatteShaderCache_ShowProgress(const std::function & loadUpdateF else text = fmt::format("{}/{} ({}%%)", g_shaderCacheLoaderState.loadedShaderFiles, g_shaderCacheLoaderState.shaderFileCount, (int)(percentLoaded * 100)); ImGui::SetCursorPosX(width - ImGui::CalcTextSize(text.c_str()).x / 2); - ImGui::Text(text.c_str()); + ImGui::Text("%s", text.c_str()); ImGui::End(); } ImGui::PopFont(); @@ -775,4 +775,4 @@ void LatteShaderCache_handleDeprecatedCacheFiles(fs::path pathGeneric, fs::path fs::remove(pathGenericPre1_25_0, ec); } } -} \ No newline at end of file +} diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VKRMemoryManager.cpp b/src/Cafe/HW/Latte/Renderer/Vulkan/VKRMemoryManager.cpp index 93021fd8..95a04315 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VKRMemoryManager.cpp +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VKRMemoryManager.cpp @@ -531,6 +531,6 @@ void VKRMemoryManager::appendOverlayHeapDebugInfo() uint32 heapSizeMB = (heapSize / 1024 / 1024); uint32 allocatedBytesMB = (allocatedBytes / 1024 / 1024); - ImGui::Text(fmt::format("{0:#08x} Size: {1}MB/{2}MB", itr.first, allocatedBytesMB, heapSizeMB).c_str()); + ImGui::Text("%s", fmt::format("{0:#08x} Size: {1}MB/{2}MB", itr.first, allocatedBytesMB, heapSizeMB).c_str()); } -} \ No newline at end of file +} diff --git a/src/Cafe/OS/libs/coreinit/coreinit_MEM.cpp b/src/Cafe/OS/libs/coreinit/coreinit_MEM.cpp index e1904f72..a9f9f3a8 100644 --- a/src/Cafe/OS/libs/coreinit/coreinit_MEM.cpp +++ b/src/Cafe/OS/libs/coreinit/coreinit_MEM.cpp @@ -538,7 +538,6 @@ namespace coreinit void coreinitExport_MEMAllocFromAllocator(PPCInterpreter_t* hCPU) { - debug_printf("MEMAllocFromAllocator(0x%x, 0x%x)\n", hCPU->gpr[3], hCPU->gpr[4]); MEMAllocator* memAllocator = (MEMAllocator*)memory_getPointerFromVirtualOffset(hCPU->gpr[3]); // redirect execution to allocator alloc callback hCPU->instructionPointer = memAllocator->func->funcAlloc.GetMPTR(); @@ -546,7 +545,6 @@ namespace coreinit void coreinitExport_MEMFreeToAllocator(PPCInterpreter_t* hCPU) { - debug_printf("MEMFreeToAllocator(0x%x, 0x%08x)\n", hCPU->gpr[3], hCPU->gpr[4]); MEMAllocator* memAllocator = (MEMAllocator*)memory_getPointerFromVirtualOffset(hCPU->gpr[3]); // redirect execution to allocator free callback hCPU->instructionPointer = memAllocator->func->funcFree.GetMPTR(); @@ -568,11 +566,10 @@ namespace coreinit void coreinitExport_MEMInitAllocatorForDefaultHeap(PPCInterpreter_t* hCPU) { - debug_printf("MEMInitAllocatorForDefaultHeap(0x%08x)", hCPU->gpr[3]); ppcDefineParamStructPtr(memAllocator, MEMAllocator, 0); - gDefaultHeapAllocator->funcAlloc = _swapEndianU32(PPCInterpreter_makeCallableExportDepr(_DefaultHeapAllocator_Alloc)); - gDefaultHeapAllocator->funcFree = _swapEndianU32(PPCInterpreter_makeCallableExportDepr(_DefaultHeapAllocator_Free)); + gDefaultHeapAllocator->funcAlloc = PPCInterpreter_makeCallableExportDepr(_DefaultHeapAllocator_Alloc); + gDefaultHeapAllocator->funcFree = PPCInterpreter_makeCallableExportDepr(_DefaultHeapAllocator_Free); memAllocator->func = gDefaultHeapAllocator.GetPtr(); memAllocator->heap = MEMPTR(MEMGetBaseHeapHandle(1)); diff --git a/src/Cafe/OS/libs/coreinit/coreinit_MEM_ExpHeap.cpp b/src/Cafe/OS/libs/coreinit/coreinit_MEM_ExpHeap.cpp index fe221717..c587b879 100644 --- a/src/Cafe/OS/libs/coreinit/coreinit_MEM_ExpHeap.cpp +++ b/src/Cafe/OS/libs/coreinit/coreinit_MEM_ExpHeap.cpp @@ -831,8 +831,8 @@ SysAllocator gExpHeapDefaultAllocator; void MEMInitAllocatorForExpHeap(MEMAllocator* allocator, MEMHeapHandle heap, sint32 alignment) { allocator->func = gExpHeapDefaultAllocator.GetPtr(); - gExpHeapDefaultAllocator->funcAlloc = _swapEndianU32(PPCInterpreter_makeCallableExportDepr(_DefaultAllocatorForExpHeap_Alloc)); - gExpHeapDefaultAllocator->funcFree = _swapEndianU32(PPCInterpreter_makeCallableExportDepr(_DefaultAllocatorForExpHeap_Free)); + gExpHeapDefaultAllocator->funcAlloc = PPCInterpreter_makeCallableExportDepr(_DefaultAllocatorForExpHeap_Alloc); + gExpHeapDefaultAllocator->funcFree = PPCInterpreter_makeCallableExportDepr(_DefaultAllocatorForExpHeap_Free); allocator->heap = heap; allocator->param1 = alignment; diff --git a/src/Cafe/OS/libs/swkbd/swkbd.cpp b/src/Cafe/OS/libs/swkbd/swkbd.cpp index 1a09ec58..b7ad80f4 100644 --- a/src/Cafe/OS/libs/swkbd/swkbd.cpp +++ b/src/Cafe/OS/libs/swkbd/swkbd.cpp @@ -390,7 +390,7 @@ void swkbd_render(bool mainWindow) ImGui::PushFont(font); if (ImGui::Begin("Keyboard Input", nullptr, kPopupFlags)) { - ImGui::Text(_utf8WrapperPtr(ICON_FA_KEYBOARD)); + ImGui::Text("%s", _utf8WrapperPtr(ICON_FA_KEYBOARD)); ImGui::SameLine(70); auto text = boost::nowide::narrow(fmt::format(L"{}", swkbdInternalState->formStringBuffer)); @@ -647,4 +647,4 @@ namespace swkbd osLib_addFunction("swkbd", "SwkbdIsNeedCalcSubThreadFont__3RplFv", swkbdExport_SwkbdIsNeedCalcSubThreadFont); osLib_addFunction("swkbd", "SwkbdIsNeedCalcSubThreadPredict__3RplFv", swkbdExport_SwkbdIsNeedCalcSubThreadPredict); } -} \ No newline at end of file +} diff --git a/src/Common/precompiled.h b/src/Common/precompiled.h index 0ec725a6..de9c8837 100644 --- a/src/Common/precompiled.h +++ b/src/Common/precompiled.h @@ -1,3 +1,9 @@ +//Temporary Workaround for static_assert related errors in libstdc++12 +//TODO: Make a proper fix +#ifdef __clang__ +#define static_assert(...) static_assert(true, "") +#endif + #pragma once #include // for size_t diff --git a/vcpkg.json b/vcpkg.json index 1525a5a2..8a5095f5 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -13,7 +13,6 @@ "default-features": false }, "rapidjson", - "vulkan", "sdl2", "boost-tokenizer", "boost-container",