Skip to content

Commit

Permalink
Qt: move rsx capture to Utilities menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Megamouse committed Apr 22, 2020
1 parent 16c9b46 commit 4c80d33
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 16 deletions.
6 changes: 3 additions & 3 deletions rpcs3/Emu/RSX/RSXThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class GSRender;

#define CMD_DEBUG 0

std::atomic<bool> user_asked_for_frame_capture = false;
std::atomic<bool> g_user_asked_for_frame_capture = false;
rsx::frame_trace_data frame_debug;
rsx::frame_capture_data frame_capture;

Expand Down Expand Up @@ -309,7 +309,7 @@ namespace rsx

m_graphics_state = pipeline_state::all_dirty;

user_asked_for_frame_capture = false;
g_user_asked_for_frame_capture = false;

if (g_cfg.misc.use_native_interface && (g_cfg.video.renderer == video_renderer::opengl || g_cfg.video.renderer == video_renderer::vulkan))
{
Expand Down Expand Up @@ -2558,7 +2558,7 @@ namespace rsx
void thread::on_frame_end(u32 buffer, bool forced)
{
// Marks the end of a frame scope GPU-side
if (user_asked_for_frame_capture.exchange(false) && !capture_current_frame)
if (g_user_asked_for_frame_capture.exchange(false) && !capture_current_frame)
{
capture_current_frame = true;
frame_debug.reset();
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/RSX/RSXThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
extern u64 get_guest_system_time();
extern u64 get_system_time();

extern std::atomic<bool> user_asked_for_frame_capture;
extern std::atomic<bool> g_user_asked_for_frame_capture;
extern rsx::frame_trace_data frame_debug;
extern rsx::frame_capture_data frame_capture;

Expand Down
10 changes: 0 additions & 10 deletions rpcs3/rpcs3qt/debugger_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <atomic>

constexpr auto qstr = QString::fromStdString;
extern std::atomic<bool> user_asked_for_frame_capture;

debugger_frame::debugger_frame(std::shared_ptr<gui_settings> settings, QWidget *parent)
: custom_dock_widget(tr("Debugger"), parent), xgui_settings(settings)
Expand Down Expand Up @@ -69,7 +68,6 @@ debugger_frame::debugger_frame(std::shared_ptr<gui_settings> settings, QWidget *

m_go_to_addr = new QPushButton(tr("Go To Address"), this);
m_go_to_pc = new QPushButton(tr("Go To PC"), this);
m_btn_capture = new QPushButton(tr("RSX Capture"), this);
m_btn_step = new QPushButton(tr("Step"), this);
m_btn_step_over = new QPushButton(tr("Step Over"), this);
m_btn_run = new QPushButton(RunString, this);
Expand All @@ -80,7 +78,6 @@ debugger_frame::debugger_frame(std::shared_ptr<gui_settings> settings, QWidget *

hbox_b_main->addWidget(m_go_to_addr);
hbox_b_main->addWidget(m_go_to_pc);
hbox_b_main->addWidget(m_btn_capture);
hbox_b_main->addWidget(m_btn_step);
hbox_b_main->addWidget(m_btn_step_over);
hbox_b_main->addWidget(m_btn_run);
Expand Down Expand Up @@ -132,11 +129,6 @@ debugger_frame::debugger_frame(std::shared_ptr<gui_settings> settings, QWidget *
connect(m_go_to_addr, &QAbstractButton::clicked, this, &debugger_frame::ShowGotoAddressDialog);
connect(m_go_to_pc, &QAbstractButton::clicked, this, &debugger_frame::ShowPC);

connect(m_btn_capture, &QAbstractButton::clicked, [this]()
{
user_asked_for_frame_capture = true;
});

connect(m_btn_step, &QAbstractButton::clicked, this, &debugger_frame::DoStep);
connect(m_btn_step_over, &QAbstractButton::clicked, [this]() { DoStep(true); });

Expand Down Expand Up @@ -301,8 +293,6 @@ void debugger_frame::UpdateUI()
{
UpdateUnitList();

m_btn_capture->setEnabled(Emu.IsRunning() || Emu.IsPaused());

if (m_no_thread_selected) return;

const auto cpu = this->cpu.lock();
Expand Down
1 change: 0 additions & 1 deletion rpcs3/rpcs3qt/debugger_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class debugger_frame : public custom_dock_widget
QTextEdit* m_regs;
QPushButton* m_go_to_addr;
QPushButton* m_go_to_pc;
QPushButton* m_btn_capture;
QPushButton* m_btn_step;
QPushButton* m_btn_step_over;
QPushButton* m_btn_run;
Expand Down
7 changes: 7 additions & 0 deletions rpcs3/rpcs3qt/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@

LOG_CHANNEL(gui_log, "GUI");

extern std::atomic<bool> g_user_asked_for_frame_capture;

inline std::string sstr(const QString& _in) { return _in.toStdString(); }

main_window::main_window(std::shared_ptr<gui_settings> gui_settings, std::shared_ptr<emu_settings> emu_settings, std::shared_ptr<persistent_settings> persistent_settings, QWidget *parent)
Expand Down Expand Up @@ -1088,6 +1090,7 @@ void main_window::EnableMenus(bool enabled)
ui->toolsmemory_viewerAct->setEnabled(enabled);
ui->toolsRsxDebuggerAct->setEnabled(enabled);
ui->toolsStringSearchAct->setEnabled(enabled);
ui->actionCreate_RSX_Capture->setEnabled(enabled);
}

void main_window::BootRecentAction(const QAction* act)
Expand Down Expand Up @@ -1359,6 +1362,10 @@ void main_window::CreateConnects()
connect(ui->bootElfAct, &QAction::triggered, this, &main_window::BootElf);
connect(ui->bootGameAct, &QAction::triggered, this, &main_window::BootGame);
connect(ui->actionopen_rsx_capture, &QAction::triggered, [this](){ BootRsxCapture(); });
connect(ui->actionCreate_RSX_Capture, &QAction::triggered, []()
{
g_user_asked_for_frame_capture = true;
});

connect(ui->addGamesAct, &QAction::triggered, [this]()
{
Expand Down
13 changes: 12 additions & 1 deletion rpcs3/rpcs3qt/main_window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
<x>0</x>
<y>0</y>
<width>1058</width>
<height>26</height>
<height>22</height>
</rect>
</property>
<property name="contextMenuPolicy">
Expand Down Expand Up @@ -250,7 +250,10 @@
<addaction name="toolsStringSearchAct"/>
<addaction name="separator"/>
<addaction name="toolsDecryptSprxLibsAct"/>
<addaction name="separator"/>
<addaction name="actionopen_rsx_capture"/>
<addaction name="separator"/>
<addaction name="actionCreate_RSX_Capture"/>
</widget>
<widget class="QMenu" name="menuView">
<property name="title">
Expand Down Expand Up @@ -1057,6 +1060,14 @@
<string>Create Firmware Cache</string>
</property>
</action>
<action name="actionCreate_RSX_Capture">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Create RSX Capture</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>
Expand Down

0 comments on commit 4c80d33

Please sign in to comment.