| 253 | #define JumpTarget(op, address) ( ((address) & 0xF0000000) | (((op).target)<<2) ) |
| 254 | |
| 255 | u32 GetBranchTarget( u32 address, OpCode op_code, ER4300BranchType type ) |
| 256 | { |
| 257 | #ifdef DAEDALUS_ENABLE_ASSERTS |
| 258 | DAEDALUS_ASSERT( type != BT_NOT_BRANCH, "This is not a valid branch type" ); |
| 259 | #endif |
| 260 | // We pass the type in for efficiency - check that it's correct in debug though |
| 261 | // This already checked |
| 262 | //DAEDALUS_ASSERT( GetBranchType( op_code ) == type, "Specified type is inconsistant with op code" ); |
| 263 | |
| 264 | if( type < BT_J ) |
| 265 | { |
| 266 | return BranchAddress( op_code, address ); |
| 267 | } |
| 268 | |
| 269 | // All the following are unconditional |
| 270 | if( type < BT_JR ) |
| 271 | { |
| 272 | return JumpTarget( op_code, address ); |
| 273 | } |
| 274 | |
| 275 | // These are all indirect |
| 276 | return 0; |
| 277 | } |