diff options
| -rw-r--r-- | src/video_core/macro_interpreter.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/macro_interpreter.h | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/video_core/macro_interpreter.cpp b/src/video_core/macro_interpreter.cpp index 44ece01c1..377bd66ab 100644 --- a/src/video_core/macro_interpreter.cpp +++ b/src/video_core/macro_interpreter.cpp | |||
| @@ -102,11 +102,11 @@ bool MacroInterpreter::Step(const std::vector<u32>& code, bool is_delay_slot) { | |||
| 102 | if (taken) { | 102 | if (taken) { |
| 103 | // Ignore the delay slot if the branch has the annul bit. | 103 | // Ignore the delay slot if the branch has the annul bit. |
| 104 | if (opcode.branch_annul) { | 104 | if (opcode.branch_annul) { |
| 105 | pc = base_address + (opcode.immediate << 2); | 105 | pc = base_address + opcode.GetBranchTarget(); |
| 106 | return true; | 106 | return true; |
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | delayed_pc = base_address + (opcode.immediate << 2); | 109 | delayed_pc = base_address + opcode.GetBranchTarget(); |
| 110 | // Execute one more instruction due to the delay slot. | 110 | // Execute one more instruction due to the delay slot. |
| 111 | return Step(code, true); | 111 | return Step(code, true); |
| 112 | } | 112 | } |
diff --git a/src/video_core/macro_interpreter.h b/src/video_core/macro_interpreter.h index a71e359d8..7d836b816 100644 --- a/src/video_core/macro_interpreter.h +++ b/src/video_core/macro_interpreter.h | |||
| @@ -91,6 +91,10 @@ private: | |||
| 91 | u32 GetBitfieldMask() const { | 91 | u32 GetBitfieldMask() const { |
| 92 | return (1 << bf_size) - 1; | 92 | return (1 << bf_size) - 1; |
| 93 | } | 93 | } |
| 94 | |||
| 95 | s32 GetBranchTarget() const { | ||
| 96 | return static_cast<s32>(immediate * sizeof(u32)); | ||
| 97 | } | ||
| 94 | }; | 98 | }; |
| 95 | 99 | ||
| 96 | union MethodAddress { | 100 | union MethodAddress { |