UPDATE:
https://github.com/dolphin-emu/dolphin/pull/3881
Opening a pull request is a big step in getting official support for iOS. It's currently undergoing code review, so please be patient. (The original OP is below if you want to look at it.)
https://github.com/dolphin-emu/dolphin/pull/3881
Opening a pull request is a big step in getting official support for iOS. It's currently undergoing code review, so please be patient. (The original OP is below if you want to look at it.)
Spoiler:
Well, I spent the last few days attempting an iOS port of the Android version of Dolphin. I never even expected to get as far as it almost running, but I did. Unfortunately, I just don't have the knowledge or Google-fu to figure out what I should do to fix up MemArena.cpp (shm_open is pretty much unusable on iOS 7+ as it just errors out saying "operation not permitted" no matter what you do... people on the iOS dev forum say that IPC was probably crippled to tighten the sandbox)
If anybody's interested, I've put up what I have on GitHub under the 'ios' branch. Just a couple things first though:
1. The main CMakeLists.txt file is a mess, and the preprocessor macro definitions too. There's lots of #if defined(ANDROID) && !TARGET_OS_IPHONE. Looking back, I think I shouldn't have just said add_definitions(-DANDROID), and just added "|| defined(IOS)" on what I needed. There's also some inconsistency when I check for an iOS build since I use IOS in some files and TARGET_OS_IPHONE in other files.
2. On some files, the indentation is slightly off. However, when you open the files in Xcode, they look perfectly aligned! I'm not entirely sure what happened there.
3. And finally, how to build, since README.md isn't up to date yet. I'm assuming you know how to clone the git repo and switch to the proper branch, so let's just get into the good stuff. You will need an OS X 10.9+ machine with Xcode installed. (And yes, it can be a virtual machine. In fact, I've been using one all this time!)
Then, copy all the .a files into the Source/iOS/Dolphin-iOS/DolphiniOS/libraries directory, and all the .h files into the Source/iOS/Dolphin-iOS/DolphiniOS/libraries/include directory. I used some rsync commands to automate this but I can't seem to find them in my bash_history file for some reason.
To run the application, you will need your developer signing identity. (no, you can't run the application in the iOS Simulator. Besides, the toolchain doesn't build for x86_64 and even if it did, you would be using the regular Jit64 core, not JitArm! Where's the fun in that? ) To get a signing identity, you will need to pay the $99/year to be a member of the iOS Developer Program. However, there are ways to force Xcode to run the app on a jailbroken device with AppSync Unified installed, without a signing identity. Remember, Google is your friend.
Once you have that sorted out, open up the .xcodeproj file with Xcode and plug in your 64-bit iOS device. (Yeah, sorry, I set the toolchain to only build for arm64.) Once it's copied all the necessary things to run your app, make sure that the destination is set to your device. Next, click the big play button in the upper left and the application will be built, sent to your device, and automatically start up. And yes, it does hang on the splash screen for a variable amount of time. I'm not sure what's up with that either. Tapping the "RUN DOLPHIN" button will attempt to start Dolphin and run starfield.dol.
Now after all that information, here's the link to the git repo. If you want to submit some enhancements or fixes, feel free to open up a pull request. Have fun!
If anybody's interested, I've put up what I have on GitHub under the 'ios' branch. Just a couple things first though:
1. The main CMakeLists.txt file is a mess, and the preprocessor macro definitions too. There's lots of #if defined(ANDROID) && !TARGET_OS_IPHONE. Looking back, I think I shouldn't have just said add_definitions(-DANDROID), and just added "|| defined(IOS)" on what I needed. There's also some inconsistency when I check for an iOS build since I use IOS in some files and TARGET_OS_IPHONE in other files.
2. On some files, the indentation is slightly off. However, when you open the files in Xcode, they look perfectly aligned! I'm not entirely sure what happened there.
3. And finally, how to build, since README.md isn't up to date yet. I'm assuming you know how to clone the git repo and switch to the proper branch, so let's just get into the good stuff. You will need an OS X 10.9+ machine with Xcode installed. (And yes, it can be a virtual machine. In fact, I've been using one all this time!)
Code:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # install brew
brew doctor # prepare brew to install things
brew install cmake # install cmake
mkdir Build # run this in the dolphin directory
cd Build
cmake -DCMAKE_TOOLCHAIN_FILE=../Source/iOS/ios.toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DDISABLE_WX=true -DENABLE_PCH=false .. # build!
Then, copy all the .a files into the Source/iOS/Dolphin-iOS/DolphiniOS/libraries directory, and all the .h files into the Source/iOS/Dolphin-iOS/DolphiniOS/libraries/include directory. I used some rsync commands to automate this but I can't seem to find them in my bash_history file for some reason.
To run the application, you will need your developer signing identity. (no, you can't run the application in the iOS Simulator. Besides, the toolchain doesn't build for x86_64 and even if it did, you would be using the regular Jit64 core, not JitArm! Where's the fun in that? ) To get a signing identity, you will need to pay the $99/year to be a member of the iOS Developer Program. However, there are ways to force Xcode to run the app on a jailbroken device with AppSync Unified installed, without a signing identity. Remember, Google is your friend.
Once you have that sorted out, open up the .xcodeproj file with Xcode and plug in your 64-bit iOS device. (Yeah, sorry, I set the toolchain to only build for arm64.) Once it's copied all the necessary things to run your app, make sure that the destination is set to your device. Next, click the big play button in the upper left and the application will be built, sent to your device, and automatically start up. And yes, it does hang on the splash screen for a variable amount of time. I'm not sure what's up with that either. Tapping the "RUN DOLPHIN" button will attempt to start Dolphin and run starfield.dol.
Now after all that information, here's the link to the git repo. If you want to submit some enhancements or fixes, feel free to open up a pull request. Have fun!