diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 33a86883..a343f5a3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,11 +11,6 @@ endif() if(MSVC) add_compile_definitions(WIN32_LEAN_AND_MEAN CURL_STATICLIB) - #add_compile_definitions(VK_USE_PLATFORM_WIN32_KHR) - # _CRT_SECURE_NO_WARNINGS - # _WINSOCK_DEPRECATED_NO_WARNINGS - # _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING - # _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS elseif(UNIX) if(APPLE) add_compile_definitions( @@ -32,7 +27,6 @@ elseif(UNIX) add_compile_definitions(VK_USE_PLATFORM_WAYLAND_KHR) endif() endif() - add_compile_options(-maes) # warnings if(CMAKE_C_COMPILER_ID STREQUAL "Clang") add_compile_options(-Wno-ambiguous-reversed-operator) diff --git a/src/Cafe/CafeSystem.cpp b/src/Cafe/CafeSystem.cpp index 6e9c5ce6..d302e137 100644 --- a/src/Cafe/CafeSystem.cpp +++ b/src/Cafe/CafeSystem.cpp @@ -232,21 +232,21 @@ void InfoLog_TitleLoaded() void InfoLog_PrintActiveSettings() { const auto& config = GetConfig(); - forceLog_printf("------- Active settings -------"); + cemuLog_log(LogType::Force, "------- Active settings -------"); // settings to log: - forceLog_printf("CPU-Mode: %s%s", fmt::format("{}", ActiveSettings::GetCPUMode()).c_str(), g_current_game_profile->GetCPUMode().has_value() ? " (gameprofile)" : ""); - forceLog_printf("Load shared libraries: %s%s", ActiveSettings::LoadSharedLibrariesEnabled() ? "true" : "false", g_current_game_profile->ShouldLoadSharedLibraries().has_value() ? " (gameprofile)" : ""); - forceLog_printf("Use precompiled shaders: %s%s", fmt::format("{}", ActiveSettings::GetPrecompiledShadersOption()).c_str(), g_current_game_profile->GetPrecompiledShadersState().has_value() ? " (gameprofile)" : ""); - forceLog_printf("Full sync at GX2DrawDone: %s", ActiveSettings::WaitForGX2DrawDoneEnabled() ? "true" : "false"); + cemuLog_log(LogType::Force, "CPU-Mode: {}{}", fmt::format("{}", ActiveSettings::GetCPUMode()).c_str(), g_current_game_profile->GetCPUMode().has_value() ? " (gameprofile)" : ""); + cemuLog_log(LogType::Force, "Load shared libraries: {}{}", ActiveSettings::LoadSharedLibrariesEnabled() ? "true" : "false", g_current_game_profile->ShouldLoadSharedLibraries().has_value() ? " (gameprofile)" : ""); + cemuLog_log(LogType::Force, "Use precompiled shaders: {}{}", fmt::format("{}", ActiveSettings::GetPrecompiledShadersOption()), g_current_game_profile->GetPrecompiledShadersState().has_value() ? " (gameprofile)" : ""); + cemuLog_log(LogType::Force, "Full sync at GX2DrawDone: {}", ActiveSettings::WaitForGX2DrawDoneEnabled() ? "true" : "false"); + cemuLog_log(LogType::Force, "Strict shader mul: {}", g_current_game_profile->GetAccurateShaderMul() == AccurateShaderMulOption::True ? "true" : "false"); if (ActiveSettings::GetGraphicsAPI() == GraphicAPI::kVulkan) { - forceLog_printf("Async compile: %s", GetConfig().async_compile.GetValue() ? "true" : "false"); + cemuLog_log(LogType::Force, "Async compile: {}", GetConfig().async_compile.GetValue() ? "true" : "false"); if(!GetConfig().vk_accurate_barriers.GetValue()) - forceLog_printf("Accurate barriers are disabled!"); + cemuLog_log(LogType::Force, "Accurate barriers are disabled!"); } - - forceLog_printf("Console language: %s", fmt::format("{}", config.console_language).c_str()); + cemuLog_log(LogType::Force, "Console language: {}", config.console_language); } void PPCCore_setupSPR(PPCInterpreter_t* hCPU, uint32 coreIndex) diff --git a/src/Cafe/HW/Latte/Core/LatteIndices.cpp b/src/Cafe/HW/Latte/Core/LatteIndices.cpp index fa52332a..6e1d7455 100644 --- a/src/Cafe/HW/Latte/Core/LatteIndices.cpp +++ b/src/Cafe/HW/Latte/Core/LatteIndices.cpp @@ -3,20 +3,10 @@ #include "Cafe/HW/Latte/ISA/RegDefines.h" #include "Common/cpu_features.h" -#if defined(ARCH_X86_64) -#if __GNUC__ +#if defined(ARCH_X86_64) && defined(__GNUC__) #include #endif -#ifdef __GNUC__ -#define ATTRIBUTE_AVX2 __attribute__((target("avx2"))) -#define ATTRIBUTE_SSE41 __attribute__((target("sse4.1"))) -#else -#define ATTRIBUTE_AVX2 -#define ATTRIBUTE_SSE41 -#endif -#endif - struct { const void* lastPtr; diff --git a/src/Common/cpu_features.h b/src/Common/cpu_features.h index d2bec82c..130b51a8 100644 --- a/src/Common/cpu_features.h +++ b/src/Common/cpu_features.h @@ -1,4 +1,14 @@ +#ifdef __GNUC__ +#define ATTRIBUTE_AVX2 __attribute__((target("avx2"))) +#define ATTRIBUTE_SSE41 __attribute__((target("sse4.1"))) +#define ATTRIBUTE_AESNI __attribute__((target("aes"))) +#else +#define ATTRIBUTE_AVX2 +#define ATTRIBUTE_SSE41 +#define ATTRIBUTE_AESNI +#endif + class CPUFeaturesImpl { public: diff --git a/src/audio/IAudioInputAPI.cpp b/src/audio/IAudioInputAPI.cpp index 250f2e0a..c896b6fa 100644 --- a/src/audio/IAudioInputAPI.cpp +++ b/src/audio/IAudioInputAPI.cpp @@ -16,7 +16,7 @@ IAudioInputAPI::IAudioInputAPI(uint32 samplerate, uint32 channels, uint32 sample void IAudioInputAPI::PrintLogging() { - forceLog_printf("------- Init Audio Input backend -------"); + forceLog_printf("------- Init Audio input backend -------"); forceLog_printf("Cubeb: %s", s_availableApis[Cubeb] ? "available" : "not supported"); } diff --git a/src/util/crypto/aes128.cpp b/src/util/crypto/aes128.cpp index 8ab7b608..e11b4b44 100644 --- a/src/util/crypto/aes128.cpp +++ b/src/util/crypto/aes128.cpp @@ -601,7 +601,7 @@ void AES128_CBC_decrypt_updateIV(uint8* output, uint8* input, uint32 length, con } #if defined(ARCH_X86_64) -inline __m128i AESNI128_ASSIST( +ATTRIBUTE_AESNI inline __m128i AESNI128_ASSIST( __m128i temp1, __m128i temp2) { @@ -621,7 +621,7 @@ inline __m128i AESNI128_ASSIST( return temp1; } -void AESNI128_KeyExpansionEncrypt(const unsigned char *userkey, unsigned char *key) +ATTRIBUTE_AESNI void AESNI128_KeyExpansionEncrypt(const unsigned char *userkey, unsigned char *key) { __m128i temp1, temp2; __m128i *Key_Schedule = (__m128i*)key; @@ -659,7 +659,7 @@ void AESNI128_KeyExpansionEncrypt(const unsigned char *userkey, unsigned char *k Key_Schedule[10] = temp1; } -void AESNI128_KeyExpansionDecrypt(const unsigned char *userkey, unsigned char *key) +ATTRIBUTE_AESNI void AESNI128_KeyExpansionDecrypt(const unsigned char *userkey, unsigned char *key) { __m128i temp1, temp2; __m128i *Key_Schedule = (__m128i*)key; @@ -702,7 +702,7 @@ void AESNI128_KeyExpansionDecrypt(const unsigned char *userkey, unsigned char *k } } -void AESNI128_CBC_encrypt(const unsigned char *in, +ATTRIBUTE_AESNI void AESNI128_CBC_encrypt(const unsigned char *in, unsigned char *out, unsigned char ivec[16], unsigned long length, @@ -730,7 +730,7 @@ void AESNI128_CBC_encrypt(const unsigned char *in, } } -void AESNI128_CBC_decryptWithExpandedKey(const unsigned char *in, +ATTRIBUTE_AESNI void AESNI128_CBC_decryptWithExpandedKey(const unsigned char *in, unsigned char *out, const unsigned char ivec[16], unsigned long length, @@ -757,7 +757,7 @@ void AESNI128_CBC_decryptWithExpandedKey(const unsigned char *in, } } -void __aesni__AES128_CBC_decrypt(uint8* output, uint8* input, uint32 length, const uint8* key, const uint8* iv) +ATTRIBUTE_AESNI void __aesni__AES128_CBC_decrypt(uint8* output, uint8* input, uint32 length, const uint8* key, const uint8* iv) { alignas(16) uint8 expandedKey[11 * 16]; AESNI128_KeyExpansionDecrypt(key, expandedKey); @@ -772,7 +772,7 @@ void __aesni__AES128_CBC_decrypt(uint8* output, uint8* input, uint32 length, con } } -void __aesni__AES128_ECB_encrypt(uint8* input, const uint8* key, uint8* output) +ATTRIBUTE_AESNI void __aesni__AES128_ECB_encrypt(uint8* input, const uint8* key, uint8* output) { alignas(16) uint8 expandedKey[11 * 16]; AESNI128_KeyExpansionEncrypt(key, expandedKey);