Commit Graph

1070 Commits

Author SHA1 Message Date
zackhow 51fa5d2fd8 Android: Clear controller binding by long press on TV
The TV interface can't 'click' the clear button, this gives TV a way to clear
2018-08-11 21:47:49 -04:00
zackhow 75f4e74e94 Android: Add default touch button overlay
This sets up default positions for touch buttons so they are not just bunched in the corner on a fresh install. Also added a toast when emulation starts on how to edit button layout
2018-08-11 12:56:23 -04:00
Markus Wick 74057ec222
Merge pull request #7303 from zackhow/exitemumenu
Android:  Add exit to phone emu menu
2018-08-09 10:19:25 +02:00
Markus Wick bfbf9ed2ee
Merge pull request #7292 from mahdihijazi/settings_refactor
Android: Settings refactor & Fix custom game settings
2018-08-09 10:17:03 +02:00
zackhow 58aa6b9905 Android: Add exit to phone emu menu
Some phones that have capacitive nav bar buttons disable those buttons while in emulation. This gives those devices a way to exit
2018-08-06 22:26:58 -04:00
mahdihijazi f41785e1b9 Android: Reflect the settings that is being used by the emulator on the UI
Per-Game settings now load the settings in this order
1. Emulator Settings
2. Default Settings of the Game that we ship with Dolphin
3. Custom game settings the user have

where the later always overides the former in case of collision, then
we show that on the UI to make it clear to the user which settings being
used.
2018-08-05 01:33:30 +02:00
zackhow ec5e46fa7a Android: Return 0 on fail on WiimoteReal IOWrite and update WiimoteNew defaults
Some of the write checks do an & on the result, returning 0 will allow these fails to be caught.
Updated the default WiimoteNew to set wiimotes 2-4 to be disabled on new install. No reason to have these
enabled unless there is actually a 2+ players
2018-08-03 19:46:26 -04:00
mahdihijazi ed1c91b4f6 Android: Fix custom game settings
Apparently there was a different section names used by the custom game
settings that caused Android to have those settings broken for
some sections like the graphics one. This adds the map between the generic
settings <> custom settings.
2018-08-03 22:45:52 +02:00
mahdihijazi c664bb7458 Android: Refactor the settings managemnt
1. Create Settings class the encaupslate the loading/saving of all settings
2. Decouple the logic of saving the settings into 3 different config files
from the UI code.
2018-08-03 21:45:39 +02:00
mahdihijazi 61835a7e08 Android: Start structure the project around features instead of data types
This only moves the settings feature, the rest will be moved slowely later
2018-08-03 21:41:34 +02:00
zackhow be02a8e70b Android: Fix wiimote settings saving.
Index was off by one, so if you enabled Emulated Controller for
wiimote1, it would set the 'Source = 1' for wiimote0.
2018-07-30 19:50:45 -04:00
zackhow 38c8d970f2 Android: Fix emulated wiimotes via controller
A little background: Android has 8 controller setup, 4 gamecube pads and 4 wiimote pads. When the static GCPadNew.ini and wiimotenew.ini is created, pads 0-3 are gc 1-4, and 4-7 are wii 1-4. Problem was the settings set wii controllers as pads 1-4, instead of 4-7. So any setting for wiimote1, was set for gc2(padID 1). Which is why the only wiimote to work was 4, since it mapped to padID 4, which is actually wiimote1.
2018-07-29 21:24:28 -04:00
Markus Wick be9437450e
Merge pull request #7234 from zackhow/master
Android: Support for AndroidTV Oreo Homescreen channels
2018-07-22 15:02:49 +02:00
zackhow 0488fe1d30 Android: Support for AndroidTV Oreo Homescreen channels 2018-07-20 17:56:45 -04:00
JosJuice 7f6be99ad9 Android: Make ControllerMappingHelper methods static
This class has no state.
2018-07-11 14:00:57 +02:00
JosJuice 78cb1c2914 Android: Remove controller-specific code that isn't needed anymore 2018-07-11 14:00:37 +02:00
JosJuice d32c297c0d Android controller mapping: Ignore axes with constant values
Some controllers have axes that are stuck to values like 0.5 or 1.
Starting with PR #6123, when you press a control to map, Dolphin will
immediately think that such an axis is the axis that you want to map.
This commit fixes that issue (https://bugs.dolphin-emu.org/issues/10909)
2018-07-11 13:59:22 +02:00
Markus Wick d819df1d08
Merge pull request #7186 from gwicks/androidTouchJoystickRelCenter
Android: Make touch joystick re-centering configurable
2018-07-11 08:41:06 +02:00
Markus Wick fd83937987
Merge pull request #6338 from mahdihijazi/settings_enhancements
Update Android UI Settings to have the most common used settings
2018-07-04 21:50:09 +02:00
Markus Wick 0cf205f947
Merge pull request #7211 from mahdihijazi/upgrade_targetsdk
Android: Upgrade targetSDK to 27 and androidSupportVersion to 7.1.1
2018-07-04 21:45:13 +02:00
mahdihijazi e8ad6e4d49 Upgrade targetSDK to 27 and androidSupportVersion to 7.1.1 2018-07-02 16:40:16 +02:00
mahdihijazi 03fd8ddce6 Disable automatic backup
Since we don't have proper confuguration file of what to include/exclude
in the backup, this better be disabled because it will lead to unexpected
state. This will solve any issue that was keep hapenning even after fresh
install of the emulator until you manually clear the app data.
2018-07-02 16:24:57 +02:00
mahdihijazi 77e51ab527 Android: Make the header focusable
otherwise the settings list scrolling is not working properly
on Android Oreo(Tv)
2018-07-01 22:25:14 +02:00
mahdihijazi a639fa9a81 Android: Expose arbitrary mipmap detection toggle in UI 2018-07-01 22:25:14 +02:00
mahdihijazi e7d295894a Android: Support GameCube System Language 2018-07-01 22:25:14 +02:00
mahdihijazi d5a048a2ba Android: Create didcated sections for GameCube & Wii
This align the Android UI with the desktop UI
2018-07-01 22:25:14 +02:00
mahdihijazi 5010dfde7e Android: Support WideScreen Hack 2018-07-01 22:25:13 +02:00
mahdihijazi 84229c0c05 Android: Support SpeedLimit config option 2018-07-01 22:25:13 +02:00
mahdihijazi b924445e48 Android: Support Post Processing Shaders 2018-07-01 22:25:13 +02:00
mahdihijazi b4bb213ffd Android: Add Force 24-Bit Color enhancement option 2018-07-01 22:25:12 +02:00
mahdihijazi ef23d97063 Android: Refine the Graphics Settings Screen
1. Add General Section
2. Move the Aspect Ration Settings from the Enhancmenets Section to
the General section to match the desktop GUI.
2018-07-01 22:25:12 +02:00
mahdihijazi e0e9b43559 Android: Rename main settings buttons to match the desktop version
- Video Settings to Graphics Settings
- CPU Settings to Config
2018-07-01 22:25:12 +02:00
mahdihijazi 9316537964 Android: Change the incremental value of the slider to be 5% instead of 20% 2018-07-01 22:25:12 +02:00
mahdihijazi 87534f1b2f RfC: Refactor the settings for Android to use dedicated tags
Before we used different way of identifying which settings menu to
show, someotimes we used the section name, other times we used the
settings file name. This one replaces all those different ways by just
one way based on a menu tag which is more clear and easy to follow.
2018-07-01 22:25:05 +02:00
Greg Wicks 82ec3c929c Android: Make touch joystick re centering configurable 2018-06-29 16:09:59 -04:00
JosJuice 1073aa4602
Merge pull request #7181 from Ebola16/R
Android: Properly set default Internal Resolution
2018-06-29 09:40:09 +02:00
Ryan Meredith cdbc61dd0e Android: Properly set default Internal Resolution 2018-06-28 22:14:53 -04:00
JosJuice d1a82182ac Android: Use case insensitive sorting in game list 2018-06-18 19:11:58 +02:00
Léo Lam bd85d63c62
Merge pull request #7120 from Ebola16/313
Update Android Gradle to 3.1.3 and minor improvements
2018-06-15 19:54:49 +02:00
Lioncash 6f473b96d0 PowerPC: Convert CPUCore enum into an enum class
Makes the enum values strongly-typed and prevents the identifiers from
polluting the PowerPC namespace. This also cleans up the parameters of
some functions where we were accepting an ambiguous int type and
expecting the correct values to be passed in.

Now those parameters accept a PowerPC::CPUCore type only, making it
immediately obvious which values should be passed in. It also turns out
we were storing these core types into other structures as plain ints,
which have also been corrected.

As this type is used directly with the configuration code, we need to
provide our own overloaded insertion (<<) and extraction (>>) operators
in order to make it compatible with it. These are fairly trivial to
implement, so there's no issue here.

A minor adjustment to TryParse() was required, as our generic function
was doing the following:

N tmp = 0;

which is problematic, as custom types may not be able to have that
assignment performed (e.g. strongly-typed enums), so we change this to:

N tmp;

which is sufficient, as the value is attempted to be initialized
immediately under that statement.
2018-06-15 10:27:59 -04:00
Ryan Meredith 31b3647d73 Android: Add Emulated CPU Clock description and minor cleanup 2018-06-14 23:15:39 -04:00
Ryan Meredith fb3ae94acb Android: Add AlertDialog for files without Game IDs in Game Settings 2018-06-09 11:30:20 -04:00
Ryan Meredith 569454c961 Update Android Gradle to 3.1.3 2018-06-07 22:15:11 -04:00
JosJuice f0f8ca2172 Android: Don't allow INI editing for DOL/ELF files 2018-06-06 17:34:08 +02:00
JosJuice 1c027bc148 Use UICommon's game list code on Android
Deduplicates code, and gets rid of some problems the old code had
(such as: bad performance when calling native functions, only one
disc showing up for multi-disc games, Wii banners being low-res,
unnecessarily much effort being needed for adding more metadata).
2018-06-06 17:34:07 +02:00
JosJuice daee5a4b43 Android: Store folders to scan in SharedPreferences instead of SQLite
Needed in order for the next commit to get rid of the SQLite database.
2018-06-04 22:12:25 +02:00
Léo Lam 34511b397e
Merge pull request #7067 from Ebola16/ASU3
Update Android Gradle Plugin
2018-06-04 19:37:33 +02:00
Ryan Meredith dad9c87d8c Update Android Gradle Plugin 2018-06-04 13:22:37 -04:00
Léo Lam 86368fcd4d
Merge pull request #6499 from Ebola16/SettingsGroup
Android: Initial implementation of Interface submenu
2018-06-03 12:02:56 +02:00
JosJuice 2062768bb2 Don't include the Themes directory in Android APKs
We already exclude the Resources folder. Let's do the same with Themes.
2018-06-03 11:11:24 +02:00
JosJuice 1b127bdf33 Android: Refresh all fragments, not just the selected one
This fixes the oddity of having to manually refresh after adding a
folder that contains games for a different tab than the one you're on.
2018-06-01 18:17:51 +02:00
Ryan Meredith 4e010912cd Android: Consistently use description 2018-06-01 09:58:34 -04:00
Lioncash 4288bfe0f9 Common: Move host communication enum to Host.h
Given this is actually a part of the Host interface, this should be
placed with it.

While we're at it, turn it into an enum class so that we don't dump its
contained values into the surrounding scope. We can also make
Host_Message take the enum type itself directly instead of taking a
general int value.

After this, it'll be trivial to divide out the rest of Common.h and
remove the header from the repository entirely
2018-05-28 14:34:59 -04:00
JosJuice cc42b4354d Reimplement custom PNG banners in game list
Fixes https://bugs.dolphin-emu.org/issues/10938
and makes PNG banners available in DolphinQt2 for the first time.
2018-05-20 15:34:03 +02:00
Ryan Meredith c448fceb26 Rename strings to specify INI vs submenus 2018-05-03 16:09:46 -04:00
Ryan Meredith 532493bed5 Android: Update Stereoscopy submenu string names 2018-05-03 16:09:45 -04:00
Ryan Meredith 4c40871fff Android: Add missing Show FPS description 2018-05-03 16:05:22 -04:00
Ryan Meredith c2355d4f63 Android Interface submenu: Add Show OSD Messages 2018-05-03 16:05:22 -04:00
Ryan Meredith 25179258b7 Android: Initial implementation of Interface submenu 2018-05-03 16:05:22 -04:00
Distro Lucas dbeec37b0f Fixed aspect ratio bigger than 16:9 on Android Devices 2018-05-02 22:21:28 -03:00
Stenzek ea4090d92c Dolphin: Add disable copy filter to graphics options 2018-04-29 19:05:20 +10:00
Ryan Meredith b00c29b70d Update Android Gradle Plugin 2018-04-17 16:54:14 -04:00
Tillmann Karras 4cfd900c67 Fix some warnings 2018-04-17 14:10:05 +01:00
Lioncash 21ee216e63
Android/CMakeLists: Remove usages of LIBS and SRCS variables
Instead, operate on the target itself.
2018-04-03 08:05:43 -04:00
JosJuice 3fe0051a53 Fix build error on Android
Caused by 4387432.
2018-04-03 08:32:55 +02:00
Léo Lam c82da2b978 Remove dead code
Unused, old code that is intended to be removed should not be left in
comments -- that is what version control is for.
2018-03-31 14:56:27 +02:00
JosJuice 4387432436 DiscIO: Don't use all uppercase for enum values
Also removing some prefixes that we don't need now that we're
using enum classes instead of plain enums.
2018-03-31 14:11:32 +02:00
Ryan Meredith 00db87e304 Android: Updates for Android Studio 3.1 2018-03-28 16:38:22 -04:00
Stenzek 2f1a7cbee1 Implement "Skip" ubershader mode
Skip ubershader mode works the same as hybrid ubershaders in that the
shaders are compiled asynchronously. However, instead of using the
ubershader to draw the object, it skips it entirely until the
specialized shader is made available.

This mode will likely result in broken effects where a game creates an
EFB copy, and does not redraw it every frame. Therefore, it is not a
recommended option, however, it may result in better performance on
low-end systems.
2018-03-26 01:57:41 +10:00
JosJuice 828c2c44ca Bring the Android GUI setting for ubershaders up to date
9fa2470 changed how the ubershader setting is stored in INIs but didn't
update the Android GUI code to reflect that, so the setting in the
Android GUI has been broken starting with that commit.

Fixes https://bugs.dolphin-emu.org/issues/10947
2018-03-15 19:15:13 +01:00
Greg Wicks b28236611d Android: Make on-screen joysticks center on the initial touch input. 2018-02-21 20:36:03 -05:00
Markus Wick 9d3d31a8e8
Merge pull request #6387 from mahdihijazi/fix_build_no
Android: Use the git rev-list --count for versionCode
2018-02-20 10:42:22 +01:00
Stenzek 0dddaf9d7d Android: Update renderer surface before resuming emulation
Previously, this could cause a race condition which resulted in the
Vulkan backend attempting to acquire a swap chain image from a now
non-existant surface. By ensuring the backend knows about the surface
before a frame is presented, this race does not happen.
2018-02-20 01:15:55 +10:00
mahdihijazi 135ac2a7a8 Android: Use the git rev-list --count for versionCode 2018-02-19 15:33:46 +01:00
Greg Wicks e19922c5de Android: Implement game-specific settings overrides UI 2018-02-16 13:47:52 -05:00
Markus Wick 5ba18f642c
Merge pull request #6306 from mahdihijazi/fix_hardcoded_path2
Android: Don't hard code the user dircetory path to /sdcard/dolphin-emu
2018-01-26 11:38:51 +01:00
mahdihijazi ae8b469b80 Android: Don't hard code the user dircetory path to /sdcard/dolphin-emu
Android is allowed to pick any path for the external storage media and
that's why we should always use Environment.getExternalStorageDirectory()
to get the external storage path
2018-01-24 12:15:59 +01:00
Léo Lam c3dc8bf1c0
Merge pull request #6310 from mahdihijazi/fix_animation
Android: Fix settings screen animation if Animator Duration Scale is Off
2018-01-24 12:14:21 +01:00
Léo Lam 9a166dca57
Merge pull request #6313 from mahdihijazi/support_change_disc
Android: Support change disc
2018-01-24 12:07:10 +01:00
Ryan Meredith 765b20cc7a Update the Android Gradle plugin to version 3.0.1 2018-01-21 17:29:34 -05:00
mahdihijazi c9dc585dcb Android: Support change disc 2018-01-21 13:59:36 +01:00
mahdihijazi e2dbf10ee5 Android: Keep the local copy of the mSurface
onCreateView might not be called after resuming the emulatoin wich will
leed the game to stuck in the middle since mRunWhenSurfaceIsValid will be
true but surfaceChanged will never be called in this case.
2018-01-21 01:30:45 +01:00
mahdihijazi 53f2fcb571 Android: Fix settings screen animation if Animator Duration Scale is Off
If Animator Duration Scale is Off, the Enhancements/Hacks screens were
not visible unless you enable the Animator Duration Scale back. This
make sure screens will be visible regardless of your animation settings.
2018-01-19 11:55:20 +01:00
Léo Lam ec78118a43
Merge pull request #6302 from JosJuice/gradle-compile
Use "implementation" for all dependencies in build.gradle
2018-01-13 11:25:37 +01:00
JosJuice 83870fbcf0 Use "implementation" for all dependencies in build.gradle 2018-01-12 21:29:42 +01:00
Markus Wick 41fe276323
Merge pull request #6295 from 34will/master
Yes/No Dialogs for Android
2018-01-10 14:55:37 +01:00
34will 10ea9e5f5b Added an actual implementation for yes/no dialogs on Android using Object.wait and Object.notify.
Modified NativeLibrary to display alerts in AlertDialogs rather than Toast notifications, and allow yes/no options.
Modified MainAndroid to use the new displayAlertMsg, and to return its output.
2018-01-10 13:41:57 +00:00
Markus Wick a1467f0e5a
Merge pull request #6282 from mahdihijazi/replace_file_browser
[Android] Replace current file browser
2018-01-10 09:50:16 +01:00
mahdihijazi 409ae4c444 [Android] Replace current file browser
1. Allow users to pick games dircetory from external storage.
2. Better UX experince to distinguish between selecting a directory or
a game. The later is needed when we implement change disk for android.
2018-01-05 21:43:19 +01:00
Markus Wick e705d43312
Merge pull request #6270 from mahdihijazi/suppport_restore_state
[Android] Support restore emulator state
2018-01-05 13:45:36 +01:00
mahdihijazi 42fa129552 [Android] Fix refreshing the games list after adding a directory
This was a regression from the time we introrduced the Platform enums.
2018-01-03 19:39:28 +01:00
mahdihijazi 136e835fb4 [Android] Support restore emulator state after the emulation screen is killed
1) Most of the times the native heap is kept around even after the activity
is killed, we can ask the native code if it is still running and resume
the emulation if that is the case.

2) In case the native heap is freed and the emulation can't resume we used
a temporary state to load on the game boot.

I couldn't find a way to test this, if you want to test this schnario,
add this block to EmulationFragment.

public void onDestroy()
{
	stopEmulation();
	super.onDestroy();
}

onDestroy is only called if the acivity killed by the OS and not be rotation
change whihch in this case will make sure to kill the emulation and start
again when the activiy is re-created.
2017-12-28 23:50:25 +01:00
JosJuice 82a6701f79 Optionally delete savestate that gets loaded at boot 2017-12-28 23:15:48 +01:00
JosJuice b921f6cdef MainAndroid: Don't set User directory redundantly 2017-12-28 13:34:49 +01:00
JosJuice 3e6e66b0d9 Android: Don't return anything from HandleInit
It only ever returned false.
2017-12-28 12:51:45 +01:00
JosJuice d8f10ba177 Android: Always run HandleInit logic on app start
Note: By "HandleInit" in this commit message, I mean the code that is
in HandleInit in master except the part that launches EmulationActivity.
In other words, I mean the call to SetUserDirectory and the call to
DirectoryInitializationService.startService. Couldn't think of
something more accurate to call that than "HandleInit"...

In master, HandleInit only runs when the main activity is launched.
This is a problem if the app ends up being launched in some other way,
such as resuming EmulationActivity after the app has been killed in
order to reclaim memory. It's important that we run HandleInit, because
otherwise the native code won't know where the User and Sys folders are.

In order to implement this, I'm dropping the ability to set a custom
User folder in an intent. I don't think anyone is using that anyway.
It's not impossible to support it, but I can't see a way to support
it that doesn't involve something ugly like having code for calling
HandleInit in every activity (or at least MainActivity + TvMainActivity
+ EmulationActivity, with more activities potentially needing it in
the future if we expand the usage of native code for e.g. settings).
If we want to support setting a custom user directory, we should
consider another way to do it, such as a setting that's stored in
getFilesDir() or getExternalStorageDirectory(). Intents are intended
to control the behavior of a specific activity, not the whole app.
2017-12-28 12:51:00 +01:00
JosJuice f9a0511937 MainAndroid: Optionally wait for savestate to finish writing 2017-12-27 21:53:14 +01:00
JosJuice 87957faddd MainAndroid: Allow specifying savestate to load at boot 2017-12-27 21:53:13 +01:00
JosJuice a81cbf60fb MainAndroid: Add wrapper for Core::IsRunning 2017-12-27 21:53:13 +01:00
JosJuice d9dd210739 MainAndroid: Allow specifying path for savestates 2017-12-27 21:53:07 +01:00
JosJuice 152f7fa35c Android: Fix race condition with writing files before setting User path 2017-12-26 09:53:44 +01:00
JosJuice 3262314435 Android: Don't extract Sys if it already is extracted 2017-12-26 09:53:43 +01:00
JosJuice b3b7aef09a Android: Extract Sys to a different folder than the User folder 2017-12-26 09:53:32 +01:00
JosJuice bfa7c14fef
Merge pull request #6258 from mahdihijazi/extract_service
[Android] Refactor AssetCopyService and the way we extract resources …
2017-12-24 14:59:14 +01:00
mahdihijazi 58ee9d2a78 Fix a bug when you open the gc pad settings after fresh install of Dolphin
You will see an empty gc pad settings screen until you open any other
settings screen and change something, at that moment the Dolphin.ini will
be created and the gc pad settings will be loaded successfully the next
time you open the screen.

This fixes the bug by putting the default gc pad settings section even if
the Dolphin.ini file doesn't exist
2017-12-23 16:39:26 +01:00
mahdihijazi 2cecb64e4c Don't override the WiimoteNew.ini so the user don't loose the selected source 2017-12-23 00:03:02 +01:00
JosJuice 06e25d1b4a Fix default value for Show FPS in Android GUI
https://bugs.dolphin-emu.org/issues/10728
2017-12-20 10:45:45 +01:00
Markus Wick f547703660
Merge pull request #6224 from hackbar/input-fix-moga
Android: Handle missing mappings for the Moga Pro 2 HID controller.
2017-12-19 09:55:57 +01:00
JosJuice acee8b1e23 Update Android GUI settings for Hybrid XFB 2017-12-18 21:53:06 +01:00
mahdihijazi 1190afef51 [Android] Refactor AssetCopyService and the way we extract resources from the assets
This solves the following issues:
1. If user uninstall Dolphin and install it again the resources will
not be copied unless the user manually clear the app cache because we
are enabling the allowBackup flag in the manifest which will make the app
restore the settings saved in the shared prefernces including the flag
assetsCopied. This PR always copy the files everytime you open Dolphin.

2. If the AssetCopyService took long time and you tried to open the settings
screen or start a game the behaviour was not expected or the emulator will
crash, this PR make sure that whatever we add to the DirectoryInitializationService
or how long it will take will still work as expected by blocking both
the settings screen and the emulaion screen to wait untill all resources
needed are copied.

3. Better communication between the DirectoryInitializationService and the
UI screens using brocast messages.
2017-12-18 14:32:39 +01:00
mahdihijazi e61e4d4b3c Replace all Anonymouse class with lambdas or method refernce where applicable 2017-12-18 13:19:57 +01:00
mahdihijazi c6bc25a189 Enable Java 8 features in Dolphin 2017-12-17 16:52:19 +01:00
taylor 6f6cdd206b [Android] Add support for true analog triggers.
This only works if GCPadNew.ini and Dolphin.ini files are not already in the dolphin config folder. Any advice would be helpful. I'd really like to tackle the UI and wiring for deadzones, radius, etc.
2017-12-06 16:46:10 -08:00
Mike 0067bf1b3e Android: Handle missing mappings for the Moga Pro 2 HID controller.
It seems to report the GENERIC_1 axis stuck at 1.
2017-11-28 19:57:50 -08:00
Mike 74ae2522fe Android: Handle a database downgrade.
This has no effect now, as we've never bumped the database version.
Instead, it adds future proofing, and makes moving between a future
version with a bump and master clean.
2017-11-09 18:54:04 -08:00
Mike 1f81e13d81 Android: Ignore joystick axis movements in the flat area.
Now that all inputs are corrected to zero-centered, we can use getFlat()
to ignore movements that are just noise.

This eliminates a lot of drift when the controller is at rest, notably
on the character select screen in Melee.
2017-11-07 17:39:56 -08:00
Mike 6787fcb712 Android: Handle duplicate axis, and fix known bad axis.
Android reports the same physical axis multiple times for analog
triggers, and this handles this case.

There are also some controllers with broken mappings (eg the analog
triggers on a PS4 DualShock 4). These axis don't center correctly.

There are also some controllers (again, the PS4) that send both a button
press and an axis movement. This ignores the buttons so we can use the
analog axis. Otherwise, since the button comes before the axis moves
far we would always take the button.
2017-11-07 17:39:56 -08:00
Leo Lam c8710d0861
Merge pull request #6142 from gwicks/android-settings
Android: Add Slot A and B Device settings to the settings UI
2017-11-03 14:25:40 +01:00
Leo Lam a58df9fe3d
Merge pull request #6163 from JosJuice/simple-ini-ir
Revert "Convert to/from old EFB scale numbering"
2017-11-03 13:46:40 +01:00
JosJuice 2d3dd5ede7 Revert "Convert to/from old EFB scale numbering"
This reverts commit 1fc910b3ea,
replacing the old INI setting EFBScale with a new INI setting
called InternalResolution, which has a simpler mapping:

                  | EFBScale             | InternalResolution
----------------- | -------------------- | --------------------
Auto (fractional) | 0                    |
Auto (integral)   | 1                    | 0
1x                | 2                    | 1
1.5x              | 3                    |
2x                | 4                    | 2
2.5x              | 5                    |
3x                | 6                    | 3
4x                | 7                    | 4
5x                | 8                    | 5
6x                | 9                    | 6

All the fractional IRs were removed in f090a943.
2017-11-02 21:39:05 +01:00
Anthony ad8d885c1d
Merge pull request #6140 from hackbar/cleanup2
Android: minor UI changes
2017-11-02 11:53:54 -07:00
Mike 18cb68eb3c Android: Destroy the surface in EmulationFragment onStop.
Emulation needs to be running when the surface is destroyed, but we want
to pause in onStop. So call the surfaceDestroyed callback, as this
accomplished both.
2017-11-01 23:39:56 -07:00
Mike 987d24fe87 Android: Use the newInstance pattern for EmulationFragment. 2017-11-01 22:39:48 -07:00
Mike 5cb1a08b13 Android: Only specify the transition name for the target Activity.
The source Views don't need the transition name. We could get the name
from the sharedView via getTransitionName, but since the TV
ImageCardView isn't inflated in XML it would be to be manually set.

I'm not sure if that would be any cleaner than this.
2017-11-01 18:54:54 -07:00
Mike 0fb3cb2f56 Android: Use the system "immersive" mode for fullscreen, and simplify how it's
called.

The user will get a brief system popup tutorial the first time it's
used, so we don't need to show them the menu every time. Once they
enable it by pulling down, hide again after 3s.
2017-11-01 18:54:54 -07:00
Greg Wicks 0625cfc34b Android: Add Slot A and B device settings to UI 2017-10-30 15:07:29 -04:00
Greg Wicks cf57e90986 Android: Update dependencies to use new format 2017-10-27 13:06:48 -04:00
Greg Wicks faad9ea5ab Android: Update gradle version 2017-10-26 20:59:18 -04:00
Mat M 78d5dbe032 Merge pull request #6127 from mbc07/android-codestyle-fix
[Android] Don't install Genymotion plugin when importing Code Style preferences file
2017-10-21 18:50:31 -04:00
Mike Harris fb6274f7bc Android: Refactor onMotionEvent.
This works the same, but only looks for the initial event and ignores
the keyup / return to home. It handles joystick diagonals smarter, in
that it ignore diagonals until the stick moves in a more cardinal
direction.

This fixes an odd bug where the dpad up/down were switched (thread post
I think found it -
https://forums.dolphin-emu.org/Thread-arm64-version-on-shield-tv-x1-local-multiplayer-not-working-d-pad-mappings?pid=379918#pid379918)
2017-10-21 13:01:13 -07:00
Mike Harris b8d45ad4be Android: Refactor the saveInput function.
In its prior state, it had xor parameters, which is confusing.
2017-10-21 13:01:12 -07:00
Mateus B. Cassiano 9eaf95144f [Android] Don't install GenyMotion plugin when importing Code Style preferences file 2017-10-21 02:28:36 -03:00
Mike Harris 0d78545255 Rename the param to setGamePath. 2017-10-16 20:36:13 -07:00
Mike Harris d73100f0e4 Minor cleanup in EmulationActivity.
Move the parameter extraction earlier on in onCreate. Mostly this moves
setting sIsGameCubeGame to before setContentView, which means
EmulationFragment will always see it in a consistent state. Previously,
there was a race, which mean the controller overlay would randomly be
Wii controls for a GameCube game (since the default is false).

Use the correct support version of things, ActivityOptionsCompat and
transitions

Rename static var mIsGameCubeGame to sIsGameCubeGame. s is static, m is
member.
2017-10-16 20:36:12 -07:00
Mike Harris 94ed30b055 Use the fragment backstack properly, and use fragment animations.
Make the MenuFragment added and removed by fragment transactions only,
instead of being initially present in the XML. This fixes a glitch where
it doesn't animate correctly the first time it's used.
2017-10-16 20:36:12 -07:00
Mike Harris c4d7814afa Collapse layouts with a framelayout root then another viewgroup.
There's no point to this, and it just slow things down (technically).
2017-10-15 16:44:56 -07:00
Mike Harris 4cab718065 Move emulation lifecycle handling into EmulationFragment.
The Activity is responsible for just its views and menus and such. It
signals the Fragment via setGamePath, StartEmulation and StopEmulation.

The Fragment manages the actual emulation lifecycle. It is solely
responsible for calling the NativeLibrary lifecycle methods.

With this lifecycle simplification, the NativeLibrary no longer needs to
kill the Activity. It happens normally now.

This simplifies a lot of things, live handling rotation.
2017-10-15 16:44:56 -07:00
Mike Harris d48c64457a Start the postponed activity transition as soon as Picasso loads the
image.

Doing it on the preDraw for the View is too complicated. This works just
as well.
2017-10-15 16:44:56 -07:00
Mike Harris 25a08fc5cc Only postpone transistions on Activity creation.
This is causing bugs (no UI is rendered) when the Activity is rotated.
2017-10-15 16:44:56 -07:00
Mike Harris 80e1cc56b3 Use weak references for the static Activity in NativeLibrary.
Add in null checks as well.
2017-10-15 16:44:56 -07:00
Mike Harris cde003c5cc Remove EmulationActivity.MenuType. This should have been removed when
SaveLoadStateFragment was refactored.
2017-10-15 16:44:56 -07:00
Mike Harris 80d51c97ab Add dummy View that works around a bug with the nVidia Shield.
Without this View, the emulation SurfaceView acts like it has the
highest Z-value, blocking any other View. This includes the menu
fragments and the screenshot ImageView.
2017-10-15 16:44:56 -07:00
Mike Harris bb3f61296e Add a clearEmulation method.
This makes it clear that the Activity is being cleared and removes null as
a valid param. This improves readability (and logging slightly).

Fix spacing between [Tag] and message. This matches the rest of the log
messages.
2017-10-15 16:44:56 -07:00
Mike Harris 9fb0d9a664 Move all Activities and Fragments to the support library versions.
In the support lib, the code comes from the SDK, not the device like the
framework version. This means we're shipping a more recent and less buggy
version.

It's also a good idea to keep the entire project on one version. We have a bit
of a mix now. I think some of the Fragment animation issues were because of
this mixing.

For the leanback activities, AppCompatActivity requires AppCompat themes, which
they don't ship for Theme.Leanback. So use FragmentActivity instead (that's the
parent of AppCompatActivity, but still in the support library). For passed
around Activities, use FragmentActivity to work with both.
2017-10-15 16:44:56 -07:00
Mike Harris 9407d9ee0b Bump compile SDK and buildtools version to 26 (Oreo).
Bump the support lib version to 26. This allows for using property
animators (R.animator) in FragmentTransaction.setCustomAnimations.

Add the google maven repo, as from support lib 26 onwards, they're only
publishing it in there.

Bump the gradle version while we're at it, keep Android Studio quiet.
2017-10-15 16:44:56 -07:00
Mike Harris e4c2d75198 Combine SaveStateFragment and LoadStateFragment into one.
Other than what action they send back to
EmulationActivity.handleMenuAction(), they are the same.

Change the menu-handling logic in EmulationActivity to keep track of a
boolean for whether the submenu is visible, rather than keeping the
fragment tag. There's only one fragment visible, so this makes more
sense.
2017-10-03 17:51:08 -07:00
Mike Harris bdeee34eac Move newInstance and launch to the top of the file.
Following the style guide, constructors go before public methods.
newInstance and launch are basically constructors.
2017-10-03 17:51:08 -07:00
Mike Harris 3c3d0fa6f5 Remove 'all' as a Platform enum.
This will remove the 'all games' row on the TV view.
2017-09-29 09:38:14 -07:00
Mike Harris cc77a4963f Convert platform ints to a proper enum Platform.
This is good practice (see Effective Java chapter 6), and adds
compile-time checks.
2017-09-29 09:38:14 -07:00
Mike Harris 487591c760 Change from using tags in ImageCardView to setting a per-platform background.
This allows us to use a real ImageCardView instead of extending the
class.
2017-09-29 09:38:14 -07:00
Mike Harris 2d740147fe remove dupe log tag 2017-09-29 09:38:14 -07:00
Mike Harris 7db88e831e Remove prefix of tag, args and keys with packagename.
Prefixing everything with a constant packagename is not needed for
internal keys, and just adds complexity.

Rename ARGUMENT_ prefix to ARG_ to match (most) of the rest of the
codebase.

Restrict visiblity of above as much as possible.
2017-09-26 17:15:58 -07:00
Mike Harris ab90a3029d Move Save/LoadFragment's layout ID inline and private.
Fix the hack of using the layout resource ID as a save/load ID, and
instead use a proper enum.
2017-09-26 17:15:57 -07:00
Mike Harris 96525cbaaa Remove unused FRAGMENT_TAG, and move the fragment's layout ID inline.
FRAGMENT_ID wasn't actually the fragment's ID (that's misleading, and
sounds like the tag). It's actually the layout resource ID. There's no point in making that a static constant.
2017-09-25 22:47:52 -07:00
Mike Harris 252af9c1bd Remove the debug strings.xml definition of application_id.
This is handled by gradle, we don't need a separate strings.xml for
debug.
2017-09-25 22:20:52 -07:00
JosJuice 85ab968136 Android: Adjust position of floating action button 2017-09-21 15:48:17 +02:00
Markus Wick 4a124868d6 Merge pull request #6034 from JonnyH/WIP/fix-android-null-SettingsSection-crash
Fix some Android UI crashes opening 'settings' menus
2017-09-10 11:11:51 +02:00
Lioncash 696e1b40b5 Common: Move version strings to their own header
Ideally Common.h wouldn't be a header in the Common library, and instead be renamed to something else, like PlatformCompatibility.h or something, but even then, there's still some things in the header that don't really fall under that label

This moves the version strings out to their own version header that doesn't dump a bunch of other unrelated things into scope, like what Common.h was doing.

This also places them into the Common namespace, as opposed to letting them sit in the global namespace.
2017-09-09 19:28:10 -04:00
JosJuice 7fa20cb1be Remove trailing spaces from Android files
Android Studio wants to correct these automatically when editing files.
2017-09-09 11:34:28 +02:00
Jonathan Hamilton ec96a5d8bc Android UI: remove some unnecessary null pointer catches
These can no longer happen during 'normal' use (IE if the setting was
missing)
2017-09-08 10:11:04 -07:00
Jonathan Hamilton 3f247eefae Android SettingsFragmentParser - remove ad-hoc SettingSection construction
Now the SettingsSection map constructs a new SettingsSection at .get()
time, these are no longer needed
2017-09-08 10:06:53 -07:00
Jonathan Hamilton 221462808d Avoid crashes due to null SettingsSections
If a SettingsFile had at least one section, it was assumed all sections
were correctly filled out. This caused crashes when opening the settings
menus if that was not the case - for example the GFX.ini settings empty
sections are removed by the main dolphin app, putting the .ini file in a
state that would crash the settings window if at least one setting was
changed in it from the default, some sections were left as default.

This adds a subclass of HashMap<String, SettingSection> that constructs a
new SettingSection instead of returning 'null' if the key isn't found,
so the mSettings.get(FILE).get(SECTION).get(SETTING) pattern can be
safely used.
2017-09-08 10:06:53 -07:00
Markus Wick ce670c1851 Merge pull request #5959 from mahdihijazi/tv_version_number
[Android] Show the version number on the title for the Android TV UI
2017-09-08 12:17:06 +02:00
Leo Lam 1705d15d6f Merge pull request #5969 from JosJuice/android-filename
MainAndroid: Remove s_filename
2017-08-28 21:03:26 +02:00
Jonathan Hamilton 5a361fd6b3 Make the Android settings parser a bit more robust
It would fail on lines line "Value =" - IE a value set to emptystring.

This would cause the app to crash when trying to open the corresponding
settings window.
2017-08-23 15:50:21 -07:00
JosJuice f8703f90e3 MainAndroid: Remove s_filename
This fits better as a function parameter than as global state.
2017-08-23 22:36:21 +02:00
mahdihijazi 9918d6e333 [Android] Show the version number on the title for the Android TV UI
- Stop reading version number from native code and use the one from BuildConfig
- Show the version number on the title for the Android TV UI
2017-08-21 22:00:56 +02:00
mahdihijazi a1d713c589 [Android] Cleanup unused resources & code 2017-08-20 15:49:39 +02:00
JosJuice 1fc910b3ea Convert to/from old EFB scale numbering 2017-08-08 12:09:50 +02:00
JosJuice f090a94319 Remove non-integer IRs 2017-08-08 12:09:50 +02:00
Michael M 737651f298 MsgHandler: small cleanup 2017-08-03 13:29:59 -07:00
Stenzek 134b0ca940 Android: Fix ubershader hybrid setting 2017-08-01 00:38:26 +10:00
Stenzek 901bf9c257 VideoConfig: Add config options for ubershaders 2017-07-30 17:43:59 +10:00
Stenzek 1fccbd5be3 DolphinWX: Add a progress dialog host command
Allows feedback from backends to be communicated to the user when
long-running operation are performed (e.g. shader compilation).
2017-07-30 12:38:48 +10:00
Léo Lam ee868e2362 Move the Wiimote connect code out of Host
I don't know who thought it would be a good idea to put the Wiimote
connect code as part of the Host interface, and have that called
from both the UI code and the core. And then hack around it by having
"force connect" events whenever Host_ConnectWiimote is called
from the core...
2017-07-23 15:47:32 +08:00
Léo Lam 91f8283a1d Remove Wii Remote connection status from status bar
Showing the Wii remote connection status leads to inconsistent UX,
because we don't do anything like that for GameCube controllers
or with Bluetooth passthrough.

It's also questionable how useful it is given that:

* it doesn't print the number of connected remotes, just that one
  remote is connected, connecting or not connected, so the only info
  it provides is actually wrong when using multiple remotes;

* this user-facing feature is actually broken in master and no one has
  complained AFAIK, which means people don't really rely on it;

* the status bar isn't visible most of the time unless the user is
  using render to main or deliberately keeping the main window's
  status bar visible by moving the render window and they're not too
  far away from their screen;

* emulated Wii remotes now reconnect on input, which means that there
  is less of a need to actually know at all times whether a remote
  is connected, since pressing any button will reconnect it and provide
  immediate, visible feedback via OSD messages and the Wii remote
  pointer appearing.
2017-07-15 13:01:56 +08:00
Michael Maltese 0019c34c73 DolphinWX: fix input bitmaps not working when background input is off 2017-07-12 00:12:07 -07:00
Léo Lam 22992ae41e Boot: Clean up the boot code
* Move out boot parameters to a separate struct, which is not part
  of SConfig/ConfigManager because there is no reason for it to
  be there.

* Move out file name parsing and constructing the appropriate params
  from paths to a separate function that does that, and only that.

* For every different boot type we support, add a proper struct with
  only the required parameters, with descriptive names and use
  std::variant to only store what we need.

* Clean up the bHLE_BS2 stuff which made no sense sometimes. Now
  instead of using bHLE_BS2 for two different things, both for storing
  the user config setting and as a runtime boot parameter,
  we simply replace the Disc boot params with BootParameters::IPL.

* Const correctness so it's clear what can or cannot update the config.

* Drop unused parameters and unneeded checks.

* Make a few checks a lot more concise. (Looking at you, extension
  checks for disc images.)

* Remove a mildly terrible workaround where we needed to pass an empty
  string in order to boot the GC IPL without any game inserted.
  (Not required anymore thanks to std::variant and std::optional.)

The motivation for this are multiple: cleaning up and being able to add
support for booting an installed NAND title. Without this change, it'd
be pretty much impossible to implement that.

Also, using std::visit with std::variant makes the compiler do
additional type checks: now we're guaranteed that the boot code will
handle all boot types and no invalid boot type will be possible.
2017-06-06 16:27:52 +02:00
JosJuice b2af07a7b7 DiscIO: Remove C/I/S prefixes from class names
These prefixes were inconsistent with the rest of Dolphin.

I'm also renaming VolumeWiiCrypted to VolumeWii because of 1113b13.
2017-06-06 12:31:59 +02:00
shuffle2 b9b3b1dc19 Merge pull request #5347 from JosJuice/do-not-translate-button-names
Don't translate button names
2017-06-05 19:05:09 -07:00
Léo Lam d9fd056803 Fix minor formatting issues
These were not caught by the lint script while it was broken.
2017-06-05 02:32:19 +02:00
Leo Lam f4190ab1c4 Merge pull request #5465 from sepalani/gc-bios
Tools: Load GameCube BIOS added
2017-05-26 10:23:03 +02:00
Sepalani 95ea721f06 Tools: Load GameCube BIOS added 2017-05-22 22:44:21 +01:00
Léo Lam cf0c4455cd Fix indirect includes 2017-05-22 10:39:36 +02:00
Pierre Bourdon d486904e9b build.gradle: do not change the output filename, our CI relies on it 2017-05-20 05:54:55 +02:00
JosJuice ac5c82b36b DiscIO: Remove VolumeCreator
This file is pretty small now that it doesn't handle Wii
partitions anymore, so let's move its contents to Volume.cpp.
This is also more consistent with how blob creation works.
2017-05-19 18:33:21 +02:00
Lioncash 35aa55931f MainAndroid: Resolve -Wmissing-variable-declarations warnings 2017-05-18 19:55:05 -04:00
Sean Maas 3e33c99f4c Android: Initialize video backend setting on first run 2017-05-18 08:44:45 -04:00
Sean Maas d4728807e0 Android: Add pressed dpad images for other DPIs 2017-05-15 08:32:22 -04:00
Sean Maas 3bd8890486 Android: Prevent stuck on-screen buttons 2017-05-15 08:32:07 -04:00
Sean Maas 6190b1c4e2 Android: Animate onscreen joystick
Invalidate more often, display nub as pressed when in use, and implement
basic nub bounds.
2017-05-14 15:29:47 -04:00
Mahdi Hijazi 216a7ceea8 Android: Add pressed state to the on-screen controllers
Now the buttons will be shown in different color to indicate a press event
2017-05-14 18:41:04 +02:00
JosJuice 0146456af0 Don't translate button names
Since these button names are printed on all real controllers,
we should show them in the same way as they are printed on
the controllers, regardless of the user's language. It seems
like this was intended all along (except for "Start"), but the
_ markers in TASInputDlg.cpp (accidentally?) led to the button
names in the controller configs also becoming translatable.

I'm making exceptions for "L" and "R" because translators
may want to mark them in some way (for instance "L-Digital")
to clarify the difference from "L-Analog" and "R-Analog".

I'm also making an exception for START/PAUSE because it's
referred to as スタート in Japanese games.

I'm changing "Home" and "Start" to uppercase for consistency
with how Nintendo refers to those buttons, and because someone
who isn't familiar with the Latin script might not know the
connection between the lowercase and uppercase letters (most
users likely do know the connection, but we shouldn't assume it),
and because leaving "Start" as "Start" makes it "collide" with
unrelated strings, such as the string for the button that starts
a netplay session.

To rename "Start" and "Home" without breaking INI
compatibility, I added a ui_name variable like in f5c82ad.
2017-05-06 16:29:10 +02:00
Tim Mutton 3dde12af13 Update support version 2017-05-04 17:21:31 +10:00
Tim Mutton 61aa507d23 Make apk name more descriptive 2017-05-04 17:13:31 +10:00
Tim Mutton 1fe1e11e0e Use try/catch with logging for version number 2017-05-04 17:13:31 +10:00
Tim Mutton c8d66fa246 Nix and windows variant of getting tag 2017-05-04 17:13:31 +10:00
Tim Mutton 8908d10028 Use different git command for version name 2017-05-04 17:13:31 +10:00
Tim Mutton 3d95bf0837 Revert change to version code until I can work out why its 13 2017-05-04 17:13:31 +10:00
Tim Mutton 6b704f5059 Update to latest libraries, use correct version name 2017-05-04 17:13:30 +10:00