Script to Compile the latest github for retroarch+cores for iOS

If anyone has a JB’d device and can tell me a core that works with JIT, it would help me IMMENSELY.

Ok. I find iPad Pro iOS 11.4.1 and jb it. What’s else? What RA version need install? Cores?

@jet082 I have an iPad Pro 2 jailbroken on iOS 12.4 if you want me to test anything…

PCSX ReARMed seems like a good candidate, as the whole thing is rewritten and optimized with ARM in mind (although 32-bit only), and was pretty fast on an iPhone 4s, with upscaling… So it’s use of JIT is pretty much confirmed!

pcsx_rearmed is very good candidate, but mupen64plus_next have new jit for arm64, and ppsspp have working wit too.

I will try to make branches for these that someone can compile and test on JB. HOWEVER, is there not a specific cydia tweak one needs to enable this stuff? And does that exist for 64-bit?

I suppose I can take a look as to how PPSSPP does it, but…

1 Like

@jet082 The tweak to enable JIT on iOS 64-bit by Luca Todesco was never really used by anything…

On the Unc0ver jailbreak options, one could export TFP0 for all apps (even though it’s not recommended, as apps can do ANYTHING), so that would give kernel privileges to RetroArch, which would allow for any kind of JIT without using any tweaks!

PPSSPP uses only the CS_DEBUGGED option for it’s JIT, which allows it to launch the app in debug mode without having Xcode active… It doesn’t use a “full” JIT recompiler anymore on iOS 64-bit, though…

See this link from my previous post for a little more insight on this:

Okay, I’ll play around with this, but it can’t happen until at least the weekend since my school schedule is currently flooded.

1 Like

Im Westen nichts Neues?

@jet082 The JIT on PPSSPP is quite mature now, as they have an alternative for when CS_DEBUGGED is not set, but I see you posted in the thread, so you might already know all about that (and the patch from sbingner…)

I have made essentially no progress with JIT. The reason being, I have no real idea how to test it. I am not a programmer, persay, I just know how to massage code into compiling on various platforms. So, I do not know how to test code to ensure JIT is working. I can copy/paste random JIT-enabling code into various places, but unless I have a way to see if that works or not, I don’t really know what I can do.

With this and my increasing school obligations, it’s been real rough for me lately to get any work done. I’d like to return to JIT testing, but I think it won’t happen until winter break at least.

Until then, this weekend (and next) I will probably get my iOS stuff enabled in mupen64plus_next (which I’ve been putting off doing for awhile), try to get a more consistent flycast compiled (which will take some massaging, but is within my skill range I think), and begin working on debugging other cores to get them to compile or work.

@jet082 I think JIT on iOS 64-bit is quite a beast to tackle… Actually, to test it, you don’t even need a jailbroken device, Apple allows JIT in apps as long as they are run in debug mode, when connected to a computer with Xcode running in tethered debugging mode…

Hence the use of CS_DEBUGGED in PPSSPP’s implementation of JIT requiring one to enable this particular option from within Unc0ver (enabled by default on Electra), but it doesn’t require it anymore with sbingner’s commit (in my previous post…), as he made an alternative for when CS_DEBUGGED is not available : he actually tricks iOS into thinking the app is debugged by Xcode, while just hijacking other system processes to act as a fake debugger…

I think porting NEON optimizations to iOS 64-bit, then enabling NEON at compile time would be enough for at least PCSX ReARMed to get it’s upscaling and JIT capabilities back on iOS 64-bit (works fine on iOS 32-bit only at the moment…)!

What device do you have BTW? I actually just jailbroke an iPad Pro 2 on iOS 13.2.2 with checkra1n (!

There seems to be some new cores coming to RetroArch too, so if you want to look into them, I think JIT on iOS 64-bit can still wait a little more, it’s not like it just broke last week anyway… :wink:

You are great though, and obviously do this on your spare time, so if you don’t have time for you, take some! We don’t want a great mind to overburn because of a problem nobody else managed to solve anyway… :smile:

Bravo, @Weedy_Weed_Smoker! @jet082 - keep it up! As for jit - I see flycast for switch very successful recent time. May be jit development for iOS-arm64 need some bounty like for Nintendo Switch?

1 Like

Me not being able to test this has nothing to do with Jailbreak or not. I am aware of the PPSSPP hack.

However, again, unless I have some way of using a core with JIT that I know works, I can’t actually test these hacks. The pcsx rearmed core looks promising, but there’s a lot of work that goes into “porting 32 bit neon optimizations to ios 64 bit.” My ARM asm skills are fairly low. I know a bit - enough to sort of vaguely identify what lines of code are breaking via a debugger. But that’s a far cry from what is needed.

When I have tried to do similar porting with flycast, I literally just googled particular instructions that did not exist in arm64 and tried to find someone on github who did a similar port and then hoped that following their example would work (it did not, though it did compile).

1 Like

But now there is Gillou68310 jit for arm64. No need port 32bit code or I am mistaken?

WOW! ARM asm holy sh*t…

Sounds a lot like a french word :


nom masculin

1. économie : slump, stagnation
 "nous sommes en plein marasme"  we're going through a slump, our economy's in the doldrums

2. [apathie] : listlessness, apathy, depression

3. médecine : marasmus, cachexia

On a more serious note though: please be safe… We love you!

Oh my god, ARM asm… BTW, that’s a GREAT skill to have nowadays! :wink:

BTW, do you have any idea of what causes this ?

Someone opened an issue later without realizing mine was exactly the same…

Oh yeah I had that issue with hatari. iirc, I marked it as not working as a result. I had assumed something was off with my file - they use a weird method of calculating size to verify and I suspect that might be the issue.

Anyway, I updated my script slightly. In recent versions of retroarch they began to populate the team automatically or something? This messed with manual signing, so I fixed that.

1 Like

I would need to know more about the Gillou68310 asm. Occasionally, arm64 JIT exists (like in the flycast JIT for switch), but it does not compile on iOS without some tweaks.

You guys have a much higher opinion of my ability to do this than I do. I’m like 99.9% sure this is above my skill level. Writing scripts or massaging top level languages enough to compile (or even debugging them enough to make them work) is one thing - writing code, not to mention low level language code on an unfamiliar architecture, is entirely another.

1 Like

I updated the script again. It turned out, I was leaving out several cores (like 10?) because of the way I was generating my list. These are now included.

I also got basilisk2 to compile.

1 Like

@jet082 That’s great!! You did some magic again… :wink:

BTW, is there some dependency(ies) for chailove i’m not aware of? It’s not compiling with the latest Xcode and tools…

Here’s what the error looks like :

clang: warning: /Applications/ 'linker' input unused [-Wunused-command-line-argument]
clang: warning: no such sysroot directory: '-DHAVE_POSIX_MEMALIGN' [-Wmissing-sysroot]
In file included from vendor/libretro-common/audio/audio_mix.c:23:
In file included from ./vendor/libretro-common/include/audio/audio_mix.h:26:
./vendor/libretro-common/include/retro_common_api.h:75:10: fatal error: 'sys/types.h' file not found
#include <sys/types.h>
1 error generated.
make: *** [vendor/libretro-common/audio/audio_mix.o] Error 1

I’m guessing you updated without re-running xcode-select --install or something.