mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-05 15:55:10 +00:00
Compare commits
4 Commits
30dd1e79df
...
068ab1df2e
Author | SHA1 | Date | |
---|---|---|---|
![]() |
068ab1df2e | ||
![]() |
42eea4073e | ||
![]() |
033a0540f7 | ||
![]() |
64a20c74fc |
@ -174,6 +174,15 @@ void AddCode(ARCode code)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t CountEnabledCodes()
|
||||||
|
{
|
||||||
|
if (!Config::AreCheatsEnabled())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
std::lock_guard guard(s_lock);
|
||||||
|
return s_active_codes.size();
|
||||||
|
}
|
||||||
|
|
||||||
void LoadAndApplyCodes(const Common::IniFile& global_ini, const Common::IniFile& local_ini,
|
void LoadAndApplyCodes(const Common::IniFile& global_ini, const Common::IniFile& local_ini,
|
||||||
const std::string& game_id, u16 revision)
|
const std::string& game_id, u16 revision)
|
||||||
{
|
{
|
||||||
|
@ -50,6 +50,7 @@ void SetSyncedCodesAsActive();
|
|||||||
void UpdateSyncedCodes(std::span<const ARCode> codes);
|
void UpdateSyncedCodes(std::span<const ARCode> codes);
|
||||||
std::vector<ARCode> ApplyAndReturnCodes(std::span<const ARCode> codes);
|
std::vector<ARCode> ApplyAndReturnCodes(std::span<const ARCode> codes);
|
||||||
void AddCode(ARCode new_code);
|
void AddCode(ARCode new_code);
|
||||||
|
size_t CountEnabledCodes();
|
||||||
void LoadAndApplyCodes(const Common::IniFile& global_ini, const Common::IniFile& local_ini,
|
void LoadAndApplyCodes(const Common::IniFile& global_ini, const Common::IniFile& local_ini,
|
||||||
const std::string& game_id, u16 revision);
|
const std::string& game_id, u16 revision);
|
||||||
|
|
||||||
|
@ -50,6 +50,15 @@ static std::vector<GeckoCode> s_active_codes;
|
|||||||
static std::vector<GeckoCode> s_synced_codes;
|
static std::vector<GeckoCode> s_synced_codes;
|
||||||
static std::mutex s_active_codes_lock;
|
static std::mutex s_active_codes_lock;
|
||||||
|
|
||||||
|
size_t CountEnabledCodes()
|
||||||
|
{
|
||||||
|
if (!Config::AreCheatsEnabled())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
std::lock_guard guard(s_active_codes_lock);
|
||||||
|
return s_active_codes.size();
|
||||||
|
}
|
||||||
|
|
||||||
void SetActiveCodes(std::span<const GeckoCode> gcodes, const std::string& game_id, u16 revision)
|
void SetActiveCodes(std::span<const GeckoCode> gcodes, const std::string& game_id, u16 revision)
|
||||||
{
|
{
|
||||||
std::lock_guard lk(s_active_codes_lock);
|
std::lock_guard lk(s_active_codes_lock);
|
||||||
|
@ -60,6 +60,7 @@ constexpr u32 HLE_TRAMPOLINE_ADDRESS = INSTALLER_END_ADDRESS - 4;
|
|||||||
// preserve the emulation performance.
|
// preserve the emulation performance.
|
||||||
constexpr u32 MAGIC_GAMEID = 0xD01F1BAD;
|
constexpr u32 MAGIC_GAMEID = 0xD01F1BAD;
|
||||||
|
|
||||||
|
size_t CountEnabledCodes();
|
||||||
void SetActiveCodes(std::span<const GeckoCode> gcodes, const std::string& game_id, u16 revision);
|
void SetActiveCodes(std::span<const GeckoCode> gcodes, const std::string& game_id, u16 revision);
|
||||||
void SetSyncedCodesAsActive();
|
void SetSyncedCodesAsActive();
|
||||||
void UpdateSyncedCodes(std::span<const GeckoCode> gcodes);
|
void UpdateSyncedCodes(std::span<const GeckoCode> gcodes);
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include "Core/PowerPC/MMU.h"
|
#include "Core/PowerPC/MMU.h"
|
||||||
#include "Core/PowerPC/PowerPC.h"
|
#include "Core/PowerPC/PowerPC.h"
|
||||||
#include "Core/System.h"
|
#include "Core/System.h"
|
||||||
|
#include "VideoCommon/OnScreenDisplay.h"
|
||||||
|
|
||||||
namespace PatchEngine
|
namespace PatchEngine
|
||||||
{
|
{
|
||||||
@ -200,6 +201,18 @@ void LoadPatches()
|
|||||||
ActionReplay::LoadAndApplyCodes(globalIni, localIni, sconfig.GetGameID(),
|
ActionReplay::LoadAndApplyCodes(globalIni, localIni, sconfig.GetGameID(),
|
||||||
sconfig.GetRevision());
|
sconfig.GetRevision());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const size_t enabled_patch_count =
|
||||||
|
std::ranges::count_if(s_on_frame, [](Patch patch) { return patch.enabled; });
|
||||||
|
if (enabled_patch_count > 0)
|
||||||
|
{
|
||||||
|
OSD::AddMessage(fmt::format("{} game patch(es) enabled", enabled_patch_count),
|
||||||
|
OSD::Duration::NORMAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
const size_t enabled_cheat_count = ActionReplay::CountEnabledCodes() + Gecko::CountEnabledCodes();
|
||||||
|
if (enabled_cheat_count > 0)
|
||||||
|
OSD::AddMessage(fmt::format("{} cheat(s) enabled", enabled_cheat_count), OSD::Duration::NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ApplyPatches(const Core::CPUThreadGuard& guard, const std::vector<Patch>& patches)
|
static void ApplyPatches(const Core::CPUThreadGuard& guard, const std::vector<Patch>& patches)
|
||||||
|
@ -32,16 +32,16 @@ protected:
|
|||||||
for (int i{0}; i < tab_count; ++i)
|
for (int i{0}; i < tab_count; ++i)
|
||||||
{
|
{
|
||||||
if (i != current_tab_index)
|
if (i != current_tab_index)
|
||||||
paintTab(painter, i);
|
PaintTab(painter, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Current tab is painted last as, depending on the [system] style, it is possible that the
|
// Current tab is painted last as, depending on the [system] style, it is possible that the
|
||||||
// decoration is required to occlude the adjacent tab underneath.
|
// decoration is required to occlude the adjacent tab underneath.
|
||||||
paintTab(painter, current_tab_index);
|
PaintTab(painter, current_tab_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void paintTab(QStylePainter& painter, const int tab_index)
|
void PaintTab(QStylePainter& painter, const int tab_index)
|
||||||
{
|
{
|
||||||
painter.save();
|
painter.save();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user