Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rsx: Minor pfifo opcode fixes #5185

Merged
merged 2 commits into from
Sep 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 16 additions & 13 deletions rpcs3/Emu/RSX/RSXThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,17 @@ namespace rsx
m_return_addr = std::exchange(internal_get.raw(), offs) + 4;
continue;
}
if (cmd == RSX_METHOD_RETURN_CMD)

if (cmd & 0x3)
{
// TODO: Check for more invalid bits combinations
LOG_ERROR(RSX, "FIFO: Illegal command(0x%x) was executed. Resetting...", cmd);
internal_get = restore_point.load();
m_return_addr = restore_ret_addr;
continue;
}

if ((cmd & ~0xfffc) == RSX_METHOD_RETURN_CMD)
{
if (m_return_addr == -1)
{
Expand All @@ -712,7 +722,10 @@ namespace rsx
internal_get = get;
continue;
}
if (cmd == 0) //nop

u32 count = (cmd >> 18) & 0x7ff;

if (count == 0) //nop
{
if (performance_counters.state == FIFO_state::running)
{
Expand All @@ -723,21 +736,11 @@ namespace rsx
internal_get += 4;
continue;
}
if (cmd & 0x3)
{
// TODO: Check for more invalid bits combinations
LOG_ERROR(RSX, "FIFO: Illegal command(0x%x) was executed. Resetting...", cmd);
internal_get = restore_point.load();
m_return_addr = restore_ret_addr;
continue;
}

u32 count = (cmd >> 18) & 0x7ff;

//Validate the args ptr if the command attempts to read from it
auto args = vm::ptr<u32>::make(RSXIOMem.RealAddr(internal_get + 4));

if (!args && count)
if (!args)
{
std::this_thread::sleep_for(33ms);

Expand Down