diff --git a/UnleashedRecomp/CMakeLists.txt b/UnleashedRecomp/CMakeLists.txt index 0b239c69..3cb11f70 100644 --- a/UnleashedRecomp/CMakeLists.txt +++ b/UnleashedRecomp/CMakeLists.txt @@ -38,7 +38,6 @@ function(BIN2C) endfunction() add_compile_options( - -ffp-model=strict -march=sandybridge -fno-strict-aliasing @@ -53,6 +52,12 @@ add_compile_options( -Wno-null-conversion ) +if (WIN32) + add_compile_options(/fp:strict) +else() + add_compile_options(-ffp-model=strict) +endif() + add_compile_definitions( SWA_IMPL SDL_MAIN_HANDLED diff --git a/UnleashedRecomp/kernel/imports.cpp b/UnleashedRecomp/kernel/imports.cpp index f80a7a9a..2344f365 100644 --- a/UnleashedRecomp/kernel/imports.cpp +++ b/UnleashedRecomp/kernel/imports.cpp @@ -13,6 +13,10 @@ #include #include +#ifdef _WIN32 +#include +#endif + struct Event final : KernelObject, HostObject { bool manualReset; @@ -1259,17 +1263,18 @@ uint32_t RtlMultiByteToUnicodeN(wchar_t* UnicodeString, uint32_t MaxBytesInUnico MultiByteString, MultiByteString + BytesInMultiByteString ); - uint32_t bytesRequired = static_cast(wideString.size() * sizeof(wchar_t)); + uint32_t bytesRequired = static_cast((wideString.size() + 1) * sizeof(wchar_t)); uint32_t bytesToCopy = (bytesRequired > MaxBytesInUnicodeString) ? MaxBytesInUnicodeString : bytesRequired; memcpy(UnicodeString, wideString.data(), bytesToCopy); - for (size_t i = 0; i < bytesToCopy; i += sizeof(uint16_t)) + for (size_t i = 0; i < bytesToCopy / 2; i++) UnicodeString[i] = ByteSwap(UnicodeString[i]); - *BytesInUnicodeString = bytesToCopy; + if (BytesInUnicodeString != nullptr) + *BytesInUnicodeString = bytesToCopy; return STATUS_SUCCESS; } diff --git a/UnleashedRecomp/ui/game_window.h b/UnleashedRecomp/ui/game_window.h index 1be8f1ec..7fe381e2 100644 --- a/UnleashedRecomp/ui/game_window.h +++ b/UnleashedRecomp/ui/game_window.h @@ -88,7 +88,7 @@ public: : 19; // DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 const DWORD useImmersiveDarkMode = isEnabled; - DwmSetWindowAttribute(s_handle, flag, &useImmersiveDarkMode, sizeof(useImmersiveDarkMode)); + DwmSetWindowAttribute(s_renderWindow, flag, &useImmersiveDarkMode, sizeof(useImmersiveDarkMode)); #endif } diff --git a/UnleashedRecompLib/CMakeLists.txt b/UnleashedRecompLib/CMakeLists.txt index 5fa3926e..98d41dd1 100644 --- a/UnleashedRecompLib/CMakeLists.txt +++ b/UnleashedRecompLib/CMakeLists.txt @@ -1,12 +1,17 @@ project("UnleashedRecompLib") add_compile_options( - -ffp-model=strict -march=sandybridge -mlzcnt -fno-strict-aliasing ) +if (WIN32) + add_compile_options(/fp:strict) +else() + add_compile_options(-ffp-model=strict) +endif() + target_compile_definitions(PowerRecomp PRIVATE CONFIG_FILE_PATH=\"${CMAKE_CURRENT_SOURCE_DIR}/config/SWA.toml\") set(SWA_PPC_RECOMPILED_SOURCES diff --git a/tools/ShaderRecomp b/tools/ShaderRecomp index 472f5cc4..20bf4654 160000 --- a/tools/ShaderRecomp +++ b/tools/ShaderRecomp @@ -1 +1 @@ -Subproject commit 472f5cc4c69d232d759df6ddbd68032193804a94 +Subproject commit 20bf4654480aad68940c2bf019f2fc7cdde60b79