This commit is contained in:
Nayla Hanegan 2024-01-27 04:44:26 -05:00
commit 0af9a3ae8f
212 changed files with 50301 additions and 41718 deletions

View file

@ -15,6 +15,7 @@
#include "Core/Config/MainSettings.h"
#include "Core/Core.h"
#include "Core/Movie.h"
#include "Core/System.h"
#include "DolphinQt/Config/ControllerInterface/ControllerInterfaceWindow.h"
#include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h"
@ -197,9 +198,9 @@ void AchievementSettingsWidget::LoadSettings()
SignalBlocking(m_common_hardcore_enabled_input)
->setChecked(Config::Get(Config::RA_HARDCORE_ENABLED));
SignalBlocking(m_common_hardcore_enabled_input)
->setEnabled(enabled &&
(hardcore_enabled ||
(Core::GetState() == Core::State::Uninitialized && !Movie::IsPlayingInput())));
->setEnabled(enabled && (hardcore_enabled ||
(Core::GetState() == Core::State::Uninitialized &&
!Core::System::GetInstance().GetMovie().IsPlayingInput())));
SignalBlocking(m_common_progress_enabled_input)
->setChecked(Config::Get(Config::RA_PROGRESS_ENABLED));

View file

@ -17,10 +17,9 @@ namespace
{
QString HtmlFormatErrorLoc(const Common::GekkoAssembler::AssemblerError& err)
{
const QString error = QStringLiteral("<span style=\"color: red; font-weight: bold\">%1</span>")
.arg(QObject::tr("Error"));
// i18n: '%1' is the translation of 'Error'
return QObject::tr("%1 in column %2").arg(error).arg(err.col + 1);
return QObject::tr("<span style=\"color: red; font-weight: bold\">Error</span> on line %1 col %2")
.arg(err.line + 1)
.arg(err.col + 1);
}
QString HtmlFormatErrorLine(const Common::GekkoAssembler::AssemblerError& err)

View file

@ -48,10 +48,9 @@ using namespace Common::GekkoAssembler;
QString HtmlFormatErrorLoc(const AssemblerError& err)
{
const QString error = QStringLiteral("<span style=\"color: red; font-weight: bold\">%1</span>")
.arg(QObject::tr("Error"));
// i18n: '%1' is the translation of 'Error'
return QObject::tr("%1 on line %1 column %2").arg(error).arg(err.line + 1).arg(err.col + 1);
return QObject::tr("<span style=\"color: red; font-weight: bold\">Error</span> on line %1 col %2")
.arg(err.line + 1)
.arg(err.col + 1);
}
QString HtmlFormatErrorLine(const AssemblerError& err)
@ -525,10 +524,8 @@ void AssemblerWidget::OnAssemble(std::vector<CodeBlock>* asm_out)
if (!good)
{
base_address = 0;
const QString warning =
QStringLiteral("<span style=\"color:#ffcc00\">%1</span>").arg(tr("Warning"));
// i18n: '%1' is the translation of 'Warning'
m_error_box->append(tr("%1 invalid base address, defaulting to 0").arg(warning));
m_error_box->append(
tr("<span style=\"color:#ffcc00\">Warning</span> invalid base address, defaulting to 0"));
}
const std::string contents = active_editor->toPlainText().toStdString();
@ -701,21 +698,23 @@ void AssemblerWidget::OnTabChange(int index)
QString AssemblerWidget::TabTextForEditor(AsmEditor* editor, bool with_dirty)
{
ASSERT(editor != nullptr);
QString dirtyFlag = QStringLiteral();
if (editor->IsDirty() && with_dirty)
QString result;
if (!editor->Path().isEmpty())
result = editor->EditorTitle();
else if (editor->EditorNum() == 0)
result = tr("New File");
else
result = tr("New File (%1)").arg(editor->EditorNum() + 1);
if (with_dirty && editor->IsDirty())
{
dirtyFlag = QStringLiteral(" *");
// i18n: This asterisk is added to the title of an editor to indicate that it has unsaved
// changes
result = tr("%1 *").arg(result);
}
if (editor->Path().isEmpty())
{
if (editor->EditorNum() == 0)
{
return tr("New File%1").arg(dirtyFlag);
}
return tr("New File (%1)%2").arg(editor->EditorNum() + 1).arg(dirtyFlag);
}
return tr("%1%2").arg(editor->EditorTitle()).arg(dirtyFlag);
return result;
}
AsmEditor* AssemblerWidget::GetEditor(int idx)

View file

@ -52,7 +52,7 @@ public:
break;
case Terminal::FPR:
HighlightCurToken(HighlightFormat::GPR);
HighlightCurToken(HighlightFormat::FPR);
break;
case Terminal::SPR:
@ -221,17 +221,9 @@ void GekkoSyntaxHighlight::HighlightSubstr(int start, int len, HighlightFormat f
hl_format.setForeground(IMM_COLOR[m_theme_idx]);
break;
case HighlightFormat::GPR:
hl_format.setForeground(BUILTIN_COLOR[m_theme_idx]);
break;
case HighlightFormat::FPR:
hl_format.setForeground(BUILTIN_COLOR[m_theme_idx]);
break;
case HighlightFormat::SPR:
hl_format.setForeground(BUILTIN_COLOR[m_theme_idx]);
break;
case HighlightFormat::CRField:
hl_format.setForeground(BUILTIN_COLOR[m_theme_idx]);
break;
case HighlightFormat::CRFlag:
hl_format.setForeground(BUILTIN_COLOR[m_theme_idx]);
break;

View file

@ -37,7 +37,7 @@ constexpr int PART_START_ROLE = Qt::UserRole + 1;
// Values range from 1 to number of parts
constexpr int PART_END_ROLE = Qt::UserRole + 2;
FIFOAnalyzer::FIFOAnalyzer()
FIFOAnalyzer::FIFOAnalyzer(FifoPlayer& fifo_player) : m_fifo_player(fifo_player)
{
CreateWidgets();
ConnectWidgets();
@ -138,7 +138,7 @@ void FIFOAnalyzer::UpdateTree()
{
m_tree_widget->clear();
if (!FifoPlayer::GetInstance().IsPlaying())
if (!m_fifo_player.IsPlaying())
{
m_tree_widget->addTopLevelItem(new QTreeWidgetItem({tr("No recording loaded.")}));
return;
@ -148,7 +148,7 @@ void FIFOAnalyzer::UpdateTree()
m_tree_widget->addTopLevelItem(recording_item);
auto* file = FifoPlayer::GetInstance().GetFile();
auto* file = m_fifo_player.GetFile();
const u32 frame_count = file->GetFrameCount();
@ -158,7 +158,7 @@ void FIFOAnalyzer::UpdateTree()
recording_item->addChild(frame_item);
const AnalyzedFrameInfo& frame_info = FifoPlayer::GetInstance().GetAnalyzedFrameInfo(frame);
const AnalyzedFrameInfo& frame_info = m_fifo_player.GetAnalyzedFrameInfo(frame);
ASSERT(frame_info.parts.size() != 0);
Common::EnumMap<u32, FramePartType::EFBCopy> part_counts;
@ -339,7 +339,7 @@ void FIFOAnalyzer::UpdateDetails()
m_search_previous->setEnabled(false);
m_search_label->clear();
if (!FifoPlayer::GetInstance().IsPlaying())
if (!m_fifo_player.IsPlaying())
return;
const auto items = m_tree_widget->selectedItems();
@ -351,8 +351,8 @@ void FIFOAnalyzer::UpdateDetails()
const u32 start_part_nr = items[0]->data(0, PART_START_ROLE).toUInt();
const u32 end_part_nr = items[0]->data(0, PART_END_ROLE).toUInt();
const AnalyzedFrameInfo& frame_info = FifoPlayer::GetInstance().GetAnalyzedFrameInfo(frame_nr);
const auto& fifo_frame = FifoPlayer::GetInstance().GetFile()->GetFrame(frame_nr);
const AnalyzedFrameInfo& frame_info = m_fifo_player.GetAnalyzedFrameInfo(frame_nr);
const auto& fifo_frame = m_fifo_player.GetFile()->GetFrame(frame_nr);
const u32 object_start = frame_info.parts[start_part_nr].m_start;
const u32 object_end = frame_info.parts[end_part_nr].m_end;
@ -386,7 +386,7 @@ void FIFOAnalyzer::BeginSearch()
{
const QString search_str = m_search_edit->text();
if (!FifoPlayer::GetInstance().IsPlaying())
if (!m_fifo_player.IsPlaying())
return;
const auto items = m_tree_widget->selectedItems();
@ -434,8 +434,8 @@ void FIFOAnalyzer::BeginSearch()
const u32 start_part_nr = items[0]->data(0, PART_START_ROLE).toUInt();
const u32 end_part_nr = items[0]->data(0, PART_END_ROLE).toUInt();
const AnalyzedFrameInfo& frame_info = FifoPlayer::GetInstance().GetAnalyzedFrameInfo(frame_nr);
const FifoFrameInfo& fifo_frame = FifoPlayer::GetInstance().GetFile()->GetFrame(frame_nr);
const AnalyzedFrameInfo& frame_info = m_fifo_player.GetAnalyzedFrameInfo(frame_nr);
const FifoFrameInfo& fifo_frame = m_fifo_player.GetFile()->GetFrame(frame_nr);
const u32 object_start = frame_info.parts[start_part_nr].m_start;
const u32 object_end = frame_info.parts[end_part_nr].m_end;
@ -750,7 +750,7 @@ void FIFOAnalyzer::UpdateDescription()
{
m_entry_detail_browser->clear();
if (!FifoPlayer::GetInstance().IsPlaying())
if (!m_fifo_player.IsPlaying())
return;
const auto items = m_tree_widget->selectedItems();
@ -766,8 +766,8 @@ void FIFOAnalyzer::UpdateDescription()
const u32 end_part_nr = items[0]->data(0, PART_END_ROLE).toUInt();
const u32 entry_nr = m_detail_list->currentRow();
const AnalyzedFrameInfo& frame_info = FifoPlayer::GetInstance().GetAnalyzedFrameInfo(frame_nr);
const FifoFrameInfo& fifo_frame = FifoPlayer::GetInstance().GetFile()->GetFrame(frame_nr);
const AnalyzedFrameInfo& frame_info = m_fifo_player.GetAnalyzedFrameInfo(frame_nr);
const FifoFrameInfo& fifo_frame = m_fifo_player.GetFile()->GetFrame(frame_nr);
const u32 object_start = frame_info.parts[start_part_nr].m_start;
const u32 object_end = frame_info.parts[end_part_nr].m_end;

View file

@ -9,6 +9,7 @@
#include "Common/CommonTypes.h"
class FifoPlayer;
class QGroupBox;
class QLabel;
class QLineEdit;
@ -23,7 +24,7 @@ class FIFOAnalyzer final : public QWidget
Q_OBJECT
public:
explicit FIFOAnalyzer();
explicit FIFOAnalyzer(FifoPlayer& fifo_player);
~FIFOAnalyzer();
void Update();
@ -42,6 +43,8 @@ private:
void UpdateDetails();
void UpdateDescription();
FifoPlayer& m_fifo_player;
QTreeWidget* m_tree_widget;
QListWidget* m_detail_list;
QTextBrowser* m_entry_detail_browser;

View file

@ -32,7 +32,9 @@
#include "DolphinQt/Resources.h"
#include "DolphinQt/Settings.h"
FIFOPlayerWindow::FIFOPlayerWindow(QWidget* parent) : QWidget(parent)
FIFOPlayerWindow::FIFOPlayerWindow(FifoPlayer& fifo_player, FifoRecorder& fifo_recorder,
QWidget* parent)
: QWidget(parent), m_fifo_player(fifo_player), m_fifo_recorder(fifo_recorder)
{
setWindowTitle(tr("FIFO Player"));
setWindowIcon(Resources::GetAppIcon());
@ -46,9 +48,9 @@ FIFOPlayerWindow::FIFOPlayerWindow(QWidget* parent) : QWidget(parent)
UpdateControls();
FifoPlayer::GetInstance().SetFileLoadedCallback(
m_fifo_player.SetFileLoadedCallback(
[this] { QueueOnObject(this, &FIFOPlayerWindow::OnFIFOLoaded); });
FifoPlayer::GetInstance().SetFrameWrittenCallback([this] {
m_fifo_player.SetFrameWrittenCallback([this] {
QueueOnObject(this, [this] {
UpdateInfo();
UpdateControls();
@ -68,8 +70,8 @@ FIFOPlayerWindow::FIFOPlayerWindow(QWidget* parent) : QWidget(parent)
FIFOPlayerWindow::~FIFOPlayerWindow()
{
FifoPlayer::GetInstance().SetFileLoadedCallback({});
FifoPlayer::GetInstance().SetFrameWrittenCallback({});
m_fifo_player.SetFileLoadedCallback({});
m_fifo_player.SetFrameWrittenCallback({});
}
void FIFOPlayerWindow::CreateWidgets()
@ -160,7 +162,7 @@ void FIFOPlayerWindow::CreateWidgets()
m_tab_widget = new QTabWidget(this);
m_analyzer = new FIFOAnalyzer;
m_analyzer = new FIFOAnalyzer(m_fifo_player);
m_tab_widget->addTab(m_main_widget, tr("Play / Record"));
m_tab_widget->addTab(m_analyzer, tr("Analyze"));
@ -228,7 +230,7 @@ void FIFOPlayerWindow::SaveRecording()
if (path.isEmpty())
return;
FifoDataFile* file = FifoRecorder::GetInstance().GetRecordedFile();
FifoDataFile* file = m_fifo_recorder.GetRecordedFile();
bool result = file->Save(path.toStdString());
@ -241,9 +243,8 @@ void FIFOPlayerWindow::SaveRecording()
void FIFOPlayerWindow::StartRecording()
{
// Start recording
FifoRecorder::GetInstance().StartRecording(m_frame_record_count->value(), [this] {
QueueOnObject(this, [this] { OnRecordingDone(); });
});
m_fifo_recorder.StartRecording(m_frame_record_count->value(),
[this] { QueueOnObject(this, [this] { OnRecordingDone(); }); });
UpdateControls();
@ -252,7 +253,7 @@ void FIFOPlayerWindow::StartRecording()
void FIFOPlayerWindow::StopRecording()
{
FifoRecorder::GetInstance().StopRecording();
m_fifo_recorder.StopRecording();
UpdateControls();
UpdateInfo();
@ -262,14 +263,14 @@ void FIFOPlayerWindow::OnEmulationStarted()
{
UpdateControls();
if (FifoPlayer::GetInstance().GetFile())
if (m_fifo_player.GetFile())
OnFIFOLoaded();
}
void FIFOPlayerWindow::OnEmulationStopped()
{
// If we have previously been recording, stop now.
if (FifoRecorder::GetInstance().IsRecording())
if (m_fifo_recorder.IsRecording())
StopRecording();
UpdateControls();
@ -286,20 +287,19 @@ void FIFOPlayerWindow::OnRecordingDone()
void FIFOPlayerWindow::UpdateInfo()
{
if (FifoPlayer::GetInstance().IsPlaying())
if (m_fifo_player.IsPlaying())
{
FifoDataFile* file = FifoPlayer::GetInstance().GetFile();
m_info_label->setText(
tr("%1 frame(s)\n%2 object(s)\nCurrent Frame: %3")
.arg(QString::number(file->GetFrameCount()),
QString::number(FifoPlayer::GetInstance().GetCurrentFrameObjectCount()),
QString::number(FifoPlayer::GetInstance().GetCurrentFrameNum())));
FifoDataFile* file = m_fifo_player.GetFile();
m_info_label->setText(tr("%1 frame(s)\n%2 object(s)\nCurrent Frame: %3")
.arg(QString::number(file->GetFrameCount()),
QString::number(m_fifo_player.GetCurrentFrameObjectCount()),
QString::number(m_fifo_player.GetCurrentFrameNum())));
return;
}
if (FifoRecorder::GetInstance().IsRecordingDone())
if (m_fifo_recorder.IsRecordingDone())
{
FifoDataFile* file = FifoRecorder::GetInstance().GetRecordedFile();
FifoDataFile* file = m_fifo_recorder.GetRecordedFile();
size_t fifo_bytes = 0;
size_t mem_bytes = 0;
@ -316,7 +316,7 @@ void FIFOPlayerWindow::UpdateInfo()
return;
}
if (Core::IsRunning() && FifoRecorder::GetInstance().IsRecording())
if (Core::IsRunning() && m_fifo_recorder.IsRecording())
{
m_info_label->setText(tr("Recording..."));
return;
@ -327,9 +327,9 @@ void FIFOPlayerWindow::UpdateInfo()
void FIFOPlayerWindow::OnFIFOLoaded()
{
FifoDataFile* file = FifoPlayer::GetInstance().GetFile();
FifoDataFile* file = m_fifo_player.GetFile();
auto object_count = FifoPlayer::GetInstance().GetMaxObjectCount();
auto object_count = m_fifo_player.GetMaxObjectCount();
auto frame_count = file->GetFrameCount();
m_frame_range_to->setMaximum(frame_count - 1);
@ -356,7 +356,7 @@ void FIFOPlayerWindow::OnConfigChanged()
void FIFOPlayerWindow::OnLimitsChanged()
{
FifoPlayer& player = FifoPlayer::GetInstance();
FifoPlayer& player = m_fifo_player;
player.SetFrameRangeStart(m_frame_range_from->value());
player.SetFrameRangeEnd(m_frame_range_to->value());
@ -376,8 +376,8 @@ void FIFOPlayerWindow::UpdateLimits()
void FIFOPlayerWindow::UpdateControls()
{
bool running = Core::IsRunning();
bool is_recording = FifoRecorder::GetInstance().IsRecording();
bool is_playing = FifoPlayer::GetInstance().IsPlaying();
bool is_recording = m_fifo_recorder.IsRecording();
bool is_playing = m_fifo_player.IsPlaying();
m_frame_range_from->setEnabled(is_playing);
m_frame_range_from_label->setEnabled(is_playing);
@ -399,7 +399,7 @@ void FIFOPlayerWindow::UpdateControls()
m_stop->setVisible(running && is_recording);
m_record->setVisible(!m_stop->isVisible());
m_save->setEnabled(FifoRecorder::GetInstance().IsRecordingDone());
m_save->setEnabled(m_fifo_recorder.IsRecordingDone());
}
bool FIFOPlayerWindow::eventFilter(QObject* object, QEvent* event)

View file

@ -13,13 +13,16 @@ class QPushButton;
class QSpinBox;
class QTabWidget;
class ToolTipCheckBox;
class FifoPlayer;
class FifoRecorder;
class FIFOAnalyzer;
class FIFOPlayerWindow : public QWidget
{
Q_OBJECT
public:
explicit FIFOPlayerWindow(QWidget* parent = nullptr);
explicit FIFOPlayerWindow(FifoPlayer& fifo_player, FifoRecorder& fifo_recorder,
QWidget* parent = nullptr);
~FIFOPlayerWindow();
signals:
@ -49,6 +52,9 @@ private:
bool eventFilter(QObject* object, QEvent* event) final override;
FifoPlayer& m_fifo_player;
FifoRecorder& m_fifo_recorder;
QLabel* m_info_label;
QPushButton* m_load;
QPushButton* m_save;

View file

@ -365,7 +365,7 @@ void GBAWidget::SaveSettings()
bool GBAWidget::CanControlCore()
{
return !Movie::IsMovieActive() && !NetPlay::IsNetPlayRunning();
return !Core::System::GetInstance().GetMovie().IsMovieActive() && !NetPlay::IsNetPlayRunning();
}
bool GBAWidget::CanResetCore()

View file

@ -279,7 +279,7 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters,
if (!movie_path.empty())
{
std::optional<std::string> savestate_path;
if (Movie::PlayInput(movie_path, &savestate_path))
if (Core::System::GetInstance().GetMovie().PlayInput(movie_path, &savestate_path))
{
m_pending_boot->boot_session_data.SetSavestateData(std::move(savestate_path),
DeleteSavestateAfterBoot::No);
@ -646,8 +646,9 @@ void MainWindow::ConnectHotkeys()
connect(m_hotkey_scheduler, &HotkeyScheduler::ConnectWiiRemote, this,
&MainWindow::OnConnectWiiRemote);
connect(m_hotkey_scheduler, &HotkeyScheduler::ToggleReadOnlyMode, [this] {
bool read_only = !Movie::IsReadOnly();
Movie::SetReadOnly(read_only);
auto& movie = Core::System::GetInstance().GetMovie();
bool read_only = !movie.IsReadOnly();
movie.SetReadOnly(read_only);
emit ReadOnlyModeChanged(read_only);
});
@ -1117,9 +1118,10 @@ void MainWindow::ForceStop()
void MainWindow::Reset()
{
if (Movie::IsRecordingInput())
Movie::SetReset(true);
auto& system = Core::System::GetInstance();
auto& movie = system.GetMovie();
if (movie.IsRecordingInput())
movie.SetReset(true);
system.GetProcessorInterface().ResetButton_Tap();
}
@ -1469,7 +1471,8 @@ void MainWindow::ShowFIFOPlayer()
{
if (!m_fifo_window)
{
m_fifo_window = new FIFOPlayerWindow;
m_fifo_window = new FIFOPlayerWindow(Core::System::GetInstance().GetFifoPlayer(),
Core::System::GetInstance().GetFifoRecorder());
connect(m_fifo_window, &FIFOPlayerWindow::LoadFIFORequested, this,
[this](const QString& path) { StartGame(path, ScanForSecondDisc::No); });
}
@ -1959,15 +1962,16 @@ void MainWindow::OnPlayRecording()
if (dtm_file.isEmpty())
return;
if (!Movie::IsReadOnly())
auto& movie = Core::System::GetInstance().GetMovie();
if (!movie.IsReadOnly())
{
// let's make the read-only flag consistent at the start of a movie.
Movie::SetReadOnly(true);
movie.SetReadOnly(true);
emit ReadOnlyModeChanged(true);
}
std::optional<std::string> savestate_path;
if (Movie::PlayInput(dtm_file.toStdString(), &savestate_path))
if (movie.PlayInput(dtm_file.toStdString(), &savestate_path))
{
emit RecordingStatusChanged(true);
@ -1977,14 +1981,17 @@ void MainWindow::OnPlayRecording()
void MainWindow::OnStartRecording()
{
if ((!Core::IsRunningAndStarted() && Core::IsRunning()) || Movie::IsRecordingInput() ||
Movie::IsPlayingInput())
auto& movie = Core::System::GetInstance().GetMovie();
if ((!Core::IsRunningAndStarted() && Core::IsRunning()) || movie.IsRecordingInput() ||
movie.IsPlayingInput())
{
return;
}
if (Movie::IsReadOnly())
if (movie.IsReadOnly())
{
// The user just chose to record a movie, so that should take precedence
Movie::SetReadOnly(false);
movie.SetReadOnly(false);
emit ReadOnlyModeChanged(true);
}
@ -2003,7 +2010,7 @@ void MainWindow::OnStartRecording()
wiimotes[i] = Config::Get(Config::GetInfoForWiimoteSource(i)) != WiimoteSource::None;
}
if (Movie::BeginRecordingInput(controllers, wiimotes))
if (movie.BeginRecordingInput(controllers, wiimotes))
{
emit RecordingStatusChanged(true);
@ -2014,10 +2021,11 @@ void MainWindow::OnStartRecording()
void MainWindow::OnStopRecording()
{
if (Movie::IsRecordingInput())
auto& movie = Core::System::GetInstance().GetMovie();
if (movie.IsRecordingInput())
OnExportRecording();
if (Movie::IsMovieActive())
Movie::EndPlayInput(false);
if (movie.IsMovieActive())
movie.EndPlayInput(false);
emit RecordingStatusChanged(false);
}
@ -2027,7 +2035,7 @@ void MainWindow::OnExportRecording()
QString dtm_file = DolphinFileDialog::getSaveFileName(
this, tr("Save Recording File As"), QString(), tr("Dolphin TAS Movies (*.dtm)"));
if (!dtm_file.isEmpty())
Movie::SaveRecording(dtm_file.toStdString());
Core::System::GetInstance().GetMovie().SaveRecording(dtm_file.toStdString());
});
}

View file

@ -147,7 +147,8 @@ void MenuBar::OnEmulationStateChanged(Core::State state)
#else // USE_RETRO_ACHIEVEMENTS
m_recording_play->setEnabled(m_game_selected && !running);
#endif // USE_RETRO_ACHIEVEMENTS
m_recording_start->setEnabled((m_game_selected || running) && !Movie::IsPlayingInput());
m_recording_start->setEnabled((m_game_selected || running) &&
!Core::System::GetInstance().GetMovie().IsPlayingInput());
// JIT
m_jit_interpreter_core->setEnabled(running);
@ -185,6 +186,7 @@ void MenuBar::OnDebugModeToggled(bool enabled)
m_show_memory->setVisible(enabled);
m_show_network->setVisible(enabled);
m_show_jit->setVisible(enabled);
m_show_assembler->setVisible(enabled);
if (enabled)
{
@ -754,8 +756,9 @@ void MenuBar::AddMovieMenu()
m_recording_read_only = movie_menu->addAction(tr("&Read-Only Mode"));
m_recording_read_only->setCheckable(true);
m_recording_read_only->setChecked(Movie::IsReadOnly());
connect(m_recording_read_only, &QAction::toggled, [](bool value) { Movie::SetReadOnly(value); });
m_recording_read_only->setChecked(Core::System::GetInstance().GetMovie().IsReadOnly());
connect(m_recording_read_only, &QAction::toggled,
[](bool value) { Core::System::GetInstance().GetMovie().SetReadOnly(value); });
movie_menu->addAction(tr("TAS Input"), this, [this] { emit ShowTASInput(); });
@ -1210,7 +1213,8 @@ void MenuBar::OnSelectionChanged(std::shared_ptr<const UICommon::GameFile> game_
m_game_selected = !!game_file;
m_recording_play->setEnabled(m_game_selected && !Core::IsRunning());
m_recording_start->setEnabled((m_game_selected || Core::IsRunning()) && !Movie::IsPlayingInput());
m_recording_start->setEnabled((m_game_selected || Core::IsRunning()) &&
!Core::System::GetInstance().GetMovie().IsPlayingInput());
}
void MenuBar::OnRecordingStatusChanged(bool recording)

View file

@ -21,6 +21,7 @@
#include "Core/Core.h"
#include "Core/HW/SystemTimers.h"
#include "Core/PowerPC/PowerPC.h"
#include "Core/System.h"
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
#include "DolphinQt/QtUtils/SignalBlocking.h"
@ -275,7 +276,8 @@ void AdvancedPane::Update()
}
m_cpu_clock_override_slider_label->setText([] {
int core_clock = SystemTimers::GetTicksPerSecond() / std::pow(10, 6);
int core_clock =
Core::System::GetInstance().GetSystemTimers().GetTicksPerSecond() / std::pow(10, 6);
int percent = static_cast<int>(std::round(Config::Get(Config::MAIN_OVERCLOCK) * 100.f));
int clock = static_cast<int>(std::round(Config::Get(Config::MAIN_OVERCLOCK) * core_clock));
return tr("%1% (%2 MHz)").arg(QString::number(percent), QString::number(clock));

View file

@ -6,6 +6,7 @@
#include <QMouseEvent>
#include "Core/Movie.h"
#include "Core/System.h"
#include "DolphinQt/QtUtils/QueueOnObject.h"
#include "DolphinQt/TAS/TASInputWindow.h"
@ -23,7 +24,8 @@ bool TASCheckBox::GetValue() const
if (check_state == Qt::PartiallyChecked)
{
const u64 frames_elapsed = Movie::GetCurrentFrame() - m_frame_turbo_started;
const u64 frames_elapsed =
Core::System::GetInstance().GetMovie().GetCurrentFrame() - m_frame_turbo_started;
return static_cast<int>(frames_elapsed % m_turbo_total_frames) < m_turbo_press_frames;
}
@ -50,7 +52,7 @@ void TASCheckBox::mousePressEvent(QMouseEvent* event)
return;
}
m_frame_turbo_started = Movie::GetCurrentFrame();
m_frame_turbo_started = Core::System::GetInstance().GetMovie().GetCurrentFrame();
m_turbo_press_frames = m_parent->GetTurboPressFrames();
m_turbo_total_frames = m_turbo_press_frames + m_parent->GetTurboReleaseFrames();
setCheckState(Qt::PartiallyChecked);