• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
« Previous 1 ... 14 15 16 17 18 ... 116 Next »

Dolphin on iOS
View New Posts | View Today's Posts

Pages (14): 1 2 3 4 5 ... 14 Next »
Jump to page 
Thread Closed 
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Dolphin on iOS
03-20-2015, 08:12 AM (This post was last modified: 06-06-2016, 09:40 AM by OatmealDome.)
#1
OatmealDome Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 292
Threads: 2
Joined: Mar 2015
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.)

Spoiler: (Show 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!)
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? Tongue ) 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!
Find
03-20-2015, 09:05 AM
#2
Sonicadvance1 Offline
Professional Hand Holder
**********
Developers (Some Administrators and Super Moderators)
Posts: 716
Threads: 15
Joined: Jan 2013
Nifty.
Someone could definitely use that as a reference to do it completely.
Find
03-20-2015, 10:23 PM (This post was last modified: 03-20-2015, 10:23 PM by Fiora.)
#3
Fiora Offline
x86 JIT Princess
**********
Developers (Some Administrators and Super Moderators)
Posts: 237
Threads: 0
Joined: Aug 2014
Maybe look at how other iOS-compatible emulators like PPSSPP handle memory? Does PPSSPP have a fastmem-equivalent?
Website Find
03-21-2015, 12:37 AM
#4
KHg8m3r Offline
Doesn't sleep, just Dolphin and Robots
*******
Posts: 5,920
Threads: 4
Joined: Sep 2013
Yeah, PPSSPP has a fast memory setting, but its unstable.
Good job OatmealDome! What else can it run besides the starfield.dol?
Find
03-21-2015, 02:07 AM
#5
OatmealDome Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 292
Threads: 2
Joined: Mar 2015
(03-21-2015, 12:37 AM)KHg8m3r Wrote: Yeah, PPSSPP has a fast memory setting, but its unstable.
Good job OatmealDome! What else can it run besides the starfield.dol?

Well, it doesn't even run starfield.dol Tongue It just crashes when it tries to setup memory because of the broken shm_open...

Also, I did some further tests and apparently non-sandboxed applications (those that live in /Applications, not /var/mobile/Containers/Bundles/) can use shm_open just fine! However, this does restrict Dolphin to only running on jailbroken devices (you can't just sign the application and run on a regular device as it would still be sandboxed).

It's also more time consuming trying to run Dolphin now since you have to find and copy the Application bundle within the mess of UUIDs in /var/mobile/Containers/Bundles (though this is made easier using 'find . -name 'DolphiniOS'), then run uicache to refresh the home screen. To run a new copy of Dolphin, you would have to delete the bundle from /Applications, kill SpringBoard, then you can install the application again with Xcode. Those steps could probably be automated with scripts, and the regular user shouldn't have to do that at all with a .deb package that they can just install through Cydia.

Anyway, i'll just keep trying to run Dolphin and I will also report back if I get stuck again or it if actually works.
Find
03-21-2015, 06:23 AM (This post was last modified: 03-21-2015, 06:24 AM by Fiora.)
#6
Fiora Offline
x86 JIT Princess
**********
Developers (Some Administrators and Super Moderators)
Posts: 237
Threads: 0
Joined: Aug 2014
Running Dolphin on a non-jailbroken device is pretty much impossible isn't it? I thought (non-jailbroken) iOS stopped you from using RWX memory, which the JIT requires. Or am I mistaken?
Website Find
03-21-2015, 07:20 AM
#7
OatmealDome Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 292
Threads: 2
Joined: Mar 2015
Yeah, I think you're right. It looks like that the jailbreak patches the kernel in two places to prevent it from checking for and removing the execute bit: vm_map_enter, vm_map_protect.
Find
03-21-2015, 08:03 AM
#8
KHg8m3r Offline
Doesn't sleep, just Dolphin and Robots
*******
Posts: 5,920
Threads: 4
Joined: Sep 2013
Yes, you need the jailbreak to run JIT code.
Oatmeal, look into how PPSSPP has their app installed. They package theirs as a .deb, which allows easier installation by using Cydia (even without it being on a repo, you can install by putting it in Cydia's autoinstall folder)
Find
03-21-2015, 03:06 PM
#9
OatmealDome Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 292
Threads: 2
Joined: Mar 2015
@khg8m3r
Yeah, I'll look into having Xcode build a deb file for me to make it easier.

Progress Update:
Almost there, but it crashes when the cpu thread attempts to execute the first bit of compiledcode with exc_bad_access... I really don't know what to do from here. Is iOS blocking it from running the code..? Also, MemArena fails most of the time trying to find a base. (Does it really need to find 16GB? I set it to only find 1GB like the 32 bit code does, and even then it still fails most of the time. The memory is freed like moments after, too)

Anyways, I'll update the git branch tomorrow with the latest code.
Find
03-21-2015, 03:59 PM
#10
magumagu Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 42
Threads: 1
Joined: May 2014
Yes, it actually wants 16GB. The fact that we free it immediately is a bug. Note that it isn't actually allocating that much memory, just trying to reserve address space for fastmem. This hasn't been a problem on desktop OSes or Android; not sure why iOS doesn't like it.

If reserving the address space is really impossible on iOS, we'll need to modify the JIT to compensate for a different memory layout. Not impossible, but there would be a substantial performance penalty.
Find
« Next Oldest | Next Newest »
Pages (14): 1 2 3 4 5 ... 14 Next »
Jump to page 
Thread Closed 


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode