Qt/FIFOPlayer: Implement Analyzer

This commit is contained in:
spycrab
2018-05-22 23:51:01 +02:00
parent 0e9255c469
commit 94e97d47a0
7 changed files with 599 additions and 8 deletions
+2 -1
View File
@@ -8,7 +8,8 @@ set(CMAKE_AUTOMOC ON)
add_executable(dolphin-emu
AboutDialog.cpp
CheatsManager.cpp
FIFOPlayerWindow.cpp
FIFO/FIFOPlayerWindow.cpp
FIFO/FIFOAnalyzer.cpp
HotkeyScheduler.cpp
Host.cpp
Main.cpp
+7 -4
View File
@@ -44,7 +44,7 @@
<AdditionalDependencies>avrt.lib;iphlpapi.lib;winmm.lib;setupapi.lib;opengl32.lib;glu32.lib;rpcrt4.lib;comctl32.lib;avcodec.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)VideoInterface;$(ProjectDir)GameList;$(ProjectDir)Debugger;$(ProjectDir)Settings;$(ProjectDir)Config;$(ProjectDir)Config\Mapping;$(ProjectDir)Config\Graphics;$(ProjectDir)NetPlay;$(ProjectDir)QtUtils;$(ProjectDir)TAS;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)VideoInterface;$(ProjectDir)GameList;$(ProjectDir)Debugger;$(ProjectDir)Settings;$(ProjectDir)Config;$(ProjectDir)Config\Mapping;$(ProjectDir)Config\Graphics;$(ProjectDir)NetPlay;$(ProjectDir)QtUtils;$(ProjectDir)TAS;$(ProjectDir)FIFO;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Manifest>
<AdditionalManifestFiles>DolphinQt2.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
@@ -105,7 +105,8 @@
<QtMoc Include="Config\PatchesWidget.h" />
<QtMoc Include="Config\PropertiesDialog.h" />
<QtMoc Include="Config\SettingsWindow.h" />
<QtMoc Include="FIFOPlayerWindow.h" />
<QtMoc Include="FIFO\FIFOAnalyzer.h" />
<QtMoc Include="FIFO\FIFOPlayerWindow.h" />
<QtMoc Include="TAS\GCTASInputWindow.h" />
<QtMoc Include="TAS\WiiTASInputWindow.h" />
<QtMoc Include="TAS\StickWidget.h" />
@@ -173,6 +174,7 @@
<ClCompile Include="$(QtMocOutPrefix)DoubleClickEventFilter.cpp" />
<ClCompile Include="$(QtMocOutPrefix)ElidedButton.cpp" />
<ClCompile Include="$(QtMocOutPrefix)EnhancementsWidget.cpp" />
<ClCompile Include="$(QtMocOutPrefix)FIFOAnalyzer.cpp" />
<ClCompile Include="$(QtMocOutPrefix)FIFOPlayerWindow.cpp" />
<ClCompile Include="$(QtMocOutPrefix)FilesystemWidget.cpp" />
<ClCompile Include="$(QtMocOutPrefix)GCKeyboardEmu.cpp" />
@@ -307,7 +309,8 @@
<ClCompile Include="Debugger\JITWidget.cpp" />
<ClCompile Include="Debugger\MemoryWidget.cpp" />
<ClCompile Include="Debugger\MemoryViewWidget.cpp" />
<ClCompile Include="FIFOPlayerWindow.cpp" />
<ClCompile Include="FIFO\FIFOAnalyzer.cpp" />
<ClCompile Include="FIFO\FIFOPlayerWindow.cpp" />
<ClCompile Include="QtUtils\WinIconHelper.cpp" />
<ClCompile Include="TAS\GCTASInputWindow.cpp" />
<ClCompile Include="TAS\WiiTASInputWindow.cpp" />
@@ -456,4 +459,4 @@
<Message Text="Copy: @(BinaryFiles) -&gt; $(BinaryOutputDir)" Importance="High" />
<Copy SourceFiles="@(BinaryFiles)" DestinationFolder="$(BinaryOutputDir)" />
</Target>
</Project>
</Project>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,67 @@
// Copyright 2018 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <vector>
#include <QWidget>
class QGroupBox;
class QLabel;
class QLineEdit;
class QListWidget;
class QPushButton;
class QSplitter;
class QTextBrowser;
class QTreeWidget;
class FIFOAnalyzer final : public QWidget
{
Q_OBJECT
public:
explicit FIFOAnalyzer();
~FIFOAnalyzer();
void Update();
private:
void CreateWidgets();
void ConnectWidgets();
void BeginSearch();
void FindNext();
void FindPrevious();
void ShowSearchResult(size_t index);
void UpdateTree();
void UpdateDetails();
void UpdateDescription();
QTreeWidget* m_tree_widget;
QListWidget* m_detail_list;
QTextBrowser* m_entry_detail_browser;
QSplitter* m_object_splitter;
// Search
QGroupBox* m_search_box;
QLineEdit* m_search_edit;
QPushButton* m_search_new;
QPushButton* m_search_next;
QPushButton* m_search_previous;
QLabel* m_search_label;
QSplitter* m_search_splitter;
struct SearchResult
{
int frame;
int object;
int cmd;
};
std::vector<int> m_object_data_offsets;
std::vector<SearchResult> m_search_results;
};
@@ -2,7 +2,7 @@
// Licensed under GPLv2+
// Refer to the license.txt file included.
#include "DolphinQt2/FIFOPlayerWindow.h"
#include "DolphinQt2/FIFO/FIFOPlayerWindow.h"
#include <QCheckBox>
#include <QDialogButtonBox>
@@ -13,6 +13,7 @@
#include <QMessageBox>
#include <QPushButton>
#include <QSpinBox>
#include <QTabWidget>
#include <QVBoxLayout>
#include <algorithm>
@@ -23,6 +24,7 @@
#include "Core/FifoPlayer/FifoPlayer.h"
#include "Core/FifoPlayer/FifoRecorder.h"
#include "DolphinQt2/FIFO/FIFOAnalyzer.h"
#include "DolphinQt2/QtUtils/QueueOnObject.h"
#include "DolphinQt2/Settings.h"
@@ -142,7 +144,20 @@ void FIFOPlayerWindow::CreateWidgets()
layout->addWidget(recording_group);
layout->addWidget(m_button_box);
setLayout(layout);
QWidget* main_widget = new QWidget(this);
main_widget->setLayout(layout);
auto* tab_widget = new QTabWidget(this);
m_analyzer = new FIFOAnalyzer;
tab_widget->addTab(main_widget, tr("Play / Record"));
tab_widget->addTab(m_analyzer, tr("Analyze"));
auto* tab_layout = new QVBoxLayout;
tab_layout->addWidget(tab_widget);
setLayout(tab_layout);
}
void FIFOPlayerWindow::ConnectWidgets()
@@ -292,6 +307,8 @@ void FIFOPlayerWindow::OnFIFOLoaded()
UpdateInfo();
UpdateLimits();
UpdateControls();
m_analyzer->Update();
}
void FIFOPlayerWindow::OnEarlyMemoryUpdatesChanged(bool enabled)
@@ -11,6 +11,7 @@ class QDialogButtonBox;
class QLabel;
class QPushButton;
class QSpinBox;
class FIFOAnalyzer;
class FIFOPlayerWindow : public QDialog
{
@@ -59,4 +60,6 @@ private:
QLabel* m_object_range_to_label;
QCheckBox* m_early_memory_updates;
QDialogButtonBox* m_button_box;
FIFOAnalyzer* m_analyzer;
};
+1 -1
View File
@@ -60,7 +60,7 @@
#include "DolphinQt2/Debugger/MemoryWidget.h"
#include "DolphinQt2/Debugger/RegisterWidget.h"
#include "DolphinQt2/Debugger/WatchWidget.h"
#include "DolphinQt2/FIFOPlayerWindow.h"
#include "DolphinQt2/FIFO/FIFOPlayerWindow.h"
#include "DolphinQt2/GCMemcardManager.h"
#include "DolphinQt2/Host.h"
#include "DolphinQt2/HotkeyScheduler.h"