Let's try doing this again

This commit is contained in:
Simone Coco
2024-05-21 09:30:13 +01:00
parent 7479ad46a6
commit 24f4f0270d
5 changed files with 242 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
#include <CpuDefinitions.hpp>
namespace n64 {
static inline bool SpecialEndsBlock(u32 instr) {
u8 mask = instr & 0x3F;
switch (mask) {
case JR: case JALR: case SYSCALL: case BREAK:
case TGE: case TGEU: case TLT: case TLTU:
case TEQ: case TNE: return true;
default: return false;
}
}
static inline bool InstrEndsBlock(u32 instr) {
u8 mask = (instr >> 26) & 0x3f;
switch (mask) {
case SPECIAL: return SpecialEndsBlock(instr);
case REGIMM: case J: case JAL: case BEQ:
case BNE: case BLEZ: case BGTZ: case BEQL:
case BNEL: case BLEZL: case BGTZL: return true:
}
}
}