summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/input_common/udp/client.cpp2
-rw-r--r--src/video_core/shader/decode/xmad.cpp63
-rw-r--r--src/yuzu/configuration/config.cpp2
-rw-r--r--src/yuzu_cmd/config.cpp2
4 files changed, 51 insertions, 18 deletions
diff --git a/src/input_common/udp/client.cpp b/src/input_common/udp/client.cpp
index e82ae7ef1..da5227058 100644
--- a/src/input_common/udp/client.cpp
+++ b/src/input_common/udp/client.cpp
@@ -35,7 +35,7 @@ public:
35 pad_index(pad_index) { 35 pad_index(pad_index) {
36 boost::system::error_code ec{}; 36 boost::system::error_code ec{};
37 auto ipv4 = boost::asio::ip::make_address_v4(host, ec); 37 auto ipv4 = boost::asio::ip::make_address_v4(host, ec);
38 if (ec.failed()) { 38 if (ec.value() != boost::system::errc::success) {
39 LOG_ERROR(Input, "Invalid IPv4 address \"{}\" provided to socket", host); 39 LOG_ERROR(Input, "Invalid IPv4 address \"{}\" provided to socket", host);
40 ipv4 = boost::asio::ip::address_v4{}; 40 ipv4 = boost::asio::ip::address_v4{};
41 } 41 }
diff --git a/src/video_core/shader/decode/xmad.cpp b/src/video_core/shader/decode/xmad.cpp
index 206961909..fbd7e9a17 100644
--- a/src/video_core/shader/decode/xmad.cpp
+++ b/src/video_core/shader/decode/xmad.cpp
@@ -12,6 +12,7 @@ namespace VideoCommon::Shader {
12 12
13using Tegra::Shader::Instruction; 13using Tegra::Shader::Instruction;
14using Tegra::Shader::OpCode; 14using Tegra::Shader::OpCode;
15using Tegra::Shader::PredCondition;
15 16
16u32 ShaderIR::DecodeXmad(NodeBlock& bb, u32 pc) { 17u32 ShaderIR::DecodeXmad(NodeBlock& bb, u32 pc) {
17 const Instruction instr = {program_code[pc]}; 18 const Instruction instr = {program_code[pc]};
@@ -63,15 +64,18 @@ u32 ShaderIR::DecodeXmad(NodeBlock& bb, u32 pc) {
63 } 64 }
64 }(); 65 }();
65 66
66 op_a = BitfieldExtract(op_a, instr.xmad.high_a ? 16 : 0, 16); 67 op_a = SignedOperation(OperationCode::IBitfieldExtract, is_signed_a, std::move(op_a),
68 instr.xmad.high_a ? Immediate(16) : Immediate(0), Immediate(16));
67 69
68 const Node original_b = op_b; 70 const Node original_b = op_b;
69 op_b = BitfieldExtract(op_b, is_high_b ? 16 : 0, 16); 71 op_b = SignedOperation(OperationCode::IBitfieldExtract, is_signed_b, std::move(op_b),
72 is_high_b ? Immediate(16) : Immediate(0), Immediate(16));
70 73
71 // TODO(Rodrigo): Use an appropiate sign for this operation 74 // we already check sign_a and sign_b is difference or not before so just use one in here.
72 Node product = Operation(OperationCode::IMul, NO_PRECISE, op_a, op_b); 75 Node product = SignedOperation(OperationCode::IMul, is_signed_a, op_a, op_b);
73 if (is_psl) { 76 if (is_psl) {
74 product = Operation(OperationCode::ILogicalShiftLeft, NO_PRECISE, product, Immediate(16)); 77 product =
78 SignedOperation(OperationCode::ILogicalShiftLeft, is_signed_a, product, Immediate(16));
75 } 79 }
76 SetTemporary(bb, 0, product); 80 SetTemporary(bb, 0, product);
77 product = GetTemporary(0); 81 product = GetTemporary(0);
@@ -88,12 +92,40 @@ u32 ShaderIR::DecodeXmad(NodeBlock& bb, u32 pc) {
88 return BitfieldExtract(original_c, 16, 16); 92 return BitfieldExtract(original_c, 16, 16);
89 case Tegra::Shader::XmadMode::CBcc: { 93 case Tegra::Shader::XmadMode::CBcc: {
90 const Node shifted_b = SignedOperation(OperationCode::ILogicalShiftLeft, is_signed_b, 94 const Node shifted_b = SignedOperation(OperationCode::ILogicalShiftLeft, is_signed_b,
91 NO_PRECISE, original_b, Immediate(16)); 95 original_b, Immediate(16));
92 return SignedOperation(OperationCode::IAdd, is_signed_c, NO_PRECISE, original_c, 96 return SignedOperation(OperationCode::IAdd, is_signed_c, original_c, shifted_b);
93 shifted_b); 97 }
98 case Tegra::Shader::XmadMode::CSfu: {
99 const Node comp_a = GetPredicateComparisonInteger(PredCondition::Equal, is_signed_a,
100 op_a, Immediate(0));
101 const Node comp_b = GetPredicateComparisonInteger(PredCondition::Equal, is_signed_b,
102 op_b, Immediate(0));
103 const Node comp = Operation(OperationCode::LogicalOr, comp_a, comp_b);
104
105 const Node comp_minus_a = GetPredicateComparisonInteger(
106 PredCondition::NotEqual, is_signed_a,
107 SignedOperation(OperationCode::IBitwiseAnd, is_signed_a, op_a,
108 Immediate(0x80000000)),
109 Immediate(0));
110 const Node comp_minus_b = GetPredicateComparisonInteger(
111 PredCondition::NotEqual, is_signed_b,
112 SignedOperation(OperationCode::IBitwiseAnd, is_signed_b, op_b,
113 Immediate(0x80000000)),
114 Immediate(0));
115
116 Node new_c = Operation(
117 OperationCode::Select, comp_minus_a,
118 SignedOperation(OperationCode::IAdd, is_signed_c, original_c, Immediate(-65536)),
119 original_c);
120 new_c = Operation(
121 OperationCode::Select, comp_minus_b,
122 SignedOperation(OperationCode::IAdd, is_signed_c, new_c, Immediate(-65536)),
123 std::move(new_c));
124
125 return Operation(OperationCode::Select, comp, original_c, std::move(new_c));
94 } 126 }
95 default: 127 default:
96 UNIMPLEMENTED_MSG("Unhandled XMAD mode: {}", static_cast<u32>(instr.xmad.mode.Value())); 128 UNREACHABLE();
97 return Immediate(0); 129 return Immediate(0);
98 } 130 }
99 }(); 131 }();
@@ -102,18 +134,19 @@ u32 ShaderIR::DecodeXmad(NodeBlock& bb, u32 pc) {
102 op_c = GetTemporary(1); 134 op_c = GetTemporary(1);
103 135
104 // TODO(Rodrigo): Use an appropiate sign for this operation 136 // TODO(Rodrigo): Use an appropiate sign for this operation
105 Node sum = Operation(OperationCode::IAdd, product, op_c); 137 Node sum = SignedOperation(OperationCode::IAdd, is_signed_a, product, std::move(op_c));
106 SetTemporary(bb, 2, sum); 138 SetTemporary(bb, 2, sum);
107 sum = GetTemporary(2); 139 sum = GetTemporary(2);
108 if (is_merge) { 140 if (is_merge) {
109 const Node a = BitfieldExtract(sum, 0, 16); 141 const Node a = SignedOperation(OperationCode::IBitfieldExtract, is_signed_a, std::move(sum),
110 const Node b = 142 Immediate(0), Immediate(16));
111 Operation(OperationCode::ILogicalShiftLeft, NO_PRECISE, original_b, Immediate(16)); 143 const Node b = SignedOperation(OperationCode::ILogicalShiftLeft, is_signed_b, original_b,
112 sum = Operation(OperationCode::IBitwiseOr, NO_PRECISE, a, b); 144 Immediate(16));
145 sum = SignedOperation(OperationCode::IBitwiseOr, is_signed_a, a, b);
113 } 146 }
114 147
115 SetInternalFlagsFromInteger(bb, sum, instr.generates_cc); 148 SetInternalFlagsFromInteger(bb, sum, instr.generates_cc);
116 SetRegister(bb, instr.gpr0, sum); 149 SetRegister(bb, instr.gpr0, std::move(sum));
117 150
118 return pc; 151 return pc;
119} 152}
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index aaa2aa4c7..3b9ab38dd 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -539,7 +539,7 @@ void Config::ReadDebuggingValues() {
539void Config::ReadServiceValues() { 539void Config::ReadServiceValues() {
540 qt_config->beginGroup(QStringLiteral("Services")); 540 qt_config->beginGroup(QStringLiteral("Services"));
541 Settings::values.bcat_backend = 541 Settings::values.bcat_backend =
542 ReadSetting(QStringLiteral("bcat_backend"), QStringLiteral("boxcat")) 542 ReadSetting(QStringLiteral("bcat_backend"), QStringLiteral("null"))
543 .toString() 543 .toString()
544 .toStdString(); 544 .toStdString();
545 Settings::values.bcat_boxcat_local = 545 Settings::values.bcat_boxcat_local =
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp
index 907abaa51..f4cd905c9 100644
--- a/src/yuzu_cmd/config.cpp
+++ b/src/yuzu_cmd/config.cpp
@@ -452,7 +452,7 @@ void Config::ReadValues() {
452 Settings::values.yuzu_token = sdl2_config->Get("WebService", "yuzu_token", ""); 452 Settings::values.yuzu_token = sdl2_config->Get("WebService", "yuzu_token", "");
453 453
454 // Services 454 // Services
455 Settings::values.bcat_backend = sdl2_config->Get("Services", "bcat_backend", "boxcat"); 455 Settings::values.bcat_backend = sdl2_config->Get("Services", "bcat_backend", "null");
456 Settings::values.bcat_boxcat_local = 456 Settings::values.bcat_boxcat_local =
457 sdl2_config->GetBoolean("Services", "bcat_boxcat_local", false); 457 sdl2_config->GetBoolean("Services", "bcat_boxcat_local", false);
458} 458}