hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.06k stars 2.15k forks source link

Could the new PPSSPP for iOS be distributed on AltStore? #12575

Open lzlrd opened 4 years ago

lzlrd commented 4 years ago

AltStore (https://altstore.io) is an alternative app store for non-jailbroken iOS devices, and can distribute and resign applications onto Apple devices. This would be a great way to recieve updates for those of us who aren't jailbroken.

mariolopjr commented 4 years ago

Hi @hrydgard @unknownbrackets I'd like to help with AltStore and ipa/deb building for iOS.

You can see repo here: https://github.com/mariolopjr/ppsspp-builder, based on some previous scripts and newer changes in PPSSPP, I've got GitHub CI working building complaint ipa. I can then work on getting these on AltStore. However, my repo will be tracking the tagged releases (I will explore building for each commit).

I hope this can help folks with non-jailbroken iOS devices. Thoughts?

hrydgard commented 4 years ago

Sounds good, since I'm not actively supporting iOS myself, any such effort is appreciated. Happy to link to things or merge changes you need.

mariolopjr commented 4 years ago

Thank you! I will be doing a PR for the git-version cmake to (hopefully) make it more compatible with ppsspp in a submodule. I've also reached out to AltStore.

I am not sure if you happen to know, but I'd also like to issue some fixes for the notch (I have an iPhone X I can test with). I also want to investigate setting the IR interpreter as the default setting the first time PPSSPP is run on an iOS device. Any pointers as to where to look for these? I am crawling the files (ofc), but am still unfamiliar with PPSSPP's structure. Thanks!!

I am also hoping to get a "preview" version out with MoltenVK dylibs linked for the experimental MoltenVK/Vulkan support on iOS (and macOS when I have the time!). I don't mind helping with those as well!

hrydgard commented 4 years ago

As for the notch, you just need to return the right values in System_GetPropertyFloat - though it's already hooked up I see. Check out viewSafeAreaInsetsDidChange in ViewController.mm.

Setting the core to IRInterpreter by default can be done in Core/Config.cpp.

MoltenVK for iOS would be awesome.

mariolopjr commented 4 years ago

My apologies, I thought I saw an iOS notch issue/bug (it may be I was looking at closed issues when exploring MoltenVK support).

Thanks for the pointers, lots of good stuff to explore!

devinprater commented 4 years ago

Having this on AltStore, and having it set to IR Interpreter automatically, would make things much easier for me, and would cut down the barrier of entry for any other blind person wanting to have PPSSPP as a, well, mobile gaming system on an iPhone. Thanks so much for this!

mariolopjr commented 4 years ago

To be honest, it may make sense to set IR interpreter as default and disable/remove the option for JIT (for iOS), as that would be the least confusing for folks (I can imagine someone setting the JIT and wondering why PPSSPP is crashing).

@devinprater I recall seeing you pop up in some of the issues, glad this can help for you and others! Any other areas for improvement for blind folks (if you don't mind me asking)? Might as well take a look at that while I am exploring other fixes. :)

hrydgard commented 4 years ago

We should probably detect iOS 14 or later where no jailbreak can fix JIT, and enforce IR and remove the option. Not quite sure how to detect OS version though. Would be useful if you could implement SYSPROP_SYSTEMVERSION in System_GetPropertyInt in main.mm to return something useful, then we can easily check it from the settings code.

devinprater commented 4 years ago

Enabling the UI sounds would help. We can now launch games from the Files app, but one may want to use save states though, so having menu sounds, in place of an accessible PPSSPP menu (from pressing the Menu button from within a game), would help some. I’d have to try things out to see which option on the menu does what, unless I can find that in the code somewhere, but for just regularly playing games, having the IR interpreter automatically set would solve a large amount of steps. Of course, setting one’s name in PPSSPP still requires the editing of the config file, which reminds me that I really should find a text editor on iOS that opens INI files, but that’s just one step, setting the PSP nickname.

Also, setting the screen orientation to 0:

InternalScreenRotation = 0

Makes the device actually go into landscape mode, the right one… most of the time… meaning that those with some vision won’t have to turn their phone to reverse landscape mode to play the game.

mariolopjr commented 4 years ago

Good idea -- I thought JIT was broken for all iOS versions (including jailbreak), not just iOS 14 (thank you for pointing that out). I'll wrap in a version check and enforce IR if iOS >= 14.

@devinprater Thank you! Good suggestions. I'll have to play with accessibility options, I am unfamiliar with that. Ignorant question incoming: I thought when using accessibility in iOS apps for blind folks, iOS "reads out loud" the label of the control/button. Does the same not happen with PPSSPP? I assume your statement "try out which option does what", you mean you have to go through each control, have iOS read out the label, and try to figure out if that's the option you need?

Also nice to know regarding what is available on the menu with PPSSPP, it may be beneficial on iOS devices to allow changing the name or rotation within settings, as those are more important on mobile devices.

devinprater commented 4 years ago

I believe JIT is pretty much broken for all iOS versions without Jailbreaking. There was just some hack that enabled debug mode, which enables JIT, but it required that you quit the emulator from the PPSSPP menu. About accessibility, the iOS accessibility features work off of textual labels https://developer.apple.com/accessibility/ios/ in apps. These have to be exposed to the accessibility interfaces in operating systems, and QT/SDL, from what I’ve found, doesn’t do that on iOS. From what I’ve seen, as a very beginner in coding, is that PPSSPP draws its interface with pictures, not native controls, so iOS doesn’t really know what’s going on, so it can’t tell VoiceOver or other accessibility tools.

Now, in iOS 14, VoiceOver has a feature called Screen Recognition, which can recognize some of that, but the further things stray away from the model of iOS-like interfaces, the more it misses out on. What I do to figure things out like the menus and such is to use text recognition on a Windows computer (some screen readers, like NVDA https://www.nvaccess.org/ use Windows 10’s text recognition system), to go through the PPSSPP menu or game menus, and try to memorize that.

Of course, if PPSSPP can be made to work with VoiceOver, that would be great, but even just having things set up and ready to go, pretty much, would at least give blind people a chance to play games offline. Doing Adhoc stuff for online play would still be a lot of steps, editing the IP address of the ProAdhocServer, but one step at a time, I suppose. :)

mariolopjr commented 4 years ago

Wow, this is really good info. Definitely making gaming (and emulation) accessible is a good thing. Especially when there are versions on many different platforms to reach many different enthusiasts, this is just another version of that. I will explore and see what I can do within the constraints of PPSSPP. :)

devinprater commented 4 years ago

Thanks very much for looking into this. It’s hard to get blind people into emulation, especially on mobile. Retroarch has gone the rout of just sending the text of the currently focused item to the system’s TTS engine, creating a very crude screen reader. This has lead to a bit of scrambling to fix things when they switched UI drivers, so there’s that aspect of building that to consider. But on mobile, this would require use of a keyboard or game controller. Then again, the only way blind people will successfully play video games is with a physical game controller or keyboard. I’m not saying Retroarch’s way is best, it’s a workaround, but it is an option, and blind people aren’t picky at all when it comes to gaming. It’s always best, if possible, to use native accessibility. I’m also excited to see vibration being scripted into games, like Mortal Kombat Unchained, Dissidia Final Fantasy, ETC. because that always helps too. There’s just so much in emulation that hasn’t been explored for accessibility, like this Final Fantasy 1 accessibility pack for Retroarch https://ztranslate.net/download/ff1_package5b.zip?owner=, or Pokemon Crystal Access https://allinaccess.com/pca/. I know FF1 is far simpler than any PSP game, but I’m very excited for the future of emulation. And having PPSSPP on iOS, arguably one of the most accessible platforms for the blind, will really help blind people get into emulation.

hrydgard commented 4 years ago

I think we should move accessibility discussion here: https://github.com/hrydgard/ppsspp/issues/11696

mariolopjr commented 4 years ago

Thank you, didn't realize there was a separate issue. I'll take a look at iOS accessibility once building and deployment is stabilized for everyone!

mariolopjr commented 3 years ago

@lazerl0rd @devinprater Good news! Brought up a link which should auto-update PPSSPP packages in AltStore! Here's the AltStore source link: https://techmunchies.net/.netlify/functions/altstore. Right now, only the latest tagged PPSSPP IPA is available. I am hoping in the next couple days to have the dev-latest (each commit on PPSSPP master) built and available on the AltStore repo. My next step after that is to supply MoltenVK builds for further testing.

Unfortunately, I do not have access to AltStore beta (lol) to test at the moment, I may jump on soon to make sure things work. If anyone is using AltStore beta, please try to add the following link as a 3rd party source and let me know if it works: https://techmunchies.net/.netlify/functions/altstore. If it works, feel free to spread it far and wide! We will finally have an easy, fully open-source, auto-updated source for PPSSPP IPAs.

The serverless function code is also open-source, feel free to visit my site's GitHub repo to see how it's built (and to verify where it's fetching the IPA, you can also inspect the JSON response).

Anyways, thank you all. Please don't close this ticket just yet as I have a couple more builds to add to the "store". :)

hrydgard commented 3 years ago

Cool. Not closing :)

PixPMusic commented 3 years ago

Re: JIT support.

Psychic Paper was patched in 13.5, but 13.5 can be jailbroken, but AltStore installs apps as a standard App Store app, so you'll still need to escape the sandbox.

https://siguza.github.io/psychicpaper/

PixPMusic commented 3 years ago

Also, here's a direct link for that repo

Edit: Github won't linkify it even when I use link tags altstore://source?url=https://techmunchies.net/.netlify/functions/altstore

As long as the IPA and the repo agree on IPA version, updates should work perfectly. That's the only existing issue with the older build currently out there.

mariolopjr commented 3 years ago

@PixPMusic I heard about this some time back. And while cool for iOS < 13.5 (which I don't think PPSSPP can assume that), I think JIT is just not going to be a thing on iOS until Apple stops being jerks about emulation being perfectly legal.

Also, that's how the AltStore link is supposed to work? Fantastic, thank you! I had to find an existing AltStore JSON feed to base the PPSSPP one, and of course, without the beta, I had no idea how it actually works with AltStore lol. Were you able to test and it work?

Additionally, I can add the psychic paper exploit which will benefit iOS < 13.5, but does it break for iOS >= 13.5? I.e. PPSSPP won't run on later versions? I am a bit afraid of patched, hacky solutions.

PixPMusic commented 3 years ago

@mariolopjr Your JSON is invalid. Please remove the empty imageurl in the news section.

Also, I'm unsure if you can implement Psychic Paper while maintaining support for later iOS versions. The main app I know that uses the exploit is Dolphin, which is broken on 13.5+

PixPMusic commented 3 years ago

Nice IMG_60802D6DEB9F-1

mariolopjr commented 3 years ago

@PixPMusic Thank you, fixed the JSON. Can you try again?

EDIT: ahahah you are way ahead of me LOL. Thank you! Does PPSSPP install well and work? I assume so. :) This is great news!

Also, for Psychic Paper, I could always have a separate build for that for older iOS version, not sure if it'll be used but worth a shot.

PixPMusic commented 3 years ago

AltStore is currently limited to showing one version by bundle ID, and the bundle ID of the IPA needs to match the json, or AltStore will throw an error.

Yep, functioning in jailed mode on iOS 13.5, 1.10.3 PPSSPP homebrew working

mariolopjr commented 3 years ago

@PixPMusic No problem, I was planning on altering the bundleId anyway (org.ppsspp.ppsspp-dev, org.ppsspp.ppsspp-dev-mvk, etc.).

And excellent! Really appreciate you testing this, helps me out haha! I should hopefully have MoltenVK and dev ipas on there soon.

PixPMusic commented 3 years ago

Oh, one more issue with your JSON. The version string needs to just be the numbers, no "v" as it's used for managing updates. Currently, the strings don't compare correctly and there's always an update available.

mariolopjr commented 3 years ago

@PixPMusic Pushed a new update to the function, hopefully fixes the version issue? You may need to re-install IPA if the version checking in borked due to string == numerical comparison breaking or something.

PixPMusic commented 3 years ago

Nah, it was all in the JSON comparing against installed version strings. Pushing the change to the JSON fixed it. The string comparison is happening in AltStore itself.

If you need access to testing tools, message me on Discord. PixelPerfect#0001

mariolopjr commented 3 years ago

Cool thx I'll send you a dm!

sizmos commented 3 years ago

The latest AltStore update seemed to add JIT for iOS 14.2+ I tried to see if it worked for the latest psppp version though no luck. Is there anything that has changed in more recent builds?

I can seem to get Dynarec (JIT) working on v1.9.3-80-g73bf6098e, though still with the mini map issue as per: https://github.com/hrydgard/ppsspp/issues/13451#issuecomment-702655862

PixPMusic commented 3 years ago

New JIT will require proper implementation to work with AltStore. Look to UTM and DolphiniOS for more.

On Nov 15, 2020, at 10:06 PM, sizmos notifications@github.com wrote:

 The latest AltStore update seemed to add JIT for iOS 14.2+ I tried to see if it worked for the latest psppp version though no luck. Is there anything that has changed in more recent builds?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

mariolopjr commented 3 years ago

It'll be interesting to distribute a JIT build in addition to other builds. I'll take a look at this. My (last) semester is wrapping up, so lots of exams and final reports. Once that's over my free time will open up. :-) Hope to get back to this early December.