diff --git a/.gitmodules b/.gitmodules index 0784b50c..8f94ef0a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,12 @@ -[submodule "thirdparty/PowerRecomp"] - path = tools/PowerRecomp - url = https://github.com/hedge-dev/PowerRecomp +[submodule "tools/XenonRecomp"] + path = tools/XenonRecomp + url = https://github.com/hedge-dev/XenonRecomp.git [submodule "thirdparty/ddspp"] path = thirdparty/ddspp url = https://github.com/redorav/ddspp.git -[submodule "thirdparty/ShaderRecomp"] - path = tools/ShaderRecomp - url = https://github.com/hedge-dev/ShaderRecomp.git +[submodule "tools/XenosRecomp"] + path = tools/XenosRecomp + url = https://github.com/hedge-dev/XenosRecomp.git [submodule "thirdparty/libmspack"] path = thirdparty/libmspack url = https://github.com/kyz/libmspack diff --git a/CMakeLists.txt b/CMakeLists.txt index 652f3acd..141f3764 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,8 +5,8 @@ if(NOT DEFINED ENV{VCPKG_ROOT}) endif() include($ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake) -set(SWA_THIRDPARTY_ROOT ${CMAKE_SOURCE_DIR}/thirdparty) -set(SWA_TOOLS_ROOT ${CMAKE_SOURCE_DIR}/tools) +set(UNLEASHED_RECOMP_THIRDPARTY_ROOT ${CMAKE_SOURCE_DIR}/thirdparty) +set(UNLEASHED_RECOMP_TOOLS_ROOT ${CMAKE_SOURCE_DIR}/tools) set(CMAKE_CXX_STANDARD 20) set(BUILD_SHARED_LIBS OFF) @@ -18,8 +18,8 @@ endif() set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") -add_subdirectory(${SWA_THIRDPARTY_ROOT}) -add_subdirectory(${SWA_TOOLS_ROOT}) +add_subdirectory(${UNLEASHED_RECOMP_THIRDPARTY_ROOT}) +add_subdirectory(${UNLEASHED_RECOMP_TOOLS_ROOT}) project("UnleashedRecomp-ALL") diff --git a/UnleashedRecomp/CMakeLists.txt b/UnleashedRecomp/CMakeLists.txt index d21f07ee..51041556 100644 --- a/UnleashedRecomp/CMakeLists.txt +++ b/UnleashedRecomp/CMakeLists.txt @@ -1,15 +1,14 @@ project("UnleashedRecomp") -set(TARGET_NAME "SWA") if (WIN32) - option(SWA_D3D12 "Add D3D12 support for rendering" ON) + option(UNLEASHED_RECOMP_D3D12 "Add D3D12 support for rendering" ON) endif() if (CMAKE_SYSTEM_NAME MATCHES "Linux") - option(SWA_FLATPAK "Configure the build for Flatpak compatibility." OFF) + option(UNLEASHED_RECOMP_FLATPAK "Configure the build for Flatpak compatibility." OFF) endif() -option(SWA_XAUDIO2 "Use XAudio2 for audio playback" OFF) +option(UNLEASHED_RECOMP_XAUDIO2 "Use XAudio2 for audio playback" OFF) function(BIN2C) cmake_parse_arguments(BIN2C_ARGS "" "TARGET_OBJ;SOURCE_FILE;DEST_FILE;ARRAY_NAME;COMPRESSION_TYPE" "" ${ARGN}) @@ -64,16 +63,15 @@ else() endif() add_compile_definitions( - SWA_IMPL SDL_MAIN_HANDLED _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR # Microsoft wtf? _CRT_SECURE_NO_WARNINGS) -set(SWA_PRECOMPILED_HEADERS +set(UNLEASHED_RECOMP_PRECOMPILED_HEADERS "stdafx.h" ) -set(SWA_KERNEL_CXX_SOURCES +set(UNLEASHED_RECOMP_KERNEL_CXX_SOURCES "kernel/imports.cpp" "kernel/xdm.cpp" "kernel/heap.cpp" @@ -82,13 +80,13 @@ set(SWA_KERNEL_CXX_SOURCES "kernel/io/file_system.cpp" ) -set(SWA_LOCALE_CXX_SOURCES +set(UNLEASHED_RECOMP_LOCALE_CXX_SOURCES "locale/config_locale.cpp" "locale/locale.cpp" ) if (WIN32) - set(SWA_OS_CXX_SOURCES + set(UNLEASHED_RECOMP_OS_CXX_SOURCES "os/win32/logger_win32.cpp" "os/win32/media_win32.cpp" "os/win32/process_win32.cpp" @@ -96,7 +94,7 @@ if (WIN32) "os/win32/version_win32.cpp" ) elseif (CMAKE_SYSTEM_NAME MATCHES "Linux") - set(SWA_OS_CXX_SOURCES + set(UNLEASHED_RECOMP_OS_CXX_SOURCES "os/linux/logger_linux.cpp" "os/linux/media_linux.cpp" "os/linux/process_linux.cpp" @@ -105,11 +103,11 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "Linux") ) endif() -set(SWA_CPU_CXX_SOURCES +set(UNLEASHED_RECOMP_CPU_CXX_SOURCES "cpu/guest_thread.cpp" ) -set(SWA_GPU_CXX_SOURCES +set(UNLEASHED_RECOMP_GPU_CXX_SOURCES "gpu/video.cpp" "gpu/imgui/imgui_common.cpp" "gpu/imgui/imgui_font_builder.cpp" @@ -117,29 +115,29 @@ set(SWA_GPU_CXX_SOURCES "gpu/rhi/plume_vulkan.cpp" ) -if (SWA_D3D12) - list(APPEND SWA_GPU_CXX_SOURCES +if (UNLEASHED_RECOMP_D3D12) + list(APPEND UNLEASHED_RECOMP_GPU_CXX_SOURCES "gpu/rhi/plume_d3d12.cpp" ) endif() -set(SWA_APU_CXX_SOURCES +set(UNLEASHED_RECOMP_APU_CXX_SOURCES "apu/audio.cpp" "apu/embedded_player.cpp" ) -if (SWA_XAUDIO2) - list(APPEND SWA_APU_CXX_SOURCES "apu/driver/xaudio_driver.cpp") +if (UNLEASHED_RECOMP_XAUDIO2) + list(APPEND UNLEASHED_RECOMP_APU_CXX_SOURCES "apu/driver/xaudio_driver.cpp") else() - list(APPEND SWA_APU_CXX_SOURCES "apu/driver/sdl2_driver.cpp") + list(APPEND UNLEASHED_RECOMP_APU_CXX_SOURCES "apu/driver/sdl2_driver.cpp") endif() -set(SWA_HID_CXX_SOURCES +set(UNLEASHED_RECOMP_HID_CXX_SOURCES "hid/hid.cpp" "hid/driver/sdl_hid.cpp" ) -set(SWA_PATCHES_CXX_SOURCES +set(UNLEASHED_RECOMP_PATCHES_CXX_SOURCES "patches/ui/CHudPause_patches.cpp" "patches/ui/CTitleStateIntro_patches.cpp" "patches/ui/CTitleStateMenu_patches.cpp" @@ -158,7 +156,7 @@ set(SWA_PATCHES_CXX_SOURCES "patches/video_patches.cpp" ) -set(SWA_UI_CXX_SOURCES +set(UNLEASHED_RECOMP_UI_CXX_SOURCES "ui/achievement_menu.cpp" "ui/achievement_overlay.cpp" "ui/installer_wizard.cpp" @@ -171,7 +169,7 @@ set(SWA_UI_CXX_SOURCES "ui/game_window.cpp" ) -set(SWA_INSTALL_CXX_SOURCES +set(UNLEASHED_RECOMP_INSTALL_CXX_SOURCES "install/installer.cpp" "install/iso_file_system.cpp" "install/memory_mapped_file.cpp" @@ -187,56 +185,56 @@ set(SWA_INSTALL_CXX_SOURCES "install/hashes/update.cpp" ) -set(SWA_USER_CXX_SOURCES +set(UNLEASHED_RECOMP_USER_CXX_SOURCES "user/achievement_data.cpp" "user/config.cpp" ) -set(SWA_MOD_CXX_SOURCES +set(UNLEASHED_RECOMP_MOD_CXX_SOURCES "mod/mod_loader.cpp" ) -set(SWA_THIRDPARTY_SOURCES - "${SWA_THIRDPARTY_ROOT}/imgui/backends/imgui_impl_sdl2.cpp" - "${SWA_THIRDPARTY_ROOT}/imgui/imgui.cpp" - "${SWA_THIRDPARTY_ROOT}/imgui/imgui_demo.cpp" - "${SWA_THIRDPARTY_ROOT}/imgui/imgui_draw.cpp" - "${SWA_THIRDPARTY_ROOT}/imgui/imgui_tables.cpp" - "${SWA_THIRDPARTY_ROOT}/imgui/imgui_widgets.cpp" - "${SWA_THIRDPARTY_ROOT}/implot/implot.cpp" - "${SWA_THIRDPARTY_ROOT}/implot/implot_demo.cpp" - "${SWA_THIRDPARTY_ROOT}/implot/implot_items.cpp" - "${SWA_THIRDPARTY_ROOT}/libmspack/libmspack/mspack/lzxd.c" - "${SWA_THIRDPARTY_ROOT}/tiny-AES-c/aes.c" - "${SWA_TOOLS_ROOT}/ShaderRecomp/thirdparty/smol-v/source/smolv.cpp" +set(UNLEASHED_RECOMP_THIRDPARTY_SOURCES + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/backends/imgui_impl_sdl2.cpp" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui.cpp" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui_demo.cpp" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui_draw.cpp" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui_tables.cpp" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui_widgets.cpp" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot/implot.cpp" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot/implot_demo.cpp" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot/implot_items.cpp" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/libmspack/libmspack/mspack/lzxd.c" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/tiny-AES-c/aes.c" + "${UNLEASHED_RECOMP_TOOLS_ROOT}/XenosRecomp/thirdparty/smol-v/source/smolv.cpp" ) -set(SWA_THIRDPARTY_INCLUDES - "${SWA_THIRDPARTY_ROOT}/concurrentqueue" - "${SWA_THIRDPARTY_ROOT}/ddspp" - "${SWA_THIRDPARTY_ROOT}/imgui" - "${SWA_THIRDPARTY_ROOT}/implot" - "${SWA_THIRDPARTY_ROOT}/libmspack/libmspack/mspack" - "${SWA_THIRDPARTY_ROOT}/magic_enum/include" - "${SWA_THIRDPARTY_ROOT}/stb" - "${SWA_THIRDPARTY_ROOT}/tiny-AES-c" - "${SWA_THIRDPARTY_ROOT}/TinySHA1" - "${SWA_THIRDPARTY_ROOT}/unordered_dense/include" - "${SWA_THIRDPARTY_ROOT}/volk" - "${SWA_THIRDPARTY_ROOT}/Vulkan-Headers/include" - "${SWA_THIRDPARTY_ROOT}/VulkanMemoryAllocator/include" - "${SWA_TOOLS_ROOT}/bc_diff" - "${SWA_TOOLS_ROOT}/ShaderRecomp/thirdparty/smol-v/source" +set(UNLEASHED_RECOMP_THIRDPARTY_INCLUDES + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/concurrentqueue" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/ddspp" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/libmspack/libmspack/mspack" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/magic_enum/include" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/stb" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/tiny-AES-c" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/TinySHA1" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/unordered_dense/include" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/volk" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/Vulkan-Headers/include" + "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/VulkanMemoryAllocator/include" + "${UNLEASHED_RECOMP_TOOLS_ROOT}/bc_diff" + "${UNLEASHED_RECOMP_TOOLS_ROOT}/XenosRecomp/thirdparty/smol-v/source" ) -if (SWA_D3D12) - list(APPEND SWA_THIRDPARTY_INCLUDES "${SWA_THIRDPARTY_ROOT}/D3D12MemoryAllocator/include") - list(APPEND SWA_THIRDPARTY_SOURCES "${SWA_THIRDPARTY_ROOT}/D3D12MemoryAllocator/src/D3D12MemAlloc.cpp") +if (UNLEASHED_RECOMP_D3D12) + list(APPEND UNLEASHED_RECOMP_THIRDPARTY_INCLUDES "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/D3D12MemoryAllocator/include") + list(APPEND UNLEASHED_RECOMP_THIRDPARTY_SOURCES "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/D3D12MemoryAllocator/src/D3D12MemAlloc.cpp") endif() -set_source_files_properties(${SWA_THIRDPARTY_SOURCES} PROPERTIES SKIP_PRECOMPILE_HEADERS ON) +set_source_files_properties(${UNLEASHED_RECOMP_THIRDPARTY_SOURCES} PROPERTIES SKIP_PRECOMPILE_HEADERS ON) -set(SWA_CXX_SOURCES +set(UNLEASHED_RECOMP_CXX_SOURCES "app.cpp" "exports.cpp" "main.cpp" @@ -244,40 +242,38 @@ set(SWA_CXX_SOURCES "stdafx.cpp" "version.cpp" - ${SWA_KERNEL_CXX_SOURCES} - ${SWA_LOCALE_CXX_SOURCES} - ${SWA_OS_CXX_SOURCES} - ${SWA_CPU_CXX_SOURCES} - ${SWA_GPU_CXX_SOURCES} - ${SWA_APU_CXX_SOURCES} - ${SWA_HID_CXX_SOURCES} - ${SWA_PATCHES_CXX_SOURCES} - ${SWA_UI_CXX_SOURCES} - ${SWA_INSTALL_CXX_SOURCES} - ${SWA_USER_CXX_SOURCES} - ${SWA_MOD_CXX_SOURCES} - ${SWA_THIRDPARTY_SOURCES} + ${UNLEASHED_RECOMP_KERNEL_CXX_SOURCES} + ${UNLEASHED_RECOMP_LOCALE_CXX_SOURCES} + ${UNLEASHED_RECOMP_OS_CXX_SOURCES} + ${UNLEASHED_RECOMP_CPU_CXX_SOURCES} + ${UNLEASHED_RECOMP_GPU_CXX_SOURCES} + ${UNLEASHED_RECOMP_APU_CXX_SOURCES} + ${UNLEASHED_RECOMP_HID_CXX_SOURCES} + ${UNLEASHED_RECOMP_PATCHES_CXX_SOURCES} + ${UNLEASHED_RECOMP_UI_CXX_SOURCES} + ${UNLEASHED_RECOMP_INSTALL_CXX_SOURCES} + ${UNLEASHED_RECOMP_USER_CXX_SOURCES} + ${UNLEASHED_RECOMP_MOD_CXX_SOURCES} + ${UNLEASHED_RECOMP_THIRDPARTY_SOURCES} ) if (WIN32) # Set up Win32 resources for application icon. set(ICON_PATH "${PROJECT_SOURCE_DIR}/../UnleashedRecompResources/images/game_icon.ico") configure_file("res/win32/res.rc.template" "${CMAKE_BINARY_DIR}/res.rc" @ONLY) - add_executable(UnleashedRecomp ${SWA_CXX_SOURCES} "${CMAKE_BINARY_DIR}/res.rc") + add_executable(UnleashedRecomp ${UNLEASHED_RECOMP_CXX_SOURCES} "${CMAKE_BINARY_DIR}/res.rc") else() - add_executable(UnleashedRecomp ${SWA_CXX_SOURCES}) + add_executable(UnleashedRecomp ${UNLEASHED_RECOMP_CXX_SOURCES}) endif() -set_target_properties(UnleashedRecomp PROPERTIES OUTPUT_NAME ${TARGET_NAME}) - -if (SWA_FLATPAK) +if (UNLEASHED_RECOMP_FLATPAK) target_compile_definitions(UnleashedRecomp PRIVATE "GAME_INSTALL_DIRECTORY=\"/var/data\"") endif() -if (SWA_D3D12) +if (UNLEASHED_RECOMP_D3D12) find_package(directx-headers CONFIG REQUIRED) find_package(directx12-agility CONFIG REQUIRED) - target_compile_definitions(UnleashedRecomp PRIVATE SWA_D3D12) + target_compile_definitions(UnleashedRecomp PRIVATE UNLEASHED_RECOMP_D3D12) endif() if (CMAKE_SYSTEM_NAME MATCHES "Linux") @@ -286,7 +282,7 @@ endif() find_package(directx-dxc REQUIRED) -if (SWA_D3D12) +if (UNLEASHED_RECOMP_D3D12) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/D3D12) add_custom_command(TARGET UnleashedRecomp POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_CURRENT_BINARY_DIR}/D3D12 @@ -324,7 +320,7 @@ target_link_libraries(UnleashedRecomp PRIVATE msdf-atlas-gen::msdf-atlas-gen nfd::nfd o1heap - PowerUtils + XenonUtils SDL2::SDL2-static SDL2_mixer tomlplusplus::tomlplusplus @@ -335,7 +331,7 @@ target_link_libraries(UnleashedRecomp PRIVATE target_include_directories(UnleashedRecomp PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/api" - ${SWA_THIRDPARTY_INCLUDES} + ${UNLEASHED_RECOMP_THIRDPARTY_INCLUDES} ) if (CMAKE_SYSTEM_NAME MATCHES "Linux") @@ -344,12 +340,12 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux") target_link_libraries(UnleashedRecomp PRIVATE ${X11_LIBRARIES}) endif() -target_precompile_headers(UnleashedRecomp PUBLIC ${SWA_PRECOMPILED_HEADERS}) +target_precompile_headers(UnleashedRecomp PUBLIC ${UNLEASHED_RECOMP_PRECOMPILED_HEADERS}) function(compile_shader FILE_PATH TARGET_NAME) set(FILE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/gpu/shader/${FILE_PATH}.hlsl) cmake_path(GET FILE_PATH STEM VARIABLE_NAME) - if (SWA_D3D12) + if (UNLEASHED_RECOMP_D3D12) add_custom_command( OUTPUT ${FILE_PATH}.dxil.h COMMAND ${DIRECTX_DXC_TOOL} -T ${TARGET_NAME} -HV 2021 -all-resources-bound -Wno-ignored-attributes -Fh ${FILE_PATH}.dxil.h ${FILE_PATH} -Vn g_${VARIABLE_NAME}_dxil diff --git a/UnleashedRecomp/apu/audio.h b/UnleashedRecomp/apu/audio.h index 229264f5..aaa0038f 100644 --- a/UnleashedRecomp/apu/audio.h +++ b/UnleashedRecomp/apu/audio.h @@ -7,11 +7,9 @@ // Number of samples in a frame #define XAUDIO_NUM_SAMPLES 256 -#ifdef SWA_IMPL void XAudioInitializeSystem(); void XAudioRegisterClient(PPCFunc* callback, uint32_t param); void XAudioSubmitFrame(void* samples); -#endif uint32_t XAudioRegisterRenderDriverClient(be* callback, be* driver); uint32_t XAudioUnregisterRenderDriverClient(uint32_t driver); diff --git a/UnleashedRecomp/gpu/shader/csd_filter_ps.hlsl b/UnleashedRecomp/gpu/shader/csd_filter_ps.hlsl index 54d24112..e1ecde39 100644 --- a/UnleashedRecomp/gpu/shader/csd_filter_ps.hlsl +++ b/UnleashedRecomp/gpu/shader/csd_filter_ps.hlsl @@ -1,4 +1,4 @@ -#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h" +#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h" #ifdef __spirv__ diff --git a/UnleashedRecomp/gpu/shader/csd_no_tex_vs.hlsl b/UnleashedRecomp/gpu/shader/csd_no_tex_vs.hlsl index 9c83bb53..48ec6af1 100644 --- a/UnleashedRecomp/gpu/shader/csd_no_tex_vs.hlsl +++ b/UnleashedRecomp/gpu/shader/csd_no_tex_vs.hlsl @@ -1,4 +1,4 @@ -#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h" +#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h" #ifdef __spirv__ diff --git a/UnleashedRecomp/gpu/shader/csd_vs.hlsl b/UnleashedRecomp/gpu/shader/csd_vs.hlsl index c9862fb1..11463684 100644 --- a/UnleashedRecomp/gpu/shader/csd_vs.hlsl +++ b/UnleashedRecomp/gpu/shader/csd_vs.hlsl @@ -1,4 +1,4 @@ -#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h" +#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h" #ifdef __spirv__ diff --git a/UnleashedRecomp/gpu/shader/enhanced_motion_blur_ps.hlsl b/UnleashedRecomp/gpu/shader/enhanced_motion_blur_ps.hlsl index 6c4de50f..df707e7e 100644 --- a/UnleashedRecomp/gpu/shader/enhanced_motion_blur_ps.hlsl +++ b/UnleashedRecomp/gpu/shader/enhanced_motion_blur_ps.hlsl @@ -1,4 +1,4 @@ -#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h" +#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h" #ifdef __spirv__ diff --git a/UnleashedRecomp/gpu/shader/gamma_correction_ps.hlsl b/UnleashedRecomp/gpu/shader/gamma_correction_ps.hlsl index cf4be926..2f98b6e6 100644 --- a/UnleashedRecomp/gpu/shader/gamma_correction_ps.hlsl +++ b/UnleashedRecomp/gpu/shader/gamma_correction_ps.hlsl @@ -1,4 +1,4 @@ -#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h" +#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h" #ifdef __spirv__ diff --git a/UnleashedRecomp/gpu/shader/gaussian_blur.hlsli b/UnleashedRecomp/gpu/shader/gaussian_blur.hlsli index 20f99552..10d76cf3 100644 --- a/UnleashedRecomp/gpu/shader/gaussian_blur.hlsli +++ b/UnleashedRecomp/gpu/shader/gaussian_blur.hlsli @@ -1,4 +1,4 @@ -#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h" +#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h" #ifdef __spirv__ diff --git a/UnleashedRecomp/gpu/shader/movie_common.hlsli b/UnleashedRecomp/gpu/shader/movie_common.hlsli index 31f52a23..12942353 100644 --- a/UnleashedRecomp/gpu/shader/movie_common.hlsli +++ b/UnleashedRecomp/gpu/shader/movie_common.hlsli @@ -1,6 +1,6 @@ #pragma once -#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h" +#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h" #ifdef __spirv__ diff --git a/UnleashedRecomp/gpu/video.cpp b/UnleashedRecomp/gpu/video.cpp index fa1c20f8..a4a65852 100644 --- a/UnleashedRecomp/gpu/video.cpp +++ b/UnleashedRecomp/gpu/video.cpp @@ -34,9 +34,9 @@ #include #endif -#include "../../tools/ShaderRecomp/ShaderRecomp/shader_common.h" +#include "../../tools/XenosRecomp/XenosRecomp/shader_common.h" -#ifdef SWA_D3D12 +#ifdef UNLEASHED_RECOMP_D3D12 #include "shader/copy_vs.hlsl.dxil.h" #include "shader/csd_filter_ps.hlsl.dxil.h" #include "shader/csd_no_tex_vs.hlsl.dxil.h" @@ -84,7 +84,7 @@ extern "C" namespace plume { -#ifdef SWA_D3D12 +#ifdef UNLEASHED_RECOMP_D3D12 extern std::unique_ptr CreateD3D12Interface(); #endif #ifdef SDL_VULKAN_ENABLED @@ -198,7 +198,7 @@ static void SetDirtyValue(bool& dirtyState, T& dest, const T& src) } } -#ifdef SWA_D3D12 +#ifdef UNLEASHED_RECOMP_D3D12 static bool g_vulkan = false; #else static constexpr bool g_vulkan = true; @@ -619,7 +619,7 @@ static void LoadEmbeddedResources() g_shaderCache = std::make_unique(g_spirvCacheDecompressedSize); ZSTD_decompress(g_shaderCache.get(), g_spirvCacheDecompressedSize, g_compressedSpirvCache, g_spirvCacheCompressedSize); } -#ifdef SWA_D3D12 +#ifdef UNLEASHED_RECOMP_D3D12 else { g_shaderCache = std::make_unique(g_dxilCacheDecompressedSize); @@ -1111,7 +1111,7 @@ static GuestShader* g_csdShader; static std::unique_ptr g_enhancedMotionBlurShader; -#ifdef SWA_D3D12 +#ifdef UNLEASHED_RECOMP_D3D12 #define CREATE_SHADER(NAME) \ g_device->createShader( \ @@ -1440,7 +1440,7 @@ void Video::CreateHostDevice(const char *sdlVideoDriver) GameWindow::Init(sdlVideoDriver); -#ifdef SWA_D3D12 +#ifdef UNLEASHED_RECOMP_D3D12 g_vulkan = DetectWine() || Config::GraphicsAPI == EGraphicsAPI::Vulkan; #endif @@ -1452,7 +1452,7 @@ void Video::CreateHostDevice(const char *sdlVideoDriver) #else g_interface = CreateVulkanInterface(); #endif -#ifdef SWA_D3D12 +#ifdef UNLEASHED_RECOMP_D3D12 else g_interface = CreateD3D12Interface(); #endif @@ -3108,7 +3108,7 @@ static RenderShader* GetOrLinkShader(GuestShader* guestShader, uint32_t specCons shader = guestShader->linkedShaders[specConstants].get(); } -#ifdef SWA_D3D12 +#ifdef UNLEASHED_RECOMP_D3D12 if (shader == nullptr) { static Mutex g_compiledSpecConstantLibraryBlobMutex; diff --git a/UnleashedRecomp/gpu/video.h b/UnleashedRecomp/gpu/video.h index de94b1dc..ae5c0653 100644 --- a/UnleashedRecomp/gpu/video.h +++ b/UnleashedRecomp/gpu/video.h @@ -285,7 +285,7 @@ struct GuestShader : GuestResource std::unique_ptr shader; struct ShaderCacheEntry* shaderCacheEntry = nullptr; ankerl::unordered_dense::map> linkedShaders; -#ifdef SWA_D3D12 +#ifdef UNLEASHED_RECOMP_D3D12 std::vector> shaderBlobs; ComPtr libraryBlob; #endif diff --git a/UnleashedRecomp/stdafx.h b/UnleashedRecomp/stdafx.h index 6bbf4181..4c553910 100644 --- a/UnleashedRecomp/stdafx.h +++ b/UnleashedRecomp/stdafx.h @@ -13,7 +13,7 @@ using Microsoft::WRL::ComPtr; #include #endif -#ifdef SWA_D3D12 +#ifdef UNLEASHED_RECOMP_D3D12 #include #endif diff --git a/UnleashedRecomp/ui/game_window.cpp b/UnleashedRecomp/ui/game_window.cpp index c13bd9f7..3ac7b901 100644 --- a/UnleashedRecomp/ui/game_window.cpp +++ b/UnleashedRecomp/ui/game_window.cpp @@ -214,7 +214,7 @@ void GameWindow::Init(const char* sdlVideoDriver) if (!IsPositionValid()) GameWindow::ResetDimensions(); - s_pWindow = SDL_CreateWindow("SWA", s_x, s_y, s_width, s_height, GetWindowFlags()); + s_pWindow = SDL_CreateWindow("Unleashed Recompiled", s_x, s_y, s_width, s_height, GetWindowFlags()); if (IsFullscreen()) SDL_ShowCursor(SDL_DISABLE); diff --git a/UnleashedRecomp/user/config.cpp b/UnleashedRecomp/user/config.cpp index 0696ad26..d952af91 100644 --- a/UnleashedRecomp/user/config.cpp +++ b/UnleashedRecomp/user/config.cpp @@ -45,7 +45,7 @@ CONFIG_DEFINE_ENUM_TEMPLATE(EVoiceLanguage) CONFIG_DEFINE_ENUM_TEMPLATE(EGraphicsAPI) { -#ifdef SWA_D3D12 +#ifdef UNLEASHED_RECOMP_D3D12 { "D3D12", EGraphicsAPI::D3D12 }, #endif { "Vulkan", EGraphicsAPI::Vulkan } diff --git a/UnleashedRecomp/user/config.h b/UnleashedRecomp/user/config.h index 597c792a..ad3654de 100644 --- a/UnleashedRecomp/user/config.h +++ b/UnleashedRecomp/user/config.h @@ -56,7 +56,7 @@ enum class EVoiceLanguage : uint32_t enum class EGraphicsAPI : uint32_t { -#ifdef SWA_D3D12 +#ifdef UNLEASHED_RECOMP_D3D12 D3D12, #endif Vulkan diff --git a/UnleashedRecomp/user/config_def.h b/UnleashedRecomp/user/config_def.h index cca938f3..90f72d9f 100644 --- a/UnleashedRecomp/user/config_def.h +++ b/UnleashedRecomp/user/config_def.h @@ -21,7 +21,7 @@ CONFIG_DEFINE_LOCALISED("Audio", bool, Subtitles, true); CONFIG_DEFINE_LOCALISED("Audio", bool, MusicAttenuation, false); CONFIG_DEFINE_LOCALISED("Audio", bool, BattleTheme, true); -#ifdef SWA_D3D12 +#ifdef UNLEASHED_RECOMP_D3D12 CONFIG_DEFINE_ENUM("Video", EGraphicsAPI, GraphicsAPI, EGraphicsAPI::D3D12); #else CONFIG_DEFINE_ENUM("Video", EGraphicsAPI, GraphicsAPI, EGraphicsAPI::Vulkan); diff --git a/UnleashedRecomp/user/paths.h b/UnleashedRecomp/user/paths.h index a081f857..003f4eb7 100644 --- a/UnleashedRecomp/user/paths.h +++ b/UnleashedRecomp/user/paths.h @@ -2,7 +2,7 @@ #include -#define USER_DIRECTORY "SWA" +#define USER_DIRECTORY "UnleashedRecomp" #ifndef GAME_INSTALL_DIRECTORY #define GAME_INSTALL_DIRECTORY "." diff --git a/UnleashedRecompLib/CMakeLists.txt b/UnleashedRecompLib/CMakeLists.txt index 6d8134e0..6b92a236 100644 --- a/UnleashedRecompLib/CMakeLists.txt +++ b/UnleashedRecompLib/CMakeLists.txt @@ -12,11 +12,11 @@ else() add_compile_options(-ffp-model=strict) endif() -target_compile_definitions(PowerRecomp PRIVATE - CONFIG_FILE_PATH=\"${CMAKE_CURRENT_SOURCE_DIR}/config/SWA.toml\" - HEADER_FILE_PATH=\"${SWA_TOOLS_ROOT}/PowerRecomp/PowerUtils/ppc_context.h\") +target_compile_definitions(XenonRecomp PRIVATE + XENON_RECOMP_CONFIG_FILE_PATH=\"${CMAKE_CURRENT_SOURCE_DIR}/config/SWA.toml\" + XENON_RECOMP_HEADER_FILE_PATH=\"${UNLEASHED_RECOMP_TOOLS_ROOT}/XenonRecomp/XenonUtils/ppc_context.h\") -set(SWA_PPC_RECOMPILED_SOURCES +set(UNLEASHED_RECOMP_PPC_RECOMPILED_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_config.h" "${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_context.h" "${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_func_mapping.cpp" @@ -24,37 +24,37 @@ set(SWA_PPC_RECOMPILED_SOURCES ) foreach(i RANGE 0 260) - list(APPEND SWA_PPC_RECOMPILED_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_recomp.${i}.cpp") + list(APPEND UNLEASHED_RECOMP_PPC_RECOMPILED_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_recomp.${i}.cpp") endforeach() add_custom_command( - OUTPUT ${SWA_PPC_RECOMPILED_SOURCES} - COMMAND $ + OUTPUT ${UNLEASHED_RECOMP_PPC_RECOMPILED_SOURCES} + COMMAND $ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/private/default.xex" "${CMAKE_CURRENT_SOURCE_DIR}/config/SWA.toml" ) -set(SHADER_RECOMP_ROOT "${SWA_TOOLS_ROOT}/ShaderRecomp/ShaderRecomp") -set(SHADER_RECOMP_INCLUDE "${SHADER_RECOMP_ROOT}/shader_common.h") +set(XENOS_RECOMP_ROOT "${UNLEASHED_RECOMP_TOOLS_ROOT}/XenosRecomp/XenosRecomp") +set(XENOS_RECOMP_INCLUDE "${XENOS_RECOMP_ROOT}/shader_common.h") -target_compile_definitions(ShaderRecomp PRIVATE - SHADER_RECOMP_INPUT=\"${CMAKE_CURRENT_SOURCE_DIR}/private\" - SHADER_RECOMP_OUTPUT=\"${CMAKE_CURRENT_SOURCE_DIR}/shader/shader_cache.cpp\" - SHADER_RECOMP_INCLUDE_INPUT=\"${SHADER_RECOMP_INCLUDE}\" +target_compile_definitions(XenosRecomp PRIVATE + XENOS_RECOMP_INPUT=\"${CMAKE_CURRENT_SOURCE_DIR}/private\" + XENOS_RECOMP_OUTPUT=\"${CMAKE_CURRENT_SOURCE_DIR}/shader/shader_cache.cpp\" + XENOS_RECOMP_INCLUDE_INPUT=\"${XENOS_RECOMP_INCLUDE}\" ) -file(GLOB SHADER_RECOMP_SOURCES - "${SHADER_RECOMP_ROOT}/*.h" - "${SHADER_RECOMP_ROOT}/*.cpp" +file(GLOB XENOS_RECOMP_SOURCES + "${XENOS_RECOMP_ROOT}/*.h" + "${XENOS_RECOMP_ROOT}/*.cpp" ) add_custom_command( OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/shader/shader_cache.cpp" - COMMAND $ - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/private/shader.ar" ${SHADER_RECOMP_SOURCES} ${SHADER_RECOMP_INCLUDE} + COMMAND $ + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/private/shader.ar" ${XENOS_RECOMP_SOURCES} ${XENOS_RECOMP_INCLUDE} ) add_library(UnleashedRecompLib - ${SWA_PPC_RECOMPILED_SOURCES} + ${UNLEASHED_RECOMP_PPC_RECOMPILED_SOURCES} "shader/shader_cache.h" "shader/shader_cache.cpp" ) diff --git a/flatpak/io.github.hedge_dev.unleashedrecomp.desktop b/flatpak/io.github.hedge_dev.unleashedrecomp.desktop index a94400f7..5f8db212 100644 --- a/flatpak/io.github.hedge_dev.unleashedrecomp.desktop +++ b/flatpak/io.github.hedge_dev.unleashedrecomp.desktop @@ -1,8 +1,8 @@ [Desktop Entry] Name=Unleashed Recompiled -Exec=/app/bin/SWA +Exec=/app/bin/UnleashedRecomp Type=Application Icon=io.github.hedge_dev.unleashedrecomp Categories=Game; Comment=Static recompilation of Sonic Unleashed. -MimeType=x-scheme-handler/unleashedrecomp \ No newline at end of file +MimeType=x-scheme-handler/unleashedrecomp diff --git a/flatpak/io.github.hedge_dev.unleashedrecomp.json b/flatpak/io.github.hedge_dev.unleashedrecomp.json index 51887c3f..a9393da1 100644 --- a/flatpak/io.github.hedge_dev.unleashedrecomp.json +++ b/flatpak/io.github.hedge_dev.unleashedrecomp.json @@ -20,10 +20,10 @@ "name": "UnleashedRecomp", "buildsystem": "simple", "build-commands": [ - "cmake --preset linux-release -DSWA_FLATPAK=ON -DSDL2MIXER_VORBIS=VORBISFILE", + "cmake --preset linux-release -DUNLEASHED_RECOMP_FLATPAK=ON -DSDL2MIXER_VORBIS=VORBISFILE", "cmake --build out/build/linux-release", "mkdir -p /app/bin", - "cp out/build/linux-release/UnleashedRecomp/SWA /app/bin/SWA", + "cp out/build/linux-release/UnleashedRecomp/UnleashedRecomp /app/bin/UnleashedRecomp", "install -Dm644 UnleashedRecompResources/images/game_icon.png /app/share/icons/hicolor/128x128/apps/${FLATPAK_ID}.png", "install -Dm644 flatpak/io.github.hedge_dev.unleashedrecomp.metainfo.xml /app/share/metainfo/${FLATPAK_ID}.metainfo.xml", "install -Dm644 flatpak/io.github.hedge_dev.unleashedrecomp.desktop /app/share/applications/${FLATPAK_ID}.desktop" diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 4ace5405..97656fd8 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -15,8 +15,8 @@ set(SDL2MIXER_OPUS OFF) set(SDL2MIXER_VORBIS "VORBISFILE") set(SDL2MIXER_WAVPACK OFF) -add_subdirectory("${SWA_THIRDPARTY_ROOT}/msdf-atlas-gen") -add_subdirectory("${SWA_THIRDPARTY_ROOT}/nativefiledialog-extended") -add_subdirectory("${SWA_THIRDPARTY_ROOT}/o1heap") -add_subdirectory("${SWA_THIRDPARTY_ROOT}/SDL") -add_subdirectory("${SWA_THIRDPARTY_ROOT}/SDL_mixer") +add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/msdf-atlas-gen") +add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/nativefiledialog-extended") +add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/o1heap") +add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/SDL") +add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/SDL_mixer") diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 8c1ae807..33b579e9 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,5 +1,5 @@ -add_subdirectory(${SWA_TOOLS_ROOT}/bc_diff) -add_subdirectory(${SWA_TOOLS_ROOT}/file_to_c) -add_subdirectory(${SWA_TOOLS_ROOT}/fshasher) -add_subdirectory(${SWA_TOOLS_ROOT}/PowerRecomp) -add_subdirectory(${SWA_TOOLS_ROOT}/ShaderRecomp) +add_subdirectory(${UNLEASHED_RECOMP_TOOLS_ROOT}/bc_diff) +add_subdirectory(${UNLEASHED_RECOMP_TOOLS_ROOT}/file_to_c) +add_subdirectory(${UNLEASHED_RECOMP_TOOLS_ROOT}/fshasher) +add_subdirectory(${UNLEASHED_RECOMP_TOOLS_ROOT}/XenonRecomp) +add_subdirectory(${UNLEASHED_RECOMP_TOOLS_ROOT}/XenosRecomp) diff --git a/tools/PowerRecomp b/tools/PowerRecomp deleted file mode 160000 index 7fb8af1b..00000000 --- a/tools/PowerRecomp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7fb8af1bad9ecb22d5fa9c1b72555cdf7c22db02 diff --git a/tools/ShaderRecomp b/tools/ShaderRecomp deleted file mode 160000 index 66c618cc..00000000 --- a/tools/ShaderRecomp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 66c618cc72db3a46778caa9b9dd1a5328e8c3765 diff --git a/tools/XenonRecomp b/tools/XenonRecomp new file mode 160000 index 00000000..87e35090 --- /dev/null +++ b/tools/XenonRecomp @@ -0,0 +1 @@ +Subproject commit 87e350906ba41cb01aedcc6cb3a94aac24d75251 diff --git a/tools/XenosRecomp b/tools/XenosRecomp new file mode 160000 index 00000000..ab277869 --- /dev/null +++ b/tools/XenosRecomp @@ -0,0 +1 @@ +Subproject commit ab277869d428295fe6398b5f2708f20b6998e6cb