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

ppsspp community no sleeping: https://github.com/hrydgard/ppsspp/pull/12424. Non-jb devices are again working with jit.

@jet082 Hello. Are you still dealing with problem cores or doing something else? I’m interested in progress in flycast (textures and jit) and OpenLara (no output to screen).

So, one issue is that I’m coming up against a bit of a skill wall. There are some errors in the flycast core logic and I have discussed them with the person who basically manages it. However, fixing them or working around them is very difficult for me. I have also recently learned that, apparently, the “generic JIT” might work? I do not know if this is true or not, however, but I certainly spent an awful lot of time on trying to get it to work.

As far as OpenLara goes - the issue there appears to be in shaders not existing or something. I’m a bit unsure as to anything OpenGL beyond “debugging the problem.” In Craft, the issue is that some texture isn’t compiling properly or something when rendering the sky. However, there is a native OpenLara iOS version, so for now it might be best to just use that if you are interested in playing it.

And as for the non-JB JIT… I have been keeping a close eye on that. However, actually implementing it in other cores is far above my skill level, I think. Ideally, the people who know the various cores the best (flyinghead for flycast, for example) should implement that since they would know how best to do so. I mean, even more ideally, if it is at all possible, it would be nice to get a RetroArch-wide implementation so that various cores would not have to worry about implementing it in any particularized way. However, I do not know if this is possible.

Either way, if we want JIT in flycast, it will need some asm changes. I have gotten some of the asm stuff to work in arm64, but… Even then, I’m not ENTIRELY sure it is 1:1 since, well, the JIT just causes flycast to crash as it is anyway.

So that’s where things stand. The next core I think I want to work on getting interpreter mode working on is Dolphin. That seems feasible. Alternatively, I may try to look into getting JIT working retroarch-wide or something, but the issue is that I simply don’t have a way of testing to see if works. I do not know how to begin going about that.

Clearly. Standalone OpenLara have many issues in the iOS version and in general so as for does flycast. But no one has been in a hurry to solve them for months. And you have crazy potential and most importantly - courage. You will succeed.

Can take as a basis a couple of working cores and experiment with retroarch-wide JIT. I therefore suggested to try the solution from ppsspp because that works.

Well, the problem is - I do not have a core that I know works with JIT. I have cores that have JIT, but when they crash I do not know whether it is “because I implemented the PPSSPP hack incorrectly” or “because the random asm hacks aren’t working.” And I am not sure how to differentiate. If I can find a way to consistently test just the hack (for example, with a core that has JIT that works on a JB device), then I can begin working on that.

@jet082 Actually, I think we may have a problem with how JIT can be enabled on iOS, which is a little bit restricted compared to non security-oriented devices…

Even the greatly skilled @ qwertyoruiopz tried (since iOS 9/10 days, when 64-bit JIT was first tackled with…) when he was a little less skilled than now (and maybe a little to high to finish it… :joy: )


Since then, hrydgard implemented (and fixed with subsequent updates…) JIT in 64-bit ppsspp for iOS successfully, with the help of the amazingly skilled angelXwind

It’s the only emulator I know of that makes use of JIT on iOS 64-bit devices!

This was an issue opened by her in 2015:


It hasn’t been fixed yet within RetroArch…

We know it’s gonna be hard to fix it, so to say, don’t be too troubled about it! And you may have success reaching people who actually can and are interested to help…

(We believe in you though!)

:grinning:

(BTW: Thanks for allowing me to finally play the full Soul Calibur, with a joypad, and on a 64-bit iOS device… :wink: )

 Read this passionate thread about implementing JIT: 

I so understand that in pscx_rearmed there is a modification of jit from mupen64plus. And ppsspp’s jit is an adaptation of Dolphin’s jit. But after all broke a have someone?

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 (https://checkra.in/)!


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