Skip to content

Commit

Permalink
ignoring formatting for lookup table
Browse files Browse the repository at this point in the history
  • Loading branch information
Kim-Dewelski committed Dec 17, 2023
1 parent c593fa4 commit 859c1e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/arm7.h
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ static FORCE_INLINE unsigned arm7_reg_index(arm7_t* cpu, unsigned reg){
if(SB_LIKELY(reg<8))return reg;
int mode = cpu->registers[CPSR]&0xf;

// clang-format off

const static int8_t lookup[10*16+8]={
-1,-1,-1,-1,-1,-1,-1,-1, //8 extra padding to remove the need to -8 from computation
8, 9,10,11,12,13,14,15,16,16, //mode 0x0 (user)
Expand All @@ -447,6 +449,9 @@ static FORCE_INLINE unsigned arm7_reg_index(arm7_t* cpu, unsigned reg){
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, //mode 0xE (inv)
8, 9,10,11,12,13,14,15,16,16, //mode 0xF (system)
};

// clang-format on

int8_t r = lookup[mode*10+reg];
if(SB_LIKELY(r!=-1))return r;
cpu->trigger_breakpoint=true;
Expand Down

0 comments on commit 859c1e1

Please sign in to comment.