Merge branch 'main' into linux-overlay

This commit is contained in:
Tom Lally 2022-09-04 10:27:53 +01:00
commit a3b9adb29b
40 changed files with 270 additions and 327 deletions

2
.gitignore vendored
View file

@ -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/*

View file

@ -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

View file

@ -118,18 +118,18 @@ if (ENABLE_CUBEB)
option(BUILD_TOOLS "" OFF)
option(BUNDLE_SPEEX "" OFF)
set(USE_WINMM OFF CACHE BOOL "")
add_subdirectory("dependencies/cubeb")
add_subdirectory("dependencies/cubeb" EXCLUDE_FROM_ALL)
set_property(TARGET cubeb PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
add_library(cubeb::cubeb ALIAS cubeb)
endif()
add_compile_definitions("HAS_CUBEB=1")
endif()
add_subdirectory("dependencies/ih264d")
add_subdirectory("dependencies/ih264d" EXCLUDE_FROM_ALL)
find_package(ZArchive)
if (NOT ZArchive_FOUND)
add_subdirectory("dependencies/ZArchive")
add_subdirectory("dependencies/ZArchive" EXCLUDE_FROM_ALL)
endif()
add_subdirectory(src)

View file

@ -5,10 +5,14 @@ Terminal=false
Icon=info.cemu.Cemu
Exec=cemu
GenericName=Wii U Emulator
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
Comment[ru]=Программа для эмуляции игр и приложений Wii U на PC
Comment[fr]=Application pour émuler des jeux et des applications Wii U sur PC
@ -16,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;

View file

@ -10,7 +10,8 @@
<summary xml:lang="el">Πρόγραμμα προσομοίωσης παιχνιδιών και εφαρμογών Wii U στον υπολογιστή</summary>
<summary xml:lang="es">Software para emular juegos y aplicaciones de Wii U en PC</summary>
<summary xml:lang="pt_BR">Software para emular jogos e aplicativos de Wii U no PC</summary>
<summary xml:lang="it">Software per emulare giochi ed applicazioni del Wii U su PC</summary>
<summary xml:lang="it">Software per emulare giochi e applicazioni per Wii U su PC</summary>
<summary xml:lang="fi">Ojelmisto Wii U -pelien ja -sovellusten emulointiin PC:llä</summary>
<developer_name>Cemu Project</developer_name>
<launchable type="desktop-id">info.cemu.Cemu.desktop</launchable>
<metadata_license>CC0-1.0</metadata_license>
@ -23,7 +24,8 @@
<p xml:lang="el">Το Cemu είναι ένας προσομοιωτής της κονσόλας Nintendo Wii U που υποστηρίζει τεπίσημα παιχνίδια, καθώς και μη επίσημα προγράμματα ("homebrew"), για το Wii U. Δημιουργήθηκε από τον Exzap σε C/C++.</p>
<p xml:lang="es">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++.</p>
<p xml:lang="pt_BR">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++.</p>
<p xml:lang="it">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++.</p>
<p xml:lang="it">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++.</p>
<p xml:lang="fi">Cemu on Wii U -emulaattori, joka pystyy toistamaan useimpia Wii U -pelejä ja homebrew'ta pelikelvollisesti. Luonut Exzap, kirjoitettu C:llä/C++:lla.</p>
<p>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.</p>
<p xml:lang="de">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.</p>
<p xml:lang="fr">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.</p>
@ -31,7 +33,8 @@
<p xml:lang="el">Ο προσομοιωτής αυτός στοχεύει τόσο στην ακρίβεια, όσο και στην ταχύτητα. Βελτιώνεται συνεχώς με νέες δυνατότητες και διορθώσεις που τον καθιστούν πιο βολικό, εύκολο στην χρήση και συμβατό με περισσότερα παιχνίδια.</p>
<p xml:lang="es">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.</p>
<p xml:lang="pt_BR">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.</p>
<p xml:lang="it">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à.</p>
<p xml:lang="it">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à.</p>
<p xml:lang="fi">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ä..</p>
<p>It was written from scratch and development on the project began roughly early 2015.</p>
<p xml:lang="de">Er wird seit Anfang 2015 entwickelt.</p>
<p xml:lang="fr">Il a été écrit à partir de zéro et son développement a débuté vers le début de l'année 2015.</p>
@ -39,7 +42,9 @@
<p xml:lang="el">Το Cemu βρίσκεται υπό ανάπτυξη από το 2015.</p>
<p xml:lang="es">Fue escrito desde cero y el desarrollo del proyecto comenzó aproximadamente a principios de 2015.</p>
<p xml:lang="pt_BR">Foi escrito do zero e o desenvolvimento do projeto começou aproximadamente a princípio de 2015.</p>
<p xml:lang="it">È stato scritto da zero e lo sviluppo del progetto è iniziato circa all'inizio del 2015.</p>
<p xml:lang="it">È stato scritto da zero e lo sviluppo del progetto è cominciato intorno all'inizio del 2015.</p>
<p xml:lang="fi">Se kirjoitettiin tyhjästä ja sen kehitys alkoi suunnilleen vuoden 2015 alussa.</p>
</description>
<screenshots>
<screenshot type="default">

View file

@ -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;
}

View file

@ -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<FileStream> fs_rules(FileStream::openFile2(rulesPath));
if (!fs_rules)
return;
std::vector<uint8> 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);
}
}
}
}

View file

@ -1,4 +0,0 @@
#define GP_LEGACY_VERSION (2)
void graphicPack_loadAll();
void graphicPack_activateForCurrentTitle(uint64 titleId);

View file

@ -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<GraphicPackPtr> GraphicPack2::s_graphic_packs;
std::vector<GraphicPackPtr> 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<FileStream> fs_rules(FileStream::openFile2(rulesPath));
if (!fs_rules)
return;
std::vector<uint8> 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<GraphicPack2>& graphic_pack)
@ -94,12 +156,65 @@ bool GraphicPack2::DeactivateGraphicPack(const std::shared_ptr<GraphicPack2>& 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))
{

View file

@ -159,18 +159,26 @@ public:
LatteTextureView::MagFilter GetDownscalingMagFilter() const { return m_output_settings.downscale_filter; }
// static methods
static void LoadAll();
static const std::vector<std::shared_ptr<GraphicPack2>>& GetGraphicPacks() { return s_graphic_packs; }
static const std::vector<std::shared_ptr<GraphicPack2>>& 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<GraphicPack2>& graphic_pack);
static bool DeactivateGraphicPack(const std::shared_ptr<GraphicPack2>& 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<std::shared_ptr<GraphicPack2>> s_graphic_packs;
static std::vector<std::shared_ptr<GraphicPack2>> s_active_graphic_packs;
static std::atomic_bool s_isReady;
template<typename TType>
void FillPresetConstants(TExpressionParser<TType>& parser) const

View file

@ -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"

View file

@ -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)

View file

@ -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();

View file

@ -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);
}
};
};

View file

@ -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);

View file

@ -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);

View file

@ -1,9 +1,5 @@
#include "gui/ChecksumTool.h"
#ifdef _WIN32
#include <shellapi.h>
#endif
#include "Cafe/TitleList/GameInfo.h"
#include "gui/helpers/wxCustomEvents.h"
#include "util/helpers/helpers.h"
@ -145,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);
@ -481,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))
@ -521,11 +517,8 @@ void ChecksumTool::VerifyJsonEntry(const rapidjson::Document& doc)
}
file.flush();
file.close();
#ifdef _WIN32
ShellExecuteA(GetHWND(), "open", path.c_str(), nullptr, nullptr, SW_SHOWNORMAL);
#else
assert_dbg();
#endif
wxLaunchDefaultBrowser(fmt::format("file:{}", path));
}
else
wxMessageBox(_("Can't open file to write!"), _("Error"), wxOK | wxCENTRE | wxICON_ERROR, this);
@ -715,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);

View file

@ -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
{

View file

@ -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);

View file

@ -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);

View file

@ -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<wxTreeItemId>& ids, s
void GraphicPacksWindow2::RefreshGraphicPacks()
{
GraphicPack2::ClearGraphicPacks();
graphicPack_loadAll();
GraphicPack2::LoadAll();
}
GraphicPacksWindow2::GraphicPacksWindow2(wxWindow* parent, uint64_t title_id_filter)

View file

@ -34,13 +34,8 @@
#include "gui/TitleManager.h"
#include "Cafe/CafeSystem.h"
#include "Cafe/GraphicPack/GraphicPack.h"
#include "Cafe/TitleList/GameInfo.h"
#ifdef _WIN32
#include <shellapi.h>
#endif
#include <boost/algorithm/string.hpp>
#include "util/helpers/SystemException.h"
#include "gui/DownloadGraphicPacksWindow.h"
@ -591,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 (*.*)")
);
@ -1774,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);
}
@ -1808,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));
@ -1818,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());
}
@ -1828,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);
@ -1951,11 +1945,7 @@ public:
"/*****************************************************************************/\r\n"
);
delete fs;
#ifdef _WIN32
ShellExecute(0, 0, tempPath.generic_wstring().c_str(), 0, 0, SW_SHOW);
#else
assert_dbg();
#endif
wxLaunchDefaultBrowser(fmt::format("file:{}", _utf8Wrapper(tempPath)));
});
lineSizer->Add(noticeLink, 0);
lineSizer->Add(new wxStaticText(parent, -1, ")"), 0);
@ -1973,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<const char*> patreonSupporterNames{ "Maufeat", "lvlv", "F34R", "John Godgames", "Jameel Lewis", "skooks", "Cheesy", "Barrowsx", "Mored1984", "madmat007"
, "Kuhnnl", "Owen M", "lucianobugalu", "KimoMaka", "nick palma aka renaissance18", "TheGiantBros", "SpiGAndromeda"
@ -2003,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));
}
@ -2046,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;

View file

@ -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);

View file

@ -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);

View file

@ -1,9 +1,5 @@
#include "gui/TitleManager.h"
#ifdef _WIN32
#include <shellapi.h>
#endif
#include "gui/helpers/wxCustomEvents.h"
#include "gui/helpers/wxCustomData.h"
#include "Cafe/TitleList/GameInfo.h"
@ -125,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);
@ -332,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),
@ -483,11 +479,7 @@ void TitleManager::OnSaveOpenDirectory(wxCommandEvent& event)
if (!fs::exists(target) || !fs::is_directory(target))
return;
#ifdef _WIN32
ShellExecuteW(GetHWND(), L"open", target.c_str(), nullptr, nullptr, SW_SHOWNORMAL);
#else
assert_dbg();
#endif
wxLaunchDefaultBrowser(fmt::format("file:{}", _utf8Wrapper(target)));
}
void TitleManager::OnSaveDelete(wxCommandEvent& event)
@ -688,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);

View file

@ -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);

View file

@ -4,9 +4,6 @@
#include "util/helpers/helpers.h"
#include "gui/GameProfileWindow.h"
#ifdef _WIN32
#include <shellapi.h>
#endif
#include <numeric>
#include <wx/wupdlock.h>
@ -278,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)
@ -472,7 +473,8 @@ void wxGameList::OnContextMenu(wxContextMenuEvent& event)
menu.Append(kContextMenuStart, _("&Start"));
bool isFavorite = false;
bool isFavorite = GetConfig().IsGameListFavorite(title_id);
std::error_code ec;
menu.AppendSeparator();
menu.AppendCheckItem(kContextMenuFavorite, _("&Favorite"))->Check(isFavorite);
@ -481,7 +483,7 @@ void wxGameList::OnContextMenu(wxContextMenuEvent& event)
menu.AppendSeparator();
menu.Append(kWikiPage, _("&Wiki page"));
menu.Append(kContextMenuGameFolder, _("&Game directory"));
menu.Append(kContextMenuSaveFolder, _("&Save directory"))->Enable(true);
menu.Append(kContextMenuSaveFolder, _("&Save directory"))->Enable(fs::is_directory(gameInfo.GetSaveFolder(), ec));
menu.Append(kContextMenuUpdateFolder, _("&Update directory"))->Enable(gameInfo.HasUpdate());
menu.Append(kContextMenuDLCFolder, _("&DLC directory"))->Enable(gameInfo.HasAOC());
@ -552,13 +554,9 @@ void wxGameList::OnContextMenuSelected(wxCommandEvent& event)
}
case kContextMenuGameFolder:
{
#ifdef _WIN32
fs::path path(gameInfo.GetBase().GetPath());
_stripPathFilename(path);
ShellExecuteW(GetHWND(), L"open", path.c_str(), nullptr, nullptr, SW_SHOWNORMAL);
#else
assert_dbg();
#endif
wxLaunchDefaultBrowser(fmt::format("file:{}", _utf8Wrapper(path)));
break;
}
case kWikiPage:
@ -572,44 +570,28 @@ void wxGameList::OnContextMenuSelected(wxCommandEvent& event)
wxASSERT(!tokens.empty());
const std::string company_code = gameInfo.GetBase().GetMetaInfo()->GetCompanyCode();
wxASSERT(company_code.size() >= 2);
#ifdef _WIN32
ShellExecuteA(GetHWND(), "open", fmt::format("https://wiki.cemu.info/wiki/{}{}", *tokens.rbegin(), company_code.substr(company_code.size() - 2)).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
#else
assert_dbg();
#endif
wxLaunchDefaultBrowser(fmt::format("https://wiki.cemu.info/wiki/{}{}", *tokens.rbegin(), company_code.substr(company_code.size() - 2).c_str()));
}
break;
}
case kContextMenuSaveFolder:
{
#ifdef _WIN32
ShellExecuteW(GetHWND(), L"open", gameInfo.GetSaveFolder().c_str(), nullptr, nullptr, SW_SHOWNORMAL);
#else
assert_dbg();
#endif
wxLaunchDefaultBrowser(fmt::format("file:{}", _utf8Wrapper(gameInfo.GetSaveFolder())));
break;
}
case kContextMenuUpdateFolder:
{
#ifdef _WIN32
fs::path path(gameInfo.GetUpdate().GetPath());
_stripPathFilename(path);
ShellExecuteW(GetHWND(), L"open", path.c_str(), nullptr, nullptr, SW_SHOWNORMAL);
#else
assert_dbg();
#endif
wxLaunchDefaultBrowser(fmt::format("file:{}", _utf8Wrapper(path)));
break;
}
case kContextMenuDLCFolder:
{
#ifdef _WIN32
fs::path path(gameInfo.GetAOC().front().GetPath());
_stripPathFilename(path);
ShellExecuteW(GetHWND(), L"open", path.c_str(), nullptr, nullptr, SW_SHOWNORMAL);
#else
assert_dbg();
#endif
wxLaunchDefaultBrowser(fmt::format("file:{}", _utf8Wrapper(path)));
break;
}
case kContextMenuEditGraphicPacks:
@ -842,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)

View file

@ -20,9 +20,6 @@
#include "../wxHelper.h"
#include <functional>
#ifdef _WIN32
#include <shellapi.h>
#endif
#include "config/ActiveSettings.h"
#include "gui/ChecksumTool.h"
@ -126,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);
@ -853,14 +850,10 @@ void wxTitleManagerList::OnContextMenuSelected(wxCommandEvent& event)
switch (event.GetId())
{
case kContextMenuOpenDirectory:
{
const auto path = fs::is_directory(entry->path) ? entry->path : entry->path.parent_path();
#ifdef _WIN32
ShellExecuteW(GetHWND(), L"open", path.generic_wstring().c_str(), nullptr, nullptr, SW_SHOWNORMAL);
#else
assert_dbg();
#endif
}
{
const auto path = fs::is_directory(entry->path) ? entry->path : entry->path.parent_path();
wxLaunchDefaultBrowser(fmt::format("file:{}", _utf8Wrapper(path)));
}
break;
case kContextMenuDelete:
m_context_worker = std::async(std::launch::async, &wxTitleManagerList::DeleteEntry, this, selection, entry.value());

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -35,9 +35,6 @@
bool g_inputConfigWindowHasFocus = false;
// _("<profile name>")
const wxString kDefaultProfileName = "<profile name>";
using wxTypeData = wxCustomData<EmulatedController::Type>;
using wxControllerData = wxCustomData<ControllerPtr>;
@ -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"));

View file

@ -18,6 +18,8 @@ public:
~InputSettings2();
private:
const wxString kDefaultProfileName = _("<profile name>");
wxNotebook* m_notebook;
wxTimer* m_timer;

View file

@ -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);

View file

@ -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);

View file

@ -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();
}