From 8011108e2be06192e9c8890eaf45937dbd1e4290 Mon Sep 17 00:00:00 2001 From: ArtemisX64 Date: Sat, 27 Aug 2022 11:44:43 +0900 Subject: [PATCH 1/7] gcc --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 93d2b94e..186dbd69 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ build/ out/ .cache/ +bin/Cemu # Cemu bin files bin/otp.bin @@ -32,4 +33,4 @@ bin/shaderCache/* bin/controllerProfiles/* !bin/gameProfiles/default/* -bin/gameProfiles/* \ No newline at end of file +bin/gameProfiles/* From 664e6684b83066864a423aeec53ec9d038337f33 Mon Sep 17 00:00:00 2001 From: LoaTcHi <60046287+Loatchi@users.noreply.github.com> Date: Sat, 27 Aug 2022 05:15:56 +0200 Subject: [PATCH 2/7] Added french translation to the shortcut and metainfo file. (#81) * Added french translation to the shortcut comment and metainfo --- dist/linux/info.cemu.Cemu.desktop | 1 + dist/linux/info.cemu.Cemu.metainfo.xml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/dist/linux/info.cemu.Cemu.desktop b/dist/linux/info.cemu.Cemu.desktop index e23102d8..49679c9d 100644 --- a/dist/linux/info.cemu.Cemu.desktop +++ b/dist/linux/info.cemu.Cemu.desktop @@ -7,6 +7,7 @@ Exec=cemu Comment=Software to emulate Wii U games and applications on PC Comment[de]=Software zum emulieren von Wii U Spielen und Anwendungen auf dem PC Comment[ru]=Программа для эмуляции игр и приложений Wii U на PC +Comment[fr]=Application pour émuler des jeux et des applications Wii U sur PC Categories=Game;Emulator; Keywords=Nintendo; MimeType=application/x-wii-u-rom; diff --git a/dist/linux/info.cemu.Cemu.metainfo.xml b/dist/linux/info.cemu.Cemu.metainfo.xml index 2535cbf8..4016522d 100644 --- a/dist/linux/info.cemu.Cemu.metainfo.xml +++ b/dist/linux/info.cemu.Cemu.metainfo.xml @@ -5,6 +5,7 @@ Cemu Software to emulate Wii U games and applications on PC Software zum emulieren von Wii U Spielen und Anwendungen auf dem PC + Application pour émuler des jeux et applications Wii U sur PC Cemu Project info.cemu.Cemu.desktop CC0-1.0 @@ -12,10 +13,13 @@

Cemu is a Nintendo Wii U emulator that is able to run most Wii U games and homebrew in a playable state. Created by Exzap, and written in C/C++.

Cemu ist ein Nintendo Wii U-Emulator, der die meisten Wii U Spiele und Homebrew in einem spielbaren Zustand ausführen kann. Erstellt von Exzap, und geschrieben in C/C++.

+

Cemu est un émulateur de Wii U capable de lancer la plupart des jeux Wii U et des homebrews en interface de jeu. Crée par Exzap, et développé en C/C++.

This emulator aims at providing both high-accuracy and performance, and is actively being developed with new features and fixes to increase compatibility, convenience and usability.

Dieser Emulator zielt darauf ab, sowohl hohe Genauigkeit als auch Leistung zu bieten, und wird aktiv mit neuen Funktionen und Korrekturen weiterentwickelt, um Kompatibilität, Komfort und Benutzerfreundlichkeit zu verbessern.

+

Cet émulateur vise à la fois à offrir fidélité et performance, il est activement développé avec des nouvelles fonctionnalités et des correctifs pour augmenter la compatibilité, la commodité et la facilité d'utilisation.

It was written from scratch and development on the project began roughly early 2015.

Er wird seit Anfang 2015 entwickelt.

+

Il a été écrit à partir de zéro et son développement a débuté vers le début de l'année 2015.

From 20afbc6af6462bf50d16db6812449d31c82949c6 Mon Sep 17 00:00:00 2001 From: ArtemisX64 Date: Sat, 27 Aug 2022 12:30:31 +0900 Subject: [PATCH 3/7] Fix Compilation in Windows --- src/Common/precompiled.cpp | 2 +- src/Common/precompiled.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Common/precompiled.cpp b/src/Common/precompiled.cpp index c08ca1f1..5f656a45 100644 --- a/src/Common/precompiled.cpp +++ b/src/Common/precompiled.cpp @@ -1 +1 @@ -#include "precompiled.h" \ No newline at end of file +#include "precompiled.h" diff --git a/src/Common/precompiled.h b/src/Common/precompiled.h index 8e7da689..449f7ac8 100644 --- a/src/Common/precompiled.h +++ b/src/Common/precompiled.h @@ -225,7 +225,7 @@ typedef union _LARGE_INTEGER { #define DEBUG_BREAK __debugbreak() #define ALIGN(N) __declspec(align(N)) #define NOINLINE __declspec(noinline) - #define ASSUME(X) __assume((X) + #define ASSUME(X) __assume(X) #define THREAD_LOCAL __declspec(thread) #define POPCNT(X) __popcnt((X)) #else @@ -234,7 +234,8 @@ typedef union _LARGE_INTEGER { #define DEBUG_BREAK #define ALIGN(N) __attribute__((aligned (N))) #define NOINLINE __attribute__((noinline)) - #define ASSUME(X) + // fixme: random github solution. use it with caution + #define ASSUME(X) do { if (!(X)) __builtin_unreachable(); } while (0) #define THREAD_LOCAL __thread #define POPCNT(X) __builtin_popcount((X)) #endif From 5cba1a11851d9a232fda573f1114723ada34d702 Mon Sep 17 00:00:00 2001 From: gurrgur <31393177+gurrgur@users.noreply.github.com> Date: Sat, 27 Aug 2022 05:33:30 +0200 Subject: [PATCH 4/7] gui: keep shown graphic pack when clicking on preset dropdown (#77) --- src/gui/GraphicPacksWindow2.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/GraphicPacksWindow2.cpp b/src/gui/GraphicPacksWindow2.cpp index f46d8abe..a830cb72 100644 --- a/src/gui/GraphicPacksWindow2.cpp +++ b/src/gui/GraphicPacksWindow2.cpp @@ -421,6 +421,10 @@ void GraphicPacksWindow2::OnTreeSelectionChanged(wxTreeEvent& event) { wxWindowUpdateLocker lock(this); + bool item_deselected = m_graphic_pack_tree->GetSelection() == m_graphic_pack_tree->GetRootItem(); + if (item_deselected) + return; + const auto selection = m_graphic_pack_tree->GetSelection(); if (selection.IsOk()) { From 4bc6c01ce669145d0dbffeb2c9b35f8f96e89c03 Mon Sep 17 00:00:00 2001 From: ArtemisX64 Date: Sat, 27 Aug 2022 15:53:31 +0900 Subject: [PATCH 5/7] More linux fixes --- src/CMakeLists.txt | 6 +++++- src/Cafe/CMakeLists.txt | 2 +- src/Common/precompiled.h | 6 ++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 49f79e21..fd2c4add 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -28,7 +28,11 @@ elseif(UNIX) add_definitions(-fpermissive) add_definitions(-maes) # warnings - add_compile_options(-Wno-switch -Wno-ignored-attributes -Wno-deprecated-enum-enum-conversion -Wno-ambiguous-reversed-operator) + if(CMAKE_C_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wno-ambiguous-reversed-operator) + endif() + + add_compile_options(-Wno-switch -Wno-ignored-attributes -Wno-deprecated-enum-enum-conversion) endif() add_definitions(-DVK_NO_PROTOTYPES) diff --git a/src/Cafe/CMakeLists.txt b/src/Cafe/CMakeLists.txt index 1e3fe306..b9d16185 100644 --- a/src/Cafe/CMakeLists.txt +++ b/src/Cafe/CMakeLists.txt @@ -31,4 +31,4 @@ target_link_libraries(CemuCafe ih264d zarchive) IF(WIN32) target_link_libraries(CemuCafe iphlpapi) -ENDIF() \ No newline at end of file +ENDIF() diff --git a/src/Common/precompiled.h b/src/Common/precompiled.h index 449f7ac8..1d00311f 100644 --- a/src/Common/precompiled.h +++ b/src/Common/precompiled.h @@ -231,10 +231,12 @@ typedef union _LARGE_INTEGER { #else #define DLLEXPORT #define DLLIMPORT - #define DEBUG_BREAK + // fixme: random stack overflow solution. use with caution + #include + #define DEBUG_BREAK raise(SIGTRAP) #define ALIGN(N) __attribute__((aligned (N))) #define NOINLINE __attribute__((noinline)) - // fixme: random github solution. use it with caution + // fixme: random stack overflow solution. use it with caution #define ASSUME(X) do { if (!(X)) __builtin_unreachable(); } while (0) #define THREAD_LOCAL __thread #define POPCNT(X) __builtin_popcount((X)) From 8459cd928c2dfa0155fbeda5410b14a98805d78a Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Sat, 27 Aug 2022 09:33:01 +0200 Subject: [PATCH 6/7] fix some printf format specifiers (#76) use the definition in cinttypes for portability --- src/Cafe/HW/Latte/Core/LatteOverlay.cpp | 10 ++++++---- src/Cafe/OS/libs/nn_acp/nn_acp.cpp | 7 ++++--- src/Cemu/Tools/DownloadManager/DownloadManager.cpp | 3 ++- src/gui/MemorySearcherTool.cpp | 2 +- .../windows/PPCThreadsViewer/DebugPPCThreadsWindow.cpp | 6 ++++-- src/util/Zir/Core/IR.cpp | 10 ++++++---- 6 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/Cafe/HW/Latte/Core/LatteOverlay.cpp b/src/Cafe/HW/Latte/Core/LatteOverlay.cpp index ae483c32..998043d4 100644 --- a/src/Cafe/HW/Latte/Core/LatteOverlay.cpp +++ b/src/Cafe/HW/Latte/Core/LatteOverlay.cpp @@ -13,6 +13,8 @@ #include "input/InputManager.h" +#include + #if BOOST_OS_WINDOWS #include #include @@ -405,16 +407,16 @@ void LatteOverlay_RenderNotifications(ImVec2& position, ImVec2& pivot, sint32 di if (s_pipeline_count_async > 0) { if (s_pipeline_count > 1) - ImGui::Text("Compiled %d new pipelines... (%d async) TotalSync: %lldms", s_pipeline_count, s_pipeline_count_async, totalTime); + ImGui::Text("Compiled %d new pipelines... (%d async) TotalSync: %" PRIu64 "ms", s_pipeline_count, s_pipeline_count_async, totalTime); else - ImGui::Text("Compiled %d new pipeline... (%d async) TotalSync: %lldms", s_pipeline_count, s_pipeline_count_async, totalTime); + ImGui::Text("Compiled %d new pipeline... (%d async) TotalSync: %" PRIu64 "ms", s_pipeline_count, s_pipeline_count_async, totalTime); } else { if (s_pipeline_count > 1) - ImGui::Text("Compiled %d new pipelines... TotalSync: %lldms", s_pipeline_count, totalTime); + ImGui::Text("Compiled %d new pipelines... TotalSync: %" PRIu64 "ms", s_pipeline_count, totalTime); else - ImGui::Text("Compiled %d new pipeline... TotalSync: %lldms", s_pipeline_count, totalTime); + ImGui::Text("Compiled %d new pipeline... TotalSync: %" PRIu64 "ms", s_pipeline_count, totalTime); } #else if (s_pipeline_count_async > 0) diff --git a/src/Cafe/OS/libs/nn_acp/nn_acp.cpp b/src/Cafe/OS/libs/nn_acp/nn_acp.cpp index 97f183c1..48aa3c00 100644 --- a/src/Cafe/OS/libs/nn_acp/nn_acp.cpp +++ b/src/Cafe/OS/libs/nn_acp/nn_acp.cpp @@ -5,6 +5,7 @@ #include "Cafe/OS/libs/coreinit/coreinit_IOS.h" #include "Cafe/OS/libs/coreinit/coreinit_Time.h" +#include #include #include @@ -102,7 +103,7 @@ namespace acp { // found the entry! -> update timestamp xml::XMLElement* timestamp = account->FirstChildElement("timestamp"); - sprintf(tmp, "%016llx", _acpGetTimestamp()); + sprintf(tmp, "%" PRIx64, _acpGetTimestamp()); if (timestamp) timestamp->SetText(tmp); else @@ -125,7 +126,7 @@ namespace acp tinyxml2::XMLElement* timestamp = doc.NewElement("timestamp"); { - sprintf(tmp, "%016llx", _acpGetTimestamp()); + sprintf(tmp, "%" PRIx64, _acpGetTimestamp()); timestamp->SetText(tmp); } @@ -506,4 +507,4 @@ namespace acp osLib_addFunction("nn_acp", "ACPConvertNetworkTimeToOSCalendarTime", export_ACPConvertNetworkTimeToOSCalendarTime); } } -} \ No newline at end of file +} diff --git a/src/Cemu/Tools/DownloadManager/DownloadManager.cpp b/src/Cemu/Tools/DownloadManager/DownloadManager.cpp index 8a0aa895..edaa2e00 100644 --- a/src/Cemu/Tools/DownloadManager/DownloadManager.cpp +++ b/src/Cemu/Tools/DownloadManager/DownloadManager.cpp @@ -15,6 +15,7 @@ #include "Cafe/Filesystem/FST/FST.h" #include "Cafe/TitleList/TitleList.h" +#include #include #include #include @@ -580,7 +581,7 @@ void DownloadManager::searchForIncompleteDownloads() uint64 titleId; uint32 version; std::string name = p.path().filename().generic_string(); - if( sscanf(name.c_str(), "cemu_%016llx_v%u", &titleId, &version) != 2) + if( sscanf(name.c_str(), "cemu_% " PRIx64 "_v%u", &titleId, &version) != 2) continue; std::unique_lock _l(m_mutex); for (auto& itr : m_ticketCache) diff --git a/src/gui/MemorySearcherTool.cpp b/src/gui/MemorySearcherTool.cpp index 9fd55dcd..f86bf462 100644 --- a/src/gui/MemorySearcherTool.cpp +++ b/src/gui/MemorySearcherTool.cpp @@ -400,7 +400,7 @@ void MemorySearcherTool::OnResultListClick(wxMouseEvent& event) auto currValue = m_listResults->GetItemText(selectedIndex, 1); char addressString[256]; - sprintf(addressString, "0x%08x", address); + sprintf(addressString, "0x%08lx", address); // description, address, type, value, freeze wxVector data; diff --git a/src/gui/windows/PPCThreadsViewer/DebugPPCThreadsWindow.cpp b/src/gui/windows/PPCThreadsViewer/DebugPPCThreadsWindow.cpp index cd509a52..93eaa596 100644 --- a/src/gui/windows/PPCThreadsViewer/DebugPPCThreadsWindow.cpp +++ b/src/gui/windows/PPCThreadsViewer/DebugPPCThreadsWindow.cpp @@ -5,6 +5,8 @@ #include "Cafe/OS/RPL/rpl.h" #include "Cafe/OS/RPL/rpl_symbol_storage.h" +#include + enum { // options @@ -233,11 +235,11 @@ void DebugPPCThreadsWindow::RefreshThreadList() m_thread_list->SetItem(i, 7, tempStr); // last awake in cycles uint64 lastWakeUpTime = cafeThread->wakeUpTime; - sprintf(tempStr, "%I64u", lastWakeUpTime); + sprintf(tempStr, "%" PRIu64, lastWakeUpTime); m_thread_list->SetItem(i, 8, tempStr); // awake time in cycles uint64 awakeTime = cafeThread->totalCycles; - sprintf(tempStr, "%I64u", awakeTime); + sprintf(tempStr, "%" PRIu64, awakeTime); m_thread_list->SetItem(i, 9, tempStr); // thread name const char* threadName = "NULL"; diff --git a/src/util/Zir/Core/IR.cpp b/src/util/Zir/Core/IR.cpp index 5fdfba61..9e1e3e8b 100644 --- a/src/util/Zir/Core/IR.cpp +++ b/src/util/Zir/Core/IR.cpp @@ -1,6 +1,8 @@ #include "util/Zir/Core/IR.h" #include "util/Zir/Core/ZpIRDebug.h" +#include + namespace ZpIR { @@ -201,15 +203,15 @@ namespace ZpIR void DebugPrinter::debugPrintBlock(ZpIRBasicBlock* block) { // print name - printf("IRBasicBlock %016llx\n", (uintptr_t)block); + printf("IRBasicBlock %" PRIxPTR "\n", (uintptr_t)block); // print imports printf("Imports:\n"); for(auto itr : block->m_imports) - printf(" reg: %s sym:0x%llx\n", getRegisterName(block, itr.reg).c_str(), itr.name); + printf(" reg: %s sym:0x%lux\n", getRegisterName(block, itr.reg).c_str(), itr.name); // print exports printf("Exports:\n"); for (auto itr : block->m_exports) - printf(" reg: %s sym:0x%llx\n", getRegisterName(block, itr.reg).c_str(), itr.name); + printf(" reg: %s sym:0x%lux\n", getRegisterName(block, itr.reg).c_str(), itr.name); // print instructions printf("Assembly:\n"); IR::__InsBase* instruction = block->m_instructionFirst; @@ -233,4 +235,4 @@ namespace ZpIR } } -} \ No newline at end of file +} From 01c58555f334d4d048d07b971bc559bc5a540802 Mon Sep 17 00:00:00 2001 From: ArtemisX64 <101918084+ArtemisX64@users.noreply.github.com> Date: Sat, 27 Aug 2022 16:57:30 +0900 Subject: [PATCH 7/7] Fixes Path Issues (#70) * Fix bad path --- src/Cafe/Filesystem/fsc.h | 2 +- src/Cafe/TitleList/TitleInfo.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Cafe/Filesystem/fsc.h b/src/Cafe/Filesystem/fsc.h index d63b7c2d..972d5d0a 100644 --- a/src/Cafe/Filesystem/fsc.h +++ b/src/Cafe/Filesystem/fsc.h @@ -216,4 +216,4 @@ struct CoreinitFSParsedPath void coreinitFS_parsePath(CoreinitFSParsedPath* parsedPath, const char* path); bool coreinitFS_checkNodeName(CoreinitFSParsedPath* parsedPath, sint32 index, const char* name); -char* coreinitFS_getNodeName(CoreinitFSParsedPath* parsedPath, sint32 index); \ No newline at end of file +char* coreinitFS_getNodeName(CoreinitFSParsedPath* parsedPath, sint32 index); diff --git a/src/Cafe/TitleList/TitleInfo.cpp b/src/Cafe/TitleList/TitleInfo.cpp index ec0ed7e5..a3d6aaf9 100644 --- a/src/Cafe/TitleList/TitleInfo.cpp +++ b/src/Cafe/TitleList/TitleInfo.cpp @@ -645,10 +645,10 @@ std::string TitleInfo::GetInstallPath() const { TitleId titleId = GetAppTitleId(); TitleIdParser tip(titleId); - std::string tmp; + std::string tmp; if (tip.IsSystemTitle()) - tmp = fmt::format("sys\\title\\{:08x}\\{:08x}", GetTitleIdHigh(titleId), GetTitleIdLow(titleId)); - else - tmp = fmt::format("usr\\title\\{:08x}\\{:08x}", GetTitleIdHigh(titleId), GetTitleIdLow(titleId)); + tmp = fmt::format("sys/title/{:08x}/{:08x}", GetTitleIdHigh(titleId), GetTitleIdLow(titleId)); + else + tmp = fmt::format("usr/title/{:08x}/{:08x}", GetTitleIdHigh(titleId), GetTitleIdLow(titleId)); return tmp; -} \ No newline at end of file +}