mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 05:08:57 +00:00
Merge pull request #21 from dolphin-emu/master
[pull] master from dolphin-emu:master
This commit is contained in:
commit
5c1aee04ad
306 changed files with 6219 additions and 30409 deletions
|
@ -20,6 +20,7 @@
|
|||
#include <rcheevos/include/rc_runtime.h>
|
||||
|
||||
#include "Core/AchievementManager.h"
|
||||
#include "Core/Config/AchievementSettings.h"
|
||||
#include "Core/Core.h"
|
||||
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
|
@ -64,11 +65,11 @@ AchievementHeaderWidget::AchievementHeaderWidget(QWidget* parent) : QWidget(pare
|
|||
m_total->addWidget(m_user_box);
|
||||
m_total->addWidget(m_game_box);
|
||||
|
||||
UpdateData();
|
||||
|
||||
m_total->setContentsMargins(0, 0, 0, 0);
|
||||
m_total->setAlignment(Qt::AlignTop);
|
||||
setLayout(m_total);
|
||||
|
||||
UpdateData();
|
||||
}
|
||||
|
||||
void AchievementHeaderWidget::UpdateData()
|
||||
|
@ -101,11 +102,9 @@ void AchievementHeaderWidget::UpdateData()
|
|||
m_game_progress_soft->setValue(point_spread.hard_unlocks);
|
||||
m_game_progress_soft->setRange(0, point_spread.total_count);
|
||||
m_game_progress_soft->setValue(point_spread.hard_unlocks + point_spread.soft_unlocks);
|
||||
// TODO: RP needs a minor refactor to work here, will be a future PR
|
||||
// m_rich_presence->setText(QString::fromStdString(AchievementManager::GetInstance()->GenerateRichPresence()));
|
||||
// m_rich_presence->setVisible(Config::Get(Config::RA_RICH_PRESENCE_ENABLED));
|
||||
m_rich_presence->setText(QString{});
|
||||
m_rich_presence->setVisible(false);
|
||||
m_rich_presence->setText(
|
||||
QString::fromUtf8(AchievementManager::GetInstance()->GetRichPresence().data()));
|
||||
m_rich_presence->setVisible(Config::Get(Config::RA_RICH_PRESENCE_ENABLED));
|
||||
|
||||
m_user_box->setVisible(false);
|
||||
m_game_box->setVisible(true);
|
||||
|
|
|
@ -49,6 +49,8 @@ AchievementProgressWidget::AchievementProgressWidget(QWidget* parent) : QWidget(
|
|||
QGroupBox*
|
||||
AchievementProgressWidget::CreateAchievementBox(const rc_api_achievement_definition_t* achievement)
|
||||
{
|
||||
if (!AchievementManager::GetInstance()->IsGameLoaded())
|
||||
return new QGroupBox();
|
||||
QLabel* a_title = new QLabel(QString::fromUtf8(achievement->title, strlen(achievement->title)));
|
||||
QLabel* a_description =
|
||||
new QLabel(QString::fromUtf8(achievement->description, strlen(achievement->description)));
|
||||
|
@ -91,6 +93,8 @@ void AchievementProgressWidget::UpdateData()
|
|||
delete item;
|
||||
}
|
||||
|
||||
if (!AchievementManager::GetInstance()->IsGameLoaded())
|
||||
return;
|
||||
const auto* game_data = AchievementManager::GetInstance()->GetGameData();
|
||||
for (u32 ix = 0; ix < game_data->num_achievements; ix++)
|
||||
{
|
||||
|
|
|
@ -25,6 +25,8 @@ AchievementsWindow::AchievementsWindow(QWidget* parent) : QDialog(parent)
|
|||
ConnectWidgets();
|
||||
AchievementManager::GetInstance()->SetUpdateCallback(
|
||||
[this] { QueueOnObject(this, &AchievementsWindow::UpdateData); });
|
||||
|
||||
UpdateData();
|
||||
}
|
||||
|
||||
void AchievementsWindow::showEvent(QShowEvent* event)
|
||||
|
@ -44,7 +46,6 @@ void AchievementsWindow::CreateMainLayout()
|
|||
GetWrappedWidget(new AchievementSettingsWidget(m_tab_widget, this), this, 125, 100),
|
||||
tr("Settings"));
|
||||
m_tab_widget->addTab(GetWrappedWidget(m_progress_widget, this, 125, 100), tr("Progress"));
|
||||
m_tab_widget->setTabVisible(1, AchievementManager::GetInstance()->IsGameLoaded());
|
||||
|
||||
m_button_box = new QDialogButtonBox(QDialogButtonBox::Close);
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ MemoryViewWidget::MemoryViewWidget(QWidget* parent)
|
|||
void MemoryViewWidget::UpdateFont()
|
||||
{
|
||||
const QFontMetrics fm(Settings::Instance().GetDebugFont());
|
||||
m_font_vspace = fm.lineSpacing();
|
||||
m_font_vspace = fm.lineSpacing() + 4;
|
||||
// BoundingRect is too unpredictable, a custom one would be needed for each view type. Different
|
||||
// fonts have wildly different spacing between two characters and horizontalAdvance includes
|
||||
// spacing.
|
||||
|
@ -283,8 +283,8 @@ void MemoryViewWidget::CreateTable()
|
|||
|
||||
// This sets all row heights and determines horizontal ascii spacing.
|
||||
// Could be placed in UpdateFont() but doesn't apply correctly unless called more.
|
||||
m_table->verticalHeader()->setDefaultSectionSize(m_font_vspace - 1);
|
||||
m_table->verticalHeader()->setMinimumSectionSize(m_font_vspace - 1);
|
||||
m_table->verticalHeader()->setDefaultSectionSize(m_font_vspace);
|
||||
m_table->verticalHeader()->setMinimumSectionSize(m_font_vspace);
|
||||
m_table->horizontalHeader()->setMinimumSectionSize(m_font_width * 2);
|
||||
|
||||
const QSignalBlocker blocker(m_table);
|
||||
|
|
|
@ -359,8 +359,8 @@ void HotkeyScheduler::Run()
|
|||
|
||||
// Graphics
|
||||
const auto efb_scale = Config::Get(Config::GFX_EFB_SCALE);
|
||||
auto ShowEFBScale = []() {
|
||||
switch (Config::Get(Config::GFX_EFB_SCALE))
|
||||
const auto ShowEFBScale = [](int new_efb_scale) {
|
||||
switch (new_efb_scale)
|
||||
{
|
||||
case EFB_SCALE_AUTO_INTEGRAL:
|
||||
OSD::AddMessage("Internal Resolution: Auto (integral)");
|
||||
|
@ -369,7 +369,7 @@ void HotkeyScheduler::Run()
|
|||
OSD::AddMessage("Internal Resolution: Native");
|
||||
break;
|
||||
default:
|
||||
OSD::AddMessage(fmt::format("Internal Resolution: {}x", g_Config.iEFBScale));
|
||||
OSD::AddMessage(fmt::format("Internal Resolution: {}x", new_efb_scale));
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
@ -377,14 +377,14 @@ void HotkeyScheduler::Run()
|
|||
if (IsHotkey(HK_INCREASE_IR))
|
||||
{
|
||||
Config::SetCurrent(Config::GFX_EFB_SCALE, efb_scale + 1);
|
||||
ShowEFBScale();
|
||||
ShowEFBScale(efb_scale + 1);
|
||||
}
|
||||
if (IsHotkey(HK_DECREASE_IR))
|
||||
{
|
||||
if (efb_scale > EFB_SCALE_AUTO_INTEGRAL)
|
||||
{
|
||||
Config::SetCurrent(Config::GFX_EFB_SCALE, efb_scale - 1);
|
||||
ShowEFBScale();
|
||||
ShowEFBScale(efb_scale - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -470,8 +470,11 @@ void HotkeyScheduler::Run()
|
|||
if (IsHotkey(HK_DECREASE_EMULATION_SPEED))
|
||||
{
|
||||
auto speed = Config::Get(Config::MAIN_EMULATION_SPEED) - 0.1;
|
||||
speed = (speed <= 0 || (speed >= 0.95 && speed <= 1.05)) ? 1.0 : speed;
|
||||
Config::SetCurrent(Config::MAIN_EMULATION_SPEED, speed);
|
||||
if (speed > 0)
|
||||
{
|
||||
speed = (speed >= 0.95 && speed <= 1.05) ? 1.0 : speed;
|
||||
Config::SetCurrent(Config::MAIN_EMULATION_SPEED, speed);
|
||||
}
|
||||
ShowEmulationSpeed();
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "Core/Boot/Boot.h"
|
||||
#include "Core/BootManager.h"
|
||||
#include "Core/CommonTitles.h"
|
||||
#include "Core/Config/AchievementSettings.h"
|
||||
#include "Core/Config/MainSettings.h"
|
||||
#include "Core/Config/NetplaySettings.h"
|
||||
#include "Core/Config/WiimoteSettings.h"
|
||||
|
@ -229,11 +230,6 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters,
|
|||
|
||||
InitControllers();
|
||||
|
||||
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||
// This has to be done before CreateComponents() so it's initialized.
|
||||
AchievementManager::GetInstance()->Init();
|
||||
#endif // USE_RETRO_ACHIEVEMENTS
|
||||
|
||||
CreateComponents();
|
||||
|
||||
ConnectGameList();
|
||||
|
@ -258,6 +254,10 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters,
|
|||
|
||||
NetPlayInit();
|
||||
|
||||
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||
AchievementManager::GetInstance()->Init();
|
||||
#endif // USE_RETRO_ACHIEVEMENTS
|
||||
|
||||
#if defined(__unix__) || defined(__unix) || defined(__APPLE__)
|
||||
auto* daemon = new SignalDaemon(this);
|
||||
|
||||
|
@ -282,6 +282,9 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters,
|
|||
}
|
||||
}
|
||||
|
||||
m_state_slot =
|
||||
std::clamp(Settings::Instance().GetStateSlot(), 1, static_cast<int>(State::NUM_STATES));
|
||||
|
||||
QSettings& settings = Settings::GetQSettings();
|
||||
|
||||
restoreState(settings.value(QStringLiteral("mainwindow/state")).toByteArray());
|
||||
|
|
|
@ -140,20 +140,10 @@ void MenuBar::OnEmulationStateChanged(Core::State state)
|
|||
m_jit_interpreter_core->setEnabled(running);
|
||||
m_jit_block_linking->setEnabled(!running);
|
||||
m_jit_disable_cache->setEnabled(!running);
|
||||
m_jit_disable_fastmem->setEnabled(!running);
|
||||
m_jit_clear_cache->setEnabled(running);
|
||||
m_jit_log_coverage->setEnabled(!running);
|
||||
m_jit_search_instruction->setEnabled(running);
|
||||
|
||||
for (QAction* action :
|
||||
{m_jit_off, m_jit_loadstore_off, m_jit_loadstore_lbzx_off, m_jit_loadstore_lxz_off,
|
||||
m_jit_loadstore_lwz_off, m_jit_loadstore_floating_off, m_jit_loadstore_paired_off,
|
||||
m_jit_floatingpoint_off, m_jit_integer_off, m_jit_paired_off, m_jit_systemregisters_off,
|
||||
m_jit_branch_off, m_jit_register_cache_off})
|
||||
{
|
||||
action->setEnabled(running && !playing);
|
||||
}
|
||||
|
||||
// Symbols
|
||||
m_symbols->setEnabled(running);
|
||||
|
||||
|
@ -833,10 +823,8 @@ void MenuBar::AddJITMenu()
|
|||
m_jit_disable_fastmem = m_jit->addAction(tr("Disable Fastmem"));
|
||||
m_jit_disable_fastmem->setCheckable(true);
|
||||
m_jit_disable_fastmem->setChecked(!Config::Get(Config::MAIN_FASTMEM));
|
||||
connect(m_jit_disable_fastmem, &QAction::toggled, [this](bool enabled) {
|
||||
Config::SetBaseOrCurrent(Config::MAIN_FASTMEM, !enabled);
|
||||
ClearCache();
|
||||
});
|
||||
connect(m_jit_disable_fastmem, &QAction::toggled,
|
||||
[](bool enabled) { Config::SetBaseOrCurrent(Config::MAIN_FASTMEM, !enabled); });
|
||||
|
||||
m_jit_clear_cache = m_jit->addAction(tr("Clear Cache"), this, &MenuBar::ClearCache);
|
||||
|
||||
|
@ -852,106 +840,92 @@ void MenuBar::AddJITMenu()
|
|||
m_jit_off = m_jit->addAction(tr("JIT Off (JIT Core)"));
|
||||
m_jit_off->setCheckable(true);
|
||||
m_jit_off->setChecked(Config::Get(Config::MAIN_DEBUG_JIT_OFF));
|
||||
connect(m_jit_off, &QAction::toggled, [this](bool enabled) {
|
||||
Config::SetBaseOrCurrent(Config::MAIN_DEBUG_JIT_OFF, enabled);
|
||||
ClearCache();
|
||||
});
|
||||
connect(m_jit_off, &QAction::toggled,
|
||||
[](bool enabled) { Config::SetBaseOrCurrent(Config::MAIN_DEBUG_JIT_OFF, enabled); });
|
||||
|
||||
m_jit_loadstore_off = m_jit->addAction(tr("JIT LoadStore Off"));
|
||||
m_jit_loadstore_off->setCheckable(true);
|
||||
m_jit_loadstore_off->setChecked(Config::Get(Config::MAIN_DEBUG_JIT_LOAD_STORE_OFF));
|
||||
connect(m_jit_loadstore_off, &QAction::toggled, [this](bool enabled) {
|
||||
connect(m_jit_loadstore_off, &QAction::toggled, [](bool enabled) {
|
||||
Config::SetBaseOrCurrent(Config::MAIN_DEBUG_JIT_LOAD_STORE_OFF, enabled);
|
||||
ClearCache();
|
||||
});
|
||||
|
||||
m_jit_loadstore_lbzx_off = m_jit->addAction(tr("JIT LoadStore lbzx Off"));
|
||||
m_jit_loadstore_lbzx_off->setCheckable(true);
|
||||
m_jit_loadstore_lbzx_off->setChecked(Config::Get(Config::MAIN_DEBUG_JIT_LOAD_STORE_LBZX_OFF));
|
||||
connect(m_jit_loadstore_lbzx_off, &QAction::toggled, [this](bool enabled) {
|
||||
connect(m_jit_loadstore_lbzx_off, &QAction::toggled, [](bool enabled) {
|
||||
Config::SetBaseOrCurrent(Config::MAIN_DEBUG_JIT_LOAD_STORE_LBZX_OFF, enabled);
|
||||
ClearCache();
|
||||
});
|
||||
|
||||
m_jit_loadstore_lxz_off = m_jit->addAction(tr("JIT LoadStore lXz Off"));
|
||||
m_jit_loadstore_lxz_off->setCheckable(true);
|
||||
m_jit_loadstore_lxz_off->setChecked(Config::Get(Config::MAIN_DEBUG_JIT_LOAD_STORE_LXZ_OFF));
|
||||
connect(m_jit_loadstore_lxz_off, &QAction::toggled, [this](bool enabled) {
|
||||
connect(m_jit_loadstore_lxz_off, &QAction::toggled, [](bool enabled) {
|
||||
Config::SetBaseOrCurrent(Config::MAIN_DEBUG_JIT_LOAD_STORE_LXZ_OFF, enabled);
|
||||
ClearCache();
|
||||
});
|
||||
|
||||
m_jit_loadstore_lwz_off = m_jit->addAction(tr("JIT LoadStore lwz Off"));
|
||||
m_jit_loadstore_lwz_off->setCheckable(true);
|
||||
m_jit_loadstore_lwz_off->setChecked(Config::Get(Config::MAIN_DEBUG_JIT_LOAD_STORE_LWZ_OFF));
|
||||
connect(m_jit_loadstore_lwz_off, &QAction::toggled, [this](bool enabled) {
|
||||
connect(m_jit_loadstore_lwz_off, &QAction::toggled, [](bool enabled) {
|
||||
Config::SetBaseOrCurrent(Config::MAIN_DEBUG_JIT_LOAD_STORE_LWZ_OFF, enabled);
|
||||
ClearCache();
|
||||
});
|
||||
|
||||
m_jit_loadstore_floating_off = m_jit->addAction(tr("JIT LoadStore Floating Off"));
|
||||
m_jit_loadstore_floating_off->setCheckable(true);
|
||||
m_jit_loadstore_floating_off->setChecked(
|
||||
Config::Get(Config::MAIN_DEBUG_JIT_LOAD_STORE_FLOATING_OFF));
|
||||
connect(m_jit_loadstore_floating_off, &QAction::toggled, [this](bool enabled) {
|
||||
connect(m_jit_loadstore_floating_off, &QAction::toggled, [](bool enabled) {
|
||||
Config::SetBaseOrCurrent(Config::MAIN_DEBUG_JIT_LOAD_STORE_FLOATING_OFF, enabled);
|
||||
ClearCache();
|
||||
});
|
||||
|
||||
m_jit_loadstore_paired_off = m_jit->addAction(tr("JIT LoadStore Paired Off"));
|
||||
m_jit_loadstore_paired_off->setCheckable(true);
|
||||
m_jit_loadstore_paired_off->setChecked(Config::Get(Config::MAIN_DEBUG_JIT_LOAD_STORE_PAIRED_OFF));
|
||||
connect(m_jit_loadstore_paired_off, &QAction::toggled, [this](bool enabled) {
|
||||
connect(m_jit_loadstore_paired_off, &QAction::toggled, [](bool enabled) {
|
||||
Config::SetBaseOrCurrent(Config::MAIN_DEBUG_JIT_LOAD_STORE_PAIRED_OFF, enabled);
|
||||
ClearCache();
|
||||
});
|
||||
|
||||
m_jit_floatingpoint_off = m_jit->addAction(tr("JIT FloatingPoint Off"));
|
||||
m_jit_floatingpoint_off->setCheckable(true);
|
||||
m_jit_floatingpoint_off->setChecked(Config::Get(Config::MAIN_DEBUG_JIT_FLOATING_POINT_OFF));
|
||||
connect(m_jit_floatingpoint_off, &QAction::toggled, [this](bool enabled) {
|
||||
connect(m_jit_floatingpoint_off, &QAction::toggled, [](bool enabled) {
|
||||
Config::SetBaseOrCurrent(Config::MAIN_DEBUG_JIT_FLOATING_POINT_OFF, enabled);
|
||||
ClearCache();
|
||||
});
|
||||
|
||||
m_jit_integer_off = m_jit->addAction(tr("JIT Integer Off"));
|
||||
m_jit_integer_off->setCheckable(true);
|
||||
m_jit_integer_off->setChecked(Config::Get(Config::MAIN_DEBUG_JIT_INTEGER_OFF));
|
||||
connect(m_jit_integer_off, &QAction::toggled, [this](bool enabled) {
|
||||
connect(m_jit_integer_off, &QAction::toggled, [](bool enabled) {
|
||||
Config::SetBaseOrCurrent(Config::MAIN_DEBUG_JIT_INTEGER_OFF, enabled);
|
||||
ClearCache();
|
||||
});
|
||||
|
||||
m_jit_paired_off = m_jit->addAction(tr("JIT Paired Off"));
|
||||
m_jit_paired_off->setCheckable(true);
|
||||
m_jit_paired_off->setChecked(Config::Get(Config::MAIN_DEBUG_JIT_PAIRED_OFF));
|
||||
connect(m_jit_paired_off, &QAction::toggled, [this](bool enabled) {
|
||||
connect(m_jit_paired_off, &QAction::toggled, [](bool enabled) {
|
||||
Config::SetBaseOrCurrent(Config::MAIN_DEBUG_JIT_PAIRED_OFF, enabled);
|
||||
ClearCache();
|
||||
});
|
||||
|
||||
m_jit_systemregisters_off = m_jit->addAction(tr("JIT SystemRegisters Off"));
|
||||
m_jit_systemregisters_off->setCheckable(true);
|
||||
m_jit_systemregisters_off->setChecked(Config::Get(Config::MAIN_DEBUG_JIT_SYSTEM_REGISTERS_OFF));
|
||||
connect(m_jit_systemregisters_off, &QAction::toggled, [this](bool enabled) {
|
||||
connect(m_jit_systemregisters_off, &QAction::toggled, [](bool enabled) {
|
||||
Config::SetBaseOrCurrent(Config::MAIN_DEBUG_JIT_SYSTEM_REGISTERS_OFF, enabled);
|
||||
ClearCache();
|
||||
});
|
||||
|
||||
m_jit_branch_off = m_jit->addAction(tr("JIT Branch Off"));
|
||||
m_jit_branch_off->setCheckable(true);
|
||||
m_jit_branch_off->setChecked(Config::Get(Config::MAIN_DEBUG_JIT_BRANCH_OFF));
|
||||
connect(m_jit_branch_off, &QAction::toggled, [this](bool enabled) {
|
||||
connect(m_jit_branch_off, &QAction::toggled, [](bool enabled) {
|
||||
Config::SetBaseOrCurrent(Config::MAIN_DEBUG_JIT_BRANCH_OFF, enabled);
|
||||
ClearCache();
|
||||
});
|
||||
|
||||
m_jit_register_cache_off = m_jit->addAction(tr("JIT Register Cache Off"));
|
||||
m_jit_register_cache_off->setCheckable(true);
|
||||
m_jit_register_cache_off->setChecked(Config::Get(Config::MAIN_DEBUG_JIT_REGISTER_CACHE_OFF));
|
||||
connect(m_jit_register_cache_off, &QAction::toggled, [this](bool enabled) {
|
||||
connect(m_jit_register_cache_off, &QAction::toggled, [](bool enabled) {
|
||||
Config::SetBaseOrCurrent(Config::MAIN_DEBUG_JIT_REGISTER_CACHE_OFF, enabled);
|
||||
ClearCache();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue