summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-09-15 06:17:04 -0400
committerGravatar GitHub2019-09-15 06:17:04 -0400
commitb8b1747704a612145655a1391c1ebf4d1f9e5ba6 (patch)
tree5f85729ae6532a678532ae20b9422fb0c2e84b73 /src
parentMerge pull request #2857 from ReinUsesLisp/surface-srgb (diff)
parentmaxwell_3d: Update firmware 4 call stub commentary (diff)
downloadyuzu-b8b1747704a612145655a1391c1ebf4d1f9e5ba6.tar.gz
yuzu-b8b1747704a612145655a1391c1ebf4d1f9e5ba6.tar.xz
yuzu-b8b1747704a612145655a1391c1ebf4d1f9e5ba6.zip
Merge pull request #2824 from ReinUsesLisp/mme
Revert "Revert #2466" and stub FirmwareCall 4
Diffstat (limited to 'src')
-rw-r--r--src/video_core/engines/maxwell_3d.cpp12
-rw-r--r--src/video_core/engines/maxwell_3d.h8
-rw-r--r--src/video_core/macro_interpreter.cpp4
3 files changed, 20 insertions, 4 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index c8c92757a..5d516cdb3 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -329,6 +329,10 @@ void Maxwell3D::CallMethod(const GPU::MethodCall& method_call) {
329 ProcessMacroBind(method_call.argument); 329 ProcessMacroBind(method_call.argument);
330 break; 330 break;
331 } 331 }
332 case MAXWELL3D_REG_INDEX(firmware[4]): {
333 ProcessFirmwareCall4();
334 break;
335 }
332 case MAXWELL3D_REG_INDEX(const_buffer.cb_data[0]): 336 case MAXWELL3D_REG_INDEX(const_buffer.cb_data[0]):
333 case MAXWELL3D_REG_INDEX(const_buffer.cb_data[1]): 337 case MAXWELL3D_REG_INDEX(const_buffer.cb_data[1]):
334 case MAXWELL3D_REG_INDEX(const_buffer.cb_data[2]): 338 case MAXWELL3D_REG_INDEX(const_buffer.cb_data[2]):
@@ -419,6 +423,14 @@ void Maxwell3D::ProcessMacroBind(u32 data) {
419 macro_positions[regs.macros.entry++] = data; 423 macro_positions[regs.macros.entry++] = data;
420} 424}
421 425
426void Maxwell3D::ProcessFirmwareCall4() {
427 LOG_WARNING(HW_GPU, "(STUBBED) called");
428
429 // Firmware call 4 is a blob that changes some registers depending on its parameters.
430 // These registers don't affect emulation and so are stubbed by setting 0xd00 to 1.
431 regs.reg_array[0xd00] = 1;
432}
433
422void Maxwell3D::ProcessQueryGet() { 434void Maxwell3D::ProcessQueryGet() {
423 const GPUVAddr sequence_address{regs.query.QueryAddress()}; 435 const GPUVAddr sequence_address{regs.query.QueryAddress()};
424 // Since the sequence address is given as a GPU VAddr, we have to convert it to an application 436 // Since the sequence address is given as a GPU VAddr, we have to convert it to an application
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index f67a5389f..e5ec90717 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -1089,7 +1089,9 @@ public:
1089 INSERT_PADDING_WORDS(14); 1089 INSERT_PADDING_WORDS(14);
1090 } shader_config[MaxShaderProgram]; 1090 } shader_config[MaxShaderProgram];
1091 1091
1092 INSERT_PADDING_WORDS(0x80); 1092 INSERT_PADDING_WORDS(0x60);
1093
1094 u32 firmware[0x20];
1093 1095
1094 struct { 1096 struct {
1095 u32 cb_size; 1097 u32 cb_size;
@@ -1319,6 +1321,9 @@ private:
1319 /// Handles writes to the macro bind register. 1321 /// Handles writes to the macro bind register.
1320 void ProcessMacroBind(u32 data); 1322 void ProcessMacroBind(u32 data);
1321 1323
1324 /// Handles firmware blob 4
1325 void ProcessFirmwareCall4();
1326
1322 /// Handles a write to the CLEAR_BUFFERS register. 1327 /// Handles a write to the CLEAR_BUFFERS register.
1323 void ProcessClearBuffers(); 1328 void ProcessClearBuffers();
1324 1329
@@ -1431,6 +1436,7 @@ ASSERT_REG_POSITION(vertex_array[0], 0x700);
1431ASSERT_REG_POSITION(independent_blend, 0x780); 1436ASSERT_REG_POSITION(independent_blend, 0x780);
1432ASSERT_REG_POSITION(vertex_array_limit[0], 0x7C0); 1437ASSERT_REG_POSITION(vertex_array_limit[0], 0x7C0);
1433ASSERT_REG_POSITION(shader_config[0], 0x800); 1438ASSERT_REG_POSITION(shader_config[0], 0x800);
1439ASSERT_REG_POSITION(firmware, 0x8C0);
1434ASSERT_REG_POSITION(const_buffer, 0x8E0); 1440ASSERT_REG_POSITION(const_buffer, 0x8E0);
1435ASSERT_REG_POSITION(cb_bind[0], 0x904); 1441ASSERT_REG_POSITION(cb_bind[0], 0x904);
1436ASSERT_REG_POSITION(tex_cb_index, 0x982); 1442ASSERT_REG_POSITION(tex_cb_index, 0x982);
diff --git a/src/video_core/macro_interpreter.cpp b/src/video_core/macro_interpreter.cpp
index 4e1cb98db..62afc0d11 100644
--- a/src/video_core/macro_interpreter.cpp
+++ b/src/video_core/macro_interpreter.cpp
@@ -131,9 +131,7 @@ bool MacroInterpreter::Step(u32 offset, bool is_delay_slot) {
131 131
132 // An instruction with the Exit flag will not actually 132 // An instruction with the Exit flag will not actually
133 // cause an exit if it's executed inside a delay slot. 133 // cause an exit if it's executed inside a delay slot.
134 // TODO(Blinkhawk): Reversed to always exit. The behavior explained above requires further 134 if (opcode.is_exit && !is_delay_slot) {
135 // testing on the MME code.
136 if (opcode.is_exit) {
137 // Exit has a delay slot, execute the next instruction 135 // Exit has a delay slot, execute the next instruction
138 Step(offset, true); 136 Step(offset, true);
139 return false; 137 return false;