summaryrefslogtreecommitdiffstats
path: root/src/citra_qt
diff options
context:
space:
mode:
Diffstat (limited to 'src/citra_qt')
-rw-r--r--src/citra_qt/bootmanager.cpp10
-rw-r--r--src/citra_qt/bootmanager.h4
-rw-r--r--src/citra_qt/configuration/config.cpp6
-rw-r--r--src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp41
-rw-r--r--src/citra_qt/main.cpp2
5 files changed, 29 insertions, 34 deletions
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp
index 30554890f..7107bfc60 100644
--- a/src/citra_qt/bootmanager.cpp
+++ b/src/citra_qt/bootmanager.cpp
@@ -17,6 +17,7 @@
#include "core/settings.h"
#include "input_common/keyboard.h"
#include "input_common/main.h"
+#include "input_common/motion_emu.h"
#include "network/network.h"
EmuThread::EmuThread(GRenderWindow* render_window)
@@ -201,7 +202,6 @@ qreal GRenderWindow::windowPixelRatio() {
}
void GRenderWindow::closeEvent(QCloseEvent* event) {
- motion_emu = nullptr;
emit Closed();
QWidget::closeEvent(event);
}
@@ -221,7 +221,7 @@ void GRenderWindow::mousePressEvent(QMouseEvent* event) {
this->TouchPressed(static_cast<unsigned>(pos.x() * pixelRatio),
static_cast<unsigned>(pos.y() * pixelRatio));
} else if (event->button() == Qt::RightButton) {
- motion_emu->BeginTilt(pos.x(), pos.y());
+ InputCommon::GetMotionEmu()->BeginTilt(pos.x(), pos.y());
}
}
@@ -230,14 +230,14 @@ void GRenderWindow::mouseMoveEvent(QMouseEvent* event) {
qreal pixelRatio = windowPixelRatio();
this->TouchMoved(std::max(static_cast<unsigned>(pos.x() * pixelRatio), 0u),
std::max(static_cast<unsigned>(pos.y() * pixelRatio), 0u));
- motion_emu->Tilt(pos.x(), pos.y());
+ InputCommon::GetMotionEmu()->Tilt(pos.x(), pos.y());
}
void GRenderWindow::mouseReleaseEvent(QMouseEvent* event) {
if (event->button() == Qt::LeftButton)
this->TouchReleased();
else if (event->button() == Qt::RightButton)
- motion_emu->EndTilt();
+ InputCommon::GetMotionEmu()->EndTilt();
}
void GRenderWindow::focusOutEvent(QFocusEvent* event) {
@@ -290,13 +290,11 @@ void GRenderWindow::OnMinimalClientAreaChangeRequest(
}
void GRenderWindow::OnEmulationStarting(EmuThread* emu_thread) {
- motion_emu = std::make_unique<Motion::MotionEmu>(*this);
this->emu_thread = emu_thread;
child->DisablePainting();
}
void GRenderWindow::OnEmulationStopping() {
- motion_emu = nullptr;
emu_thread = nullptr;
child->EnablePainting();
}
diff --git a/src/citra_qt/bootmanager.h b/src/citra_qt/bootmanager.h
index 4b3a3b3cc..6974edcbb 100644
--- a/src/citra_qt/bootmanager.h
+++ b/src/citra_qt/bootmanager.h
@@ -12,7 +12,6 @@
#include "common/thread.h"
#include "core/core.h"
#include "core/frontend/emu_window.h"
-#include "core/frontend/motion_emu.h"
class QKeyEvent;
class QScreen;
@@ -158,9 +157,6 @@ private:
EmuThread* emu_thread;
- /// Motion sensors emulation
- std::unique_ptr<Motion::MotionEmu> motion_emu;
-
protected:
void showEvent(QShowEvent* event) override;
};
diff --git a/src/citra_qt/configuration/config.cpp b/src/citra_qt/configuration/config.cpp
index 75abb4ce6..6e42db007 100644
--- a/src/citra_qt/configuration/config.cpp
+++ b/src/citra_qt/configuration/config.cpp
@@ -57,6 +57,11 @@ void Config::ReadValues() {
Settings::values.analogs[i] = default_param;
}
+ Settings::values.motion_device =
+ qt_config->value("motion_device", "engine:motion_emu,update_period:100,sensitivity:0.01")
+ .toString()
+ .toStdString();
+
qt_config->endGroup();
qt_config->beginGroup("Core");
@@ -203,6 +208,7 @@ void Config::SaveValues() {
qt_config->setValue(QString::fromStdString(Settings::NativeAnalog::mapping[i]),
QString::fromStdString(Settings::values.analogs[i]));
}
+ qt_config->setValue("motion_device", QString::fromStdString(Settings::values.motion_device));
qt_config->endGroup();
qt_config->beginGroup("Core");
diff --git a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp
index e3f3194db..7f4ec0c52 100644
--- a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp
+++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp
@@ -183,23 +183,13 @@ QVariant GraphicsVertexShaderModel::data(const QModelIndex& index, int role) con
print_input(output, src1, swizzle.negate_src1,
SelectorToString(swizzle.src1_selector));
AlignToColumn(kInputOperandColumnWidth);
- if (src_is_inverted) {
- print_input(output, src2, swizzle.negate_src2,
- SelectorToString(swizzle.src2_selector));
- } else {
- print_input(output, src2, swizzle.negate_src2,
- SelectorToString(swizzle.src2_selector), true,
- instr.mad.AddressRegisterName());
- }
+ print_input(output, src2, swizzle.negate_src2,
+ SelectorToString(swizzle.src2_selector), true,
+ src_is_inverted ? "" : instr.mad.AddressRegisterName());
AlignToColumn(kInputOperandColumnWidth);
- if (src_is_inverted) {
- print_input(output, src3, swizzle.negate_src3,
- SelectorToString(swizzle.src3_selector), true,
- instr.mad.AddressRegisterName());
- } else {
- print_input(output, src3, swizzle.negate_src3,
- SelectorToString(swizzle.src3_selector));
- }
+ print_input(output, src3, swizzle.negate_src3,
+ SelectorToString(swizzle.src3_selector), true,
+ src_is_inverted ? instr.mad.AddressRegisterName() : "");
AlignToColumn(kInputOperandColumnWidth);
break;
}
@@ -222,16 +212,15 @@ QVariant GraphicsVertexShaderModel::data(const QModelIndex& index, int role) con
SourceRegister src1 = instr.common.GetSrc1(src_is_inverted);
print_input(output, src1, swizzle.negate_src1,
swizzle.SelectorToString(false), true,
- instr.common.AddressRegisterName());
+ src_is_inverted ? "" : instr.common.AddressRegisterName());
AlignToColumn(kInputOperandColumnWidth);
}
- // TODO: In some cases, the Address Register is used as an index for SRC2
- // instead of SRC1
if (opcode_info.subtype & OpCode::Info::Src2) {
SourceRegister src2 = instr.common.GetSrc2(src_is_inverted);
print_input(output, src2, swizzle.negate_src2,
- swizzle.SelectorToString(true));
+ swizzle.SelectorToString(true), true,
+ src_is_inverted ? instr.common.AddressRegisterName() : "");
AlignToColumn(kInputOperandColumnWidth);
}
break;
@@ -247,7 +236,9 @@ QVariant GraphicsVertexShaderModel::data(const QModelIndex& index, int role) con
switch (opcode.EffectiveOpCode()) {
case OpCode::Id::LOOP:
- output << "(unknown instruction format)";
+ output << 'i' << instr.flow_control.int_uniform_id << " (end on 0x"
+ << std::setw(4) << std::right << std::setfill('0') << std::hex
+ << (4 * instr.flow_control.dest_offset) << ")";
break;
default:
@@ -255,7 +246,7 @@ QVariant GraphicsVertexShaderModel::data(const QModelIndex& index, int role) con
output << '(';
if (instr.flow_control.op != instr.flow_control.JustY) {
- if (instr.flow_control.refx)
+ if (!instr.flow_control.refx)
output << '!';
output << "cc.x";
}
@@ -267,13 +258,17 @@ QVariant GraphicsVertexShaderModel::data(const QModelIndex& index, int role) con
}
if (instr.flow_control.op != instr.flow_control.JustX) {
- if (instr.flow_control.refy)
+ if (!instr.flow_control.refy)
output << '!';
output << "cc.y";
}
output << ") ";
} else if (opcode_info.subtype & OpCode::Info::HasUniformIndex) {
+ if (opcode.EffectiveOpCode() == OpCode::Id::JMPU &&
+ (instr.flow_control.num_instructions & 1) == 1) {
+ output << '!';
+ }
output << 'b' << instr.flow_control.bool_uniform_id << ' ';
}
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index 02bfdca3d..c1ae0ccc8 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -311,7 +311,7 @@ bool GMainWindow::LoadROM(const QString& filename) {
if (!gladLoadGL()) {
QMessageBox::critical(this, tr("Error while initializing OpenGL 3.3 Core!"),
- tr("Your GPU may not support OpenGL 3.3, or you do not"
+ tr("Your GPU may not support OpenGL 3.3, or you do not "
"have the latest graphics driver."));
return false;
}