diff --git a/.gitignore b/.gitignore index 1fe47b70..6feed97f 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ *.out *.app .vs +.idea/ build/ out/ @@ -29,6 +30,7 @@ bin/Cemu.exe.backup bin/mlc01/* bin/settings.xml bin/title_list_cache.xml +bin/debugger/* !bin/shaderCache/info.txt bin/shaderCache/* diff --git a/BUILD.md b/BUILD.md index 6cdf243a..8aa58b7b 100644 --- a/BUILD.md +++ b/BUILD.md @@ -25,7 +25,7 @@ To compile Cemu, a recent enough compiler and STL with C++20 support is required ### Installing dependencies #### For Ubuntu and derivatives: -`sudo apt install -y git cmake ninja-build nasm libgtk-3-dev libsecret-1-dev libgcrypt20-dev libsystemd-dev freeglut3-dev libpulse-dev` +`sudo apt install -y git curl cmake ninja-build nasm libgtk-3-dev libsecret-1-dev libgcrypt20-dev libsystemd-dev freeglut3-dev libpulse-dev` Additionally, for ubuntu 20.04 only: - `sudo apt install -y clang-12` - At step 3 while building, use diff --git a/dist/linux/info.cemu.Cemu.desktop b/dist/linux/info.cemu.Cemu.desktop index cddb8393..1a25b665 100644 --- a/dist/linux/info.cemu.Cemu.desktop +++ b/dist/linux/info.cemu.Cemu.desktop @@ -9,6 +9,8 @@ GenericName[fi]=Wii U -emulaattori GenericName[el]=Πρόγραμμα προσομοίωσης Wii U GenericName[es]=Emulador de Wii U GenericName[pt_BR]=Emulador de Wii U +GenericName[fr]=Émulateur de Wii U +GenericName[it]=Emulatore Wii U Comment=Software to emulate Wii U games and applications on PC Comment[fi]=Ohjelmisto Wii U -pelien ja sovellusten emulointiin PC:lla Comment[de]=Software zum emulieren von Wii U Spielen und Anwendungen auf dem PC @@ -18,7 +20,7 @@ Comment[nl]=Applicatie om Wii U spellen en applicaties te emuleren op PC Comment[el]=Πρόγραμμα προσομοίωσης παιχνιδιών και εφαρμογών Wii U στον υπολογιστή Comment[es]=Software para emular juegos y aplicaciones de Wii U en PC Comment[pt_BR]=Software para emular jogos e aplicativos de Wii U no PC -Comment[it]=Software per emulare giochi ed applicazioni del Wii U su PC +Comment[it]=Software per emulare giochi e applicazioni per Wii U su 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 670e5dca..4fff800a 100644 --- a/dist/linux/info.cemu.Cemu.metainfo.xml +++ b/dist/linux/info.cemu.Cemu.metainfo.xml @@ -10,7 +10,7 @@ Πρόγραμμα προσομοίωσης παιχνιδιών και εφαρμογών Wii U στον υπολογιστή Software para emular juegos y aplicaciones de Wii U en PC Software para emular jogos e aplicativos de Wii U no PC - Software per emulare giochi ed applicazioni del Wii U su PC + Software per emulare giochi e applicazioni per Wii U su PC Ojelmisto Wii U -pelien ja -sovellusten emulointiin PC:llä Cemu Project info.cemu.Cemu.desktop @@ -24,7 +24,7 @@

Το Cemu είναι ένας προσομοιωτής της κονσόλας Nintendo Wii U που υποστηρίζει τεπίσημα παιχνίδια, καθώς και μη επίσημα προγράμματα ("homebrew"), για το Wii U. Δημιουργήθηκε από τον Exzap σε C/C++.

Cemu es un emulador de Nintendo Wii U que es capaz de ejecutar la mayoría de los juegos de Wii U y homebrew en un estado jugable. Creado por Exzap, y escrito en C y C++.

Cemu é um emulador de Nintendo Wii U que é capaz de executar a maioría dos jogos de Wii U e homebrew em um estado jogavel. Criado por Exzap, e escrito em C e C++.

-

Cemu è un emulatore del Nintendo Wii U capace di riprodurre la maggior parte dei giochi ed homebrew Wii U in stato giocabile. Creato da Exzap, e scritto in C/C++.

+

Cemu è un emulatore del Nintendo Wii U in grado di eseguire in stato giocabile la maggior parte dei giochi e homebrew per Wii U. Creato da Exzap, e scritto in C/C++.

Cemu on Wii U -emulaattori, joka pystyy toistamaan useimpia Wii U -pelejä ja homebrew'ta pelikelvollisesti. Luonut Exzap, kirjoitettu C:llä/C++:lla.

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.

@@ -33,7 +33,7 @@

Ο προσομοιωτής αυτός στοχεύει τόσο στην ακρίβεια, όσο και στην ταχύτητα. Βελτιώνεται συνεχώς με νέες δυνατότητες και διορθώσεις που τον καθιστούν πιο βολικό, εύκολο στην χρήση και συμβατό με περισσότερα παιχνίδια.

Este emulador tiene como objetivo proporcionar tanto alta precisión como rendimiento y se desarrolla activamente con nuevas características y correcciones para mejorar la compatibilidad, la comodidad y la usabilidad.

Esse emulador visa proporcionar tanto alta precisão como rendimento e está sendo ativamente desenvolvido com novas características e correções para melhorar a compatibilidade, a comodidade e a usabilidade.

-

Questo emulatore ha l'obiettivo di fornire sia alta precisione che alte prestazioni, ed è in continuo sviluppo con nuove funzionalità e correzioni per aumentare la compatibilità, la comodità e la fuibilità.

+

Questo emulatore ha l'obiettivo di fornire sia alta precisione che alte prestazioni, ed è in continuo sviluppo con nuove funzionalità e correzioni per aumentare la compatibilità, la comodità e l'usabilità.

Tämä emulaattori pyrkii tarjoamaan korkeaa tarkkuutta sekä suorituskykyä, ja sitä kehitetään aktiivisesti uusilla ominaisuuksilla ja korjauksilla, jotka parantavat yhteensopivuutta, mukavuutta ja käytettävyyttä..

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

Er wird seit Anfang 2015 entwickelt.

@@ -42,7 +42,7 @@

Το Cemu βρίσκεται υπό ανάπτυξη από το 2015.

Fue escrito desde cero y el desarrollo del proyecto comenzó aproximadamente a principios de 2015.

Foi escrito do zero e o desenvolvimento do projeto começou aproximadamente a princípio de 2015.

-

È stato scritto da zero e lo sviluppo del progetto è iniziato circa all'inizio del 2015.

+

È stato scritto da zero e lo sviluppo del progetto è cominciato intorno all'inizio del 2015.

Se kirjoitettiin tyhjästä ja sen kehitys alkoi suunnilleen vuoden 2015 alussa.

diff --git a/src/Cafe/CafeSystem.cpp b/src/Cafe/CafeSystem.cpp index add9d1c6..bfa5d822 100644 --- a/src/Cafe/CafeSystem.cpp +++ b/src/Cafe/CafeSystem.cpp @@ -10,7 +10,7 @@ #include "config/ActiveSettings.h" #include "Cafe/TitleList/GameInfo.h" #include "util/helpers/SystemException.h" -#include "Cafe/GraphicPack/GraphicPack.h" +#include "Cafe/GraphicPack/GraphicPack2.h" #include "input/InputManager.h" @@ -399,7 +399,7 @@ void cemu_initForGame() debugger_handleEntryBreakpoint(_entryPoint); // load graphic packs forceLog_printf("------- Activate graphic packs -------"); - graphicPack_activateForCurrentTitle(CafeSystem::GetForegroundTitleId()); + GraphicPack2::ActivateForCurrentTitle(); // print audio log IAudioAPI::PrintLogging(); // everything initialized @@ -766,6 +766,7 @@ namespace CafeSystem iosu::act::Stop(); iosu::mcp::Shutdown(); iosu::fsa::Shutdown(); + GraphicPack2::Reset(); UnmountCurrentTitle(); sSystemRunning = false; } diff --git a/src/Cafe/GraphicPack/GraphicPack.cpp b/src/Cafe/GraphicPack/GraphicPack.cpp deleted file mode 100644 index c41ca944..00000000 --- a/src/Cafe/GraphicPack/GraphicPack.cpp +++ /dev/null @@ -1,127 +0,0 @@ -#include "gui/wxgui.h" -#include "GraphicPack.h" - -#include "config/ActiveSettings.h" -#include "Cafe/GraphicPack/GraphicPack2.h" - -/* - * Loads the graphic pack if the titleId is referenced in rules.ini - */ -void graphicPack_loadGraphicPack(wchar_t* graphicPackPath) -{ - fs::path rulesPath = fs::path(graphicPackPath); - rulesPath.append("rules.txt"); - std::unique_ptr fs_rules(FileStream::openFile2(rulesPath)); - if (!fs_rules) - return; - std::vector rulesData; - fs_rules->extract(rulesData); - IniParser iniParser(rulesData, rulesPath.string()); - - if (!iniParser.NextSection()) - { - cemuLog_force(u8"{}: Does not contain any sections", rulesPath.generic_u8string()); - return; - } - if (!boost::iequals(iniParser.GetCurrentSectionName(), "Definition")) - { - cemuLog_force(u8"{}: [Definition] must be the first section", rulesPath.generic_u8string()); - return; - } - - - auto option_version = iniParser.FindOption("version"); - if (option_version) - { - sint32 versionNum = -1; - auto [ptr, ec] = std::from_chars(option_version->data(), option_version->data() + option_version->size(), versionNum); - if (ec != std::errc{}) - { - cemuLog_force(u8"{}: Unable to parse version", rulesPath.generic_u8string()); - return; - } - - if (versionNum > GP_LEGACY_VERSION) - { - GraphicPack2::LoadGraphicPack(rulesPath.generic_wstring(), iniParser); - return; - } - } - cemuLog_force(u8"{}: Outdated graphic pack", rulesPath.generic_u8string()); -} - -void graphicPack_scanForGFXPackFolders(const fs::path& currentPath, std::wstring& relativePath) -{ - // check if this directory has rules txt - fs::path rulesPath = fs::path(currentPath); - rulesPath.append("rules.txt"); - - if (fs::exists(rulesPath) && relativePath.length() != 0) - { - graphicPack_loadGraphicPack((wchar_t*)currentPath.generic_wstring().c_str()); - return; // when a rules.txt file is found stop recursion - } - - if (!fs::exists(currentPath)) - return; - - for (auto& p : fs::directory_iterator(currentPath)) - { - auto& path = p.path(); - if (fs::is_directory(p.status())) - { - // dir - sint32 origSize = relativePath.size(); - relativePath.append(L"/"); - relativePath.append(path.filename().generic_wstring()); - graphicPack_scanForGFXPackFolders(path, relativePath); - relativePath.resize(origSize); - } - } -} - -void graphicPack_loadAll() -{ - // recursively iterate all directories in graphicPacks/ folder - std::wstring graphicPackRelativePath; - graphicPack_scanForGFXPackFolders(ActiveSettings::GetPath("graphicPacks/"), graphicPackRelativePath); -} - -void graphicPack_activateForCurrentTitle(uint64 titleId) -{ - // activate graphic packs - for (const auto& gp : GraphicPack2::GetGraphicPacks()) - { - if (!gp->IsEnabled()) - continue; - - if (!gp->ContainsTitleId(titleId)) - continue; - - if(GraphicPack2::ActivateGraphicPack(gp)) - { - if (gp->GetPresets().empty()) - { - forceLog_printf("Activate graphic pack: %s", gp->GetPath().c_str()); - } - else - { - std::string logLine; - logLine.assign(fmt::format("Activate graphic pack: {} [Presets: ", gp->GetPath())); - bool isFirst = true; - for (auto& itr : gp->GetPresets()) - { - if(!itr->active) - continue; - if (isFirst) - isFirst = false; - else - logLine.append(","); - logLine.append(itr->name); - } - logLine.append("]"); - cemuLog_log(LogType::Force, logLine); - } - } - } -} \ No newline at end of file diff --git a/src/Cafe/GraphicPack/GraphicPack.h b/src/Cafe/GraphicPack/GraphicPack.h deleted file mode 100644 index 0a79ef4b..00000000 --- a/src/Cafe/GraphicPack/GraphicPack.h +++ /dev/null @@ -1,4 +0,0 @@ -#define GP_LEGACY_VERSION (2) - -void graphicPack_loadAll(); -void graphicPack_activateForCurrentTitle(uint64 titleId); \ No newline at end of file diff --git a/src/Cafe/GraphicPack/GraphicPack2.cpp b/src/Cafe/GraphicPack/GraphicPack2.cpp index 62d47388..41e33a19 100644 --- a/src/Cafe/GraphicPack/GraphicPack2.cpp +++ b/src/Cafe/GraphicPack/GraphicPack2.cpp @@ -1,6 +1,6 @@ #include "Cafe/GraphicPack/GraphicPack2.h" -#include "GraphicPack.h" #include "config/CemuConfig.h" +#include "config/ActiveSettings.h" #include "openssl/sha.h" #include "Cafe/HW/Latte/Renderer/RendererOuputShader.h" #include "Cafe/Filesystem/fsc.h" @@ -14,6 +14,69 @@ std::vector GraphicPack2::s_graphic_packs; std::vector GraphicPack2::s_active_graphic_packs; +std::atomic_bool GraphicPack2::s_isReady; + +#define GP_LEGACY_VERSION (2) + +void GraphicPack2::LoadGraphicPack(fs::path graphicPackPath) +{ + fs::path rulesPath = graphicPackPath; + rulesPath.append("rules.txt"); + std::unique_ptr fs_rules(FileStream::openFile2(rulesPath)); + if (!fs_rules) + return; + std::vector rulesData; + fs_rules->extract(rulesData); + IniParser iniParser(rulesData, rulesPath.string()); + + if (!iniParser.NextSection()) + { + cemuLog_force("{}: Does not contain any sections", _utf8Wrapper(rulesPath)); + return; + } + if (!boost::iequals(iniParser.GetCurrentSectionName(), "Definition")) + { + cemuLog_force("{}: [Definition] must be the first section", _utf8Wrapper(rulesPath)); + return; + } + + auto option_version = iniParser.FindOption("version"); + if (option_version) + { + sint32 versionNum = -1; + auto [ptr, ec] = std::from_chars(option_version->data(), option_version->data() + option_version->size(), versionNum); + if (ec != std::errc{}) + { + cemuLog_force("{}: Unable to parse version", _utf8Wrapper(rulesPath)); + return; + } + + if (versionNum > GP_LEGACY_VERSION) + { + GraphicPack2::LoadGraphicPack(rulesPath.generic_wstring(), iniParser); + return; + } + } + cemuLog_force("{}: Outdated graphic pack", _utf8Wrapper(rulesPath)); +} + +void GraphicPack2::LoadAll() +{ + std::error_code ec; + fs::path basePath = ActiveSettings::GetPath("graphicPacks"); + for (fs::recursive_directory_iterator it(basePath, ec); it != end(it); ++it) + { + if (!it->is_directory(ec)) + continue; + fs::path gfxPackPath = it->path(); + if (fs::exists(gfxPackPath / "rules.txt", ec)) + { + LoadGraphicPack(gfxPackPath); + it.disable_recursion_pending(); // dont recurse deeper in a gfx pack directory + continue; + } + } +} bool GraphicPack2::LoadGraphicPack(const std::wstring& filename, IniParser& rules) { @@ -60,7 +123,6 @@ bool GraphicPack2::LoadGraphicPack(const std::wstring& filename, IniParser& rule { return false; } - } bool GraphicPack2::ActivateGraphicPack(const std::shared_ptr& graphic_pack) @@ -94,12 +156,65 @@ bool GraphicPack2::DeactivateGraphicPack(const std::shared_ptr& gr return true; } +void GraphicPack2::ActivateForCurrentTitle() +{ + uint64 titleId = CafeSystem::GetForegroundTitleId(); + // activate graphic packs + for (const auto& gp : GraphicPack2::GetGraphicPacks()) + { + if (!gp->IsEnabled()) + continue; + + if (!gp->ContainsTitleId(titleId)) + continue; + + if (GraphicPack2::ActivateGraphicPack(gp)) + { + if (gp->GetPresets().empty()) + { + forceLog_printf("Activate graphic pack: %s", gp->GetPath().c_str()); + } + else + { + std::string logLine; + logLine.assign(fmt::format("Activate graphic pack: {} [Presets: ", gp->GetPath())); + bool isFirst = true; + for (auto& itr : gp->GetPresets()) + { + if (!itr->active) + continue; + if (isFirst) + isFirst = false; + else + logLine.append(","); + logLine.append(itr->name); + } + logLine.append("]"); + cemuLog_log(LogType::Force, logLine); + } + } + } + s_isReady = true; +} + +void GraphicPack2::Reset() +{ + s_active_graphic_packs.clear(); + s_isReady = false; +} + void GraphicPack2::ClearGraphicPacks() { s_graphic_packs.clear(); s_active_graphic_packs.clear(); } +void GraphicPack2::WaitUntilReady() +{ + while (!s_isReady) + std::this_thread::sleep_for(std::chrono::milliseconds(5)); +} + GraphicPack2::GraphicPack2(std::wstring filename) : m_filename(std::move(filename)) { diff --git a/src/Cafe/GraphicPack/GraphicPack2.h b/src/Cafe/GraphicPack/GraphicPack2.h index 65d25f3f..4c18b5c6 100644 --- a/src/Cafe/GraphicPack/GraphicPack2.h +++ b/src/Cafe/GraphicPack/GraphicPack2.h @@ -159,18 +159,26 @@ public: LatteTextureView::MagFilter GetDownscalingMagFilter() const { return m_output_settings.downscale_filter; } // static methods + static void LoadAll(); + static const std::vector>& GetGraphicPacks() { return s_graphic_packs; } static const std::vector>& GetActiveGraphicPacks() { return s_active_graphic_packs; } + static void LoadGraphicPack(fs::path graphicPackPath); static bool LoadGraphicPack(const std::wstring& filename, class IniParser& rules); static bool ActivateGraphicPack(const std::shared_ptr& graphic_pack); static bool DeactivateGraphicPack(const std::shared_ptr& graphic_pack); static void ClearGraphicPacks(); + static void WaitUntilReady(); // wait until all graphic packs finished activation + + static void ActivateForCurrentTitle(); + static void Reset(); private: bool Activate(); bool Deactivate(); static std::vector> s_graphic_packs; static std::vector> s_active_graphic_packs; + static std::atomic_bool s_isReady; template void FillPresetConstants(TExpressionParser& parser) const diff --git a/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp b/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp index fe1388f0..bcdaffa2 100644 --- a/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp +++ b/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp @@ -5,7 +5,6 @@ #include "Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompiler.h" #include "Cafe/HW/Latte/Core/FetchShader.h" #include "Cemu/FileCache/FileCache.h" -#include "Cafe/GraphicPack/GraphicPack.h" #include "Cafe/GameProfile/GameProfile.h" #include "gui/guiWrapper.h" diff --git a/src/Cafe/HW/Latte/Core/LatteTextureView.cpp b/src/Cafe/HW/Latte/Core/LatteTextureView.cpp index 8cfa11e9..cac5bcce 100644 --- a/src/Cafe/HW/Latte/Core/LatteTextureView.cpp +++ b/src/Cafe/HW/Latte/Core/LatteTextureView.cpp @@ -1,7 +1,6 @@ #include "Cafe/HW/Latte/Core/LatteTexture.h" #include "Cafe/HW/Latte/Core/LatteTextureView.h" #include "Cafe/HW/Latte/Core/Latte.h" -#include "Cafe/GraphicPack/GraphicPack.h" #include "Cafe/GraphicPack/GraphicPack2.h" LatteTextureView::LatteTextureView(LatteTexture* texture, sint32 firstMip, sint32 mipCount, sint32 firstSlice, sint32 sliceCount, Latte::E_DIM dim, Latte::E_GX2SURFFMT format, bool registerView) diff --git a/src/Cafe/HW/Latte/Core/LatteThread.cpp b/src/Cafe/HW/Latte/Core/LatteThread.cpp index 9b3dfe8a..d9b8ab94 100644 --- a/src/Cafe/HW/Latte/Core/LatteThread.cpp +++ b/src/Cafe/HW/Latte/Core/LatteThread.cpp @@ -5,6 +5,7 @@ #include "Cafe/HW/Latte/Core/LatteShader.h" #include "Cafe/HW/Latte/Core/LatteAsyncCommands.h" #include "Cafe/GameProfile/GameProfile.h" +#include "Cafe/GraphicPack/GraphicPack2.h" #include "gui/guiWrapper.h" #include "Cafe/HW/Latte/Core/LatteBufferCache.h" @@ -188,6 +189,8 @@ int Latte_ThreadEntry() g_renderer->DrawEmptyFrame(true); + // before doing anything with game specific shaders, we need to wait for graphic packs to finish loading + GraphicPack2::WaitUntilReady(); // load/init shader cache file LatteShaderCache_load(); diff --git a/src/Cafe/OS/libs/coreinit/coreinit_Misc.cpp b/src/Cafe/OS/libs/coreinit/coreinit_Misc.cpp index 50c6f758..b8a964ce 100644 --- a/src/Cafe/OS/libs/coreinit/coreinit_Misc.cpp +++ b/src/Cafe/OS/libs/coreinit/coreinit_Misc.cpp @@ -264,11 +264,13 @@ namespace coreinit return "Unknown"; } + std::mutex sCafeConsoleMutex; + void WriteCafeConsole(CafeLogType cafeLogType, const char* msg, sint32 len) { - // once a line is full or \n is written it will be posted to log + std::unique_lock _l(sCafeConsoleMutex); CafeLogBuffer& logBuffer = getLogBuffer(cafeLogType); - + // once a line is full or \n is written it will be posted to log auto flushLine = [](CafeLogBuffer& cafeLogBuffer, std::string_view cafeLogName) -> void { cemuLog_log(LogType::CoreinitLogging, "[{0}] {1}", cafeLogName, std::basic_string_view(cafeLogBuffer.lineBuffer.data(), cafeLogBuffer.lineLength)); @@ -354,4 +356,4 @@ namespace coreinit cafeExportRegister("coreinit", OSEnableHomeButtonMenu, LogType::CoreinitThread); } -}; \ No newline at end of file +}; diff --git a/src/Cemu/Logging/CemuLogging.h b/src/Cemu/Logging/CemuLogging.h index 021055d4..4238b638 100644 --- a/src/Cemu/Logging/CemuLogging.h +++ b/src/Cemu/Logging/CemuLogging.h @@ -119,11 +119,6 @@ inline bool cemuLog_force(std::string_view msg) return cemuLog_log(LogType::Force, msg); } -inline bool cemuLog_force(std::u8string_view msg) -{ - return cemuLog_log(LogType::Force, msg); -} - inline bool cemuLog_force(std::wstring_view msg) { return cemuLog_log(LogType::Force, msg); diff --git a/src/audio/audioDebuggerWindow.cpp b/src/audio/audioDebuggerWindow.cpp index 9cdb78d8..41107820 100644 --- a/src/audio/audioDebuggerWindow.cpp +++ b/src/audio/audioDebuggerWindow.cpp @@ -22,7 +22,7 @@ EVT_CLOSE(AudioDebuggerWindow::OnClose) wxEND_EVENT_TABLE() AudioDebuggerWindow::AudioDebuggerWindow(wxFrame& parent) - : wxFrame(&parent, wxID_ANY, wxT("AX voice viewer"), wxDefaultPosition, wxSize(1126, 580), wxCLOSE_BOX | wxCLIP_CHILDREN | wxCAPTION | wxRESIZE_BORDER) + : wxFrame(&parent, wxID_ANY, _("AX voice viewer"), wxDefaultPosition, wxSize(1126, 580), wxCLOSE_BOX | wxCLIP_CHILDREN | wxCAPTION | wxRESIZE_BORDER) { wxPanel* mainPane = new wxPanel(this); diff --git a/src/gui/ChecksumTool.cpp b/src/gui/ChecksumTool.cpp index 1c1e30a2..74422c9b 100644 --- a/src/gui/ChecksumTool.cpp +++ b/src/gui/ChecksumTool.cpp @@ -141,13 +141,13 @@ ChecksumTool::ChecksumTool(wxWindow* parent, wxTitleManagerList::TitleEntry& ent box_sizer->Add(m_verify_online, 0, wxALL | wxEXPAND, 5); m_verify_local = new wxButton(box, wxID_ANY, _("Verify with local file")); - m_verify_online->SetToolTip(_("Verifies the checksum with a local json file you can select")); + m_verify_online->SetToolTip(_("Verifies the checksum with a local JSON file you can select")); m_verify_local->Disable(); m_verify_local->Bind(wxEVT_BUTTON, &ChecksumTool::OnVerifyLocal, this); box_sizer->Add(m_verify_local, 0, wxALL | wxEXPAND, 5); m_export_button = new wxButton(box, wxID_ANY, _("Export")); - m_verify_online->SetToolTip(_("Export the title checksum data to a local json file")); + m_verify_online->SetToolTip(_("Export the title checksum data to a local JSON file")); m_export_button->Disable(); m_export_button->Bind(wxEVT_BUTTON, &ChecksumTool::OnExportChecksums, this); box_sizer->Add(m_export_button, 0, wxALL | wxEXPAND, 5); @@ -477,7 +477,7 @@ void ChecksumTool::VerifyJsonEntry(const rapidjson::Document& doc) { if (test_entry.wud_hash.empty()) { - wxMessageBox(_("The verification data doesn't include a wud hash!"), _("Error"), wxOK | wxCENTRE | wxICON_WARNING, this); + wxMessageBox(_("The verification data doesn't include a WUD hash!"), _("Error"), wxOK | wxCENTRE | wxICON_WARNING, this); return; } if(!boost::iequals(test_entry.wud_hash, m_json_entry.wud_hash)) @@ -708,7 +708,7 @@ void ChecksumTool::DoWork() EVP_DigestUpdate(sha256, buffer.data(), read); - wxQueueEvent(this, new wxSetGaugeValue((int)((offset * 90) / wud_size), m_progress, m_status, wxStringFormat2(_("Reading game image: {}/{}kb"), offset / 1024, wud_size / 1024))); + wxQueueEvent(this, new wxSetGaugeValue((int)((offset * 90) / wud_size), m_progress, m_status, wxStringFormat2(_("Reading game image: {0}/{1} kB"), offset / 1024, wud_size / 1024))); } while (read != 0 && size > 0); wud_close(wud); diff --git a/src/gui/DownloadGraphicPacksWindow.cpp b/src/gui/DownloadGraphicPacksWindow.cpp index 35f25225..28e5bf6b 100644 --- a/src/gui/DownloadGraphicPacksWindow.cpp +++ b/src/gui/DownloadGraphicPacksWindow.cpp @@ -92,7 +92,7 @@ void deleteDownloadedGraphicPacks() { const auto path = ActiveSettings::GetPath("graphicPacks/downloadedGraphicPacks"); std::error_code er; - if (!fs::exists(path)) + if (!fs::exists(path, er)) return; try { diff --git a/src/gui/GameProfileWindow.cpp b/src/gui/GameProfileWindow.cpp index d3cd28d4..f710988f 100644 --- a/src/gui/GameProfileWindow.cpp +++ b/src/gui/GameProfileWindow.cpp @@ -116,7 +116,7 @@ GameProfileWindow::GameProfileWindow(wxWindow* parent, uint64_t title_id) m_graphic_api = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, (int)std::size(gapi_values), gapi_values); first_row->Add(m_graphic_api, 0, wxALL, 5); - first_row->Add(new wxStaticText(panel, wxID_ANY, _("Shader mul accuracy")), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + first_row->Add(new wxStaticText(panel, wxID_ANY, _("Shader multiplication accuracy")), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); wxString mul_values[] = { _("false"), _("true"), _("minimal") }; m_shader_mul_accuracy = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, (int)std::size(mul_values), mul_values); diff --git a/src/gui/GameUpdateWindow.cpp b/src/gui/GameUpdateWindow.cpp index f8d9bf61..a42d4087 100644 --- a/src/gui/GameUpdateWindow.cpp +++ b/src/gui/GameUpdateWindow.cpp @@ -166,13 +166,13 @@ GameUpdateWindow::GameUpdateWindow(wxWindow& parent, const fs::path& filePath) TitleIdParser tip(GetTitleId()); if (tip.GetType() == TitleIdParser::TITLE_TYPE::AOC) - SetTitle(_("Installing DLC ...")); + SetTitle(_("Installing DLC...")); else if (tip.GetType() == TitleIdParser::TITLE_TYPE::BASE_TITLE_UPDATE) - SetTitle(_("Installing update ...")); + SetTitle(_("Installing update...")); else if (tip.IsSystemTitle()) - SetTitle(_("Installing system title ...")); + SetTitle(_("Installing system title...")); else - SetTitle(_("Installing title ...")); + SetTitle(_("Installing title...")); m_processBar = new wxGauge(this, wxID_ANY, 100, wxDefaultPosition, wxSize(500, 20), wxGA_HORIZONTAL); m_processBar->SetValue(0); diff --git a/src/gui/GraphicPacksWindow2.cpp b/src/gui/GraphicPacksWindow2.cpp index a830cb72..3759580e 100644 --- a/src/gui/GraphicPacksWindow2.cpp +++ b/src/gui/GraphicPacksWindow2.cpp @@ -3,7 +3,6 @@ #include "gui/DownloadGraphicPacksWindow.h" #include "Cafe/GraphicPack/GraphicPack2.h" #include "config/CemuConfig.h" -#include "Cafe/GraphicPack/GraphicPack.h" #include "Cafe/HW/Latte/Core/LatteAsyncCommands.h" @@ -184,7 +183,7 @@ void GraphicPacksWindow2::ExpandChildren(const std::vector& ids, s void GraphicPacksWindow2::RefreshGraphicPacks() { GraphicPack2::ClearGraphicPacks(); - graphicPack_loadAll(); + GraphicPack2::LoadAll(); } GraphicPacksWindow2::GraphicPacksWindow2(wxWindow* parent, uint64_t title_id_filter) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index e26b31e3..b23a5ca7 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -34,7 +34,6 @@ #include "gui/TitleManager.h" #include "Cafe/CafeSystem.h" -#include "Cafe/GraphicPack/GraphicPack.h" #include "Cafe/TitleList/GameInfo.h" #include @@ -587,10 +586,10 @@ void MainWindow::OnFileMenu(wxCommandEvent& event) "|{}|*.wua" "|{}|*.rpx;*.elf" "|{}|*", - _("All Wii U files (wud, wux, wua, iso, rpx, elf)"), - _("Wii U image (wud, wux, iso, wad)"), - _("Wii U archive (wua)"), - _("Wii U executable (rpx, elf)"), + _("All Wii U files (*.wud, *.wux, *.wua, *.iso, *.rpx, *.elf)"), + _("Wii U image (*.wud, *.wux, *.iso, *.wad)"), + _("Wii U archive (*.wua)"), + _("Wii U executable (*.rpx, *.elf)"), _("All files (*.*)") ); @@ -1770,7 +1769,7 @@ class CemuAboutDialog : public wxDialog { public: CemuAboutDialog(wxWindow* parent = NULL) - : wxDialog(NULL, wxID_ANY, "About Cemu", wxDefaultPosition, wxSize(500, 700)) + : wxDialog(NULL, wxID_ANY, _("About Cemu"), wxDefaultPosition, wxSize(500, 700)) { Create(parent); } @@ -1804,8 +1803,7 @@ public: void AddHeaderInfo(wxWindow* parent, wxSizer* sizer) { - char versionString[512]; - sprintf(versionString, "Cemu\nVersion %s\nCompiled " BUILD_DATE "\nOriginal authors: Exzap, Petergov", BUILD_VERSION_STRING); + auto versionString = fmt::format(_("Cemu\nVersion {0}\nCompiled on {1}\nOriginal authors: {2}").ToStdString(), BUILD_VERSION_STRING, BUILD_DATE, "Exzap, Petergov"); sizer->Add(new wxStaticText(parent, wxID_ANY, versionString), wxSizerFlags().Border(wxALL, 3).Border(wxTOP, 10)); sizer->Add(new wxHyperlinkCtrl(parent, -1, "https://cemu.info", "https://cemu.info"), wxSizerFlags().Expand().Border(wxTOP | wxBOTTOM, 3)); @@ -1814,7 +1812,7 @@ public: sizer->Add(new wxStaticLine(parent), wxSizerFlags().Expand().Border(wxRIGHT, 4)); sizer->AddSpacer(5); - wxString extraInfo("" EMULATOR_NAME " is a Wii U emulator.\n\nWii and Wii U are trademarks of Nintendo.\n" EMULATOR_NAME " is not affiliated with Nintendo."); + wxString extraInfo(_("Cemu is a Wii U emulator.\n\nWii and Wii U are trademarks of Nintendo.\nCemu is not affiliated with Nintendo.")); sizer->Add(new wxStaticText(parent, wxID_ANY, extraInfo), wxSizerFlags()); } @@ -1824,7 +1822,7 @@ public: sizer->Add(new wxStaticLine(parent), wxSizerFlags().Expand().Border(wxRIGHT, 4)); sizer->AddSpacer(3); - sizer->Add(new wxStaticText(parent, wxID_ANY, "Used libraries and utilities:"), wxSizerFlags().Expand().Border(wxTOP | wxBOTTOM, 2)); + sizer->Add(new wxStaticText(parent, wxID_ANY, _("Used libraries and utilities:")), wxSizerFlags().Expand().Border(wxTOP | wxBOTTOM, 2)); // zLib { wxSizer* lineSizer = new wxBoxSizer(wxHORIZONTAL); @@ -1965,7 +1963,7 @@ public: sizer->AddSpacer(2); - sizer->Add(new wxStaticText(parent, wxID_ANY, "Thanks to our Patreon supporters:"), wxSizerFlags().Expand().Border(wxTOP | wxBOTTOM, 2)); + sizer->Add(new wxStaticText(parent, wxID_ANY, _("Thanks to our Patreon supporters:")), wxSizerFlags().Expand().Border(wxTOP | wxBOTTOM, 2)); std::vector patreonSupporterNames{ "Maufeat", "lvlv", "F34R", "John Godgames", "Jameel Lewis", "skooks", "Cheesy", "Barrowsx", "Mored1984", "madmat007" , "Kuhnnl", "Owen M", "lucianobugalu", "KimoMaka", "nick palma aka renaissance18", "TheGiantBros", "SpiGAndromeda" @@ -1995,7 +1993,7 @@ public: sizer->Add(gridSizer, 1, wxEXPAND); sizer->AddSpacer(2); - sizer->Add(new wxStaticText(parent, wxID_ANY, "Special thanks:"), wxSizerFlags().Expand().Border(wxTOP, 2)); + sizer->Add(new wxStaticText(parent, wxID_ANY, _("Special thanks:")), wxSizerFlags().Expand().Border(wxTOP, 2)); sizer->Add(new wxStaticText(parent, wxID_ANY, "espes - Also try XQEMU!\nWaltzz92"), wxSizerFlags().Expand().Border(wxTOP, 1)); } @@ -2038,8 +2036,8 @@ void MainWindow::RecreateMenu() if (!m_game_launched) { - m_loadMenuItem = m_fileMenu->Append(MAINFRAME_MENU_ID_FILE_LOAD, _("&Load")); - m_installUpdateMenuItem = m_fileMenu->Append(MAINFRAME_MENU_ID_FILE_INSTALL_UPDATE, _("&Install game title, update or DLC")); + m_loadMenuItem = m_fileMenu->Append(MAINFRAME_MENU_ID_FILE_LOAD, _("&Load...")); + m_installUpdateMenuItem = m_fileMenu->Append(MAINFRAME_MENU_ID_FILE_INSTALL_UPDATE, _("&Install game title, update or DLC...")); sint32 recentFileIndex = 0; m_fileMenuSeparator0 = nullptr; diff --git a/src/gui/MemorySearcherTool.cpp b/src/gui/MemorySearcherTool.cpp index f86bf462..c7c6c734 100644 --- a/src/gui/MemorySearcherTool.cpp +++ b/src/gui/MemorySearcherTool.cpp @@ -84,12 +84,12 @@ MemorySearcherTool::MemorySearcherTool(wxFrame* parent) { wxListItem col0; col0.SetId(0); - col0.SetText(_("address")); + col0.SetText(_("Address")); col0.SetWidth(100); m_listResults->InsertColumn(0, col0); wxListItem col1; col1.SetId(1); - col1.SetText(_("value")); + col1.SetText(_("Value")); col1.SetWidth(250); m_listResults->InsertColumn(1, col1); } @@ -99,11 +99,11 @@ MemorySearcherTool::MemorySearcherTool(wxFrame* parent) m_listEntryTable->Bind(wxEVT_DATAVIEW_ITEM_CONTEXT_MENU, &MemorySearcherTool::OnEntryListRightClick, this); m_listEntryTable->Bind(wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE, &MemorySearcherTool::OnItemEdited, this); { - m_listEntryTable->AppendTextColumn(_("description"), wxDATAVIEW_CELL_EDITABLE, 150, wxALIGN_LEFT, wxDATAVIEW_COL_SORTABLE); - m_listEntryTable->AppendTextColumn(_("address"), wxDATAVIEW_CELL_INERT, 100, wxALIGN_LEFT, wxDATAVIEW_COL_SORTABLE); - m_listEntryTable->AppendTextColumn(_("type")); - m_listEntryTable->AppendTextColumn(_("value"), wxDATAVIEW_CELL_EDITABLE); - m_listEntryTable->AppendToggleColumn(_("freeze"), wxDATAVIEW_CELL_ACTIVATABLE, 50, wxALIGN_LEFT, 0); + m_listEntryTable->AppendTextColumn(_("Description"), wxDATAVIEW_CELL_EDITABLE, 150, wxALIGN_LEFT, wxDATAVIEW_COL_SORTABLE); + m_listEntryTable->AppendTextColumn(_("Address"), wxDATAVIEW_CELL_INERT, 100, wxALIGN_LEFT, wxDATAVIEW_COL_SORTABLE); + m_listEntryTable->AppendTextColumn(_("Type")); + m_listEntryTable->AppendTextColumn(_("Value"), wxDATAVIEW_CELL_EDITABLE); + m_listEntryTable->AppendToggleColumn(_("Freeze"), wxDATAVIEW_CELL_ACTIVATABLE, 50, wxALIGN_LEFT, 0); } row2->AddGrowableRow(3); diff --git a/src/gui/PadViewFrame.cpp b/src/gui/PadViewFrame.cpp index 89a85297..ba020b5f 100644 --- a/src/gui/PadViewFrame.cpp +++ b/src/gui/PadViewFrame.cpp @@ -21,7 +21,7 @@ extern WindowInfo g_window_info; PadViewFrame::PadViewFrame(wxFrame* parent) - : wxFrame(nullptr, wxID_ANY, "GamePad View", wxDefaultPosition, wxSize(854, 480), wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER | wxCLOSE_BOX | wxWANTS_CHARS) + : wxFrame(nullptr, wxID_ANY, _("GamePad View"), wxDefaultPosition, wxSize(854, 480), wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER | wxCLOSE_BOX | wxWANTS_CHARS) { gui_initHandleContextFromWxWidgetsWindow(g_window_info.window_pad, this); diff --git a/src/gui/TitleManager.cpp b/src/gui/TitleManager.cpp index 47d7a6dd..370786b6 100644 --- a/src/gui/TitleManager.cpp +++ b/src/gui/TitleManager.cpp @@ -121,7 +121,7 @@ wxPanel* TitleManager::CreateTitleManagerPage() auto* save_delete = new wxButton(m_save_panel, wxID_ANY, _("Delete")); save_delete->Bind(wxEVT_BUTTON, &TitleManager::OnSaveDelete, this); - save_delete->SetToolTip(_("Irrevocable delete the save entry ")); + save_delete->SetToolTip(_("Permanently delete the save entry")); save_delete->Disable(); save_sizer->Add(save_delete, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); @@ -328,7 +328,7 @@ void TitleManager::OnTitleSearchComplete(wxCommandEvent& event) } // update status bar text m_title_list->SortEntries(-1); - m_status_bar->SetStatusText(wxStringFormat2(_("Found {} titles, {} updates, {} DLCs and {} save entries"), + m_status_bar->SetStatusText(wxStringFormat2(_("Found {0} games, {1} updates, {2} DLCs and {3} save entries"), m_title_list->GetCountByType(wxTitleManagerList::EntryType::Base) + m_title_list->GetCountByType(wxTitleManagerList::EntryType::System), m_title_list->GetCountByType(wxTitleManagerList::EntryType::Update), m_title_list->GetCountByType(wxTitleManagerList::EntryType::Dlc), @@ -680,7 +680,7 @@ void TitleManager::OnSaveExport(wxCommandEvent& event) auto* metabuff = zip_source_buffer(zip, metacontent.data(), metacontent.size(), 0); if(zip_file_add(zip, "cemu_meta", metabuff, ZIP_FL_ENC_UTF_8) < 0) { - const auto error_msg = wxStringFormat2(_("Error when trying to add a cemu_meta to the zip:\n{}"), zip_strerror(zip)); + const auto error_msg = wxStringFormat2(_("Error when trying to add cemu_meta file to the zip:\n{}"), zip_strerror(zip)); wxMessageBox(error_msg, _("Error"), wxOK | wxCENTRE | wxICON_ERROR, this); zip_source_free(metabuff); diff --git a/src/gui/components/wxDownloadManagerList.cpp b/src/gui/components/wxDownloadManagerList.cpp index a002352a..29e2c262 100644 --- a/src/gui/components/wxDownloadManagerList.cpp +++ b/src/gui/components/wxDownloadManagerList.cpp @@ -91,7 +91,7 @@ void wxDownloadManagerList::AddColumns() { wxListItem col0; col0.SetId(ColumnTitleId); - col0.SetText(_("Title id")); + col0.SetText(_("Title ID")); col0.SetWidth(120); InsertColumn(ColumnTitleId, col0); diff --git a/src/gui/components/wxGameList.cpp b/src/gui/components/wxGameList.cpp index b919e227..a9d2946c 100644 --- a/src/gui/components/wxGameList.cpp +++ b/src/gui/components/wxGameList.cpp @@ -275,23 +275,27 @@ void wxGameList::UpdateItemColors(sint32 startIndex) } } +static inline int strongorder_to_int(const std::strong_ordering &wo) +{ + /* No easy conversion seems to exists in C++20 */ + if (wo < 0) + return -1; + else if (wo > 0) + return 1; + return 0; +} + int wxGameList::SortComparator(uint64 titleId1, uint64 titleId2, SortData* sortData) { - //if(sortData->column == ColumnGameStarted) - // return boost::ilexicographical_compare(name1, name2) ? 0 : 1; + const auto isFavoriteA = GetConfig().IsGameListFavorite(titleId1); + const auto isFavoriteB = GetConfig().IsGameListFavorite(titleId2); + const auto& name1 = GetNameByTitleId(titleId1); + const auto& name2 = GetNameByTitleId(titleId2); - - bool isFavoriteA = GetConfig().IsGameListFavorite(titleId1); - bool isFavoriteB = GetConfig().IsGameListFavorite(titleId2); - if (isFavoriteA != isFavoriteB) - return isFavoriteB; - - // default to name - std::string name1 = GetNameByTitleId(titleId1); - std::string name2 = GetNameByTitleId(titleId2); - if(sortData->dir) - return boost::ilexicographical_compare(name1, name2) ? 0 : 1; - return boost::ilexicographical_compare(name1, name2) ? 1 : 0; + if(sortData->dir > 0) + return strongorder_to_int(std::tie(isFavoriteB, name1) <=> std::tie(isFavoriteA, name2)); + else + return strongorder_to_int(std::tie(isFavoriteB, name2) <=> std::tie(isFavoriteA, name1)); } int wxGameList::SortFunction(wxIntPtr item1, wxIntPtr item2, wxIntPtr sortData) @@ -469,7 +473,7 @@ void wxGameList::OnContextMenu(wxContextMenuEvent& event) menu.Append(kContextMenuStart, _("&Start")); - bool isFavorite = false; + bool isFavorite = GetConfig().IsGameListFavorite(title_id); std::error_code ec; menu.AppendSeparator(); @@ -820,20 +824,13 @@ int wxGameList::FindInsertPosition(TitleId titleId) if (itemCount == 0) return 0; // todo - optimize this with binary search - int linearScanIndex = 0; - if (SortComparator(titleId, (uint64)GetItemData(0), &data)) + + for (int i = 0; i < itemCount; i++) { - linearScanIndex = itemCount; - for (int i = 1; i < itemCount - 1; i++) - { - if (!SortComparator(titleId, (uint64)GetItemData(i), &data)) - { - linearScanIndex = i; - break; - } - } + if (SortComparator(titleId, (uint64)GetItemData(i), &data) <= 0) + return i; } - return linearScanIndex; + return itemCount; } void wxGameList::OnGameEntryUpdatedByTitleId(wxTitleIdEvent& event) diff --git a/src/gui/components/wxTitleManagerList.cpp b/src/gui/components/wxTitleManagerList.cpp index 883472d1..9ac31bce 100644 --- a/src/gui/components/wxTitleManagerList.cpp +++ b/src/gui/components/wxTitleManagerList.cpp @@ -123,7 +123,7 @@ void wxTitleManagerList::AddColumns() { wxListItem col0; col0.SetId(ColumnTitleId); - col0.SetText(_("Title id")); + col0.SetText(_("Title ID")); col0.SetWidth(120); InsertColumn(ColumnTitleId, col0); diff --git a/src/gui/debugger/BreakpointWindow.cpp b/src/gui/debugger/BreakpointWindow.cpp index ef4eec9a..ecb77428 100644 --- a/src/gui/debugger/BreakpointWindow.cpp +++ b/src/gui/debugger/BreakpointWindow.cpp @@ -25,7 +25,7 @@ enum ItemColumns }; BreakpointWindow::BreakpointWindow(DebuggerWindow2& parent, const wxPoint& main_position, const wxSize& main_size) - : wxFrame(&parent, wxID_ANY, "Breakpoints", wxDefaultPosition, wxSize(420, 250), wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER | wxFRAME_FLOAT_ON_PARENT) + : wxFrame(&parent, wxID_ANY, _("Breakpoints"), wxDefaultPosition, wxSize(420, 250), wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER | wxFRAME_FLOAT_ON_PARENT) { this->SetSizeHints(wxDefaultSize, wxDefaultSize); diff --git a/src/gui/debugger/DebuggerWindow2.cpp b/src/gui/debugger/DebuggerWindow2.cpp index 7465c712..cca9bfb8 100644 --- a/src/gui/debugger/DebuggerWindow2.cpp +++ b/src/gui/debugger/DebuggerWindow2.cpp @@ -267,7 +267,7 @@ void DebuggerWindow2::LoadModuleStorage(const RPLModule* module) } DebuggerWindow2::DebuggerWindow2(wxFrame& parent, const wxRect& display_size) - : wxFrame(&parent, wxID_ANY, wxT("PPC Debugger"), wxDefaultPosition, wxSize(1280, 300), wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN | wxRESIZE_BORDER | wxFRAME_FLOAT_ON_PARENT), + : wxFrame(&parent, wxID_ANY, _("PPC Debugger"), wxDefaultPosition, wxSize(1280, 300), wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN | wxRESIZE_BORDER | wxFRAME_FLOAT_ON_PARENT), m_module_address(0) { this->wxWindowBase::SetBackgroundColour(*wxWHITE); diff --git a/src/gui/debugger/DumpWindow.cpp b/src/gui/debugger/DumpWindow.cpp index 06dba7df..35c9d2c8 100644 --- a/src/gui/debugger/DumpWindow.cpp +++ b/src/gui/debugger/DumpWindow.cpp @@ -15,7 +15,7 @@ enum }; DumpWindow::DumpWindow(DebuggerWindow2& parent, const wxPoint& main_position, const wxSize& main_size) - : wxFrame(&parent, wxID_ANY, wxT("Memory Dump"), wxDefaultPosition, wxSize(600, 250), wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER | wxFRAME_FLOAT_ON_PARENT) + : wxFrame(&parent, wxID_ANY, _("Memory Dump"), wxDefaultPosition, wxSize(600, 250), wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER | wxFRAME_FLOAT_ON_PARENT) { this->wxWindowBase::SetBackgroundColour(*wxWHITE); diff --git a/src/gui/debugger/ModuleWindow.cpp b/src/gui/debugger/ModuleWindow.cpp index 6e24c41f..c24517bd 100644 --- a/src/gui/debugger/ModuleWindow.cpp +++ b/src/gui/debugger/ModuleWindow.cpp @@ -20,7 +20,7 @@ enum ItemColumns }; ModuleWindow::ModuleWindow(DebuggerWindow2& parent, const wxPoint& main_position, const wxSize& main_size) - : wxFrame(&parent, wxID_ANY, "Modules", wxDefaultPosition, wxSize(420, 250), wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER | wxFRAME_FLOAT_ON_PARENT) + : wxFrame(&parent, wxID_ANY, _("Modules"), wxDefaultPosition, wxSize(420, 250), wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER | wxFRAME_FLOAT_ON_PARENT) { this->SetSizeHints(wxDefaultSize, wxDefaultSize); diff --git a/src/gui/debugger/RegisterWindow.cpp b/src/gui/debugger/RegisterWindow.cpp index b01e2040..986640a4 100644 --- a/src/gui/debugger/RegisterWindow.cpp +++ b/src/gui/debugger/RegisterWindow.cpp @@ -28,7 +28,7 @@ enum }; RegisterWindow::RegisterWindow(DebuggerWindow2& parent, const wxPoint& main_position, const wxSize& main_size) - : wxFrame(&parent, wxID_ANY, "Register View", wxDefaultPosition, wxSize(400, 975), wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER | wxFRAME_FLOAT_ON_PARENT), + : wxFrame(&parent, wxID_ANY, _("Register View"), wxDefaultPosition, wxSize(400, 975), wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER | wxFRAME_FLOAT_ON_PARENT), m_prev_snapshot({}), m_show_double_values(true), m_context_ctrl(nullptr) { SetSizeHints(wxDefaultSize, wxDefaultSize); @@ -75,7 +75,7 @@ RegisterWindow::RegisterWindow(DebuggerWindow2& parent, const wxPoint& main_posi sizer->Add(gpr_sizer, 1, wxEXPAND); - auto button = new wxButton(scrolled_win, wxID_ANY, "FP view mode"); + auto button = new wxButton(scrolled_win, wxID_ANY, _("FP view mode")); button->Bind(wxEVT_BUTTON, &RegisterWindow::OnFPViewModePress, this); sizer->Add(button, 0, wxALL, 5); diff --git a/src/gui/debugger/SymbolWindow.cpp b/src/gui/debugger/SymbolWindow.cpp index 7ef0c100..7327d7f4 100644 --- a/src/gui/debugger/SymbolWindow.cpp +++ b/src/gui/debugger/SymbolWindow.cpp @@ -13,7 +13,7 @@ enum ItemColumns }; SymbolWindow::SymbolWindow(DebuggerWindow2& parent, const wxPoint& main_position, const wxSize& main_size) - : wxFrame(&parent, wxID_ANY, wxT("Symbol Window"), wxDefaultPosition, wxSize(600, 250), wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER | wxFRAME_FLOAT_ON_PARENT) + : wxFrame(&parent, wxID_ANY, _("Symbol Window"), wxDefaultPosition, wxSize(600, 250), wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER | wxFRAME_FLOAT_ON_PARENT) { this->wxWindowBase::SetBackgroundColour(*wxWHITE); diff --git a/src/gui/dialogs/SaveImport/SaveImportWindow.cpp b/src/gui/dialogs/SaveImport/SaveImportWindow.cpp index 188d618d..bfdb00b4 100644 --- a/src/gui/dialogs/SaveImport/SaveImportWindow.cpp +++ b/src/gui/dialogs/SaveImport/SaveImportWindow.cpp @@ -31,7 +31,7 @@ SaveImportWindow::SaveImportWindow(wxWindow* parent, uint64 title_id) row1->Add(new wxStaticText(this, wxID_ANY, _("Source")), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); m_source_selection = new wxFilePickerCtrl(this, wxID_ANY, wxEmptyString, _("Select a zipped save file"), - wxStringFormat2(_("Import save entry {}"), "(*.zip)|*.zip")); + wxStringFormat2("{}|*.zip", _("Save entry (*.zip)"))); m_source_selection->SetMinSize({ 270, -1 }); row1->Add(m_source_selection, 1, wxALL | wxEXPAND, 5); diff --git a/src/gui/input/InputSettings2.cpp b/src/gui/input/InputSettings2.cpp index 62a7045a..5793cbd2 100644 --- a/src/gui/input/InputSettings2.cpp +++ b/src/gui/input/InputSettings2.cpp @@ -35,9 +35,6 @@ bool g_inputConfigWindowHasFocus = false; -// _("") -const wxString kDefaultProfileName = ""; - using wxTypeData = wxCustomData; using wxControllerData = wxCustomData; @@ -149,7 +146,7 @@ wxWindow* InputSettings2::initialize_page(size_t index) { // profile sizer->Add(new wxStaticText(page, wxID_ANY, _("Profile"), wxDefaultPosition, wxDefaultSize, 0), wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALL, 5); - auto* profiles = new wxComboBox(page, wxID_ANY, _(kDefaultProfileName)); + auto* profiles = new wxComboBox(page, wxID_ANY, kDefaultProfileName); sizer->Add(profiles, wxGBPosition(0, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALL | wxEXPAND, 5); if (emulated_controller && emulated_controller->has_profile_name()) @@ -678,7 +675,7 @@ void InputSettings2::on_profile_delete(wxCommandEvent& event) const fs::path path = ActiveSettings::GetPath(fmt::format("controllerProfiles/{}.xml", selection)); fs::remove(path); - profile_names->ChangeValue(_(kDefaultProfileName)); + profile_names->ChangeValue(kDefaultProfileName); text->SetLabelText(_("profile deleted")); text->SetForegroundColour(wxTheColourDatabase->Find("SUCCESS")); diff --git a/src/gui/input/InputSettings2.h b/src/gui/input/InputSettings2.h index f6305ff4..01313653 100644 --- a/src/gui/input/InputSettings2.h +++ b/src/gui/input/InputSettings2.h @@ -18,6 +18,8 @@ public: ~InputSettings2(); private: + const wxString kDefaultProfileName = _(""); + wxNotebook* m_notebook; wxTimer* m_timer; diff --git a/src/gui/windows/PPCThreadsViewer/DebugPPCThreadsWindow.cpp b/src/gui/windows/PPCThreadsViewer/DebugPPCThreadsWindow.cpp index 26390a6c..0c10f325 100644 --- a/src/gui/windows/PPCThreadsViewer/DebugPPCThreadsWindow.cpp +++ b/src/gui/windows/PPCThreadsViewer/DebugPPCThreadsWindow.cpp @@ -45,67 +45,67 @@ DebugPPCThreadsWindow::DebugPPCThreadsWindow(wxFrame& parent) // add columns wxListItem col0; col0.SetId(0); - col0.SetText(_("Address")); + col0.SetText("Address"); col0.SetWidth(75); m_thread_list->InsertColumn(0, col0); wxListItem col1; col1.SetId(1); - col1.SetText(_("Entry")); + col1.SetText("Entry"); col1.SetWidth(75); m_thread_list->InsertColumn(1, col1); wxListItem col2; col2.SetId(2); - col2.SetText(_("Stack")); + col2.SetText("Stack"); col2.SetWidth(145); m_thread_list->InsertColumn(2, col2); wxListItem col3; col3.SetId(3); - col3.SetText(_("PC")); + col3.SetText("PC"); col3.SetWidth(120); m_thread_list->InsertColumn(3, col3); wxListItem colLR; colLR.SetId(4); - colLR.SetText(_("LR")); + colLR.SetText("LR"); colLR.SetWidth(75); m_thread_list->InsertColumn(4, colLR); wxListItem col4; col4.SetId(5); - col4.SetText(_("State")); + col4.SetText("State"); col4.SetWidth(90); m_thread_list->InsertColumn(5, col4); wxListItem col5; col5.SetId(6); - col5.SetText(_("Affinity")); + col5.SetText("Affinity"); col5.SetWidth(70); m_thread_list->InsertColumn(6, col5); wxListItem colPriority; colPriority.SetId(7); - colPriority.SetText(_("Priority")); + colPriority.SetText("Priority"); colPriority.SetWidth(80); m_thread_list->InsertColumn(7, colPriority); wxListItem col6; col6.SetId(8); - col6.SetText(_("SliceStart")); + col6.SetText("SliceStart"); col6.SetWidth(110); m_thread_list->InsertColumn(8, col6); wxListItem col7; col7.SetId(9); - col7.SetText(_("SumWakeTime")); + col7.SetText("SumWakeTime"); col7.SetWidth(110); m_thread_list->InsertColumn(9, col7); wxListItem col8; col8.SetId(10); - col8.SetText(_("ThreadName")); + col8.SetText("ThreadName"); col8.SetWidth(180); m_thread_list->InsertColumn(10, col8); wxListItem col9; col9.SetId(11); - col9.SetText(_("GPR")); + col9.SetText("GPR"); col9.SetWidth(180); m_thread_list->InsertColumn(11, col9); wxListItem col10; col10.SetId(12); - col10.SetText(_("Extra info")); + col10.SetText("Extra info"); col10.SetWidth(180); m_thread_list->InsertColumn(12, col10); diff --git a/src/gui/windows/TextureRelationViewer/TextureRelationWindow.cpp b/src/gui/windows/TextureRelationViewer/TextureRelationWindow.cpp index 5a42691e..718bca3a 100644 --- a/src/gui/windows/TextureRelationViewer/TextureRelationWindow.cpp +++ b/src/gui/windows/TextureRelationViewer/TextureRelationWindow.cpp @@ -51,57 +51,57 @@ TextureRelationViewerWindow::TextureRelationViewerWindow(wxFrame& parent) wxListItem col0; sint32 columnIndex = 0; col0.SetId(columnIndex); columnIndex++; - col0.SetText(_("Type")); + col0.SetText("Type"); col0.SetWidth(85); textureRelationListA->InsertColumn(columnIndex-1, col0); wxListItem col1; col1.SetId(columnIndex); columnIndex++; - col1.SetText(_("PhysAddr")); + col1.SetText("PhysAddr"); col1.SetWidth(80); textureRelationListA->InsertColumn(columnIndex-1, col1); wxListItem col2; col2.SetId(columnIndex); columnIndex++; - col2.SetText(_("Dim")); + col2.SetText("Dim"); col2.SetWidth(80); textureRelationListA->InsertColumn(columnIndex-1, col2); wxListItem col3; col3.SetId(columnIndex); columnIndex++; - col3.SetText(_("Resolution")); + col3.SetText("Resolution"); col3.SetWidth(110); textureRelationListA->InsertColumn(columnIndex-1, col3); wxListItem col5; col5.SetId(columnIndex); columnIndex++; - col5.SetText(_("Format")); + col5.SetText("Format"); col5.SetWidth(70); textureRelationListA->InsertColumn(columnIndex-1, col5); wxListItem colPriority; colPriority.SetId(columnIndex); columnIndex++; - colPriority.SetText(_("Pitch")); + colPriority.SetText("Pitch"); colPriority.SetWidth(80); textureRelationListA->InsertColumn(columnIndex-1, colPriority); wxListItem col6; col6.SetId(columnIndex); columnIndex++; - col6.SetText(_("Tilemode")); + col6.SetText("Tilemode"); col6.SetWidth(80); textureRelationListA->InsertColumn(columnIndex-1, col6); wxListItem col7; col7.SetId(columnIndex); columnIndex++; - col7.SetText(_("SliceRange")); + col7.SetText("SliceRange"); col7.SetWidth(90); textureRelationListA->InsertColumn(columnIndex-1, col7); wxListItem col8; col8.SetId(columnIndex); columnIndex++; - col8.SetText(_("MipRange")); + col8.SetText("MipRange"); col8.SetWidth(90); textureRelationListA->InsertColumn(columnIndex-1, col8); wxListItem colAge; colAge.SetId(columnIndex); columnIndex++; - colAge.SetText(_("Last access")); + colAge.SetText("Last access"); colAge.SetWidth(90); textureRelationListA->InsertColumn(columnIndex - 1, colAge); wxListItem colOverwriteRes; colOverwriteRes.SetId(columnIndex); columnIndex++; - colOverwriteRes.SetText(_("OverwriteRes")); + colOverwriteRes.SetText("OverwriteRes"); colOverwriteRes.SetWidth(110); textureRelationListA->InsertColumn(columnIndex - 1, colOverwriteRes); diff --git a/src/main.cpp b/src/main.cpp index eac51f1f..f94b2761 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,7 +6,7 @@ #include "Cafe/OS/RPL/rpl_symbol_storage.h" #include "Cafe/OS/libs/gx2/GX2.h" #include "Cafe/GameProfile/GameProfile.h" -#include "Cafe/GraphicPack/GraphicPack.h" +#include "Cafe/GraphicPack/GraphicPack2.h" #include "config/CemuConfig.h" #include "gui/CemuApp.h" #include "Cafe/HW/Latte/Core/LatteOverlay.h" @@ -221,7 +221,7 @@ void mainEmulatorCommonInit() // static initialization IAudioAPI::InitializeStatic(); // load graphic packs (must happen before config is loaded) - graphicPack_loadAll(); + GraphicPack2::LoadAll(); // initialize file system fsc_init(); }