mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Fix a bug in DSP Jit where branches had a blockSize of zero.
Add some useful checking to J_CC/SetJumpTarget. Refactor increment/decrement and reuse code with increase/decrease. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5816 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -389,7 +389,8 @@ void XEmitter::J_CC(CCFlags conditionCode, const u8 * addr, bool force5Bytes)
|
||||
u64 fn = (u64)addr;
|
||||
if (!force5Bytes)
|
||||
{
|
||||
s32 distance = (s32)(fn - ((u64)code + 2)); //TODO - sanity check
|
||||
s32 distance = (s32)(fn - ((u64)code + 2));
|
||||
_assert_msg_(DYNA_REC, distance < 0x80, "Jump target too far away, needs force5Bytes = true");
|
||||
//8 bits will do
|
||||
Write8(0x70 + conditionCode);
|
||||
Write8((u8)(s8)distance);
|
||||
@ -407,7 +408,9 @@ void XEmitter::SetJumpTarget(const FixupBranch &branch)
|
||||
{
|
||||
if (branch.type == 0)
|
||||
{
|
||||
branch.ptr[-1] = (u8)(s8)(code - branch.ptr);
|
||||
s32 distance = (s32)(code - branch.ptr);
|
||||
_assert_msg_(DYNA_REC, distance < 0x80, "Jump target too far away, needs force5Bytes = true");
|
||||
branch.ptr[-1] = (u8)(s8)distance;
|
||||
}
|
||||
else if (branch.type == 1)
|
||||
{
|
||||
|
Reference in New Issue
Block a user