Skip to content

Commit

Permalink
Fix BRI instruction, fixes RPCS3#1165
Browse files Browse the repository at this point in the history
  • Loading branch information
tambry authored and Nekotekina committed Sep 7, 2015
1 parent de97c8e commit 4666f19
Showing 1 changed file with 22 additions and 25 deletions.
47 changes: 22 additions & 25 deletions rpcs3/Emu/RSX/Common/VertexProgramDecompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,39 +574,36 @@ std::string VertexProgramDecompiler::Decompile()
AddCode("}");
}
break;
/* This triggers opengl driver lost connection error code 7
case RSX_SCA_OPCODE_BRI: // works differently (BRI o[1].x(TR) L0;)
{
uint jump_position;
u32 jump_position = 1;

if (is_has_BRA)
{
jump_position = GetAddr();
}
else
{
int addr = GetAddr();
if (is_has_BRA)
{
jump_position = GetAddr();
}
else
{
u32 addr = GetAddr();

jump_position = 0;
for (auto pos : m_jump_lvls)
{
if (addr == pos)
break;
for (auto pos : m_jump_lvls)
{
if (addr == pos)
break;

++jump_position;
}
}
++jump_position;
}
}

AddCode("$ifcond ");
AddCode("{");
m_cur_instr->open_scopes++;
AddCode(fmt::format("jump_position = %u;", jump_position));
AddCode("continue;");
m_cur_instr->close_scopes++;
AddCode("}");
AddCode("$ifcond ");
AddCode("{");
m_cur_instr->open_scopes++;
AddCode(fmt::format("jump_position = %u;", jump_position));
AddCode("continue;");
m_cur_instr->close_scopes++;
AddCode("}");
}
break;
*/
case RSX_SCA_OPCODE_CAL:
// works same as BRI
AddCode("$ifcond $f(); //CAL");
Expand Down

0 comments on commit 4666f19

Please sign in to comment.