rsx: more efficient command reading

This commit is contained in:
eladash 2018-06-27 07:06:58 +03:00 committed by kd-11
parent 42851a93d4
commit 345f92ab0a

View File

@ -576,30 +576,34 @@ namespace rsx
continue; continue;
} }
//Validate put and get registers // Validate put and get registers before reading the command
//TODO: Who should handle graphics exceptions?? // TODO: Who should handle graphics exceptions??
const u32 get_address = RSXIOMem.RealAddr(internal_get); u32 cmd;
if (!get_address)
{ {
LOG_ERROR(RSX, "Invalid FIFO queue get/put registers found, get=0x%X, put=0x%X", internal_get.load(), put); u32 get_address;
if (mem_faults_count >= 3) if (!RSXIOMem.getRealAddr(internal_get, get_address))
{ {
LOG_ERROR(RSX, "Application has failed to recover, resetting FIFO queue"); LOG_ERROR(RSX, "Invalid FIFO queue get/put registers found, get=0x%X, put=0x%X", internal_get.load(), put);
internal_get = restore_point.load();;
} if (mem_faults_count >= 3)
else {
{ LOG_ERROR(RSX, "Application has failed to recover, resetting FIFO queue");
mem_faults_count++; internal_get = restore_point.load();
std::this_thread::sleep_for(10ms); }
else
{
mem_faults_count++;
std::this_thread::sleep_for(10ms);
}
invalid_command_interrupt_raised = true;
continue;
} }
invalid_command_interrupt_raised = true; cmd = vm::read32(get_address);
continue;
} }
const u32 cmd = ReadIO32(internal_get);
const u32 count = (cmd >> 18) & 0x7ff; const u32 count = (cmd >> 18) & 0x7ff;
if ((cmd & RSX_METHOD_OLD_JUMP_CMD_MASK) == RSX_METHOD_OLD_JUMP_CMD) if ((cmd & RSX_METHOD_OLD_JUMP_CMD_MASK) == RSX_METHOD_OLD_JUMP_CMD)