Thread Closed 
 
Thread Rating:
  • 14 Votes - 4.07 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PPSSPP iOS Port
03-13-2013, 07:28 PM
Post: #271
RE: PPSSPP iOS Port
(First of all I'm not a developer Tongue )
I think ZodTTD can help you.
He use dynarec for his emulators (source)
Find all posts by this user
03-13-2013, 08:50 PM
Post: #272
RE: PPSSPP iOS Port
(03-13-2013 05:18 PM)BubblegumBalloon Wrote:  If its an issue with the OS then I have an idea but its a long shot...

Basically jit CAN work on iOS but it is only enabled on apples own 1st party apps that come preinstalled on the device. If any 3rd party app tries to use jit then the OS will kill the app.

There is a jailbreak tweak called Nitrous and what Nitrous does is enable the Nitrous javascript engine that is used in safari to be used with other apps. Now you may be wondering what this has to do with ppsspp? Well basically the Nitrous javascript engine uses jit so im guessing that the Nitrous jailbreak tweak somehow gives permission for 3rd party applications to use jit without being killed by the OS.

I havent tried this out myself yet since nitrous is a paid tweak but if anybody is willing to try it out this could be a potential solution to getting jit to work on ppsspp without crashing.

I'm testing this approach now, but I don't think it will fix the problem. I don't think it works the way BubblegumBalloon describes it. I think it just substitutes Nitro for the regular JavaScript engine for 3rd party apps and doesn't universally enable JIT.

You guys here might still try contacting the developers (Joe Jordan) about it.

I'll update this post or post again once I complete my tests.

(03-13-2013 05:18 PM)BubblegumBalloon Wrote:  EDIT: I did a bit more research and I found then even though iOS does not support JIT by default it does support AOT. AOT is not as fast as JIT but its still heck of a lot faster than using Interpreter.

Seems like an awful lot of trouble to go to just to get an emulator to work on ONE platform . . . Sad

I think the best approach is contact saurik or someone on the jailbreak team. They might be able to help design a tweak to enable JIT for PPSSPP . . .
Find all posts by this user
03-13-2013, 09:01 PM
Post: #273
RE: PPSSPP iOS Port
I contacted joe (developer of nitrous) and he said that nitrous should enable JIT.

He is also going to reply to me soon explaining how to use JIT in ppsspp without it crashing, that way we wont have to rely on a tweak for the emulator to use JIT. Im pretty excited. Smile
Find all posts by this user
03-13-2013, 09:20 PM (This post was last modified: 03-13-2013 09:20 PM by ReddestDream.)
Post: #274
RE: PPSSPP iOS Port
(03-13-2013 09:01 PM)BubblegumBalloon Wrote:  I contacted joe (developer of nitrous) and he said that nitrous should enable JIT.

He is also going to reply to me soon explaining how to use JIT in ppsspp without it crashing, that way we wont have to rely on a tweak for the emulator to use JIT. Im pretty excited. Smile

AWESOME! Smile

. . . Strange though . . . I've been testing a game in PPSSPP on my iPad, and I can get it work with JIT off but not on . . .

I have Nitrous installed, BTW . . .
Find all posts by this user
03-13-2013, 09:26 PM (This post was last modified: 03-13-2013 09:29 PM by the avenger.)
Post: #275
RE: PPSSPP iOS Port
(03-13-2013 09:01 PM)BubblegumBalloon Wrote:  I contacted joe (developer of nitrous) and he said that nitrous should enable JIT.

He is also going to reply to me soon explaining how to use JIT in ppsspp without it crashing, that way we wont have to rely on a tweak for the emulator to use JIT. Im pretty excited. Smile
great news,i actually though about using nitrous more than once but dismissed it because it's not very convenient to have to pay for this to use jit(assuming it worked though far fetched) for everybody ,anyway if you could mail him with the project's git to point out what's wrong that would be even more helpful
Find all posts by this user
03-13-2013, 09:26 PM
Post: #276
RE: PPSSPP iOS Port
(03-13-2013 09:20 PM)ReddestDream Wrote:  
(03-13-2013 09:01 PM)BubblegumBalloon Wrote:  I contacted joe (developer of nitrous) and he said that nitrous should enable JIT.

He is also going to reply to me soon explaining how to use JIT in ppsspp without it crashing, that way we wont have to rely on a tweak for the emulator to use JIT. Im pretty excited. Smile

AWESOME! Smile

. . . Strange though . . . I've been testing a game in PPSSPP on my iPad, and I can get it work with JIT off but not on . . .

I have Nitrous installed, BTW . . .

Hmm...well this does seem promising. I'm not a coder (not applications anyway) but it might not be as simple just having nitros installed.
Find all posts by this user
03-13-2013, 09:54 PM (This post was last modified: 03-13-2013 11:13 PM by BubblegumBalloon.)
Post: #277
RE: PPSSPP iOS Port
(03-13-2013 09:20 PM)ReddestDream Wrote:  
(03-13-2013 09:01 PM)BubblegumBalloon Wrote:  I contacted joe (developer of nitrous) and he said that nitrous should enable JIT.

He is also going to reply to me soon explaining how to use JIT in ppsspp without it crashing, that way we wont have to rely on a tweak for the emulator to use JIT. Im pretty excited. Smile

AWESOME! Smile

. . . Strange though . . . I've been testing a game in PPSSPP on my iPad, and I can get it work with JIT off but not on . . .

I have Nitrous installed, BTW . . .

So nitrous doesnt work with ppsspp? :/

Anyway a lot of jailbreak tweaks apparently do use JIT so it is possible. Depending on when joe gets back to me we could have JIT working by tomorrow.

Sauric will probably know how too if somebody wants to try and contact him.

EDIT: Just got an email from joe


"I don't think Nitrous is going to help you - it just enables Apple's Nitro JavaScript engine, which JIT-compiles JavaScript code. This isn't going to help you at all unless the emulator really is written in JavaScript.
However, jailbroken devices have kernel patches that allow apps to map memory as read+write+execute, which is the main obstacle to being able to use your own JIT in iOS. You don't need any special tweaks or settings to do this - the kernel patches have already been applied by the jailbreak. You do still need to set the correct access privilege attributes on the memory region, using e.g. vm_protect or mmap."
Find all posts by this user
03-13-2013, 11:39 PM (This post was last modified: 03-13-2013 11:45 PM by xsacha.)
Post: #278
RE: PPSSPP iOS Port
Well it already uses mmap to get executable + writable code. iOS is disabling the executable part which would suggest it isn't patched.
Maybe someone can try running a vm_protect with PROT_EXEC | PROT_WRITE after that?

(03-13-2013 07:28 PM)WhizZz Wrote:  I think ZodTTD can help you.
He use dynarec for his emulators (source)

That was 2009. Things have changed, unfortunately Tongue. Have you noticed no new videos or emulators with JIT since then? :\
Remember that in 2009-2011 (iOS 4.3), JIT was allowed. Supposedly there's a patch now but it looks like no one is using it? Otherwise the patch is only on vm_protect and no one has thought of using that yet.
Find all posts by this user
03-14-2013, 12:44 AM
Post: #279
RE: PPSSPP iOS Port
Can't believe, that N64iOS didn't use JIT.
That would mean, that the emulator runs on my IPhone 5 (iOS 6.1.2) in pure interpreter mode as fast as mupen64+ae on Android with activated JIT ?
If I run mupen64+ae on my Nexus 4 in interpreter mode, I can only get half of the speed with heavy stuttering sound.
Here is a video from the intro sequence of zelda 2 - mm in my iPhone 5.





Don't know anything about coding, so just for reference yongzh only release of source code from mupen dynarec.

http://sourceforge.net/projects/n64oid/?source=dlp
Find all posts by this user
03-14-2013, 01:50 AM
Post: #280
RE: PPSSPP iOS Port
Looks like I'm gonna be playing me some psp really soon!!Big Grin
Find all posts by this user
03-14-2013, 01:57 AM (This post was last modified: 03-14-2013 03:15 AM by xsacha.)
Post: #281
RE: PPSSPP iOS Port
(03-14-2013 12:44 AM)scorpio16v Wrote:  Don't know anything about coding, so just for reference yongzh only release of source code from mupen dynarec.

http://sourceforge.net/projects/n64oid/?source=dlp
ZodTTD's n64 iOS code (on github) and every other source I've seen simply uses 'mmap' for iOS. Doesn't even clear cache. There's no way JIT is running from that code.

So either: 1) The code doesn't matter and it's all in the packaging or 2) He never uploaded the source that has JIT in it.
I think it's #2.


And by the way, N64 runs full speed on quite old 1GHz devices with very weak GPUs (http://www.youtube.com/watch?v=xi2-kxhD3ps ) when JIT is enabled. I have no doubt it could run full speed in interpreter on an iPhone 5. Especially when you consider that they use frameskipping on the iOS port (visible in your video) + they only use a third of the screen for display.
That is, I can't actually tell if that's interpreter or JIT in your video. I wouldn't be surprised either way. I think it's using JIT though (just because it's possible).
Find all posts by this user
03-14-2013, 03:56 AM
Post: #282
RE: PPSSPP iOS Port
OK, so knowing it can't write and exec at the same time, I've made a small patch to switch between write and exec. Tell me if it progresses any further.
Find all posts by this user
03-14-2013, 06:46 AM
Post: #283
RE: PPSSPP iOS Port
(03-14-2013 12:44 AM)scorpio16v Wrote:  Can't believe, that N64iOS didn't use JIT.
That would mean, that the emulator runs on my IPhone 5 (iOS 6.1.2) in pure interpreter mode as fast as mupen64+ae on Android with activated JIT ?
If I run mupen64+ae on my Nexus 4 in interpreter mode, I can only get half of the speed with heavy stuttering sound.
Here is a video from the intro sequence of zelda 2 - mm in my iPhone 5.





Don't know anything about coding, so just for reference yongzh only release of source code from mupen dynarec.

http://sourceforge.net/projects/n64oid/?source=dlp
That's pretty much impossible.

I got half of my Galaxy Nexus speed on my iP5.
Find all posts by this user
03-14-2013, 07:10 AM
Post: #284
RE: PPSSPP iOS Port
(03-14-2013 03:56 AM)xsacha Wrote:  OK, so knowing it can't write and exec at the same time, I've made a small patch to switch between write and exec. Tell me if it progresses any further.

If someone makes a .deb, I can test.

I'm still thinking contacting saurik or the jailbreak team might be a good idea . . . Confused
Find all posts by this user
03-14-2013, 08:31 AM
Post: #285
RE: PPSSPP iOS Port
Does anyone know why I need to go to Product -> Clean after making any change for it actually get compiled in when I build/run? Or if there's any reason why breakpoints and stack traces wouldn't work from one install but would from another?

Anyway it seems to kinda work. Still really slow. Someone else can make a build/upload it after https://github.com/hrydgard/ppsspp/pull/985 is merged. May likely have more issues.

-[Unknown]
Find all posts by this user
Thread Closed 


Forum Jump: