summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2015-07-23 21:20:01 -0300
committerGravatar Yuri Kunde Schlesner2015-07-23 21:20:01 -0300
commit3b61dd97e01700cc1f5c1e46ace9f351af6d4909 (patch)
tree35ca26ffeab4daf2ead8ee1c92abc038592050da /src/core
parentMerge pull request #977 from yuriks/glenable-tex2d (diff)
downloadyuzu-3b61dd97e01700cc1f5c1e46ace9f351af6d4909.tar.gz
yuzu-3b61dd97e01700cc1f5c1e46ace9f351af6d4909.tar.xz
yuzu-3b61dd97e01700cc1f5c1e46ace9f351af6d4909.zip
GSP: Don't try to write memory fill registers if start address is 0
Verified to be what GSP does via REing. Fixes invalid virt->phys translation error spam in some games.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/gsp_gpu.cpp31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp
index 8b40ba376..eb688cee8 100644
--- a/src/core/hle/service/gsp_gpu.cpp
+++ b/src/core/hle/service/gsp_gpu.cpp
@@ -391,19 +391,24 @@ static void ExecuteCommand(const Command& command, u32 thread_id) {
391 case CommandId::SET_MEMORY_FILL: 391 case CommandId::SET_MEMORY_FILL:
392 { 392 {
393 auto& params = command.memory_fill; 393 auto& params = command.memory_fill;
394 WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[0].address_start)), 394
395 Memory::VirtualToPhysicalAddress(params.start1) >> 3); 395 if (params.start1 != 0) {
396 WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[0].address_end)), 396 WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[0].address_start)),
397 Memory::VirtualToPhysicalAddress(params.end1) >> 3); 397 Memory::VirtualToPhysicalAddress(params.start1) >> 3);
398 WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[0].value_32bit)), params.value1); 398 WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[0].address_end)),
399 WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[0].control)), params.control1); 399 Memory::VirtualToPhysicalAddress(params.end1) >> 3);
400 400 WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[0].value_32bit)), params.value1);
401 WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[1].address_start)), 401 WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[0].control)), params.control1);
402 Memory::VirtualToPhysicalAddress(params.start2) >> 3); 402 }
403 WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[1].address_end)), 403
404 Memory::VirtualToPhysicalAddress(params.end2) >> 3); 404 if (params.start2 != 0) {
405 WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[1].value_32bit)), params.value2); 405 WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[1].address_start)),
406 WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[1].control)), params.control2); 406 Memory::VirtualToPhysicalAddress(params.start2) >> 3);
407 WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[1].address_end)),
408 Memory::VirtualToPhysicalAddress(params.end2) >> 3);
409 WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[1].value_32bit)), params.value2);
410 WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[1].control)), params.control2);
411 }
407 break; 412 break;
408 } 413 }
409 414