New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New host platform: iOS/iPadOS #74
Comments
iOS is still a very closed and locked-down platform, so even though I am an iOS user and I totally understand the appeal, I'm not very enthusiastic about the idea of trying to port to it, it would probably be a pain and not useful to many people in practice. There's a bunch of practical hurdles right now… JIT might be possible via hacky setups, but I doubt dynarmic supports it, and I don't want to try to implement that myself. Then there would be some pain relating to getting OpenGL ES working, though that'll be solved when I eventually try to port this to Android, I guess. |
With that said, if the changes aren't too intrusive, I'm not going to stop someone if they want to try to port it and contribute the changes upstream. (Please don't fork the project though…) |
I thought you were saying to add support for emulating latest iOS apps, needs a title change. |
There is also stuff about iOS 17 having offical sideloading support. About arm64 jit, It requires swapping between w^x and r^x using a seperate thread to sync properly. You can look at how dolphiniOS and pojavlauncher does this. Currently helping (with info I don't develop apps but modify them usually) with getting citra to build on iOS which also uses dynarmic. From seeing their progress it's not fully done but seemed like person making emuthreeDS got jit portion working fast and is mostly just working on moltenvk stuff. This is great work btw and I bet other people will also try help out including maybe porting to iOS. |
Yeah I'm hoping the rumours of iOS opening up a bit, perhaps in response to EU pressure, are true. If that happens for real then of course I'll try to port to iOS. |
I am trying to do this right now, or at least to find out what the build issues are. Apologies for bumping an old issue but I would like to help if I can |
It's completely fine. Infact I'm still interested as it essentially would start restoring 32bit app support for games. From my experience building with Linux and hearing others on iOS development on other emulators. You will have a bit of struggle using sdl2. Sdl2 does say it supports iOS so maybe just needs a bit of a touch up idk. |
touchHLE tries to be platform-independent as much as possible. There's very little platform-specific code in touchHLE itself, and all the libraries used should work on multiple platforms. In theory, if you build it for iOS, the build should succeed with minimal tinkering. The problem is just that iOS is a very locked-down target:
Also, touchHLE requires OpenGL ES 1.1 support. That's deprecated on modern iOS, but is it removed? Are new apps allowed to link to it? |
I don't know what SDL2 is like on iOS, but using it on Android has been a huge pain in certain ways, so I might know what you mean. iOS is a bit more normal of an OS compared to Android though, so I'd expect less issues overall with SDL2. SDL2 has to do some horrible things to work on Android that aren't necessary on iOS, I think. |
Yes. This is true and there isn't much we can do about this. We can enable JIT for certain apps for a limited amount of time using AltJIT/SideJIT/DirtyJIT. I'm personally hoping JIT is officially allowed by Apple within the next few years but who knows.
I'm fairly certain OpenGL ES 1.1 is just fine. I was able to get 2.3 contexts thru
I was able to compile most of the dependencies immediately, except for some issues with Rust-SDL2. See Rust-SDL2/rust-sdl2#1331 . I also got some issues with the OpenAL, STB and Dynarmic wrappers. The STB wrapper issue was fixed by changing the minimum iOS version from 7(?!?!) to 16 but I can't figure out how to trick the compiler and CMake into doing this automatically. |
iOS has not been limited to 1gb of addressing space in a long time. You could get 4gb of address space using a 4g ram device. There is also entitlements for people that can get a lot more via paid developer accounts on lower end devices (10+ on a iPhone 8 Plus for example which is 3gb ram). Dolphinios is a port of dolphin for example as it uses 8gb of address space. There was that limit so some developer halfed the needed address space as a hacky fastmem (no longer needed since softmmu exists now) which allowed 4gb ram devices to run it without jailbreak or added entitlements that needs a paid developer account. Dynarmic has been ported to iOS a few times already via things like emuthreeds and other arm device based emulators. Even qemu has been ported via utm. |
The jit methods are enabled via debugger. Wasn't sure if you didn't know because of the libraries you mentioned like sidejit,altjit,dirtyjit. I am one of the people that helps develop sidestore (currently working on sidekit for auto debugging apps) and helped on jitstreamer. Have you though of doing the tricks you mention in a shell script. Have you tried lower minimum iOS version like 15 or 14? For dynarmic I might have to refer to somone for that but there is available info for it to work on iOS. You could join the discord us in sidestore hangout in to ask antique using dynarmic for emuthreeds. You can also directly contact me in sidestore discord with same name. |
The issue is that I don't know how to set the minimum iOS version. The fix for the STB wrapper issue I was talking about came from me copy-pasting one of the commands CMake gave me and changing it. I don't know how to actually apply it to everything, and when I did run the command, Cargo & CMake didn't use that compiled result.
Yeah. |
Did you manage to get around these issues? Also it's very likely you will need to modify those wrappers if you cannot get them working without touching them. |
Sadly, no. Help would be appreciated 😅 CMake is a mystery to me
Probably true. Not quite sure how to go about this. |
I should be able to get you some help in discord. Since your username has discord in name I'm guessing you might have one. Join our hangout server as we have some emulator devs for iOS that could help out. This link expires in 1 day. I go by the same name. https://discord.gg/m6SDtvrG |
I have a working proof of concept on my branch here https://github.com/ciciplusplus/touchHLE/tree/tmp-ios I tested with Super Monkey Ball and Wolf3d P.S. rough explanation of how i get it working https://x.com/ciciplusplus/status/1748732428116517263?s=20 |
Is there a reason you need paid developer account. It doesn't feel like such low end apps would use up more than what is needed for them to run with jit. Is this not related to extended virtual addressing? Also is there any special build instructions you need to build it? Also I'm sure you can get the app size smaller. I believe one time I saw somone built it and it had debug symbols with it. What idevice is it. It could be possible your device just has low ammount of unified memory. |
Yeah, make sure to build the Rust project with |
I'm not aware of any other way to install a custom app on non-jailbroken device.
There is a XCode project inside
Not my goal here. I need debug symbols anyway to debug crashes.
iPhone SE 1st gen, iOS 15.8 |
People usually use AltStore, SideStore (I work on this project with others), sideloady. Even then, Xcode can install apps without paid developer accounts. Just matters if you need certain entitlements. Extended virtual addressing is one of the entitlements that need paid developer accounts. Dynarmic on other iOS apps like limon which is a port of citra doesn't need it for example. |
so I managed to get a proper device as my last one has lots of troubles but seems to be fixed using a newer device to compile. so I am having an issue compiling your repo. essentially its missing a SDL2.Framework file and few other sdl files. trying to git recurse submodules as I notice dynarmic isn't getting pulled properly and doesn't seem to work anymore. any ideas? Edit: I found I needed to manually download the dependencies as it wasn't being installed. It now gets stuck at compiling via rust. fatal error: 'dynarmic/interface/A32/context.h' file not found It's probably messed up, I can't get the exact commits for the dependancies which is likely the problem but not sure completely. |
The original repo for dynarmic no longer exists. There is a fork that we are using now. You may need to check out the fork. |
Yeah I added that one in place since the latest touchHLE used it. I pretty much just did the default branch for all of them but did sdl2 branch for sdl. |
Seems like iOS can have emulators on AppStore now. It's possible that it could get on AppStore if it was using an interpreter also. Their review stuff does mention providing files so would need to be homebrew. Retro console emulation is kinda broad in a way and idk if Apple considers old iOS games as retro console? |
Having a commercial relationship with Apple could be troublesome for a project like this. I don't think touchHLE will ever be on the App Store. |
Would AltStore be an alternative? |
I could understand not wanting a relationship with Apple as the emulator emulates old iOS programs. I'm not sure exactly sure how it would be troublesome as they don't have any right to the touchHLE code unless I'm missing something here. As mentioned above, there is using third party app marketplaces (eu only) like altstore pal but you will have to find a way to get around core technology fee (paid fee or like ads for getting around it). There's using sideloading stores like altstore global and SideStore's stores (connect is in beta rn) or just provide an ipa and people can deal with it themselves. If it was planned to go any route, I would atleast try AppStore/testflight and if not being accepted for being an iOS 4 emulator or not a console emulator then go to any suggested stuff above. |
The EU version of AltStore is not really an alternative, for the same reason. That also requires me to have a commercial relationship with Apple due to the notarisation process. |
It’s not necessary to throw them into stores, just make a build with it. you can install sherry certificates install for 7 days |
If the fear of confronting Apple is a concern. |
It would be ideal and make sense to have a port for apple devices. iOS doesn't support 32bit apps and some apps that were great back then just no longer able to be ran. Games I wanted to play like minibash (toribash mobile) and geodefence no longer possible. You can sideload apps via things like AltStore and sidestore to install ipa's. If needed you can allow jit ability using a debugger which both these programs can use. There is automatic activation for those too called altkit and sidekit. It is early on project just wanted to mention, Has it been attempted to build this rust program to "aarch64-apple-ios"?
The text was updated successfully, but these errors were encountered: