Merge pull request #1 from cemu-project/main

MM
This commit is contained in:
RyzenDew 2022-08-25 14:19:22 -03:00 committed by GitHub
commit 8cd570a3f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 72 additions and 46 deletions

View file

@ -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: ''
---
<!---
Please keep in mind Cemu is EXPERIMENTAL SOFTWARE.
Please read the FAQ:
https://cemu.info/faq.html/
THIS IS NOT A SUPPORT FORUM, FOR SUPPORT GO TO:
https://discord.com/invite/5psYsup/
If the FAQ does not answer your question, please go to:
https://discord.com/invite/5psYsup/
When submitting an issue, please check the following:
- You have read the above.
- You have provided the version (commit hash) of Cemu you are using.
- You have provided sufficient detail for the issue to be reproduced.
- You have provided system specs (if relevant).
- Please also provide:
- For any issues, a log file
- For crashes, a backtrace.
- For graphical issues, comparison screenshots with real hardware.
- For emulation inaccuracies, a test-case (if able).
-->

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View file

@ -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.

View file

@ -26,9 +26,6 @@ env:
jobs: jobs:
build-ubuntu: build-ubuntu:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
env:
install_vulkan_folder: "$GITHUB_WORKSPACE/vulkan_sdk"
install_vulkan_version: "1.3.216.0"
steps: steps:
- name: "Checkout repo" - name: "Checkout repo"
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -53,13 +50,9 @@ jobs:
run: | run: |
sudo apt update -qq 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 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" - name: "Bootstrap vcpkg"
run: | run: |
export VULKAN_SDK="${{ env.install_vulkan_folder }}/${{ env.install_vulkan_version }}/x86_64"
bash ./dependencies/vcpkg/bootstrap-vcpkg.sh bash ./dependencies/vcpkg/bootstrap-vcpkg.sh
- name: 'Setup NuGet Credentials for vcpkg' - name: 'Setup NuGet Credentials for vcpkg'
@ -78,7 +71,6 @@ jobs:
- name: "cmake" - name: "cmake"
run: | run: |
export VULKAN_SDK="${{ env.install_vulkan_folder }}/${{ env.install_vulkan_version }}/x86_64"
mkdir -p build mkdir -p build
cd 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 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: build-windows:
runs-on: windows-2022 runs-on: windows-2022
env:
install_vulkan_folder: "$GITHUB_WORKSPACE/vulkan_sdk"
install_vulkan_version: "1.3.216.0"
steps: steps:
- name: "Checkout repo" - name: "Checkout repo"
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -121,12 +110,6 @@ jobs:
echo "BUILD_FLAGS=" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append echo "BUILD_FLAGS=" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "Build mode is debug" 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 - name: Workaround
run: | run: |

1
.gitignore vendored
View file

@ -16,6 +16,7 @@
build/ build/
out/ out/
.cache/
# Cemu bin files # Cemu bin files
otp.bin otp.bin

3
.gitmodules vendored
View file

@ -10,3 +10,6 @@
path = dependencies/vcpkg path = dependencies/vcpkg
url = https://github.com/microsoft/vcpkg url = https://github.com/microsoft/vcpkg
shallow = true shallow = true
[submodule "dependencies/Vulkan-Headers"]
path = dependencies/Vulkan-Headers
url = https://github.com/KhronosGroup/Vulkan-Headers

View file

@ -5,13 +5,12 @@
Prerequisites: Prerequisites:
- A recent version of Visual Studio 2022 with CMake tools component - A recent version of Visual Studio 2022 with CMake tools component
- git - git
- Vulkan SDK ([https://vulkan.lunarg.com/](https://vulkan.lunarg.com/)). Don't forget to restart after installing.
Instructions: Instructions:
1) Run `git clone --recursive https://github.com/cemu-project/Cemu` 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 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 build/Cemu.sln in Visual Studio 3) Wait until done, then open `Cemu/build/Cemu.sln` in Visual Studio
4) Right click 'CemuBin' project -> Set as startup project 4) Right click 'CemuBin' project -> Set as startup project
5) Then build the solution and once finished you can run and debug it 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: For ubuntu and most derivatives:
1) Make sure vulkansdk is installed and the VULKAN_SDK environment variable is set correctly. 1) `sudo apt install -y libgtk-3-dev libsecret-1-dev libgcrypt20-dev libsystemd-dev freeglut3-dev clang-12 nasm ninja-build`
2) `sudo apt install -y libgtk-3-dev libsecret-1-dev libgcrypt20-dev libsystemd-dev freeglut3-dev clang-12 nasm` 2) Run `git clone --recursive https://github.com/cemu-project/Cemu`
3) Run `git clone --recursive https://github.com/cemu-project/Cemu` 3) `cd Cemu`
4) `cd Cemu` 4) `mkdir build && cd build`
5) `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) `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` 6) `ninja`
8) `ninja`
Build instructions for other distributions will be added in the future! Build instructions for other distributions will be added in the future!

View file

@ -70,8 +70,7 @@ find_package(ZLIB REQUIRED)
find_package(zstd CONFIG REQUIRED) find_package(zstd CONFIG REQUIRED)
if (ENABLE_VULKAN) if (ENABLE_VULKAN)
find_package(Vulkan REQUIRED) include_directories("dependencies/Vulkan-Headers/include")
include_directories("${Vulkan_INCLUDE_DIRS}")
endif() endif()
if (ENABLE_OPENGL) if (ENABLE_OPENGL)

View file

@ -22,13 +22,13 @@ Cemu is currently only available for 64-bit Windows and Linux devices.
## Download ## 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. 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. 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 ## Build Instructions

1
dependencies/Vulkan-Headers vendored Submodule

@ -0,0 +1 @@
Subproject commit 715673702f5b18ffb8e5832e67cf731468d32ac6

View file

@ -432,7 +432,7 @@ void LatteShaderCache_ShowProgress(const std::function <bool(void)>& loadUpdateF
} }
ImGui::SetCursorPosX(width - ImGui::CalcTextSize(text.c_str()).x / 2); ImGui::SetCursorPosX(width - ImGui::CalcTextSize(text.c_str()).x / 2);
ImGui::Text(text.c_str()); ImGui::Text("%s", text.c_str());
float percentLoaded; float percentLoaded;
if(isPipelines) if(isPipelines)
@ -446,7 +446,7 @@ void LatteShaderCache_ShowProgress(const std::function <bool(void)>& loadUpdateF
else else
text = fmt::format("{}/{} ({}%%)", g_shaderCacheLoaderState.loadedShaderFiles, g_shaderCacheLoaderState.shaderFileCount, (int)(percentLoaded * 100)); text = fmt::format("{}/{} ({}%%)", g_shaderCacheLoaderState.loadedShaderFiles, g_shaderCacheLoaderState.shaderFileCount, (int)(percentLoaded * 100));
ImGui::SetCursorPosX(width - ImGui::CalcTextSize(text.c_str()).x / 2); ImGui::SetCursorPosX(width - ImGui::CalcTextSize(text.c_str()).x / 2);
ImGui::Text(text.c_str()); ImGui::Text("%s", text.c_str());
ImGui::End(); ImGui::End();
} }
ImGui::PopFont(); ImGui::PopFont();
@ -775,4 +775,4 @@ void LatteShaderCache_handleDeprecatedCacheFiles(fs::path pathGeneric, fs::path
fs::remove(pathGenericPre1_25_0, ec); fs::remove(pathGenericPre1_25_0, ec);
} }
} }
} }

View file

@ -531,6 +531,6 @@ void VKRMemoryManager::appendOverlayHeapDebugInfo()
uint32 heapSizeMB = (heapSize / 1024 / 1024); uint32 heapSizeMB = (heapSize / 1024 / 1024);
uint32 allocatedBytesMB = (allocatedBytes / 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());
} }
} }

View file

@ -538,7 +538,6 @@ namespace coreinit
void coreinitExport_MEMAllocFromAllocator(PPCInterpreter_t* hCPU) 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]); MEMAllocator* memAllocator = (MEMAllocator*)memory_getPointerFromVirtualOffset(hCPU->gpr[3]);
// redirect execution to allocator alloc callback // redirect execution to allocator alloc callback
hCPU->instructionPointer = memAllocator->func->funcAlloc.GetMPTR(); hCPU->instructionPointer = memAllocator->func->funcAlloc.GetMPTR();
@ -546,7 +545,6 @@ namespace coreinit
void coreinitExport_MEMFreeToAllocator(PPCInterpreter_t* hCPU) 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]); MEMAllocator* memAllocator = (MEMAllocator*)memory_getPointerFromVirtualOffset(hCPU->gpr[3]);
// redirect execution to allocator free callback // redirect execution to allocator free callback
hCPU->instructionPointer = memAllocator->func->funcFree.GetMPTR(); hCPU->instructionPointer = memAllocator->func->funcFree.GetMPTR();
@ -568,11 +566,10 @@ namespace coreinit
void coreinitExport_MEMInitAllocatorForDefaultHeap(PPCInterpreter_t* hCPU) void coreinitExport_MEMInitAllocatorForDefaultHeap(PPCInterpreter_t* hCPU)
{ {
debug_printf("MEMInitAllocatorForDefaultHeap(0x%08x)", hCPU->gpr[3]);
ppcDefineParamStructPtr(memAllocator, MEMAllocator, 0); ppcDefineParamStructPtr(memAllocator, MEMAllocator, 0);
gDefaultHeapAllocator->funcAlloc = _swapEndianU32(PPCInterpreter_makeCallableExportDepr(_DefaultHeapAllocator_Alloc)); gDefaultHeapAllocator->funcAlloc = PPCInterpreter_makeCallableExportDepr(_DefaultHeapAllocator_Alloc);
gDefaultHeapAllocator->funcFree = _swapEndianU32(PPCInterpreter_makeCallableExportDepr(_DefaultHeapAllocator_Free)); gDefaultHeapAllocator->funcFree = PPCInterpreter_makeCallableExportDepr(_DefaultHeapAllocator_Free);
memAllocator->func = gDefaultHeapAllocator.GetPtr(); memAllocator->func = gDefaultHeapAllocator.GetPtr();
memAllocator->heap = MEMPTR<void>(MEMGetBaseHeapHandle(1)); memAllocator->heap = MEMPTR<void>(MEMGetBaseHeapHandle(1));

View file

@ -831,8 +831,8 @@ SysAllocator<MEMAllocatorFunc> gExpHeapDefaultAllocator;
void MEMInitAllocatorForExpHeap(MEMAllocator* allocator, MEMHeapHandle heap, sint32 alignment) void MEMInitAllocatorForExpHeap(MEMAllocator* allocator, MEMHeapHandle heap, sint32 alignment)
{ {
allocator->func = gExpHeapDefaultAllocator.GetPtr(); allocator->func = gExpHeapDefaultAllocator.GetPtr();
gExpHeapDefaultAllocator->funcAlloc = _swapEndianU32(PPCInterpreter_makeCallableExportDepr(_DefaultAllocatorForExpHeap_Alloc)); gExpHeapDefaultAllocator->funcAlloc = PPCInterpreter_makeCallableExportDepr(_DefaultAllocatorForExpHeap_Alloc);
gExpHeapDefaultAllocator->funcFree = _swapEndianU32(PPCInterpreter_makeCallableExportDepr(_DefaultAllocatorForExpHeap_Free)); gExpHeapDefaultAllocator->funcFree = PPCInterpreter_makeCallableExportDepr(_DefaultAllocatorForExpHeap_Free);
allocator->heap = heap; allocator->heap = heap;
allocator->param1 = alignment; allocator->param1 = alignment;

View file

@ -390,7 +390,7 @@ void swkbd_render(bool mainWindow)
ImGui::PushFont(font); ImGui::PushFont(font);
if (ImGui::Begin("Keyboard Input", nullptr, kPopupFlags)) if (ImGui::Begin("Keyboard Input", nullptr, kPopupFlags))
{ {
ImGui::Text(_utf8WrapperPtr(ICON_FA_KEYBOARD)); ImGui::Text("%s", _utf8WrapperPtr(ICON_FA_KEYBOARD));
ImGui::SameLine(70); ImGui::SameLine(70);
auto text = boost::nowide::narrow(fmt::format(L"{}", swkbdInternalState->formStringBuffer)); 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", "SwkbdIsNeedCalcSubThreadFont__3RplFv", swkbdExport_SwkbdIsNeedCalcSubThreadFont);
osLib_addFunction("swkbd", "SwkbdIsNeedCalcSubThreadPredict__3RplFv", swkbdExport_SwkbdIsNeedCalcSubThreadPredict); osLib_addFunction("swkbd", "SwkbdIsNeedCalcSubThreadPredict__3RplFv", swkbdExport_SwkbdIsNeedCalcSubThreadPredict);
} }
} }

View file

@ -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 #pragma once
#include <stdlib.h> // for size_t #include <stdlib.h> // for size_t

View file

@ -13,7 +13,6 @@
"default-features": false "default-features": false
}, },
"rapidjson", "rapidjson",
"vulkan",
"sdl2", "sdl2",
"boost-tokenizer", "boost-tokenizer",
"boost-container", "boost-container",