Skip to content

Commit

Permalink
Qt: Show currently active savestate slot on status bar
Browse files Browse the repository at this point in the history
  • Loading branch information
kamfretoz committed Oct 30, 2023
1 parent ae49012 commit 69d6a2d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pcsx2-qt/QtHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1016,15 +1016,17 @@ void EmuThread::updatePerformanceMetrics(bool force)
QString gs_stat;
if (THREAD_VU1)
{
gs_stat = QStringLiteral("%1 | EE: %2% | VU: %3% | GS: %4%")
gs_stat = QStringLiteral("Slot: %1 | %2 | EE: %3% | VU: %4% | GS: %5%")
.arg(VMManager::GetCurrentActiveSavestateSlot())
.arg(gs_stat_str.c_str())
.arg(PerformanceMetrics::GetCPUThreadUsage(), 0, 'f', 0)
.arg(PerformanceMetrics::GetVUThreadUsage(), 0, 'f', 0)
.arg(PerformanceMetrics::GetGSThreadUsage(), 0, 'f', 0);
}
else
{
gs_stat = QStringLiteral("%1 | EE: %2% | GS: %3%")
gs_stat = QStringLiteral("Slot: %1 | %2 | EE: %3% | GS: %4%")
.arg(VMManager::GetCurrentActiveSavestateSlot())
.arg(gs_stat_str.c_str())
.arg(PerformanceMetrics::GetCPUThreadUsage(), 0, 'f', 0)
.arg(PerformanceMetrics::GetGSThreadUsage(), 0, 'f', 0);
Expand Down
5 changes: 5 additions & 0 deletions pcsx2/Hotkeys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
static s32 s_current_save_slot = 1;
static std::optional<LimiterModeType> s_limiter_mode_prior_to_hold_interaction;

s32 VMManager::GetCurrentActiveSavestateSlot()
{
return s_current_save_slot;
}

void VMManager::Internal::ResetVMHotkeyState()
{
s_current_save_slot = 1;
Expand Down
3 changes: 3 additions & 0 deletions pcsx2/VMManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ namespace VMManager
/// The number of usable save state slots.
static constexpr s32 NUM_SAVE_STATE_SLOTS = 10;

/// Returns the currently active savestate slot.
s32 GetCurrentActiveSavestateSlot();

/// The stack size to use for threads running recompilers
static constexpr std::size_t EMU_THREAD_STACK_SIZE = 2 * 1024 * 1024; // µVU likes recursion

Expand Down

0 comments on commit 69d6a2d

Please sign in to comment.