diff --git a/core/rec-ARM/ngen_arm.S b/core/rec-ARM/ngen_arm.S index dfb5aaf01..09f2be78e 100644 --- a/core/rec-ARM/ngen_arm.S +++ b/core/rec-ARM/ngen_arm.S @@ -173,8 +173,13 @@ do_iter: HIDDEN(no_update) CSYM(no_update): @ next_pc _MUST_ be on r4 *R4 NOT R0 anymore* +#if RAM_SIZE == 33554432 + sub r2,r8,#67371008 + ubfx r1,r4,#1,#24 +#else sub r2,r8,#33816576 ubfx r1,r4,#1,#23 +#endif ldr pc,[r2,r1,lsl #2] @bic r1,r4,#0xFF000000 diff --git a/core/rec-ARM/rec_arm.cpp b/core/rec-ARM/rec_arm.cpp index ec6e86fca..ad2dff4b1 100644 --- a/core/rec-ARM/rec_arm.cpp +++ b/core/rec-ARM/rec_arm.cpp @@ -408,8 +408,14 @@ u32 DynaRBI::Relink() case BET_DynamicJump: { #ifdef CALLSTACK - SUB(r2,r8,33816576); - UBFX(r1,r4,1,23); +#error offset broken +#if RAM_SIZE == 33554432 + SUB(r2, r8, 67371008); + UBFX(r1, r4, 1, 24); +#else + SUB(r2, r8, 33816576); + UBFX(r1, r4, 1, 23); +#endif if (BlockType==BET_DynamicRet) { @@ -431,8 +437,13 @@ u32 DynaRBI::Relink() #if 1 //this is faster //why ? (Icache ?) - SUB(r2,r8,33816576); - UBFX(r1,r4,1,23); +#if RAM_SIZE == 33554432 + SUB(r2, r8, 67371008); + UBFX(r1, r4, 1, 24); +#else + SUB(r2, r8, 33816576); + UBFX(r1, r4, 1, 23); +#endif LDR(r15,r2,r1,Offset,true,S_LSL,2); #else @@ -445,8 +456,13 @@ u32 DynaRBI::Relink() } else { - SUB(r2,r8,33816576); //1 - UBFX(r1,r4,1,23); //1 +#if RAM_SIZE == 33554432 + SUB(r2, r8, 67371008); + UBFX(r1, r4, 1, 24); +#else + SUB(r2, r8, 33816576); + UBFX(r1, r4, 1, 23); +#endif NOP();NOP(); //2 LDR(r15,r2,r1,Offset,true,S_LSL,2); //1 } @@ -456,8 +472,13 @@ u32 DynaRBI::Relink() { verify(pBranchBlock==0); - SUB(r2,r8,33816576); - UBFX(r1,r4,1,23); +#if RAM_SIZE == 33554432 + SUB(r2, r8, 67371008); + UBFX(r1, r4, 1, 24); +#else + SUB(r2, r8, 33816576); + UBFX(r1, r4, 1, 23); +#endif LDR(r15,r2,r1,Offset,true,S_LSL,2); } #endif