all repos — mgba @ 7a0fb72e7e3213b7579e3cdfa65d3c8755877e6e

mGBA Game Boy Advance Emulator

Stub out SWI
Jeffrey Pfau jeffrey@endrift.com
Sat, 06 Apr 2013 19:58:01 -0700
commit

7a0fb72e7e3213b7579e3cdfa65d3c8755877e6e

parent

d620357ac8161a7d318b6e8909cb3d2277e658bc

1 files changed, 13 insertions(+), 6 deletions(-)

jump to
M src/arm.csrc/arm.c

@@ -389,6 +389,7 @@ DEFINE_INSTRUCTION_ARM(MSR,)

DEFINE_INSTRUCTION_ARM(MRS,) DEFINE_INSTRUCTION_ARM(MSRI,) DEFINE_INSTRUCTION_ARM(MRSI,) +DEFINE_INSTRUCTION_ARM(SWI,) #define DECLARE_INSTRUCTION_ARM(COND, NAME) \ _ARMInstruction ## NAME ## COND

@@ -402,6 +403,12 @@ DIRECTIVE, \

DIRECTIVE, \ DIRECTIVE, \ DIRECTIVE + +#define DO_256(DIRECTIVE) \ + DO_8(DO_8(DIRECTIVE)), \ + DO_8(DO_8(DIRECTIVE)), \ + DO_8(DO_8(DIRECTIVE)), \ + DO_8(DO_8(DIRECTIVE)) #define DO_INTERLACE(LEFT, RIGHT) \ LEFT, \

@@ -449,10 +456,7 @@ DO_8(DECLARE_INSTRUCTION_ARM(COND, NAME ## MODE ## W)), \

DO_8(DECLARE_INSTRUCTION_ARM(COND, NAME ## MODE ## W)) #define DECLARE_ARM_BRANCH_BLOCK(COND, NAME) \ - DO_8(DO_8(DECLARE_INSTRUCTION_ARM(COND, NAME))), \ - DO_8(DO_8(DECLARE_INSTRUCTION_ARM(COND, NAME))), \ - DO_8(DO_8(DECLARE_INSTRUCTION_ARM(COND, NAME))), \ - DO_8(DO_8(DECLARE_INSTRUCTION_ARM(COND, NAME))) + DO_256(DECLARE_INSTRUCTION_ARM(COND, NAME)) // TODO: Support coprocessors #define DECLARE_ARM_LOAD_STORE_COPROCESSOR_BLOCK(COND, NAME, P, U, W, N) \

@@ -462,6 +466,9 @@

#define DECLARE_ARM_COPROCESSOR_BLOCK(COND, NAME1, NAME2) \ DO_8(DO_8(DO_INTERLACE(0, 0))), \ DO_8(DO_8(DO_INTERLACE(0, 0))) + +#define DECLARE_ARM_SWI_BLOCK(COND) \ + DO_256(DECLARE_INSTRUCTION_ARM(COND, SWI)) #define DECLARE_COND_BLOCK(COND) \ DECLARE_ARM_ALU_BLOCK(COND, AND, MUL, STRH, ILL, ILL), \

@@ -673,8 +680,8 @@ DECLARE_ARM_LOAD_STORE_COPROCESSOR_BLOCK(COND, STC, P, U, N, ), \

DECLARE_ARM_LOAD_STORE_COPROCESSOR_BLOCK(COND, LDC, P, U, N, ), \ DECLARE_ARM_LOAD_STORE_COPROCESSOR_BLOCK(COND, STC, P, U, N, W), \ DECLARE_ARM_LOAD_STORE_COPROCESSOR_BLOCK(COND, LDC, P, U, N, W), \ - DECLARE_ARM_COPROCESSOR_BLOCK(COND, CDP, MCR)//, \ - // DECLARE_ARM_SWI_BLOCK + DECLARE_ARM_COPROCESSOR_BLOCK(COND, CDP, MCR), \ + DECLARE_ARM_SWI_BLOCK(COND) static const ARMInstruction armTable[0x10000] = { DECLARE_COND_BLOCK(EQ),