summaryrefslogtreecommitdiff
path: root/src/citra_qt/debugger/graphics_tracing.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/citra_qt/debugger/graphics_tracing.cpp42
1 files changed, 26 insertions, 16 deletions
diff --git a/src/citra_qt/debugger/graphics_tracing.cpp b/src/citra_qt/debugger/graphics_tracing.cpp
index 9c80f7ec9..b6f638b60 100644
--- a/src/citra_qt/debugger/graphics_tracing.cpp
+++ b/src/citra_qt/debugger/graphics_tracing.cpp
@@ -35,12 +35,16 @@ GraphicsTracingWidget::GraphicsTracingWidget(std::shared_ptr<Pica::DebugContext>
35 setObjectName("CiTracing"); 35 setObjectName("CiTracing");
36 36
37 QPushButton* start_recording = new QPushButton(tr("Start Recording")); 37 QPushButton* start_recording = new QPushButton(tr("Start Recording"));
38 QPushButton* stop_recording = new QPushButton(QIcon::fromTheme("document-save"), tr("Stop and Save")); 38 QPushButton* stop_recording =
39 new QPushButton(QIcon::fromTheme("document-save"), tr("Stop and Save"));
39 QPushButton* abort_recording = new QPushButton(tr("Abort Recording")); 40 QPushButton* abort_recording = new QPushButton(tr("Abort Recording"));
40 41
41 connect(this, SIGNAL(SetStartTracingButtonEnabled(bool)), start_recording, SLOT(setVisible(bool))); 42 connect(this, SIGNAL(SetStartTracingButtonEnabled(bool)), start_recording,
42 connect(this, SIGNAL(SetStopTracingButtonEnabled(bool)), stop_recording, SLOT(setVisible(bool))); 43 SLOT(setVisible(bool)));
43 connect(this, SIGNAL(SetAbortTracingButtonEnabled(bool)), abort_recording, SLOT(setVisible(bool))); 44 connect(this, SIGNAL(SetStopTracingButtonEnabled(bool)), stop_recording,
45 SLOT(setVisible(bool)));
46 connect(this, SIGNAL(SetAbortTracingButtonEnabled(bool)), abort_recording,
47 SLOT(setVisible(bool)));
44 connect(start_recording, SIGNAL(clicked()), this, SLOT(StartRecording())); 48 connect(start_recording, SIGNAL(clicked()), this, SLOT(StartRecording()));
45 connect(stop_recording, SIGNAL(clicked()), this, SLOT(StopRecording())); 49 connect(stop_recording, SIGNAL(clicked()), this, SLOT(StopRecording()));
46 connect(abort_recording, SIGNAL(clicked()), this, SLOT(AbortRecording())); 50 connect(abort_recording, SIGNAL(clicked()), this, SLOT(AbortRecording()));
@@ -74,26 +78,31 @@ void GraphicsTracingWidget::StartRecording() {
74 std::array<u32, 4 * 16> default_attributes; 78 std::array<u32, 4 * 16> default_attributes;
75 for (unsigned i = 0; i < 16; ++i) { 79 for (unsigned i = 0; i < 16; ++i) {
76 for (unsigned comp = 0; comp < 3; ++comp) { 80 for (unsigned comp = 0; comp < 3; ++comp) {
77 default_attributes[4 * i + comp] = nihstro::to_float24(Pica::g_state.vs_default_attributes[i][comp].ToFloat32()); 81 default_attributes[4 * i + comp] =
82 nihstro::to_float24(Pica::g_state.vs_default_attributes[i][comp].ToFloat32());
78 } 83 }
79 } 84 }
80 85
81 std::array<u32, 4 * 96> vs_float_uniforms; 86 std::array<u32, 4 * 96> vs_float_uniforms;
82 for (unsigned i = 0; i < 96; ++i) 87 for (unsigned i = 0; i < 96; ++i)
83 for (unsigned comp = 0; comp < 3; ++comp) 88 for (unsigned comp = 0; comp < 3; ++comp)
84 vs_float_uniforms[4 * i + comp] = nihstro::to_float24(Pica::g_state.vs.uniforms.f[i][comp].ToFloat32()); 89 vs_float_uniforms[4 * i + comp] =
90 nihstro::to_float24(Pica::g_state.vs.uniforms.f[i][comp].ToFloat32());
85 91
86 CiTrace::Recorder::InitialState state; 92 CiTrace::Recorder::InitialState state;
87 std::copy_n((u32*)&GPU::g_regs, sizeof(GPU::g_regs) / sizeof(u32), std::back_inserter(state.gpu_registers)); 93 std::copy_n((u32*)&GPU::g_regs, sizeof(GPU::g_regs) / sizeof(u32),
88 std::copy_n((u32*)&LCD::g_regs, sizeof(LCD::g_regs) / sizeof(u32), std::back_inserter(state.lcd_registers)); 94 std::back_inserter(state.gpu_registers));
89 std::copy_n((u32*)&Pica::g_state.regs, sizeof(Pica::g_state.regs) / sizeof(u32), std::back_inserter(state.pica_registers)); 95 std::copy_n((u32*)&LCD::g_regs, sizeof(LCD::g_regs) / sizeof(u32),
96 std::back_inserter(state.lcd_registers));
97 std::copy_n((u32*)&Pica::g_state.regs, sizeof(Pica::g_state.regs) / sizeof(u32),
98 std::back_inserter(state.pica_registers));
90 boost::copy(default_attributes, std::back_inserter(state.default_attributes)); 99 boost::copy(default_attributes, std::back_inserter(state.default_attributes));
91 boost::copy(shader_binary, std::back_inserter(state.vs_program_binary)); 100 boost::copy(shader_binary, std::back_inserter(state.vs_program_binary));
92 boost::copy(swizzle_data, std::back_inserter(state.vs_swizzle_data)); 101 boost::copy(swizzle_data, std::back_inserter(state.vs_swizzle_data));
93 boost::copy(vs_float_uniforms, std::back_inserter(state.vs_float_uniforms)); 102 boost::copy(vs_float_uniforms, std::back_inserter(state.vs_float_uniforms));
94 //boost::copy(TODO: Not implemented, std::back_inserter(state.gs_program_binary)); 103 // boost::copy(TODO: Not implemented, std::back_inserter(state.gs_program_binary));
95 //boost::copy(TODO: Not implemented, std::back_inserter(state.gs_swizzle_data)); 104 // boost::copy(TODO: Not implemented, std::back_inserter(state.gs_swizzle_data));
96 //boost::copy(TODO: Not implemented, std::back_inserter(state.gs_float_uniforms)); 105 // boost::copy(TODO: Not implemented, std::back_inserter(state.gs_float_uniforms));
97 106
98 auto recorder = new CiTrace::Recorder(state); 107 auto recorder = new CiTrace::Recorder(state);
99 context->recorder = std::shared_ptr<CiTrace::Recorder>(recorder); 108 context->recorder = std::shared_ptr<CiTrace::Recorder>(recorder);
@@ -156,11 +165,12 @@ void GraphicsTracingWidget::OnEmulationStopping() {
156 if (!context) 165 if (!context)
157 return; 166 return;
158 167
159
160 if (context->recorder) { 168 if (context->recorder) {
161 auto reply = QMessageBox::question(this, tr("CiTracing still active"), 169 auto reply =
162 tr("A CiTrace is still being recorded. Do you want to save it? If not, all recorded data will be discarded."), 170 QMessageBox::question(this, tr("CiTracing still active"),
163 QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); 171 tr("A CiTrace is still being recorded. Do you want to save it? "
172 "If not, all recorded data will be discarded."),
173 QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
164 174
165 if (reply == QMessageBox::Yes) { 175 if (reply == QMessageBox::Yes) {
166 StopRecording(); 176 StopRecording();