Skip to content

Conversation

@dantheman213
Copy link

Howdy!

I worked on and completed a way for vanilla iOS devices to easily transfer roms and game saves between the device and a computer over local WiFi.

I integrated another popular GitHub project here:
https://github.com/swisspol/GCDWebServer

I included the project under the ios/ section and added integration through the ViewController code. I had to modify the xcode project file by adding frameworks and new file references. This is why I removed the build-ios/ out of the .gitignore.

I had to add some changes to the core files in order to integrate an option inside the app's GUI in the Settings > Tools section. I added #if defined(IOS) preprocessor directives to make sure the code is only included for the iOS target build.

You can activate the feature by running the app on your iOS device.

  • Run the app
  • Navigate to Settings > Tools
  • Select option "Import/Export Roms and Game Saves"

If not connected to WiFi will get message to connect to WiFi. (had to include Apple's reachability code to detect WiFi connection state)

If connected to WiFi you will see your device's IP and can connect to a website where you can upload/download game saves and ROMs easily. You can upload large 2GB files even straight through the web app. The web server is turned off and released to memory after closing (touching the Back button) the Import/Export dialog.

There are a lot of extraneaous files and build-ios/ should definiltely be added back to the gitignore but I wanted to allow the project owner to properly merge the changes from the xcode project to the b.sh script and the way it generates everything.

The markdown file was edited just for my fork, you should modify that in your merge as well.

Please let me know if there's anything else I need to do to further tighten up my code.

Building this for my non-jailbroken iOS device in release schema allowed for near perfect PSP emulation and easy transfer of PSP games without any fuss given iOS' locked down nature.
img_1287
img_1288
screen shot 2015-07-27 at 1 57 58 pm

Dan Gillespie added 11 commits July 26, 2015 16:30
…d roms. started by creating a new window in Settings Tools section for starting the web server. Its called Import Export ROMs and Game Saves.
… within the cross platform code. also need to work on GUI window for explaining where to connect. server needs to be stopped once leaving the import export window.
…ng. now need to fully integrate with UI and provide help in app website for basic how to. also need ability to turn off and release
…ct and alterations that are different from what the b.sh generated. Will want to remove and modify build script at later point
…elp almost complete. just need to stop server when leaving dialog
… is turned off. will test tomorrow and if all is well submit a pull request with main repo.
@hrydgard
Copy link
Owner

That's pretty cool! Would have been even nicer of course if the webserver was a crossplatform one - there's not really any reason for this to be iOS-only except that perhaps that webserver is a nice one.

Also not really a big fan of sending custom commands through LaunchBrowser, could easily have just added an new function instead.

By the way, seems like you've checked in a bunch of unnecessary binary files like build-ios/PPSSPP.build/Release-iphoneos/Common.build/dgph etc.

Hm....

@dantheman213
Copy link
Author

I chose this web server because it's a great iOS service for quickly getting data onto the device. I also chose that project because iOS is the only platform that is so locked down where it would be necessary to use a web server to transfer data to and from the device. On the computer or on Android, you have open access to the disk drive and can already easily move data in place for PPSSPP.

As for the web server only being targeted for iOS, because the sources live in ios/ and because I used #if preprocess directives it shouldn't affect the builds on any other platform.

As for LaunchBrowser, I actually removed any custom command through it and I created a new function called WebServiceControl. I think you may not be looking at the latest commit in the pull request?

As for checking in all the unnecessary files.. I wasn't sure how your custom build script was creating the xcode project but since I made changes to the xcode project I just checked in everything. I was hoping you would be able to take away the meaningful pieces of the xcode project files and integrate it into your custom build script when merging in the request.

What do you think?

@hrydgard
Copy link
Owner

I see your point about this being a lot more necessary on iOS than on other platforms.

Sorry about the LaunchBrowser comment, I was indeed not looking at the latest commit.

But there's definitely way too much stuff checked in here. As the Xcode project is generated using CMake, you will indeed need to make your necessary changes in the CMake files, you can't just check in changes you made to the generated project. If you can get that done, thus getting rid of all the extra file copies, I'm open to merging this.

@dantheman213
Copy link
Author

Great! Yeah, I can go ahead and do the clean up. So I added file references and target frameworks to the xcode project. As I'm not familiar with how CMake is generating the xcode project, any suggestion on how to proceed with implementing the changes in the build script? Thanks!

@unknownbrackets
Copy link
Collaborator

A few comments (can't really look at the full diff because you added too many generated files for GitHub to show it properly):

  1. Are you aware of the feature that allows you to run (and not yet, but potentially stream and download) games from an HTTP server running on your PC? This is already cross platform (for sure works on Mac, Windows, Android, and iirc Linux) and should work on iOS (but I'm not aware of any testing.) Note that you can begin playing before the download completes.

  2. The changes to the README don't seem appropriate for the pull request. If we merged it, it would update the front-page README with exactly that text. Similarly, the changes to .gitignore etc. aren't necessary.

  3. Some of the indentation in C/C++ files is done using spaces. Please use tabs and stay consistent with the file.

  4. If possible, it would be appreciated if you rebased your changes without adding the generated files, rather than adding another commit to remove them. If you include them and later remove them, they can affect other developers who have working trees, especially while bisecting. Those generated files will also always be included in the git history and unnecessarily bloat the .git folder size for all developers from now until forever.

  5. As for updating CMakeLists.txt, I'm not an iOS developer by any stretch, so I'm not sure. However, note the following:

    https://github.com/hrydgard/ppsspp/blob/master/CMakeLists.txt#L523
    https://github.com/hrydgard/ppsspp/blob/master/CMakeLists.txt#L774

    I think that's how you add frameworks. The latter place looks likely to be the appropriate place to add them. If extra files are required in packaging (such as .js assets, etc.), those would be added here I believe:

    https://github.com/hrydgard/ppsspp/blob/master/CMakeLists.txt#L1682

-[Unknown]

@dantheman213
Copy link
Author

Unknown,

  1. I didn't see any feature like that in the GUI when I ran the premade bin on OSX or compiled it myself and ran on my iOS device. Can you point me to that specific feature?
  2. The README markdown update was just for my own repo's view so for anyone coming to my fork will see what the fork contains. That should not be included in the merge of the pull.
  3. My IDE was configured to convert tabs into spaces. Sorry about that I'll make the alterations where I see them.
  4. I'll go ahead and do that. I'm not experienced with manipulating or generating XCode projects with CMake and that's why I decided to change the gitignore and add the build-ios/ directory contains my project specific updates in order to capture the changes required to build the project now for iOS.
  5. I'll look into pruning the files and making the change to CMake. Reading up on it now. Thanks for the references.

I'll be working on changes and will update this request when I've made them.

@unknownbrackets
Copy link
Collaborator

  1. It doesn't have any GUI yet. I don't know what the easiest way to trigger it on iOS would be - on other platforms you can either launch a URL via command line arguments (starting with http://) or modify the ini file to add a URL to the recent files list.

    It plays videos smoothly on my Nexus 5 and does preloading and caching, but we're still working out some details on disk caching (which is disabled right now, so it only uses memory caching.) UI hasn't been implemented yet.

    I suppose you can also hard code the path to the game as an argument to see it working.

    We were discussing running a web server from Tools on the desktop device, which would then be accessible from a mobile device. I was also thinking of perhaps using a discovery service on report.ppsspp.org to perform the handshake and avoid having to type the private IP addresses manually anywhere (not as a proxy, just to match up two clients by having the same public ip.)

    It works with any webserver, though (nginx, httpd, etc.) The only requirement is that it supports HTTP range requests.

  2. The commits in this pull request are what will be merged if the code is merged. A common tactic is to create a separate branch, and make commits there which you are requesting be merged. These would omit any README updates specific to forks.

-[Unknown]

@dantheman213
Copy link
Author

Thanks for the information. Will keep that in mind. If this feature is nearing completion then it sounds like this would be better than having a stand alone version of a web server just for iOS. I just want to make sure it facilitates the easy transfer of ROMs and game saves from devices that are locked down like iOS devices are.

If that's the case I'm happy to help integrate a GUI option for your web server option.

@dantheman213
Copy link
Author

I'm closing this pull request as I have revised the code base and submitted a new pull request here:
#7885

Please let me know if you have any questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants