Replace uses of SWA with UnleashedRecomp & rebrand the recompilers. (#138)

This commit is contained in:
Skyth (Asilkan) 2025-01-19 23:21:05 +03:00 committed by GitHub
parent 312f913a92
commit 1efb4943b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 147 additions and 153 deletions

12
.gitmodules vendored
View file

@ -1,12 +1,12 @@
[submodule "thirdparty/PowerRecomp"] [submodule "tools/XenonRecomp"]
path = tools/PowerRecomp path = tools/XenonRecomp
url = https://github.com/hedge-dev/PowerRecomp url = https://github.com/hedge-dev/XenonRecomp.git
[submodule "thirdparty/ddspp"] [submodule "thirdparty/ddspp"]
path = thirdparty/ddspp path = thirdparty/ddspp
url = https://github.com/redorav/ddspp.git url = https://github.com/redorav/ddspp.git
[submodule "thirdparty/ShaderRecomp"] [submodule "tools/XenosRecomp"]
path = tools/ShaderRecomp path = tools/XenosRecomp
url = https://github.com/hedge-dev/ShaderRecomp.git url = https://github.com/hedge-dev/XenosRecomp.git
[submodule "thirdparty/libmspack"] [submodule "thirdparty/libmspack"]
path = thirdparty/libmspack path = thirdparty/libmspack
url = https://github.com/kyz/libmspack url = https://github.com/kyz/libmspack

View file

@ -5,8 +5,8 @@ if(NOT DEFINED ENV{VCPKG_ROOT})
endif() endif()
include($ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake) include($ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake)
set(SWA_THIRDPARTY_ROOT ${CMAKE_SOURCE_DIR}/thirdparty) set(UNLEASHED_RECOMP_THIRDPARTY_ROOT ${CMAKE_SOURCE_DIR}/thirdparty)
set(SWA_TOOLS_ROOT ${CMAKE_SOURCE_DIR}/tools) set(UNLEASHED_RECOMP_TOOLS_ROOT ${CMAKE_SOURCE_DIR}/tools)
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
set(BUILD_SHARED_LIBS OFF) set(BUILD_SHARED_LIBS OFF)
@ -18,8 +18,8 @@ endif()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
add_subdirectory(${SWA_THIRDPARTY_ROOT}) add_subdirectory(${UNLEASHED_RECOMP_THIRDPARTY_ROOT})
add_subdirectory(${SWA_TOOLS_ROOT}) add_subdirectory(${UNLEASHED_RECOMP_TOOLS_ROOT})
project("UnleashedRecomp-ALL") project("UnleashedRecomp-ALL")

View file

@ -1,15 +1,14 @@
project("UnleashedRecomp") project("UnleashedRecomp")
set(TARGET_NAME "SWA")
if (WIN32) if (WIN32)
option(SWA_D3D12 "Add D3D12 support for rendering" ON) option(UNLEASHED_RECOMP_D3D12 "Add D3D12 support for rendering" ON)
endif() endif()
if (CMAKE_SYSTEM_NAME MATCHES "Linux") 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() endif()
option(SWA_XAUDIO2 "Use XAudio2 for audio playback" OFF) option(UNLEASHED_RECOMP_XAUDIO2 "Use XAudio2 for audio playback" OFF)
function(BIN2C) function(BIN2C)
cmake_parse_arguments(BIN2C_ARGS "" "TARGET_OBJ;SOURCE_FILE;DEST_FILE;ARRAY_NAME;COMPRESSION_TYPE" "" ${ARGN}) cmake_parse_arguments(BIN2C_ARGS "" "TARGET_OBJ;SOURCE_FILE;DEST_FILE;ARRAY_NAME;COMPRESSION_TYPE" "" ${ARGN})
@ -64,16 +63,15 @@ else()
endif() endif()
add_compile_definitions( add_compile_definitions(
SWA_IMPL
SDL_MAIN_HANDLED SDL_MAIN_HANDLED
_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR # Microsoft wtf? _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR # Microsoft wtf?
_CRT_SECURE_NO_WARNINGS) _CRT_SECURE_NO_WARNINGS)
set(SWA_PRECOMPILED_HEADERS set(UNLEASHED_RECOMP_PRECOMPILED_HEADERS
"stdafx.h" "stdafx.h"
) )
set(SWA_KERNEL_CXX_SOURCES set(UNLEASHED_RECOMP_KERNEL_CXX_SOURCES
"kernel/imports.cpp" "kernel/imports.cpp"
"kernel/xdm.cpp" "kernel/xdm.cpp"
"kernel/heap.cpp" "kernel/heap.cpp"
@ -82,13 +80,13 @@ set(SWA_KERNEL_CXX_SOURCES
"kernel/io/file_system.cpp" "kernel/io/file_system.cpp"
) )
set(SWA_LOCALE_CXX_SOURCES set(UNLEASHED_RECOMP_LOCALE_CXX_SOURCES
"locale/config_locale.cpp" "locale/config_locale.cpp"
"locale/locale.cpp" "locale/locale.cpp"
) )
if (WIN32) if (WIN32)
set(SWA_OS_CXX_SOURCES set(UNLEASHED_RECOMP_OS_CXX_SOURCES
"os/win32/logger_win32.cpp" "os/win32/logger_win32.cpp"
"os/win32/media_win32.cpp" "os/win32/media_win32.cpp"
"os/win32/process_win32.cpp" "os/win32/process_win32.cpp"
@ -96,7 +94,7 @@ if (WIN32)
"os/win32/version_win32.cpp" "os/win32/version_win32.cpp"
) )
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux") elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
set(SWA_OS_CXX_SOURCES set(UNLEASHED_RECOMP_OS_CXX_SOURCES
"os/linux/logger_linux.cpp" "os/linux/logger_linux.cpp"
"os/linux/media_linux.cpp" "os/linux/media_linux.cpp"
"os/linux/process_linux.cpp" "os/linux/process_linux.cpp"
@ -105,11 +103,11 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
) )
endif() endif()
set(SWA_CPU_CXX_SOURCES set(UNLEASHED_RECOMP_CPU_CXX_SOURCES
"cpu/guest_thread.cpp" "cpu/guest_thread.cpp"
) )
set(SWA_GPU_CXX_SOURCES set(UNLEASHED_RECOMP_GPU_CXX_SOURCES
"gpu/video.cpp" "gpu/video.cpp"
"gpu/imgui/imgui_common.cpp" "gpu/imgui/imgui_common.cpp"
"gpu/imgui/imgui_font_builder.cpp" "gpu/imgui/imgui_font_builder.cpp"
@ -117,29 +115,29 @@ set(SWA_GPU_CXX_SOURCES
"gpu/rhi/plume_vulkan.cpp" "gpu/rhi/plume_vulkan.cpp"
) )
if (SWA_D3D12) if (UNLEASHED_RECOMP_D3D12)
list(APPEND SWA_GPU_CXX_SOURCES list(APPEND UNLEASHED_RECOMP_GPU_CXX_SOURCES
"gpu/rhi/plume_d3d12.cpp" "gpu/rhi/plume_d3d12.cpp"
) )
endif() endif()
set(SWA_APU_CXX_SOURCES set(UNLEASHED_RECOMP_APU_CXX_SOURCES
"apu/audio.cpp" "apu/audio.cpp"
"apu/embedded_player.cpp" "apu/embedded_player.cpp"
) )
if (SWA_XAUDIO2) if (UNLEASHED_RECOMP_XAUDIO2)
list(APPEND SWA_APU_CXX_SOURCES "apu/driver/xaudio_driver.cpp") list(APPEND UNLEASHED_RECOMP_APU_CXX_SOURCES "apu/driver/xaudio_driver.cpp")
else() 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() endif()
set(SWA_HID_CXX_SOURCES set(UNLEASHED_RECOMP_HID_CXX_SOURCES
"hid/hid.cpp" "hid/hid.cpp"
"hid/driver/sdl_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/CHudPause_patches.cpp"
"patches/ui/CTitleStateIntro_patches.cpp" "patches/ui/CTitleStateIntro_patches.cpp"
"patches/ui/CTitleStateMenu_patches.cpp" "patches/ui/CTitleStateMenu_patches.cpp"
@ -158,7 +156,7 @@ set(SWA_PATCHES_CXX_SOURCES
"patches/video_patches.cpp" "patches/video_patches.cpp"
) )
set(SWA_UI_CXX_SOURCES set(UNLEASHED_RECOMP_UI_CXX_SOURCES
"ui/achievement_menu.cpp" "ui/achievement_menu.cpp"
"ui/achievement_overlay.cpp" "ui/achievement_overlay.cpp"
"ui/installer_wizard.cpp" "ui/installer_wizard.cpp"
@ -171,7 +169,7 @@ set(SWA_UI_CXX_SOURCES
"ui/game_window.cpp" "ui/game_window.cpp"
) )
set(SWA_INSTALL_CXX_SOURCES set(UNLEASHED_RECOMP_INSTALL_CXX_SOURCES
"install/installer.cpp" "install/installer.cpp"
"install/iso_file_system.cpp" "install/iso_file_system.cpp"
"install/memory_mapped_file.cpp" "install/memory_mapped_file.cpp"
@ -187,56 +185,56 @@ set(SWA_INSTALL_CXX_SOURCES
"install/hashes/update.cpp" "install/hashes/update.cpp"
) )
set(SWA_USER_CXX_SOURCES set(UNLEASHED_RECOMP_USER_CXX_SOURCES
"user/achievement_data.cpp" "user/achievement_data.cpp"
"user/config.cpp" "user/config.cpp"
) )
set(SWA_MOD_CXX_SOURCES set(UNLEASHED_RECOMP_MOD_CXX_SOURCES
"mod/mod_loader.cpp" "mod/mod_loader.cpp"
) )
set(SWA_THIRDPARTY_SOURCES set(UNLEASHED_RECOMP_THIRDPARTY_SOURCES
"${SWA_THIRDPARTY_ROOT}/imgui/backends/imgui_impl_sdl2.cpp" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/backends/imgui_impl_sdl2.cpp"
"${SWA_THIRDPARTY_ROOT}/imgui/imgui.cpp" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui.cpp"
"${SWA_THIRDPARTY_ROOT}/imgui/imgui_demo.cpp" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui_demo.cpp"
"${SWA_THIRDPARTY_ROOT}/imgui/imgui_draw.cpp" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui_draw.cpp"
"${SWA_THIRDPARTY_ROOT}/imgui/imgui_tables.cpp" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui_tables.cpp"
"${SWA_THIRDPARTY_ROOT}/imgui/imgui_widgets.cpp" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui_widgets.cpp"
"${SWA_THIRDPARTY_ROOT}/implot/implot.cpp" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot/implot.cpp"
"${SWA_THIRDPARTY_ROOT}/implot/implot_demo.cpp" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot/implot_demo.cpp"
"${SWA_THIRDPARTY_ROOT}/implot/implot_items.cpp" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot/implot_items.cpp"
"${SWA_THIRDPARTY_ROOT}/libmspack/libmspack/mspack/lzxd.c" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/libmspack/libmspack/mspack/lzxd.c"
"${SWA_THIRDPARTY_ROOT}/tiny-AES-c/aes.c" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/tiny-AES-c/aes.c"
"${SWA_TOOLS_ROOT}/ShaderRecomp/thirdparty/smol-v/source/smolv.cpp" "${UNLEASHED_RECOMP_TOOLS_ROOT}/XenosRecomp/thirdparty/smol-v/source/smolv.cpp"
) )
set(SWA_THIRDPARTY_INCLUDES set(UNLEASHED_RECOMP_THIRDPARTY_INCLUDES
"${SWA_THIRDPARTY_ROOT}/concurrentqueue" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/concurrentqueue"
"${SWA_THIRDPARTY_ROOT}/ddspp" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/ddspp"
"${SWA_THIRDPARTY_ROOT}/imgui" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui"
"${SWA_THIRDPARTY_ROOT}/implot" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot"
"${SWA_THIRDPARTY_ROOT}/libmspack/libmspack/mspack" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/libmspack/libmspack/mspack"
"${SWA_THIRDPARTY_ROOT}/magic_enum/include" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/magic_enum/include"
"${SWA_THIRDPARTY_ROOT}/stb" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/stb"
"${SWA_THIRDPARTY_ROOT}/tiny-AES-c" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/tiny-AES-c"
"${SWA_THIRDPARTY_ROOT}/TinySHA1" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/TinySHA1"
"${SWA_THIRDPARTY_ROOT}/unordered_dense/include" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/unordered_dense/include"
"${SWA_THIRDPARTY_ROOT}/volk" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/volk"
"${SWA_THIRDPARTY_ROOT}/Vulkan-Headers/include" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/Vulkan-Headers/include"
"${SWA_THIRDPARTY_ROOT}/VulkanMemoryAllocator/include" "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/VulkanMemoryAllocator/include"
"${SWA_TOOLS_ROOT}/bc_diff" "${UNLEASHED_RECOMP_TOOLS_ROOT}/bc_diff"
"${SWA_TOOLS_ROOT}/ShaderRecomp/thirdparty/smol-v/source" "${UNLEASHED_RECOMP_TOOLS_ROOT}/XenosRecomp/thirdparty/smol-v/source"
) )
if (SWA_D3D12) if (UNLEASHED_RECOMP_D3D12)
list(APPEND SWA_THIRDPARTY_INCLUDES "${SWA_THIRDPARTY_ROOT}/D3D12MemoryAllocator/include") list(APPEND UNLEASHED_RECOMP_THIRDPARTY_INCLUDES "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/D3D12MemoryAllocator/include")
list(APPEND SWA_THIRDPARTY_SOURCES "${SWA_THIRDPARTY_ROOT}/D3D12MemoryAllocator/src/D3D12MemAlloc.cpp") list(APPEND UNLEASHED_RECOMP_THIRDPARTY_SOURCES "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/D3D12MemoryAllocator/src/D3D12MemAlloc.cpp")
endif() 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" "app.cpp"
"exports.cpp" "exports.cpp"
"main.cpp" "main.cpp"
@ -244,40 +242,38 @@ set(SWA_CXX_SOURCES
"stdafx.cpp" "stdafx.cpp"
"version.cpp" "version.cpp"
${SWA_KERNEL_CXX_SOURCES} ${UNLEASHED_RECOMP_KERNEL_CXX_SOURCES}
${SWA_LOCALE_CXX_SOURCES} ${UNLEASHED_RECOMP_LOCALE_CXX_SOURCES}
${SWA_OS_CXX_SOURCES} ${UNLEASHED_RECOMP_OS_CXX_SOURCES}
${SWA_CPU_CXX_SOURCES} ${UNLEASHED_RECOMP_CPU_CXX_SOURCES}
${SWA_GPU_CXX_SOURCES} ${UNLEASHED_RECOMP_GPU_CXX_SOURCES}
${SWA_APU_CXX_SOURCES} ${UNLEASHED_RECOMP_APU_CXX_SOURCES}
${SWA_HID_CXX_SOURCES} ${UNLEASHED_RECOMP_HID_CXX_SOURCES}
${SWA_PATCHES_CXX_SOURCES} ${UNLEASHED_RECOMP_PATCHES_CXX_SOURCES}
${SWA_UI_CXX_SOURCES} ${UNLEASHED_RECOMP_UI_CXX_SOURCES}
${SWA_INSTALL_CXX_SOURCES} ${UNLEASHED_RECOMP_INSTALL_CXX_SOURCES}
${SWA_USER_CXX_SOURCES} ${UNLEASHED_RECOMP_USER_CXX_SOURCES}
${SWA_MOD_CXX_SOURCES} ${UNLEASHED_RECOMP_MOD_CXX_SOURCES}
${SWA_THIRDPARTY_SOURCES} ${UNLEASHED_RECOMP_THIRDPARTY_SOURCES}
) )
if (WIN32) if (WIN32)
# Set up Win32 resources for application icon. # Set up Win32 resources for application icon.
set(ICON_PATH "${PROJECT_SOURCE_DIR}/../UnleashedRecompResources/images/game_icon.ico") set(ICON_PATH "${PROJECT_SOURCE_DIR}/../UnleashedRecompResources/images/game_icon.ico")
configure_file("res/win32/res.rc.template" "${CMAKE_BINARY_DIR}/res.rc" @ONLY) 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() else()
add_executable(UnleashedRecomp ${SWA_CXX_SOURCES}) add_executable(UnleashedRecomp ${UNLEASHED_RECOMP_CXX_SOURCES})
endif() endif()
set_target_properties(UnleashedRecomp PROPERTIES OUTPUT_NAME ${TARGET_NAME}) if (UNLEASHED_RECOMP_FLATPAK)
if (SWA_FLATPAK)
target_compile_definitions(UnleashedRecomp PRIVATE "GAME_INSTALL_DIRECTORY=\"/var/data\"") target_compile_definitions(UnleashedRecomp PRIVATE "GAME_INSTALL_DIRECTORY=\"/var/data\"")
endif() endif()
if (SWA_D3D12) if (UNLEASHED_RECOMP_D3D12)
find_package(directx-headers CONFIG REQUIRED) find_package(directx-headers CONFIG REQUIRED)
find_package(directx12-agility CONFIG REQUIRED) find_package(directx12-agility CONFIG REQUIRED)
target_compile_definitions(UnleashedRecomp PRIVATE SWA_D3D12) target_compile_definitions(UnleashedRecomp PRIVATE UNLEASHED_RECOMP_D3D12)
endif() endif()
if (CMAKE_SYSTEM_NAME MATCHES "Linux") if (CMAKE_SYSTEM_NAME MATCHES "Linux")
@ -286,7 +282,7 @@ endif()
find_package(directx-dxc REQUIRED) find_package(directx-dxc REQUIRED)
if (SWA_D3D12) if (UNLEASHED_RECOMP_D3D12)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/D3D12) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/D3D12)
add_custom_command(TARGET UnleashedRecomp POST_BUILD add_custom_command(TARGET UnleashedRecomp POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_PROPERTY:Microsoft::DirectX12-Core,IMPORTED_LOCATION_RELEASE> ${CMAKE_CURRENT_BINARY_DIR}/D3D12 COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_PROPERTY:Microsoft::DirectX12-Core,IMPORTED_LOCATION_RELEASE> ${CMAKE_CURRENT_BINARY_DIR}/D3D12
@ -324,7 +320,7 @@ target_link_libraries(UnleashedRecomp PRIVATE
msdf-atlas-gen::msdf-atlas-gen msdf-atlas-gen::msdf-atlas-gen
nfd::nfd nfd::nfd
o1heap o1heap
PowerUtils XenonUtils
SDL2::SDL2-static SDL2::SDL2-static
SDL2_mixer SDL2_mixer
tomlplusplus::tomlplusplus tomlplusplus::tomlplusplus
@ -335,7 +331,7 @@ target_link_libraries(UnleashedRecomp PRIVATE
target_include_directories(UnleashedRecomp PRIVATE target_include_directories(UnleashedRecomp PRIVATE
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
"${CMAKE_CURRENT_SOURCE_DIR}/api" "${CMAKE_CURRENT_SOURCE_DIR}/api"
${SWA_THIRDPARTY_INCLUDES} ${UNLEASHED_RECOMP_THIRDPARTY_INCLUDES}
) )
if (CMAKE_SYSTEM_NAME MATCHES "Linux") if (CMAKE_SYSTEM_NAME MATCHES "Linux")
@ -344,12 +340,12 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
target_link_libraries(UnleashedRecomp PRIVATE ${X11_LIBRARIES}) target_link_libraries(UnleashedRecomp PRIVATE ${X11_LIBRARIES})
endif() 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) function(compile_shader FILE_PATH TARGET_NAME)
set(FILE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/gpu/shader/${FILE_PATH}.hlsl) set(FILE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/gpu/shader/${FILE_PATH}.hlsl)
cmake_path(GET FILE_PATH STEM VARIABLE_NAME) cmake_path(GET FILE_PATH STEM VARIABLE_NAME)
if (SWA_D3D12) if (UNLEASHED_RECOMP_D3D12)
add_custom_command( add_custom_command(
OUTPUT ${FILE_PATH}.dxil.h 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 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

View file

@ -7,11 +7,9 @@
// Number of samples in a frame // Number of samples in a frame
#define XAUDIO_NUM_SAMPLES 256 #define XAUDIO_NUM_SAMPLES 256
#ifdef SWA_IMPL
void XAudioInitializeSystem(); void XAudioInitializeSystem();
void XAudioRegisterClient(PPCFunc* callback, uint32_t param); void XAudioRegisterClient(PPCFunc* callback, uint32_t param);
void XAudioSubmitFrame(void* samples); void XAudioSubmitFrame(void* samples);
#endif
uint32_t XAudioRegisterRenderDriverClient(be<uint32_t>* callback, be<uint32_t>* driver); uint32_t XAudioRegisterRenderDriverClient(be<uint32_t>* callback, be<uint32_t>* driver);
uint32_t XAudioUnregisterRenderDriverClient(uint32_t driver); uint32_t XAudioUnregisterRenderDriverClient(uint32_t driver);

View file

@ -1,4 +1,4 @@
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h" #include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
#ifdef __spirv__ #ifdef __spirv__

View file

@ -1,4 +1,4 @@
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h" #include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
#ifdef __spirv__ #ifdef __spirv__

View file

@ -1,4 +1,4 @@
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h" #include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
#ifdef __spirv__ #ifdef __spirv__

View file

@ -1,4 +1,4 @@
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h" #include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
#ifdef __spirv__ #ifdef __spirv__

View file

@ -1,4 +1,4 @@
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h" #include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
#ifdef __spirv__ #ifdef __spirv__

View file

@ -1,4 +1,4 @@
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h" #include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
#ifdef __spirv__ #ifdef __spirv__

View file

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h" #include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
#ifdef __spirv__ #ifdef __spirv__

View file

@ -34,9 +34,9 @@
#include <magic_enum/magic_enum.hpp> #include <magic_enum/magic_enum.hpp>
#endif #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/copy_vs.hlsl.dxil.h"
#include "shader/csd_filter_ps.hlsl.dxil.h" #include "shader/csd_filter_ps.hlsl.dxil.h"
#include "shader/csd_no_tex_vs.hlsl.dxil.h" #include "shader/csd_no_tex_vs.hlsl.dxil.h"
@ -84,7 +84,7 @@ extern "C"
namespace plume namespace plume
{ {
#ifdef SWA_D3D12 #ifdef UNLEASHED_RECOMP_D3D12
extern std::unique_ptr<RenderInterface> CreateD3D12Interface(); extern std::unique_ptr<RenderInterface> CreateD3D12Interface();
#endif #endif
#ifdef SDL_VULKAN_ENABLED #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; static bool g_vulkan = false;
#else #else
static constexpr bool g_vulkan = true; static constexpr bool g_vulkan = true;
@ -619,7 +619,7 @@ static void LoadEmbeddedResources()
g_shaderCache = std::make_unique<uint8_t[]>(g_spirvCacheDecompressedSize); g_shaderCache = std::make_unique<uint8_t[]>(g_spirvCacheDecompressedSize);
ZSTD_decompress(g_shaderCache.get(), g_spirvCacheDecompressedSize, g_compressedSpirvCache, g_spirvCacheCompressedSize); ZSTD_decompress(g_shaderCache.get(), g_spirvCacheDecompressedSize, g_compressedSpirvCache, g_spirvCacheCompressedSize);
} }
#ifdef SWA_D3D12 #ifdef UNLEASHED_RECOMP_D3D12
else else
{ {
g_shaderCache = std::make_unique<uint8_t[]>(g_dxilCacheDecompressedSize); g_shaderCache = std::make_unique<uint8_t[]>(g_dxilCacheDecompressedSize);
@ -1111,7 +1111,7 @@ static GuestShader* g_csdShader;
static std::unique_ptr<GuestShader> g_enhancedMotionBlurShader; static std::unique_ptr<GuestShader> g_enhancedMotionBlurShader;
#ifdef SWA_D3D12 #ifdef UNLEASHED_RECOMP_D3D12
#define CREATE_SHADER(NAME) \ #define CREATE_SHADER(NAME) \
g_device->createShader( \ g_device->createShader( \
@ -1440,7 +1440,7 @@ void Video::CreateHostDevice(const char *sdlVideoDriver)
GameWindow::Init(sdlVideoDriver); GameWindow::Init(sdlVideoDriver);
#ifdef SWA_D3D12 #ifdef UNLEASHED_RECOMP_D3D12
g_vulkan = DetectWine() || Config::GraphicsAPI == EGraphicsAPI::Vulkan; g_vulkan = DetectWine() || Config::GraphicsAPI == EGraphicsAPI::Vulkan;
#endif #endif
@ -1452,7 +1452,7 @@ void Video::CreateHostDevice(const char *sdlVideoDriver)
#else #else
g_interface = CreateVulkanInterface(); g_interface = CreateVulkanInterface();
#endif #endif
#ifdef SWA_D3D12 #ifdef UNLEASHED_RECOMP_D3D12
else else
g_interface = CreateD3D12Interface(); g_interface = CreateD3D12Interface();
#endif #endif
@ -3108,7 +3108,7 @@ static RenderShader* GetOrLinkShader(GuestShader* guestShader, uint32_t specCons
shader = guestShader->linkedShaders[specConstants].get(); shader = guestShader->linkedShaders[specConstants].get();
} }
#ifdef SWA_D3D12 #ifdef UNLEASHED_RECOMP_D3D12
if (shader == nullptr) if (shader == nullptr)
{ {
static Mutex g_compiledSpecConstantLibraryBlobMutex; static Mutex g_compiledSpecConstantLibraryBlobMutex;

View file

@ -285,7 +285,7 @@ struct GuestShader : GuestResource
std::unique_ptr<RenderShader> shader; std::unique_ptr<RenderShader> shader;
struct ShaderCacheEntry* shaderCacheEntry = nullptr; struct ShaderCacheEntry* shaderCacheEntry = nullptr;
ankerl::unordered_dense::map<uint32_t, std::unique_ptr<RenderShader>> linkedShaders; ankerl::unordered_dense::map<uint32_t, std::unique_ptr<RenderShader>> linkedShaders;
#ifdef SWA_D3D12 #ifdef UNLEASHED_RECOMP_D3D12
std::vector<ComPtr<IDxcBlob>> shaderBlobs; std::vector<ComPtr<IDxcBlob>> shaderBlobs;
ComPtr<IDxcBlobEncoding> libraryBlob; ComPtr<IDxcBlobEncoding> libraryBlob;
#endif #endif

View file

@ -13,7 +13,7 @@ using Microsoft::WRL::ComPtr;
#include <pwd.h> #include <pwd.h>
#endif #endif
#ifdef SWA_D3D12 #ifdef UNLEASHED_RECOMP_D3D12
#include <dxcapi.h> #include <dxcapi.h>
#endif #endif

View file

@ -214,7 +214,7 @@ void GameWindow::Init(const char* sdlVideoDriver)
if (!IsPositionValid()) if (!IsPositionValid())
GameWindow::ResetDimensions(); 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()) if (IsFullscreen())
SDL_ShowCursor(SDL_DISABLE); SDL_ShowCursor(SDL_DISABLE);

View file

@ -45,7 +45,7 @@ CONFIG_DEFINE_ENUM_TEMPLATE(EVoiceLanguage)
CONFIG_DEFINE_ENUM_TEMPLATE(EGraphicsAPI) CONFIG_DEFINE_ENUM_TEMPLATE(EGraphicsAPI)
{ {
#ifdef SWA_D3D12 #ifdef UNLEASHED_RECOMP_D3D12
{ "D3D12", EGraphicsAPI::D3D12 }, { "D3D12", EGraphicsAPI::D3D12 },
#endif #endif
{ "Vulkan", EGraphicsAPI::Vulkan } { "Vulkan", EGraphicsAPI::Vulkan }

View file

@ -56,7 +56,7 @@ enum class EVoiceLanguage : uint32_t
enum class EGraphicsAPI : uint32_t enum class EGraphicsAPI : uint32_t
{ {
#ifdef SWA_D3D12 #ifdef UNLEASHED_RECOMP_D3D12
D3D12, D3D12,
#endif #endif
Vulkan Vulkan

View file

@ -21,7 +21,7 @@ CONFIG_DEFINE_LOCALISED("Audio", bool, Subtitles, true);
CONFIG_DEFINE_LOCALISED("Audio", bool, MusicAttenuation, false); CONFIG_DEFINE_LOCALISED("Audio", bool, MusicAttenuation, false);
CONFIG_DEFINE_LOCALISED("Audio", bool, BattleTheme, true); CONFIG_DEFINE_LOCALISED("Audio", bool, BattleTheme, true);
#ifdef SWA_D3D12 #ifdef UNLEASHED_RECOMP_D3D12
CONFIG_DEFINE_ENUM("Video", EGraphicsAPI, GraphicsAPI, EGraphicsAPI::D3D12); CONFIG_DEFINE_ENUM("Video", EGraphicsAPI, GraphicsAPI, EGraphicsAPI::D3D12);
#else #else
CONFIG_DEFINE_ENUM("Video", EGraphicsAPI, GraphicsAPI, EGraphicsAPI::Vulkan); CONFIG_DEFINE_ENUM("Video", EGraphicsAPI, GraphicsAPI, EGraphicsAPI::Vulkan);

View file

@ -2,7 +2,7 @@
#include <mod/mod_loader.h> #include <mod/mod_loader.h>
#define USER_DIRECTORY "SWA" #define USER_DIRECTORY "UnleashedRecomp"
#ifndef GAME_INSTALL_DIRECTORY #ifndef GAME_INSTALL_DIRECTORY
#define GAME_INSTALL_DIRECTORY "." #define GAME_INSTALL_DIRECTORY "."

View file

@ -12,11 +12,11 @@ else()
add_compile_options(-ffp-model=strict) add_compile_options(-ffp-model=strict)
endif() endif()
target_compile_definitions(PowerRecomp PRIVATE target_compile_definitions(XenonRecomp PRIVATE
CONFIG_FILE_PATH=\"${CMAKE_CURRENT_SOURCE_DIR}/config/SWA.toml\" XENON_RECOMP_CONFIG_FILE_PATH=\"${CMAKE_CURRENT_SOURCE_DIR}/config/SWA.toml\"
HEADER_FILE_PATH=\"${SWA_TOOLS_ROOT}/PowerRecomp/PowerUtils/ppc_context.h\") 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_config.h"
"${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_context.h" "${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_context.h"
"${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_func_mapping.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_func_mapping.cpp"
@ -24,37 +24,37 @@ set(SWA_PPC_RECOMPILED_SOURCES
) )
foreach(i RANGE 0 260) 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() endforeach()
add_custom_command( add_custom_command(
OUTPUT ${SWA_PPC_RECOMPILED_SOURCES} OUTPUT ${UNLEASHED_RECOMP_PPC_RECOMPILED_SOURCES}
COMMAND $<TARGET_FILE:PowerRecomp> COMMAND $<TARGET_FILE:XenonRecomp>
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/private/default.xex" "${CMAKE_CURRENT_SOURCE_DIR}/config/SWA.toml" 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(XENOS_RECOMP_ROOT "${UNLEASHED_RECOMP_TOOLS_ROOT}/XenosRecomp/XenosRecomp")
set(SHADER_RECOMP_INCLUDE "${SHADER_RECOMP_ROOT}/shader_common.h") set(XENOS_RECOMP_INCLUDE "${XENOS_RECOMP_ROOT}/shader_common.h")
target_compile_definitions(ShaderRecomp PRIVATE target_compile_definitions(XenosRecomp PRIVATE
SHADER_RECOMP_INPUT=\"${CMAKE_CURRENT_SOURCE_DIR}/private\" XENOS_RECOMP_INPUT=\"${CMAKE_CURRENT_SOURCE_DIR}/private\"
SHADER_RECOMP_OUTPUT=\"${CMAKE_CURRENT_SOURCE_DIR}/shader/shader_cache.cpp\" XENOS_RECOMP_OUTPUT=\"${CMAKE_CURRENT_SOURCE_DIR}/shader/shader_cache.cpp\"
SHADER_RECOMP_INCLUDE_INPUT=\"${SHADER_RECOMP_INCLUDE}\" XENOS_RECOMP_INCLUDE_INPUT=\"${XENOS_RECOMP_INCLUDE}\"
) )
file(GLOB SHADER_RECOMP_SOURCES file(GLOB XENOS_RECOMP_SOURCES
"${SHADER_RECOMP_ROOT}/*.h" "${XENOS_RECOMP_ROOT}/*.h"
"${SHADER_RECOMP_ROOT}/*.cpp" "${XENOS_RECOMP_ROOT}/*.cpp"
) )
add_custom_command( add_custom_command(
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/shader/shader_cache.cpp" OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/shader/shader_cache.cpp"
COMMAND $<TARGET_FILE:ShaderRecomp> COMMAND $<TARGET_FILE:XenosRecomp>
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/private/shader.ar" ${SHADER_RECOMP_SOURCES} ${SHADER_RECOMP_INCLUDE} DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/private/shader.ar" ${XENOS_RECOMP_SOURCES} ${XENOS_RECOMP_INCLUDE}
) )
add_library(UnleashedRecompLib add_library(UnleashedRecompLib
${SWA_PPC_RECOMPILED_SOURCES} ${UNLEASHED_RECOMP_PPC_RECOMPILED_SOURCES}
"shader/shader_cache.h" "shader/shader_cache.h"
"shader/shader_cache.cpp" "shader/shader_cache.cpp"
) )

View file

@ -1,6 +1,6 @@
[Desktop Entry] [Desktop Entry]
Name=Unleashed Recompiled Name=Unleashed Recompiled
Exec=/app/bin/SWA Exec=/app/bin/UnleashedRecomp
Type=Application Type=Application
Icon=io.github.hedge_dev.unleashedrecomp Icon=io.github.hedge_dev.unleashedrecomp
Categories=Game; Categories=Game;

View file

@ -20,10 +20,10 @@
"name": "UnleashedRecomp", "name": "UnleashedRecomp",
"buildsystem": "simple", "buildsystem": "simple",
"build-commands": [ "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", "cmake --build out/build/linux-release",
"mkdir -p /app/bin", "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 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.metainfo.xml /app/share/metainfo/${FLATPAK_ID}.metainfo.xml",
"install -Dm644 flatpak/io.github.hedge_dev.unleashedrecomp.desktop /app/share/applications/${FLATPAK_ID}.desktop" "install -Dm644 flatpak/io.github.hedge_dev.unleashedrecomp.desktop /app/share/applications/${FLATPAK_ID}.desktop"

View file

@ -15,8 +15,8 @@ set(SDL2MIXER_OPUS OFF)
set(SDL2MIXER_VORBIS "VORBISFILE") set(SDL2MIXER_VORBIS "VORBISFILE")
set(SDL2MIXER_WAVPACK OFF) set(SDL2MIXER_WAVPACK OFF)
add_subdirectory("${SWA_THIRDPARTY_ROOT}/msdf-atlas-gen") add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/msdf-atlas-gen")
add_subdirectory("${SWA_THIRDPARTY_ROOT}/nativefiledialog-extended") add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/nativefiledialog-extended")
add_subdirectory("${SWA_THIRDPARTY_ROOT}/o1heap") add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/o1heap")
add_subdirectory("${SWA_THIRDPARTY_ROOT}/SDL") add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/SDL")
add_subdirectory("${SWA_THIRDPARTY_ROOT}/SDL_mixer") add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/SDL_mixer")

View file

@ -1,5 +1,5 @@
add_subdirectory(${SWA_TOOLS_ROOT}/bc_diff) add_subdirectory(${UNLEASHED_RECOMP_TOOLS_ROOT}/bc_diff)
add_subdirectory(${SWA_TOOLS_ROOT}/file_to_c) add_subdirectory(${UNLEASHED_RECOMP_TOOLS_ROOT}/file_to_c)
add_subdirectory(${SWA_TOOLS_ROOT}/fshasher) add_subdirectory(${UNLEASHED_RECOMP_TOOLS_ROOT}/fshasher)
add_subdirectory(${SWA_TOOLS_ROOT}/PowerRecomp) add_subdirectory(${UNLEASHED_RECOMP_TOOLS_ROOT}/XenonRecomp)
add_subdirectory(${SWA_TOOLS_ROOT}/ShaderRecomp) add_subdirectory(${UNLEASHED_RECOMP_TOOLS_ROOT}/XenosRecomp)

@ -1 +0,0 @@
Subproject commit 7fb8af1bad9ecb22d5fa9c1b72555cdf7c22db02

@ -1 +0,0 @@
Subproject commit 66c618cc72db3a46778caa9b9dd1a5328e8c3765

1
tools/XenonRecomp Submodule

@ -0,0 +1 @@
Subproject commit 87e350906ba41cb01aedcc6cb3a94aac24d75251

1
tools/XenosRecomp Submodule

@ -0,0 +1 @@
Subproject commit ab277869d428295fe6398b5f2708f20b6998e6cb