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,18 +576,20 @@ 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;
{
u32 get_address;
if (!get_address) if (!RSXIOMem.getRealAddr(internal_get, get_address))
{ {
LOG_ERROR(RSX, "Invalid FIFO queue get/put registers found, get=0x%X, put=0x%X", internal_get.load(), put); LOG_ERROR(RSX, "Invalid FIFO queue get/put registers found, get=0x%X, put=0x%X", internal_get.load(), put);
if (mem_faults_count >= 3) if (mem_faults_count >= 3)
{ {
LOG_ERROR(RSX, "Application has failed to recover, resetting FIFO queue"); LOG_ERROR(RSX, "Application has failed to recover, resetting FIFO queue");
internal_get = restore_point.load();; internal_get = restore_point.load();
} }
else else
{ {
@ -599,7 +601,9 @@ namespace rsx
continue; continue;
} }
const u32 cmd = ReadIO32(internal_get); cmd = vm::read32(get_address);
}
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)