Skip to content
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

Android hacks #240

Closed
wants to merge 4 commits into from
Closed

Android hacks #240

wants to merge 4 commits into from

Conversation

AJenbo
Copy link
Member

@AJenbo AJenbo commented Sep 3, 2019

This adds some hacks to #267, there are still a few things that need to be sorted out before this is even remotely ready to be merged.

  • Rebase on Nintendo Switch #181 since it reuses the game controller code from that branch
  • Drop music hacks, the issue appears to be a bug in the modified SDL2_mixer
  • Take letterbox into account when scaling the touch events
  • Use constants for internal game resolutions instead of hardcoding it
  • Resolve merge conflicts
  • Remove commented-code and spamy logging
  • Make sure the input changes don't break other platforms
  • Render the UI elements on the windows surface instead of the game surface (so we can render on the letterbox)
  • Fix stretched UI elements
  • Start the input system from UiInitialize (or some other appropriate place) instead of inside the DirectDraw wrapper.
  • Don't hardcode the device resolution in touch/touch.cpp or other places.
  • Stop creating /sdcard/devilutionx/ so that extra file permissions aren't required

@licaon-kter
Copy link
Contributor

licaon-kter commented Sep 3, 2019

Can you move the data folder from /sdcard/Android/data/org.diasurgical.devilutionx/ to /sdcard/devilutionx/ ?

/sdcard/Android/data/org.diasurgical.devilutionx/ will get deleted when you uninstall the game, deleting the MPQ and saves :(

/LE: Any chance to start/quit the game directly instead of showing a "launch SDL" on start or on exit?

@AJenbo
Copy link
Member Author

AJenbo commented Sep 3, 2019

1 that's pretty much the point, just like with other apps. Doing doing it differently would require extra permissions

2 that's the plan, shouldn't be a problem

@licaon-kter
Copy link
Contributor

1 that's pretty much the point, just like with other apps. Doing doing it differently would require extra permissions

The app already asks for Storage and creates /sdcard/devilutionx/ right?

(I've got an APK yesterday from a wip-devilutionxandroid repo that I can't find right now, not sure if the same applies)

@AJenbo
Copy link
Member Author

AJenbo commented Sep 3, 2019

That's one of the bugs that has to be fixed before it's ready to be merged.

That repo as been deleted as it was a huge mess, it was a proof of concept and shouldn't have been published in the way it was since there where several issues with it, this branch is the first step twords a propper solution.

@licaon-kter
Copy link
Contributor

licaon-kter commented Sep 3, 2019

That APK works, in my limited testing at least, do try to push test APK asap so we can find the bugs. ;)

@licaon-kter
Copy link
Contributor

licaon-kter commented Sep 3, 2019

The build setup can be found here: diasurgical/devilutionX-android

That fails for me, gradle assembleRelease with several: SDL ...hid.cpp undeclared identifier nullptr

How do you build exactly? Any specific NDK is used?

@AJenbo
Copy link
Member Author

AJenbo commented Sep 3, 2019

The hacks added here breaks the game for all other platforms.

There are also obvious issues for the Android platform (see list above), some content is missing and it dosent work on all devices, so at this stage there isn't much point in releasing test builds, of course your welcome to build it your self and if you can help to correct some of the issues that woulf be especially helpful.

Once #179 has been merged we will likely set up a build server where we can fetch daily builds from. #179 is generally in a better state and should work on all devices, but doesn't contain the virtual game controller, but that will come gradually as things are cleaned up.

@AJenbo
Copy link
Member Author

AJenbo commented Sep 3, 2019

@licaon-kter the devoper that build this branch has left the project so it comes with no support or guarantees. Please see #179 instead if you want something that better reflect the current android efforts.

@licaon-kter
Copy link
Contributor

@AJenbo This repo APKs I've tested: https://github.com/Jimmy-cell/wip-devilutiondroid/releases

Is the user known to this team?

@AJenbo
Copy link
Member Author

AJenbo commented Sep 3, 2019

Yeah it's basically the same as this branch, he might help out with cleaning some of this.
But you should really join our chat to discuss all of this.

@AJenbo AJenbo mentioned this pull request Sep 3, 2019
@AJenbo AJenbo changed the title Android port Android hacks Sep 23, 2019
@glebm
Copy link
Collaborator

glebm commented Oct 10, 2019

UBSAN showed that we have several unaligned memory accesses in the Source/ codebase. Unaligned accesses don't work on ARMv5 (ARMv7 is OK for most instructions, though not atomic) -- fixing these is another blocker for Android support. https://medium.com/@iLevex/the-curious-case-of-unaligned-access-on-arm-5dd0ebe24965

@AJenbo AJenbo closed this Dec 29, 2019
@AJenbo
Copy link
Member Author

AJenbo commented Dec 29, 2019

This is now replaced by the rebase code by @Jimmy-cell #522

@AJenbo AJenbo deleted the android_port branch December 29, 2019 01:10
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.

6 participants