Compare commits

..

378 Commits

Author SHA1 Message Date
bunnei
83ae04191c
Merge pull request #216 from SachinVin/disk-shader
Add Disk shader cache
2021-04-23 22:30:42 -07:00
SachinVin
9e836e9b06 DiskShaderCacheProgress.java: Use runOnUiThread instead of a Handler. 2021-04-22 20:45:27 +05:30
SachinVin
031b5c8c28 DiskShaderCacheProgress.java: Add copyright notice 2021-04-21 21:19:33 +05:30
SachinVin
1f775dac21 native.cpp; create cpu_context only when async gpu enabled and reset it after use 2021-04-21 21:19:32 +05:30
SachinVin
fa063c88f4 native.cpp: remove const for jclass,
because it is apparently a typedef'd pointer
2021-04-21 21:19:31 +05:30
SachinVin
03b0bac6e4 Android: native.cpp: use switch to map LoadCallbackStages 2021-04-21 21:19:30 +05:30
SachinVin
4a4c9da22a DiskShaderCacheProgress.java: Add log for when EmulationActivity is not present 2021-04-21 21:19:30 +05:30
SachinVin
da1f7813cb android: native.cpp: rename is_running to stop_run and invert uses 2021-04-21 21:19:29 +05:30
SachinVin
b734fbc735 clang-format
x

y
2021-04-21 21:19:28 +05:30
SachinVin
00fd444ced android: disk_shader: add UI
# Conflicts:
#	src/android/app/src/main/res/values/strings.xml

ui pt3
2021-04-21 21:16:16 +05:30
SachinVin
7851867088 android: use string resources for disk shader progress
# Conflicts:
#	src/android/app/src/main/res/values/strings.xml
2021-04-06 16:38:49 +05:30
SachinVin
6a3c181e50 android: progress bar for disk shaders 2021-04-06 16:38:49 +05:30
SachinVin
06113d9452 andoid: update default_ini.h 2021-04-06 16:38:48 +05:30
SachinVin
bb193da076 disk_shader:update directory structure 2021-04-06 16:38:48 +05:30
SachinVin
8be0e81486 disk_shader: Port multi thread shader compile from yuzu
video_core: store emu_window for creating shared context
2021-04-06 16:38:48 +05:30
SachinVin
947db6c7b6 disk_shader : non separable 2021-04-06 16:38:46 +05:30
bunnei
a6860a9653 Revert com.android.billingclient:billing to 2.0.3
- This is soon deprecated, but likely the last open source version of the building library.
2021-02-28 11:15:02 -08:00
xperia64
07d64943e2 Update gradle 2021-02-21 18:27:59 -05:00
bunnei
21a6a0d9a8 android: Update mainfiest and build.grade for target SDK version 29. 2021-02-21 18:06:29 -05:00
xperia64
3c34a6732e Partial revert of Choreographer implementation; it doesn't seem *that* much worse... 2021-02-21 18:06:29 -05:00
xperia64
9426cf490f Fix crash related to unpause being called after stop 2021-02-21 18:06:29 -05:00
bunnei
6cd96467c3 android: jni: Fix missing camera includes. 2021-02-21 18:06:29 -05:00
zhupengfei
8494a97ac2 android: Add a warning when saving state
Display a warning when a user saves a state, until they explicitly choose to not see it anymore.
2021-02-21 18:06:29 -05:00
zhupengfei
67623f95bd android: Use DialogFragment for the core error dialog
Fixes a bug when changing orientation while the dialog is shown.
2021-02-21 18:06:29 -05:00
zhupengfei
447db08960 fixup! android: Add savestates UI 2021-02-21 18:06:29 -05:00
zhupengfei
bb0a2fd6fd android: Handle core errors
The errors are handled in a similar manner to the Qt frontend: an AlertDialog
will pop up, prompting the user to select 'Abort' or 'Continue'.

Error messages are translatable as string values.
2021-02-21 18:06:29 -05:00
zhupengfei
68c80f1f9c android: Add savestates UI
A simple menu with savestates info.
2021-02-21 18:06:29 -05:00
zhupengfei
ae288b913d core, video_core: Fixes to make savestates work
1. Acquire the context before initializing renderer when using async gpu

2. Do not try present when renderer is nullptr
  This has some potential race condition but is also what we do in qt

3. Synchronize before serializing video core (WaitForProcessing)
  For this, the GPU thread is changed to pop commands *after* processing.

4. Avoid waiting on future fences
  Such events can exist in core timing queue when deserializing.
2021-02-21 18:06:29 -05:00
bunnei
fa17d8a2bc android: config: Fix setting for use_frame_limit. 2021-02-21 18:06:29 -05:00
bunnei
d29a5ab615 Update strings.xml 2021-02-21 18:06:29 -05:00
Nathan Lepori
48b636db79 Implemented switch for sliding finger across dpad + fixed sensitivity 2021-02-21 18:06:29 -05:00
SachinVin
9c86a8ab70 video_core/CMakeLists.txt: Use toolchain cmake in shader header generator 2021-02-21 18:06:29 -05:00
SachinVin
0a80621daf gl_state.cpp: Fix typo in texture buffer LUT 2021-02-21 18:06:29 -05:00
SachinVin
4ec4840fab android : EmulationActivity: Don't show rationale if the permission was denied indefinitely 2021-02-21 18:06:29 -05:00
SachinVin
0ba73687ab fix formatting 2021-02-21 18:06:29 -05:00
SachinVin
1d8da88d2c android: Disable sensors when emulation is paused 2021-02-21 18:06:29 -05:00
SachinVin
3f44609698 android : refactor button_manager{.cpp, .h} to input_manager
Now that it also handles sensors
2021-02-21 18:06:29 -05:00
SutandoTsukai181
2b655b2e7e Update framebuffer layout when closing the settings
Fixes an issue where the default layout gets applied when closing the settings, which is noticable if you swap screens before changing the layout.
2021-02-21 18:06:29 -05:00
SutandoTsukai181
d7c5727b01 Add Cardboard VR
Based on hrydgard/ppsspp/pull/12449
2021-02-21 18:06:29 -05:00
SutandoTsukai181
638435cc62 Add Stereoscopy settings UI 2021-02-21 18:06:28 -05:00
SachinVin
bb355410e6 Run clang-format 2021-02-21 18:06:28 -05:00
SutandoTsukai181
c568db81cf Remove unnecessary conditional 2021-02-21 18:06:28 -05:00
SutandoTsukai181
18f5ba21f1 Wait on present_queue instead of free_queue 2021-02-21 18:06:28 -05:00
SutandoTsukai181
3a381ad7c6 Remove reference to "has_custom_button_text" 2021-02-21 18:06:28 -05:00
SutandoTsukai181
7cda537935 Properly handle button_text for android 2021-02-21 18:06:28 -05:00
Tobias
478fad95f7 AndroidManifest: Remove the maximum aspect ratio entirely 2021-02-21 18:06:28 -05:00
Tobias
7fa52876e4 AndroidManifest: Increase the maximum aspect ratio
This should help display the app on the whole screen on 21:9 devices like the Experia Z5.
2021-02-21 18:06:28 -05:00
bunnei
792e4f9a6c gl_shader_decompiler: Improve performance of accurate_mul on Android. 2021-02-21 18:06:28 -05:00
weihuoya
cba2f53516 presenting in the ui thread 2021-02-21 18:06:28 -05:00
weihuoya
a1a446d720 presenting if need 2021-02-21 18:06:28 -05:00
weihuoya
c946a05ca0 use separate texture buffer for light and fog 2021-02-21 18:06:28 -05:00
zhang wei
b7ca89312d Minor fixes to the UX (#126) 2021-02-21 18:06:28 -05:00
bunnei
f29f5f71f5 android: CheckBoxSetting: Fix a ClassCastException exception with isChecked. 2021-02-21 18:06:28 -05:00
bunnei
e66e14bd05 android: MainActivity: Fix a nullptr exception with onSaveInstanceState. 2021-02-21 18:06:28 -05:00
bunnei
e94e1f6498 android: SettingsFragmentPresenter: Fix a nullptr exception with loadSettingsList. 2021-02-21 18:06:28 -05:00
bunnei
65cbcb61c9 Revert "Presenting in ui thread (#92)"
This reverts commit d1c2e8fb88873bf8642d07ca7e386cc1bac19692.
2021-02-21 18:06:28 -05:00
bunnei
8cf96b3129 android: native: Reload game specific settings when in game. 2021-02-21 18:06:28 -05:00
zhang wei
fda685d5a0 Presenting in ui thread (#92)
* present in ui thread

* rm test file

* use gradle 3.6.3

* fx present issue
2021-02-21 18:06:28 -05:00
xperia64
aab02e60d0 Disable deptch stencil shader in texture_downloader_es for now 2021-02-21 18:06:28 -05:00
SachinVin
92f4362303 android : Fix touchscreen for reals
Adds proper multitouch tracking for touchscreen
2021-02-21 18:06:28 -05:00
SachinVin
0127ce671b core/frontend/emu_window: return true when TouchPressed is consumed 2021-02-21 18:06:28 -05:00
xperia64
a268b6b77e Clamp the circle pad more correctly 2021-02-21 18:06:28 -05:00
xperia64
317689a790 Fix the N3DS controls 2021-02-21 18:06:28 -05:00
xperia64
1e0fb8d41f Shield TV driver bug workaround 2021-02-21 18:06:28 -05:00
SachinVin
aece34591a android : InputOverlayDrawableDpad.java: Initialize mTrackId to -1 2021-02-21 18:06:28 -05:00
SachinVin
29e5e6179c android: Bring back git hash version name 2021-02-21 18:06:28 -05:00
bunnei
1eeff1097b android: game_settings: Mario & Luigi games require accurate mul. 2021-02-21 18:06:28 -05:00
BreadFish64
7adf3827d4 actually add icons 2021-02-21 18:06:28 -05:00
BreadFish64
e4a9e64723 add icon to CIA install menu item 2021-02-21 18:06:28 -05:00
BreadFish64
4da0ce4ea0 refresh game list after installing CIA 2021-02-21 18:06:28 -05:00
BreadFish64
82c1065929 android: Add initial CIA installation 2021-02-21 18:06:28 -05:00
bunnei
1c2203c98e android: game_settings: Further cleanups. 2021-02-21 18:06:28 -05:00
bunnei
2d9e133275 android: native: Set game specific settings before initializing core.
- Allows some other settings to be overridden.
2021-02-21 18:06:28 -05:00
bunnei
5d2200bf45 android: game_settings: Disable asynch GPU with DQ7.
- This was causing some issues.
2021-02-21 18:06:28 -05:00
Nathan Lepori
0281067f92 Implemented joystick-style directional pad overlay 2021-02-21 18:06:28 -05:00
SutandoTsukai181
2024a89937 android: frontend: Start a service to keep the persistent notification 2021-02-21 18:06:28 -05:00
meteoorkip
d0f2cb09b0 Make touch joystick re-centering configurable 2021-02-21 18:06:28 -05:00
SachinVin
0430b714ea gl_shader_gen.cpp:fix implicit type conversion error for gles 2021-02-21 18:06:28 -05:00
SachinVin
89422464dc android:InputOverlay: Bit mask touch action so they are aevaluated properly
event.getAction() returns the action only in the lower byte, this works fine when the pointer index is zero and any additional indexes are not captured
2021-02-21 18:06:28 -05:00
SutandoTsukai181
aba2e8eac9 Use fixed indices for button order
Apps always return 3 strings, even if there is no custom text, so the index should be constant for each button.

The "OK" button is always at index 2.
2021-02-21 18:06:28 -05:00
bunnei
96f5a7bed5 android: game_settings: Make SM3DL's GPU timing synchronous.
- Fixes reported white screen bug.
2021-02-21 18:06:28 -05:00
bunnei
a783658b3e android: BillingManager: Purchases must be acknowledged. 2021-02-21 18:06:28 -05:00
FearlessTobi
91ce625465 android: Update app translations
Adds Korean and some minor fixes to other languages.
2021-02-21 18:06:27 -05:00
bunnei
51ed3d702c androuid: game_settings: Tighten asynch GPU timing.
- Fixes framerate issues in ZALBW.
2021-02-21 18:06:27 -05:00
SachinVin
c88c6ff9cf android: AndroidManifest.xml: bump up gles requirement to 3.2 2021-02-21 18:06:27 -05:00
SachinVin
60be542384 android: disable support for split screen 2021-02-21 18:06:27 -05:00
bunnei
c0cb0a8653 android: BillingManager: Use real managed product for premium. 2021-02-21 18:06:27 -05:00
bunnei
093502d9cb android: audio: Audio stretching is only useful with lower framerates, disable it when fullspeed. 2021-02-21 18:06:27 -05:00
bunnei
2c3b4b98a0 android: video_core: Add experimental asynchronous GPU option. 2021-02-21 18:06:27 -05:00
bunnei
c39b4cc219 Revert "android: audio: Disable audio stretching by default."
This reverts commit 9ccbba07c824e0eca168fa2563509072b6b6793d.

# Conflicts:
#	src/android/app/src/main/java/org/citra/citra_emu/features/settings/ui/SettingsFragmentPresenter.java
2021-02-21 18:06:27 -05:00
SachinVin
3a966c516f common/logging: Create a new backed for android's logcat 2021-02-21 18:06:27 -05:00
zhupengfei
23aed5350c android: Microphone support
Based on Tobi's work. Created a new 'real Mic factory' which creates mic interfaces for real devices. There's a default factory set (cubeb/null, depending on whether cubeb exists) in order to avoid changing code of other frontends.

Created a factory for the Android frontend which requests mic permission and creates a CubebInput (or null). The permission requesting code is basically the same as camera's. If the user denied the permission, an alert dialog will be shown informing them of the reason.

For easier usage, by default the Audio Input Device is set to 'Real Device'.

Co-authored-by: FearlessTobi <thm.frey@gmail.com>
2021-02-21 18:06:27 -05:00
bunnei
38ae9aba45 android: audio: Disable audio stretching by default. 2021-02-21 18:06:27 -05:00
bunnei
71893f4f9a android: MainActivity: Fix crash when game directory button is not present. 2021-02-21 18:06:27 -05:00
BreadFish64
e50e44b8a3 android: allow navigating to external storage 2021-02-21 18:06:27 -05:00
bunnei
2fd4d797ce android: BillingManager: Hide premium actionbar button when premium is active. 2021-02-21 18:06:27 -05:00
bunnei
b55ebb892c android: main: res: Add premium icon and fix folder size. 2021-02-21 18:06:27 -05:00
BreadFish64
0aa70b10b5 android: more theme changes
fix file picker dialog colors
make Citra text orange in dark mode
2021-02-21 18:06:27 -05:00
BreadFish64
0ec1df3e83 android: inherit file-picker toolbar theme from DayNight 2021-02-21 18:06:27 -05:00
BreadFish64
5155c09e1b android: fix toolbar theme 2021-02-21 18:06:27 -05:00
BreadFish64
b0a367d7ae android: fix garbled names in the game list 2021-02-21 18:06:27 -05:00
SachinVin
282e131022 android:game_info.cpp: correct grammar in comment 2021-02-21 18:06:27 -05:00
zhupengfei
328569b61d android/ndk_camera: Fix rotation
`width` and `height` are not necessarily swapped at this point
2021-02-21 18:06:27 -05:00
FearlessTobi
1e3e99a921 android: Make toolbar text black 2021-02-21 18:06:27 -05:00
SachinVin
da0df180e6 android:game_info.cpp: cleanup spammy log 2021-02-21 18:06:27 -05:00
zhupengfei
bc6a938fa5 still_image_camera: Fix incorrect JNI usage
As `jstring`s are also object references, if we would like to use them across native methods/threads, we would have to make a global reference.

We will need to delete this global reference explicitly. Since this string is shared across multiple Interfaces and also in Factory, I used shared_ptr to manage deletion. Added a fancy SharedGlobalRef to id_cache.h.

Also removed global reference creation for java/lang/String classes. Turns out that local references are guaranteed valid for the duration of the method, and I was just being too cautious.
2021-02-21 18:06:27 -05:00
FearlessTobi
9cfb34853b android: Add dark theme icons 2021-02-21 18:06:27 -05:00
FearlessTobi
f474823e9b android: Run final format 2021-02-21 18:06:27 -05:00
FearlessTobi
0123bb8f60 android: Run clang-format 2021-02-21 18:06:27 -05:00
FearlessTobi
767980833b android: Format code
Finally makes us have consistent code format in the codebase.
2021-02-21 18:06:27 -05:00
zhupengfei
1108b8f600 android/ndk_camera: A few fixes
1. Remove unused code
2. Avoid crashes when camera wasn't opened
3. Avoid potential data race
2021-02-21 18:06:27 -05:00
zhupengfei
5737bbc342 android: Fix camera settings
1. Fix settings crash when it gets treated as IntSetting
2. Properly report camera facing
2021-02-21 18:06:27 -05:00
bunnei
48234b7f4f android: GameDatabase: Fix typo in rebase. 2021-02-21 18:06:27 -05:00
SachinVin
0a2a42f710 android: GameDatabase: dont add misc extensions from sub folders. 2021-02-21 18:06:27 -05:00
SachinVin
902594d00a android: Recursive dir
# Conflicts:
#	src/android/app/src/main/java/org/citra/citra_emu/model/GameDatabase.java
#	src/android/app/src/main/jni/native.cpp

# Conflicts:
#	src/android/app/src/main/java/org/citra/citra_emu/model/GameDatabase.java
#	src/android/app/src/main/jni/native.cpp
2021-02-21 18:06:27 -05:00
FearlessTobi
da7044243a android: Add finished translations from Transifex
This adds all languages that have at least translated 50% of the Android source file.
I hope we can automate this process in the future.
2021-02-21 18:06:27 -05:00
SachinVin
29afaa8cbb android/CustomFilePickerFragment: fixup call super.goUp() instead 2021-02-21 18:06:27 -05:00
BreadFish64
bba9bde102 android/GameList: Scan for installed titles 2021-02-21 18:06:27 -05:00
SachinVin
01085252f5 android/CustomFilePickerFragment: don't go up beyond the External Storage Directory ...
/storage/emulated/0/
2021-02-21 18:06:27 -05:00
bunnei
e6433fcb41 android: overlay: Tighten portrait A/B/X/Y buttons. 2021-02-21 18:06:27 -05:00
bunnei
3d91f1c50b android: overlay: Tighten portrait input a bit, this feels more natural. 2021-02-21 18:06:27 -05:00
bunnei
8d9bf76d37 android: InputOverlayDrawableJoystick: Fix off by 1 error with inner joystick. 2021-02-21 18:06:27 -05:00
bunnei
f811adc7a2 android: BillingManager: Add a useful comment to onQuerySkuDetailsFinished. 2021-02-21 18:06:27 -05:00
bunnei
4ac39ef508 android: EmulationActivity: Fix a crash when controller is disconnected. 2021-02-21 18:06:27 -05:00
bunnei
c86611d950 android: BillingManager: Fix issue with onQuerySkuDetailsFinished null param.
- Happens when not associated with a Google account.
2021-02-21 18:06:27 -05:00
FearlessTobi
853083de7b android: Minor changes to theming 2021-02-21 18:06:27 -05:00
FearlessTobi
9c68959401 android/Settings: Set mStackCount to 0 when starting the Activity
Fixes a bug where you would have to click multiple times to get out of the settings after turning the screen off and on again.
2021-02-21 18:06:27 -05:00
SachinVin
2860df14e1 Android: directory picker: Add archive extensions for consistency 2021-02-21 18:06:27 -05:00
FearlessTobi
672f3672d0 android: Change theme colors and modify icons 2021-02-21 18:06:27 -05:00
FearlessTobi
ecabe7f1cd android/MainPresenter: Add double click prevention for the buttons 2021-02-21 18:06:27 -05:00
bunnei
b8a91a79e3 android: settings: Fix config issue with texture_filter_name for premium. 2021-02-21 18:06:27 -05:00
bunnei
11b66b079f android: native: Fix crash on multiple ZIP boots. 2021-02-21 18:06:27 -05:00
bunnei
58ef297694 android: strings: Update for asynchronous GPU. 2021-02-21 18:06:26 -05:00
bunnei
98b6daca4a android: settings: Make texture filtering a premium setting. 2021-02-21 18:06:26 -05:00
bunnei
81461e8c83 settings: PremiumSingleChoiceSetting: Fix bug in getting/setting value. 2021-02-21 18:06:26 -05:00
bunnei
2d47113d1d android: EmulationActivity: Fix merge issue with onActivityResult. 2021-02-21 18:06:26 -05:00
bunnei
3d3a655e97 Merge branch 'mii-selector' into 'master'
android/applets: Implement Mii Selector

See merge request CitraInternal/citra-android!33
2021-02-21 18:06:26 -05:00
bunnei
8da17dd5c0 Merge branch 'amiibo' into 'master'
android: Add Amiibo file support

See merge request CitraInternal/citra-android!34
2021-02-21 18:06:26 -05:00
bunnei
d5d66f9bfd android: native: Ensure shutdown on exit. 2021-02-21 18:06:26 -05:00
bunnei
c5ca290679 android: EmulationActivity: Fix gamepad triggers. 2021-02-21 18:06:26 -05:00
bunnei
837caa1840 android: settings: Use more explicit ARG_MENU_TAG. 2021-02-21 18:06:26 -05:00
bunnei
252f3341d6 android: PremiumSingleChoiceSetting: Add null check to avoid a crash. 2021-02-21 18:06:26 -05:00
bunnei
ae1fe9cc76 android: settings: Disable 'System Default' theme for pre-Android 10.
- It's not officially supported.
2021-02-21 18:06:26 -05:00
bunnei
0df64c0c28 android: settings: Store theme setting in shared preferences.
- Fixes some jankieness.
2021-02-21 18:06:26 -05:00
bunnei
34cec1f3ef Revert "Merge branch 'rt-android' into 'master'"
This reverts commit df9f831a915524e87bf6d63ce86d76589a3fcd6c, reversing
changes made to 1e11e0aecbfdc5ddb7ad835fe673366d68788bc6.
2021-02-21 18:06:26 -05:00
SachinVin
e2035e3889 android: create SingletonInstance for Picasso and add a place holder icon 2021-02-21 18:06:26 -05:00
FearlessTobi
fecd9fe896 android: Also disable realtime audio in the settings presenter 2021-02-21 18:06:26 -05:00
zhupengfei
5e6d0792ab Address review 2021-02-21 18:06:26 -05:00
zhupengfei
64146abc8f ndk_camera: Fixes
Removed debug logs and unused code
Turned CaptureSession struct for simplicity
Added support for camera reload
Fixed ANativeWindow not released
2021-02-21 18:06:26 -05:00
zhupengfei
1db947850d android/camera: UX enhancements
1. Only request camera permissions once
2. Set the default settings to NDK camera
3. When camera device is not found, fall back to still image
4. Add 'Camera Device' configuration when one is found
5. Added a message when camera permissions are denied

For 4, I had to remove the use of the `config` field in StillImage camera.
2021-02-21 18:06:26 -05:00
zhupengfei
70725a6cde android: Add simple UI for camera configuration
The UI is subject to be changed. At least need to add a camera device selection. I also think we should make Device Camera the default
2021-02-21 18:06:26 -05:00
zhupengfei
18ad8fda59 fixes to the NDK camera implementation 2021-02-21 18:06:26 -05:00
zhupengfei
a9e67235e3 android/camera: Implement image flipping
We use libyuv's Mirror function to handle horizontal flip. Regarding the vertical flip, libyuv doc states that 'just set a negative height'
2021-02-21 18:06:26 -05:00
zhupengfei
2ff2155ebc android: Add NDK camera implementation
Not tested yet as my device doesn't support camera2...
2021-02-21 18:06:26 -05:00
zhupengfei
200045529b android: Add a still image camera
Similar to what is in the Qt frontend, this camera takes a URI to a
picture file. When the config is empty, it will open up the gallery and
ask the user to pick a picture.

The image is then read and cropped from the Java side by the Picasso library,
and sent to the native code with android NDK Bitmap API (jnigraphics).
The native code handles the format conversion with libyuv.

Image flipping is yet to be implemented.
2021-02-21 18:06:26 -05:00
zhupengfei
dfb1cb1cbf externals: Add libyuv and jnigraphics 2021-02-21 18:06:26 -05:00
bunnei
e6fcd79fcf android: audio: Disable realtime audio by default. 2021-02-21 18:06:26 -05:00
bunnei
b9820ac643 android: Apply correct theme at boot. 2021-02-21 18:06:26 -05:00
bunnei
ab70d39710 android: Implement billing for Premium. 2021-02-21 18:06:26 -05:00
zhupengfei
7e20019ba6 Fix a typo in swkbd
That made the application crash when an @ is typed and the game prohibited it
2021-02-21 18:06:26 -05:00
BreadFish64
8835ce9f7a memory: fix memory leak related to un-freed shared memory 2021-02-21 18:06:26 -05:00
BreadFish64
d61c7fb058 Revert "android: log: TrimSourcePath: Cannot be constexpr."
This reverts commit 21a75c52
2021-02-21 18:06:26 -05:00
FearlessTobi
fd6d5da449 GameDatabase: Don't rescan when upgraded
This otherwise causes a crash because the Database gets closed too early.
2021-02-21 18:06:25 -05:00
FearlessTobi
79dacfd4ab GameDatabase: Increase DB_VERSION
I forgot to do this in a previous PR.
2021-02-21 18:06:25 -05:00
bunnei
e114fa291a android: MainActivity: Move theme setup to after settings initialization.
- Fixes a crash.
2021-02-21 18:06:25 -05:00
FearlessTobi
53e7cd2a56 android: Add premium section and Dark Theme setting 2021-02-21 18:06:25 -05:00
FearlessTobi
478df1e306 android/GameAdapter: Fix the getColor calls using the wrong context 2021-02-21 18:06:25 -05:00
FearlessTobi
dd97c54f41 android/build: Update exifinterface to version 1.2.0 2021-02-21 18:06:25 -05:00
FearlessTobi
b75bd576e5 android: Make adjustScale reflect changes without closing the dialog 2021-02-21 18:06:25 -05:00
FearlessTobi
e02dd58bc1 android: Clarify the warning in the Debug tab 2021-02-21 18:06:25 -05:00
FearlessTobi
8f74b671aa android: Enable audio stretching by default
It helps eliminate stutter and won't have a huge perf penalty, hopefully.
2021-02-21 18:06:25 -05:00
zhupengfei
8b621ec2da gl_shader_util: Specify default precision for uimage2D
Otherwise, this causes the application to crash when compiling any shader, on both devices I tested.
2021-02-21 18:06:25 -05:00
FearlessTobi
246ece6ac7 android: Add game region to the GameDatabase 2021-02-21 18:06:25 -05:00
FearlessTobi
472cff54ab android: Remove unused JNI functions and use better names for game icon variables 2021-02-21 18:06:25 -05:00
FearlessTobi
8a25c37e5b android/settings: Make background color match the rest of the app 2021-02-21 18:06:25 -05:00
FearlessTobi
9d63568bc8 styles: Use Appcompat instead of MaterialComponents in order to avoid various issues
Fixes the AppBar being black in settings and emulation when using the dark theme.
(Dolphin does the same.)

Also cleans up our styles a bit.
2021-02-21 18:06:25 -05:00
FearlessTobi
54051c4981 android: Fix the frame limiter
It was erroneously using the wrong config section and variable type.
2021-02-21 18:06:25 -05:00
BreadFish64
d0897d6a76 video_core: disable depth/stencil texture download on OpenGL ES 2021-02-21 18:06:25 -05:00
BreadFish64
9e74cb82e0 android: disallow split screen 2021-02-21 18:06:25 -05:00
FearlessTobi
702e892768 android/settings: Move VSync option to debug
Dolphin does the same and there's no real reason the users should mess with it.
2021-02-21 18:06:25 -05:00
FearlessTobi
5a1f66e989 android/NativeLibrary: Use Html.FROM_HTML_MODE_LEGACY
Fixes a deprecation warning.
2021-02-21 18:06:25 -05:00
FearlessTobi
ae899aa0c3 android: Make more Strings translatable 2021-02-21 18:06:25 -05:00
FearlessTobi
d4325060b1 android: Fix the menu animations
Turns out those unused methods were actually used for something.
2021-02-21 18:06:25 -05:00
FearlessTobi
bcc5888173 AndroidManifest: Workaround the crash when changing Theme while in settings
Essentially extends upon https://github.com/dolphin-emu/dolphin/pull/8288.

Original description:
"The "correct way" would be to fully save and restore data on onSaveInstanceState and restore it back on onCreate. I tried to do that first.
As there is various conflicts with doing this without some form of refactor due to how the lifecycle diverges and is baked-in to the application, ignoring Activity recreation on orientation change should work well enough and we don't draw anything different in settings on landscape mode or ui mode anyway."
2021-02-21 18:06:25 -05:00
FearlessTobi
f0dde11030 android: Show a hint when the gamelist is empty 2021-02-21 18:06:25 -05:00
FearlessTobi
633bf381d7 Make the gamelist look nicer and indicate files with a wrong extension visually 2021-02-21 18:06:25 -05:00
FearlessTobi
53350e4e2f android: Change plus icon to folder icon because we don't support multiple directories 2021-02-21 18:06:25 -05:00
FearlessTobi
5b089d2bf5 android: Add realtime audio setting 2021-02-21 18:06:25 -05:00
FearlessTobi
60f5c05249 audio_core: Add realtime audio 2021-02-21 18:06:25 -05:00
BreadFish64
5b46854f1b video_core: bump swap chain size for GLES to reduce bottleneck 2021-02-21 18:06:25 -05:00
BreadFish64
375f72876b video_core: implement optimized D24S8->RGBA8 reinterpreters 2021-02-21 18:06:25 -05:00
James Rowe
23a0777228 Use immutable storage when available 2021-02-21 18:06:25 -05:00
BreadFish64
7d855f5d57 android: disable OpenGL debug message again 2021-02-21 18:06:25 -05:00
BreadFish64
a75cf4c68f android: fix opening settings menu in-game 2021-02-21 18:06:25 -05:00
SachinVin
47cfdc6fe0 android: SettingsFragmentPresenter.java: correct the section used in debug tab
Fixes setting always showing the default value.
2021-02-21 18:06:25 -05:00
BreadFish64
1a6697f6d3 video_core: implement GLES depth/stencil downloads 2021-02-21 18:06:25 -05:00
FearlessTobi
84a93c8731 android: Add debug tab 2021-02-21 18:06:25 -05:00
FearlessTobi
8c31c20c44 Optimize imports 2021-02-21 18:06:25 -05:00
FearlessTobi
c345cd1140 android: Complete the removal of ATV and address minor Linter warnings 2021-02-21 18:06:25 -05:00
FearlessTobi
8e6db57e03 android: Remove obsolete AndroidTV mode and its resources 2021-02-21 18:06:25 -05:00
BreadFish64
ed652a8f2f android: add texture filter setting 2021-02-21 18:06:25 -05:00
BreadFish64
d46ac82a2d android: Add StringSingleChoiceSetting 2021-02-21 18:06:25 -05:00
BreadFish64
fb56b0cc5c video_core: fix texture filters in GLES 2021-02-21 18:06:25 -05:00
zhupengfei
b6c2fb9408 android/swkbd: Properly set uncancelable
When using a DialogFragment you have to set this property on the DialogFragment itself.
2021-02-21 18:06:25 -05:00
FearlessTobi
a269380c35 Android: 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.

Original commit by mahdihijazi for Dolphin-emu.
2021-02-21 18:06:25 -05:00
FearlessTobi
bc9be624b9 build: Fix abiFilter 2021-02-21 18:06:25 -05:00
FearlessTobi
4411f7b2c7 jni/config: Set is_new_3ds to true by default 2021-02-21 18:06:25 -05:00
zhupengfei
19e3eee3a5 res: Add Chinese (zh) translation 2021-02-21 18:06:25 -05:00
FearlessTobi
6133eaeb6e android/strings: Add German translation 2021-02-21 18:06:25 -05:00
FearlessTobi
e91631b324 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.

Original commit by mahdihijazi for Dolphin-emu.
2021-02-21 18:06:25 -05:00
FearlessTobi
9e86f9aa76 strings: Add the performance warning to the translatable strings 2021-02-21 18:06:25 -05:00
FearlessTobi
676df9b7ad 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.

Original commit by mahdihijazi for Dolphin-emu.
2021-02-21 18:06:25 -05:00
FearlessTobi
4c69eec56c 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.
2021-02-21 18:06:25 -05:00
FearlessTobi
747423fa66 Android: Start structure the project around features instead of data types
This only moves the settings feature, the rest will be moved slowely later.

Original commit by mahdihijazi for Dolphin-emu.
2021-02-21 18:06:25 -05:00
zhupengfei
7ebd646594 android/swkbd: Fix rotation crash
Create a new DialogFragment to manage the dialog's state.
Also replaced AlertDialog with the androidx one which arguably looks better.
2021-02-21 18:06:25 -05:00
FearlessTobi
84094a4107 Clean up unused resources and resolve linter warnings 2021-02-21 18:06:24 -05:00
BreadFish64
f24b87a89f android/config: initialize cpu_clock_frequency
leaving it uninitialized broke some games for obvious reasons
2021-02-21 18:06:24 -05:00
BreadFish64
c77132b064 android: don't use ScopeAcquireContext in RunCitra
The context will be released when window is destroyed
2021-02-21 18:06:24 -05:00
zhupengfei
38ce973787 Fix incorrect import due to library change 2021-02-21 18:06:24 -05:00
zhupengfei
042cca532a android: SoftwareKeyboard implementation 2021-02-21 18:06:24 -05:00
BreadFish64
b521a57f2f android/ndk_motion: remove ALooper_release from ndk_motion destructor
We didn't acquire the looper from another thread so this is not correct
2021-02-21 18:06:24 -05:00
BreadFish64
89db27199d android: jni cleanup 2021-02-21 18:06:24 -05:00
FearlessTobi
8f71a81ade Remove unused code 2021-02-21 18:06:24 -05:00
FearlessTobi
bf0cfe7755 Fix a bunch of issues found by the Linter and rename Dolphin functions to Citra 2021-02-21 18:06:24 -05:00
FearlessTobi
84642c98dd Android: Set up Day/Night mode for system-compatible optional dark theme
Original commit by TheRealPSV for Dolphin-emu.
2021-02-21 18:06:24 -05:00
FearlessTobi
ad39b97839 Android: Fix displaying checkbox settings with no description
bugs.dolphin-emu.org/issues/11904.

Original commit by JosJuice for Dolphin-emu.
2021-02-21 18:06:24 -05:00
FearlessTobi
ce58d86569 Moves AlertDialogs imports to AndroidX and fix tabs background color
Original commit by rafaeltoledo for Dolphin-emu.
2021-02-21 18:06:24 -05:00
FearlessTobi
c3268c5e45 Bumps compile API to 29 (Q) removes unecessary casts and deprecated calls
This will help the Android client to evolve with the latest libraries (as the legacy support libs will not be shipped anymore with the com.android.support package).

This PR also makes the app compliant with the new API requirements to start later this year:
android-developers.googleblog.com/2019/02/expanding-target-api-level-requirements.html.

Original commit by rafaeltoledo for Dolphin-emu.
2021-02-21 18:06:24 -05:00
FearlessTobi
f7beb3e05e Migrate to AndroidX
Support Libraries are outdated and AndroidX is recommended instead. Read more here: developer.android.com/jetpack/androidx.

Original commit by Simonx22 for Dolphin-emu.
2021-02-21 18:06:24 -05:00
FearlessTobi
d31fe0a20f Android: Show files in the directory picker
People in the Google Play reviews still seem to be confused about
games not showing up in the directory picker, so let's show them
even though they can't be selected. (Either that or they haven't
realized that they need to extract their pirated games.)

Original commit by JosJuice for Dolphin-emu.
2021-02-21 18:06:24 -05:00
FearlessTobi
9eb9acc5b3 Android: Expand the comment for NVidiaShieldWorkaroundView
This text has been taken from the message of the commit that added
the class. (I don't have an Nvidia Shield to reproduce the bug with.)

Original commit by JosJuice for Dolphin-emu.
2021-02-21 18:06:24 -05:00
FearlessTobi
18dd8a2ce5 Remove unused code
Original commit by weihuoya for Dolphin-emu.
2021-02-21 18:06:24 -05:00
FearlessTobi
32917eeedf Fix for crash when switching to landscape mode
bugs.dolphin-emu.org/issues/10815

Original commit by allanxp4 for Dolphin-emu.
2021-02-21 18:06:24 -05:00
FearlessTobi
ab7ad1ab53 Android: Bunch of cleanups & Updates
1. Update Picasso to latest version
2. Remove some unused code

Original commit by mahdihijazi for Dolphin-emu.
2021-02-21 18:06:24 -05:00
FearlessTobi
bf0322151a Android: fix/ignore L2/R2 buttons
L2/R2 will trigger a key press and an axis event if the trigger is pressed fully down
Was incorrectly ignoring L1/R1 key presses.

Original commit by zackhow for Dolphin-emu.
2021-02-21 18:06:24 -05:00
FearlessTobi
fde1d3fec0 Android: don't try to pause emulation when not running
Forcing landscape at emulation start revealed a bug where if the activity was
recreated before emulation started then it would get stuck in a paused state.

Original commit by zackhow for Dolphin-emu.
2021-02-21 18:06:24 -05:00
FearlessTobi
d371d75b2a Android: Remove the cancel button from the file browser
Fix the regresion from dolphin-emu/dolphin#7520, also it applies the change
to the directory picker only.

Original commit by mahdihijazi for Dolphin-emu.
2021-02-21 18:06:24 -05:00
FearlessTobi
7378497373 Android: Change the file browser dialog ok button title
I hope this will make it more clear to users that they are suppose to
select the dircetory that has the games.

Original commit by mahdihijazi for Dolphin-emu.
2021-02-21 18:06:24 -05:00
FearlessTobi
de1da36392 android: remove enter and exit transition
Originally done by weihuoya for Dolphin-emu.
2021-02-21 18:06:24 -05:00
FearlessTobi
c61b903a9c Android: Run Directory Initialization as a thread instead of service
Two reasons for this change. First, it appears that some android launchers do some sort of call into
the application when long pressing the app icon, which in turn calls the DirectoryInit service. This
was ok to do prior to Oreo but will cause crashes with the new restrictions on services running
in the background. Which leads to the second reason that DirectoryInit doesn't need to be a service
at all since these actions are required for dolphin to function and shouldn't be a scheduled action.
So we instead just kick this off in a new thread and send the broadcast when done.

Original commit by zackhow for Dolphin-emu
2021-02-21 18:06:24 -05:00
Marshall Mohror
dead5b1808 android: implement motion controls via device sensors 2021-02-21 18:06:24 -05:00
SachinVin
3fd28ba49d android: jni: Remove unused ndk_helper after EGL migration + cleanup jni/CMakeLists.txt 2021-02-21 18:06:24 -05:00
BreadFish64
24e567f6ae android: allow changing settings while game is running 2021-02-21 18:06:24 -05:00
bunnei
eb6624f1f5 android: frontend: Limit game list to a single directory. 2021-02-21 18:06:24 -05:00
bunnei
be913a1905 android: frontend: MainActivity: Fix issues with declining app permissions. 2021-02-21 18:06:24 -05:00
bunnei
464ae4b70a android: build.gradle: Bump minimum version to 26. 2021-02-21 18:06:24 -05:00
bunnei
c4cf1a9317 android: Rename app package from citra_android to citra_emu.
- There is already a conflicting name on the Play Store.
2021-02-21 18:06:24 -05:00
bunnei
4f6c81b79b android: emu_window: Fix surface width/height.
- Fixes a bug when resuming the app.
2021-02-21 18:06:24 -05:00
bunnei
99c583dbaa android: AndroidManifest: Use singleTop mode, not singleInstance.
- Fixes launching the app without restarting the emulation activity.
2021-02-21 18:06:24 -05:00
bunnei
813fc071d1 android: frontend: game_list: Move add directory button to top bar. 2021-02-21 18:06:24 -05:00
bunnei
7f8cc1ac19 android: frontend: game_list: Tweak game cards. 2021-02-21 18:06:24 -05:00
bunnei
97de618506 android: frontend: game_list: Rounded icons and other UX improvements. 2021-02-21 18:06:24 -05:00
bunnei
9c7a545d32 android: frontend: Add vsync to the settings now that it is supported. 2021-02-21 18:06:24 -05:00
bunnei
774282dc4d android: emu_window: Adapt for use with split presenter thread. 2021-02-21 18:06:24 -05:00
bunnei
bb4c92aabe android: Update .gitignore for CXX compile cache. 2021-02-21 18:06:24 -05:00
bunnei
7ee887218b android: renderer_opengl: Various fixes for GLES. 2021-02-21 18:06:24 -05:00
bunnei
c90a99a327 android: log: TrimSourcePath: Cannot be constexpr. 2021-02-21 18:06:24 -05:00
SachinVin
8c42f312a6 Android: frontend: use android.R.string.ok instead of literal 2021-02-21 18:06:24 -05:00
SachinVin
ca29e322ab Android: Settings: Center the setting title when no setting description is provided. 2021-02-21 18:06:23 -05:00
bunnei
bfbb72722c android: video_core: Enable HW shadows and texture barrier on GLES. 2021-02-21 18:06:23 -05:00
bunnei
572df50c79 video_core: gl_shader_manager: Only set shader samplers on fragment shader.
- Avoids unnecessary uniform errors.
2021-02-21 18:06:23 -05:00
bunnei
2a4cf63631 android: video_core: Require GLES 3.2 in shaders. 2021-02-21 18:06:23 -05:00
bunnei
9da36dc5fd android: native: Change order of EmuWindow teardown.
- This needs to happen after system shutdown for asynchronous GPU.
2021-02-21 18:06:23 -05:00
bunnei
798ac32f47 android: video_core: gl_rasterizer_cache: Make cache access thread safe. 2021-02-21 18:06:23 -05:00
bunnei
9a08c3e26d android: audio_core: Remove noisy log. 2021-02-21 18:06:23 -05:00
bunnei
deb9349e06 android: core: frontend: Port yuzu's code for scope acquire window context. 2021-02-21 18:06:23 -05:00
bunnei
18181ab361 android: res: Update the launcher icon. 2021-02-21 18:06:23 -05:00
bunnei
9a44c88087 android: frontend: FPS overlay: Add some minor margin. 2021-02-21 18:06:23 -05:00
bunnei
a50498f3ad android: jni: Migrate EmuWindow_Android class to EGL.
- This enables us to use shared contexts more easily.
2021-02-21 18:06:23 -05:00
bunnei
db0cafa15f android: frontend: Add errors for unsupported ROM formats. 2021-02-21 18:06:23 -05:00
bunnei
de5b9b8caf android: renderer_opengl: Partially implement glLogicOp on GLES. 2021-02-21 18:06:23 -05:00
SachinVin
5ceca646b3 android/GameDatabase.java: remove duplicate ".3ds" from allowedExtensions 2021-02-21 18:06:23 -05:00
bunnei
f2c2140748 android: renderer_opengl: Optimize GetTexImageOES and fix bugs. 2021-02-21 18:06:23 -05:00
bunnei
d62ef07f84 android: settings: Add system language setting. 2021-02-21 18:06:23 -05:00
bunnei
9d98605125 android: settings: Fix bug where changing speed limiter will slow game down. 2021-02-21 18:06:23 -05:00
bunnei
e5fa95cda2 android: frontend: Support 18.5:9 aspect ratio. 2021-02-21 18:06:23 -05:00
bunnei
ef66dec71a android: frontend: Further simplify show FPS overlay text. 2021-02-21 18:06:23 -05:00
bunnei
c3706ea6bc android: frontend: Fix several issues with running notification.
- Priority should be low without sound/vibration.
- Notification should restore app.
2021-02-21 18:06:23 -05:00
bunnei
756c1fe28e android: frontend: Use color white for FPS overlay. 2021-02-21 18:06:23 -05:00
bunnei
e2fda98dcf android: frontend: settings: Temporarily disable V-Sync. 2021-02-21 18:06:23 -05:00
bunnei
288df380a9 android: frontend: Rename settings hint to "Settings". 2021-02-21 18:06:23 -05:00
bunnei
0763ab77d0 android: frontend: New and improved launcher icon. 2021-02-21 18:06:23 -05:00
bunnei
7ad5fc6cc6 android: frontend: startup: Improve startup and permissions handling.
- Fixes a first boot crash.
2021-02-21 18:06:23 -05:00
bunnei
10c7a2f102 android: frontend: settings: Disable audio stretching by default. 2021-02-21 18:06:23 -05:00
bunnei
8e11367074 android: frontend: settings: Accurate shader multiplication should be disabled. 2021-02-21 18:06:23 -05:00
bunnei
e0ac8635e3 android: frontend: settings: Simplify sliders. 2021-02-21 18:06:23 -05:00
bunnei
a927bad573 android: frontend: menu: Improve in game options, make check boxes. 2021-02-21 18:06:23 -05:00
bunnei
07848c7368 android: frontend: Implement persistent notification while emulator is running. 2021-02-21 18:06:23 -05:00
bunnei
a7f33affdc android: Rename main entry class to CitraApplication. 2021-02-21 18:06:23 -05:00
bunnei
8106d85742 android: frontend: Implement basic software keyboard applet. 2021-02-21 18:06:23 -05:00
bunnei
8fddac5da8 android: frontend: Use android builtin ok/yes/no/cancel strings where possible. 2021-02-21 18:06:23 -05:00
bunnei
339193597a android: frontend: Add "Cancel" and "Default" buttons to reset overlay. 2021-02-21 18:06:22 -05:00
bunnei
5c959916ff android: frontend: Fix bug with reset overlay scale. 2021-02-21 18:06:22 -05:00
bunnei
e2dd439fe1 android: frontend: Cleanup perf stats. 2021-02-21 18:06:22 -05:00
bunnei
4f9bc1b8d6 android: frontend: card_game: Tighten padding a little bit. 2021-02-21 18:06:22 -05:00
bunnei
c4f7d2412c android: frontend: gamelist: Save PlatformGamesFragment state.
- Fixes weird duplication of game list on rotation.
2021-02-21 18:06:22 -05:00
bunnei
cecb4546c5 android: frontend: gamelist: Fix weird scroll behavior with action bar. 2021-02-21 18:06:22 -05:00
bunnei
d8bc9d351f android: jni: Improve management of core emulation state.
- Furthermore fixes bug where audio crackling could bleed out of the app.
2021-02-21 18:06:22 -05:00
bunnei
36799e87b3 android: frontend: settings: Add a back button to the navigation bar. 2021-02-21 18:06:22 -05:00
bunnei
e7b9fbefbe android: frontend: gamelist: Add swipe to refresh gesture. 2021-02-21 18:06:22 -05:00
bunnei
93c9e4e4cd android: frontend: settings: Disable configuring D-pad as buttons. 2021-02-21 18:06:22 -05:00
bunnei
63f579bebe android: frontend: settings: Rename "controller" section to "gamepad". 2021-02-21 18:06:22 -05:00
bunnei
b7918c49df android: frontend: menu_settings: Remove save button. 2021-02-21 18:06:22 -05:00
bunnei
ea745b31ed android: frontend: fragment_settings: Remove margins. 2021-02-21 18:06:22 -05:00
bunnei
76f202a067 android: frontend: settings: Simply save toast. 2021-02-21 18:06:22 -05:00
bunnei
1ffea53b37 android: frontend: EmulationActivity: Remove citra icon from game prompt. 2021-02-21 18:06:22 -05:00
bunnei
db7c8cfb57 gl_rasterizer_cache: Remove redundant GLES check. 2021-02-21 18:06:22 -05:00
bunnei
edf522ffe8 android: gl_rasterizer_cache: Skip costly shutdown procedure. 2021-02-21 18:06:22 -05:00
bunnei
e9b3596f52 android: jni: Fix how we handle orientation changes.
- This previously broke Jave to C++ bindings.
2021-02-21 18:06:21 -05:00
bunnei
487acf8821 core: Reset cpu_core after kernel.
- Fixes a crash on Android.
2021-02-21 18:06:21 -05:00
bunnei
84036582b1 android: jni: config: Disable shaders_accurate_mul by default (it's too slow). 2021-02-21 18:06:21 -05:00
bunnei
277e823c6b android: jni: Add IDCache to cache Java methods. 2021-02-21 18:06:21 -05:00
bunnei
1482759d2a android: Picasso: Use newer version and some minor cleanup. 2021-02-21 18:06:21 -05:00
bunnei
a4ce46ea2a android: AndroidManifest.xml: Require GLES 3.1 and AEP. 2021-02-21 18:06:21 -05:00
bunnei
cb810f1a97 android: native: Reset old EmuWindow before constructing a new one.
- Enforces that touch is unregistered at the right time, ensuring it works for subsequent runs.
2021-02-21 18:06:21 -05:00
bunnei
ec0f81d2e9 android: native: Use actual array length for banner copy. 2021-02-21 18:06:21 -05:00
bunnei
c4cf477108 android: frontend: Add config option for linear filtering. 2021-02-21 18:06:21 -05:00
bunnei
c23046bbba android: settings: Add/update missing config options from latest master. 2021-02-21 18:06:21 -05:00
bunnei
1051144274 android: settings: Remove shaders_accurate_gs and toggle_3d.
- shaders_accurate_gs no longer exists.
- toggle_3d was renamed, but is not used on Android.
2021-02-21 18:06:21 -05:00
bunnei
845b618fcd android: input: Add support for gamepads. 2021-02-21 18:06:21 -05:00
bunnei
e6a6c26f17 android: frontend: SettingsFragmentPresenter: Add config options for joypad controls. 2021-02-21 18:06:21 -05:00
bunnei
e69e13c15d android: frontend: MotionAlertDialog: Merge latest Dolphin code. 2021-02-21 18:06:21 -05:00
Weiyi Wang
6363fe7581 Add reset button to slider setting 2021-02-21 18:06:21 -05:00
Weiyi Wang
41ab284a42 move speed limiter to general 2021-02-21 18:06:21 -05:00
bunnei
adebfdb8da android: frontend: SettingsFile: Add button strings. 2021-02-21 18:06:21 -05:00
bunnei
5cf8c36eb7 android: frontend: strings: Cleanup for controller input. 2021-02-21 18:06:21 -05:00
bunnei
eadd31ee1a android: app: Add method to get global context. 2021-02-21 18:06:21 -05:00
bunnei
90fd8fe095 android: jni: Remove unnecessary code. 2021-02-21 18:06:21 -05:00
Weiyi Wang
019740685e remove redundant code 2021-02-21 18:06:21 -05:00
Weiyi Wang
f883df18f4 Also fix default value for speed limiter & audio stretcher 2021-02-21 18:06:21 -05:00
Weiyi Wang
d0a3b5eef7 Accurate GS is default to true in config 2021-02-21 18:06:20 -05:00
Weiyi Wang
50c7e563b0 fix system clock default value 2021-02-21 18:06:20 -05:00
Weiyi Wang
8ed498b94b fix time picker not saving/loading time 2021-02-21 18:06:20 -05:00
Weiyi Wang
db0e2cba3f Fix TimePicker style 2021-02-21 18:06:20 -05:00
Weiyi Wang
7d0905295c move "select game folder" string to resource 2021-02-21 18:06:20 -05:00
Weiyi Wang
9e789b3bc5 Add title to file picker 2021-02-21 18:06:20 -05:00
bunnei
1e071d3c9f android: config: Enable accurate multiplication by default. 2021-02-21 18:06:20 -05:00
bunnei
37f5b9f6c5 android: frontend: Update circle pad icon resources. 2021-02-21 18:06:20 -05:00
bunnei
231f7fede5 android: frontend: Swap select and start buttons to match 3DS. 2021-02-21 18:06:20 -05:00
bunnei
65e55078ac android: frontend: settings: String cleanup & minor improvements. 2021-02-21 18:06:20 -05:00
bunnei
95e1c4ac13 android: native: Ensure game config is re-loaded before starting. 2021-02-21 18:06:20 -05:00
bunnei
ec5baf2edd android: frontend: Remove Home button for now, as it does not do anything. 2021-02-21 18:06:20 -05:00
bunnei
7ae012c937 android: frontend: Add a confirmation dialog on game exit. 2021-02-21 18:06:20 -05:00
bunnei
44f62f2857 android: frontend: Update controls overlay placement for new icon resources. 2021-02-21 18:06:20 -05:00
bunnei
5f9967bf12 android: frontend: Update to new icon resources. 2021-02-21 18:06:20 -05:00
bunnei
a5cf813d2e android: frontend: settings: Add performance warnings for relevant settings. 2021-02-21 18:06:20 -05:00
bunnei
987ae79ac4 android: frontend: Remove "Toggle All" option from toggle controls.
- This was broken, and is not terribly useful as-is.
2021-02-21 18:06:20 -05:00
bunnei
33274b8bb3 android: frontend: Decrease spacing between game cards. 2021-02-21 18:06:20 -05:00
bunnei
40391df1eb android: jni: Fix management of core emulation state and various cleanups.
- Fixes a shutdown crash.
2021-02-21 18:06:19 -05:00
bunnei
d220516a2c android: frontend: Fix bug where games could be double-clicked. 2021-02-21 18:06:19 -05:00
bunnei
8685a9f218 android: jni: Sanitize analog stick inputs.
- Fixes bug where joystick sometimes is unresponsive.
2021-02-21 18:06:19 -05:00
bunnei
56074b1754 android: frontend: Fix default state for toggle controls, enable D-pad by default. 2021-02-21 18:06:19 -05:00
bunnei
171fb38510 android: frontend: Add persistent changeable layout option for landscape mode. 2021-02-21 18:06:19 -05:00
bunnei
222629b195 android: frontend: Track screen layout separately for orientation. 2021-02-21 18:06:19 -05:00
bunnei
64ba419977 android: frontend: Add MobileLandscape layout profile for mobile devices. 2021-02-21 18:06:19 -05:00
James Rowe
af61478822 Adds in missing changes to gradle file and updates dynarmic 2021-02-21 18:06:19 -05:00
bunnei
3961943829 android: jni: button_manager: Fix circle pad on subsequent game launch.
- We were missing an UnregisterFactory call for AnalogDevice.
2021-02-21 18:06:19 -05:00
bunnei
bcd1c7bdfc android: frontend: MainPresenter: Refresh game directory on app boot. 2021-02-21 18:06:19 -05:00
bunnei
59df6df795 android: jni: game_info: Fix crash on banner load for missing title. 2021-02-21 18:06:19 -05:00
bunnei
26813bab63 android: jni: config: Fix bug preventing creation of config.ini. 2021-02-21 18:06:19 -05:00
bunnei
da7b0e7f78 android: frontend: StartupHandler: Add an intro sequence to pick game dir. 2021-02-21 18:06:19 -05:00
bunnei
5241f5044e android: frontend: SettingsFragmentPresenter: Default resolution scale to 1X.
- Because android phones aren't very fast.
2021-02-21 18:06:19 -05:00
bunnei
164475bc09 android: frontend: Settings: Section categories must match INI settings. 2021-02-21 18:06:19 -05:00
bunnei
fb38edb03e android: frontend: Settings: Various updates and preserve single choice text in UI. 2021-02-21 18:06:19 -05:00
bunnei
55da147dbd android: frontend: SettingsFragmentPresenter: Move speed limit to Graphics, give proper strings. 2021-02-21 18:06:19 -05:00
bunnei
e7c666397a android: frontend: Enlarge icon for launcher. 2021-02-21 18:06:19 -05:00
bunnei
18a2f6e4f7 android: frontend: SettingsFragmentPresenter: Organize settings into logical categories. 2021-02-21 18:06:18 -05:00
bunnei
24e3068911 android: frontend: SettingsFragmentPresenter: Remove unnecessary settings, add JIT setting. 2021-02-21 18:06:18 -05:00
bunnei
ce700ad46d android: frontend: InputOverlay: Fix setting save for portrait mode. 2021-02-21 18:06:18 -05:00
bunnei
214b8c1a0d android: frontend: Fix settings slider cancel button. 2021-02-21 18:06:18 -05:00
bunnei
1130a7dac3 android: frontend: auto-reformat all code for consistent style. 2021-02-21 18:06:18 -05:00
James Rowe
d6501b6c8f Perf: Remove more breakpoint checking in the interpreter. Move filtering earlier in the logging chain 2021-02-21 18:06:18 -05:00
bunnei
274004c17b (jroweboy) Remove existing code in src/android
Move src/citra_android to src/android/app/src/main/jni
Disable gdbstub breakpoints on android (could be done better)
Disable LOD_BIAS for GLES (not support on gles)
2021-02-21 18:06:18 -05:00
bunnei
75ccba38cb android: frontend: Implement MobilePortrait layout, which makes more sense for mobile. 2021-02-21 18:06:18 -05:00
bunnei
381c81ad9a android: native: Remove several unused hooks. 2021-02-21 18:06:18 -05:00
bunnei
155dcf7125 android: native: Add hooks for SwitchScreenLayout and SwapScreens. 2021-02-21 18:06:18 -05:00
bunnei
a9d793de44 android: config: Update to reflect latest settings. 2021-02-21 18:06:18 -05:00
bunnei
23d6fb0e04 android: frontend: Add base project. 2021-02-21 18:06:18 -05:00
27 changed files with 87 additions and 427 deletions

2
externals/catch vendored

@ -1 +1 @@
Subproject commit de6fe184a9ac1a06895cdd1c9b437f0a0bdf14ad
Subproject commit 15cf3caaceb21172ea42a24e595a2eb58c3ec960

2
externals/dynarmic vendored

@ -1 +1 @@
Subproject commit 358cf6f0357baae3e3bb5788431acf1068f897b5
Subproject commit f9d84871fb6dd41c47945d649dc9017aa3762125

View File

@ -97,11 +97,13 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
}
@Override
public void showSettingsFragment(String menuTag, boolean addToStack, String gameID) {
if (!addToStack && getFragment() != null) {
return;
}
public void onBackPressed() {
mPresenter.onBackPressed();
}
@Override
public void showSettingsFragment(String menuTag, boolean addToStack, String gameID) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
if (addToStack) {
@ -114,6 +116,7 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
}
transaction.addToBackStack(null);
mPresenter.addToStack();
}
transaction.replace(R.id.frame_content, SettingsFragment.newInstance(menuTag, gameID), FRAGMENT_TAG);
@ -204,6 +207,11 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
Toast.makeText(this, message, is_long ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT).show();
}
@Override
public void popBackStack() {
getSupportFragmentManager().popBackStackImmediate();
}
@Override
public void onSettingChanged() {
mPresenter.onSettingChanged();

View File

@ -22,6 +22,8 @@ public final class SettingsActivityPresenter {
private Settings mSettings = new Settings();
private int mStackCount;
private boolean mShouldSave;
private DirectoryStateReceiver directoryStateReceiver;
@ -43,6 +45,7 @@ public final class SettingsActivityPresenter {
}
public void onStart() {
this.mStackCount = 0;
prepareCitraDirectoriesIfNeeded();
}
@ -114,6 +117,19 @@ public final class SettingsActivityPresenter {
NativeLibrary.ReloadSettings();
}
public void addToStack() {
mStackCount++;
}
public void onBackPressed() {
if (mStackCount > 0) {
mView.popBackStack();
mStackCount--;
} else {
mView.finish();
}
}
public void onSettingChanged() {
mShouldSave = true;
}

View File

@ -55,6 +55,11 @@ public interface SettingsActivityView {
*/
void showToastMessage(String message, boolean is_long);
/**
* Show the previous fragment.
*/
void popBackStack();
/**
* End the activity.
*/

View File

@ -34,8 +34,6 @@ static jmethodID s_request_camera_permission;
static jmethodID s_request_mic_permission;
static jmethodID s_disk_cache_load_progress;
static std::unordered_map<VideoCore::LoadCallbackStage, jobject> s_java_load_callback_stages;
namespace IDCache {
JNIEnv* GetEnvForThread() {
@ -117,13 +115,6 @@ jmethodID GetDiskCacheLoadProgress() {
return s_disk_cache_load_progress;
}
jobject GetJavaLoadCallbackStage(VideoCore::LoadCallbackStage stage) {
const auto it = s_java_load_callback_stages.find(stage);
ASSERT_MSG(it != s_java_load_callback_stages.end(), "Invalid LoadCallbackStage: {}", stage);
return it->second;
}
} // namespace IDCache
#ifdef __cplusplus
@ -147,7 +138,7 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) {
FileUtil::GetUserPath(FileUtil::UserPath::LogDir) + LOG_FILE));
LOG_INFO(Frontend, "Logging backend initialised");
// Initialize Java classes
// Initialize Java methods
const jclass native_library_class = env->FindClass("org/citra/citra_emu/NativeLibrary");
s_native_library_class = reinterpret_cast<jclass>(env->NewGlobalRef(native_library_class));
s_savestate_info_class = reinterpret_cast<jclass>(
@ -159,7 +150,6 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) {
s_load_callback_stage_class = reinterpret_cast<jclass>(env->NewGlobalRef(env->FindClass(
"org/citra/citra_emu/disk_shader_cache/DiskShaderCacheProgress$LoadCallbackStage")));
// Initialize Java methods
s_on_core_error = env->GetStaticMethodID(
s_native_library_class, "OnCoreError",
"(Lorg/citra/citra_emu/NativeLibrary$CoreError;Ljava/lang/String;)Z");
@ -183,25 +173,6 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) {
s_disk_cache_progress_class, "loadProgress",
"(Lorg/citra/citra_emu/disk_shader_cache/DiskShaderCacheProgress$LoadCallbackStage;II)V");
// Initialize LoadCallbackStage map
const auto to_java_load_callback_stage = [env](const std::string& stage) {
jclass load_callback_stage_class = IDCache::GetDiskCacheLoadCallbackStageClass();
return env->NewGlobalRef(env->GetStaticObjectField(
load_callback_stage_class,
env->GetStaticFieldID(load_callback_stage_class, stage.c_str(),
"Lorg/citra/citra_emu/disk_shader_cache/"
"DiskShaderCacheProgress$LoadCallbackStage;")));
};
s_java_load_callback_stages.emplace(VideoCore::LoadCallbackStage::Prepare,
to_java_load_callback_stage("Prepare"));
s_java_load_callback_stages.emplace(VideoCore::LoadCallbackStage::Decompile,
to_java_load_callback_stage("Decompile"));
s_java_load_callback_stages.emplace(VideoCore::LoadCallbackStage::Build,
to_java_load_callback_stage("Build"));
s_java_load_callback_stages.emplace(VideoCore::LoadCallbackStage::Complete,
to_java_load_callback_stage("Complete"));
MiiSelector::InitJNI(env);
SoftwareKeyboard::InitJNI(env);
Camera::StillImage::InitJNI(env);
@ -218,13 +189,6 @@ void JNI_OnUnload(JavaVM* vm, void* reserved) {
env->DeleteGlobalRef(s_native_library_class);
env->DeleteGlobalRef(s_savestate_info_class);
env->DeleteGlobalRef(s_core_error_class);
env->DeleteGlobalRef(s_disk_cache_progress_class);
env->DeleteGlobalRef(s_load_callback_stage_class);
for (auto& [key, object] : s_java_load_callback_stages) {
env->DeleteGlobalRef(object);
}
MiiSelector::CleanupJNI(env);
SoftwareKeyboard::CleanupJNI(env);
Camera::StillImage::CleanupJNI(env);

View File

@ -7,7 +7,6 @@
#include <memory>
#include <type_traits>
#include <jni.h>
#include "video_core/rasterizer_interface.h"
namespace IDCache {
@ -28,8 +27,6 @@ jmethodID GetRequestCameraPermission();
jmethodID GetRequestMicPermission();
jmethodID GetDiskCacheLoadProgress();
jobject GetJavaLoadCallbackStage(VideoCore::LoadCallbackStage stage);
} // namespace IDCache
template <typename T = jobject>

View File

@ -119,12 +119,40 @@ static bool HandleCoreError(Core::System::ResultStatus result, const std::string
env->NewStringUTF(details.c_str())) != JNI_FALSE;
}
static jobject ToJavaLoadCallbackStage(VideoCore::LoadCallbackStage stage) {
const char* name;
switch (stage) {
case VideoCore::LoadCallbackStage::Prepare:
name = "Prepare";
break;
case VideoCore::LoadCallbackStage::Decompile:
name = "Decompile";
break;
case VideoCore::LoadCallbackStage::Build:
name = "Build";
break;
case VideoCore::LoadCallbackStage::Complete:
name = "Complete";
break;
default:
UNREACHABLE();
}
JNIEnv* env = IDCache::GetEnvForThread();
jclass load_callback_stage_class = IDCache::GetDiskCacheLoadCallbackStageClass();
return env->GetStaticObjectField(
load_callback_stage_class,
env->GetStaticFieldID(
load_callback_stage_class, name,
"Lorg/citra/citra_emu/disk_shader_cache/DiskShaderCacheProgress$LoadCallbackStage;"));
}
static void LoadDiskCacheProgress(VideoCore::LoadCallbackStage stage, int progress, int max) {
JNIEnv* env = IDCache::GetEnvForThread();
env->CallStaticVoidMethod(IDCache::GetDiskCacheProgressClass(),
IDCache::GetDiskCacheLoadProgress(),
IDCache::GetJavaLoadCallbackStage(stage), static_cast<jint>(progress),
static_cast<jint>(max));
IDCache::GetDiskCacheLoadProgress(), ToJavaLoadCallbackStage(stage),
(jint)progress, (jint)max);
}
static Camera::NDK::Factory* g_ndk_factory{};

View File

@ -201,10 +201,6 @@ void Config::ReadValues() {
// Data Storage
Settings::values.use_virtual_sd =
sdl2_config->GetBoolean("Data Storage", "use_virtual_sd", true);
Settings::values.nand_dir = sdl2_config->GetString(
"Data Storage", "nand_directory", FileUtil::GetUserPath(FileUtil::UserPath::NANDDir));
Settings::values.sdmc_dir = sdl2_config->GetString(
"Data Storage", "sdmc_directory", FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir));
// System
Settings::values.is_new_3ds = sdl2_config->GetBoolean("System", "is_new_3ds", true);

View File

@ -250,14 +250,6 @@ volume =
# 1 (default): Yes, 0: No
use_virtual_sd =
# The path of the virtual SD card directory.
# empty (default) will use the user_path
sdmc_directory =
# The path of NAND directory.
# empty (default) will use the user_path
nand_directory =
[System]
# The system model that Citra will try to emulate
# 0: Old 3DS, 1: New 3DS (default)

View File

@ -66,9 +66,6 @@ add_executable(citra-qt
configuration/configure_motion_touch.cpp
configuration/configure_motion_touch.h
configuration/configure_motion_touch.ui
configuration/configure_storage.cpp
configuration/configure_storage.h
configuration/configure_storage.ui
configuration/configure_system.cpp
configuration/configure_system.h
configuration/configure_system.ui

View File

@ -104,7 +104,7 @@ void EmuThread::run() {
}
OpenGLWindow::OpenGLWindow(QWindow* parent, QWidget* event_handler, QOpenGLContext* shared_context)
: QWindow(parent), context(std::make_unique<QOpenGLContext>(shared_context->parent())),
: QWindow(parent), context(new QOpenGLContext(shared_context->parent())),
event_handler(event_handler) {
// disable vsync for any shared contexts
@ -447,8 +447,8 @@ std::unique_ptr<Frontend::GraphicsContext> GRenderWindow::CreateSharedContext()
}
GLContext::GLContext(QOpenGLContext* shared_context)
: context(std::make_unique<QOpenGLContext>(shared_context->parent())),
surface(std::make_unique<QOffscreenSurface>(nullptr)) {
: context(new QOpenGLContext(shared_context->parent())),
surface(new QOffscreenSurface(nullptr)) {
// disable vsync for any shared contexts
auto format = shared_context->format();
@ -463,7 +463,7 @@ GLContext::GLContext(QOpenGLContext* shared_context)
}
void GLContext::MakeCurrent() {
context->makeCurrent(surface.get());
context->makeCurrent(surface);
}
void GLContext::DoneCurrent() {

View File

@ -6,7 +6,6 @@
#include <atomic>
#include <condition_variable>
#include <memory>
#include <mutex>
#include <QThread>
#include <QWidget>
@ -37,8 +36,8 @@ public:
void DoneCurrent() override;
private:
std::unique_ptr<QOpenGLContext> context;
std::unique_ptr<QOffscreenSurface> surface;
QOpenGLContext* context;
QOffscreenSurface* surface;
};
class EmuThread final : public QThread {
@ -139,7 +138,7 @@ protected:
void exposeEvent(QExposeEvent* event) override;
private:
std::unique_ptr<QOpenGLContext> context;
QOpenGLContext* context;
QWidget* event_handler;
};

View File

@ -302,16 +302,6 @@ void Config::ReadDataStorageValues() {
qt_config->beginGroup(QStringLiteral("Data Storage"));
Settings::values.use_virtual_sd = ReadSetting(QStringLiteral("use_virtual_sd"), true).toBool();
std::string nand_dir = FileUtil::GetUserPath(FileUtil::UserPath::NANDDir);
Settings::values.nand_dir =
ReadSetting(QStringLiteral("nand_directory"), QString::fromStdString(nand_dir))
.toString()
.toStdString();
std::string sdmc_dir = FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir);
Settings::values.sdmc_dir =
ReadSetting(QStringLiteral("sdmc_directory"), QString::fromStdString(sdmc_dir))
.toString()
.toStdString();
qt_config->endGroup();
}
@ -862,12 +852,6 @@ void Config::SaveDataStorageValues() {
qt_config->beginGroup(QStringLiteral("Data Storage"));
WriteSetting(QStringLiteral("use_virtual_sd"), Settings::values.use_virtual_sd, true);
WriteSetting(QStringLiteral("nand_directory"),
QString::fromStdString(Settings::values.nand_dir),
QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::NANDDir)));
WriteSetting(QStringLiteral("sdmc_directory"),
QString::fromStdString(Settings::values.sdmc_dir),
QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir)));
qt_config->endGroup();
}

View File

@ -68,11 +68,6 @@
<string>Debug</string>
</attribute>
</widget>
<widget class="ConfigureStorage" name="storageTab">
<attribute name="title">
<string>Storage</string>
</attribute>
</widget>
<widget class="ConfigureWeb" name="webTab">
<attribute name="title">
<string>Web</string>
@ -126,12 +121,6 @@
<extends>QWidget</extends>
<header>configuration/configure_debug.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureStorage</class>
<extends>QWidget</extends>
<header>configuration/configure_storage.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureInput</class>

View File

@ -51,7 +51,6 @@ void ConfigureDialog::SetConfiguration() {
ui->debugTab->SetConfiguration();
ui->webTab->SetConfiguration();
ui->uiTab->SetConfiguration();
ui->storageTab->SetConfiguration();
}
void ConfigureDialog::ApplyConfiguration() {
@ -67,7 +66,6 @@ void ConfigureDialog::ApplyConfiguration() {
ui->debugTab->ApplyConfiguration();
ui->webTab->ApplyConfiguration();
ui->uiTab->ApplyConfiguration();
ui->storageTab->ApplyConfiguration();
Settings::Apply();
Settings::LogSettings();
}
@ -79,7 +77,7 @@ void ConfigureDialog::PopulateSelectionList() {
const std::array<std::pair<QString, QList<QWidget*>>, 5> items{
{{tr("General"), {ui->generalTab, ui->webTab, ui->debugTab, ui->uiTab}},
{tr("System"), {ui->systemTab, ui->cameraTab, ui->storageTab}},
{tr("System"), {ui->systemTab, ui->cameraTab}},
{tr("Graphics"), {ui->enhancementsTab, ui->graphicsTab}},
{tr("Audio"), {ui->audioTab}},
{tr("Controls"), {ui->inputTab, ui->hotkeysTab}}}};
@ -120,7 +118,6 @@ void ConfigureDialog::RetranslateUI() {
ui->debugTab->RetranslateUI();
ui->webTab->RetranslateUI();
ui->uiTab->RetranslateUI();
ui->storageTab->RetranslateUI();
}
void ConfigureDialog::UpdateVisibleTabs() {
@ -137,7 +134,6 @@ void ConfigureDialog::UpdateVisibleTabs() {
{ui->audioTab, tr("Audio")},
{ui->cameraTab, tr("Camera")},
{ui->debugTab, tr("Debug")},
{ui->storageTab, tr("Storage")},
{ui->webTab, tr("Web")},
{ui->uiTab, tr("UI")}};

View File

@ -1,78 +0,0 @@
// Copyright 2021 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <QDesktopServices>
#include <QFileDialog>
#include <QUrl>
#include "citra_qt/configuration/configure_storage.h"
#include "core/core.h"
#include "core/settings.h"
#include "ui_configure_storage.h"
ConfigureStorage::ConfigureStorage(QWidget* parent)
: QWidget(parent), ui(std::make_unique<Ui::ConfigureStorage>()) {
ui->setupUi(this);
SetConfiguration();
connect(ui->open_nand_dir, &QPushButton::clicked, []() {
QString path = QString::fromStdString(Settings::values.nand_dir);
QDesktopServices::openUrl(QUrl::fromLocalFile(path));
});
connect(ui->change_nand_dir, &QPushButton::clicked, this, [this]() {
const QString dir_path = QFileDialog::getExistingDirectory(
this, tr("Select NAND Directory"), QString::fromStdString(Settings::values.nand_dir),
QFileDialog::ShowDirsOnly);
if (!dir_path.isEmpty()) {
Settings::values.nand_dir = dir_path.toStdString();
SetConfiguration();
}
});
connect(ui->open_sdmc_dir, &QPushButton::clicked, []() {
QString path = QString::fromStdString(Settings::values.sdmc_dir);
QDesktopServices::openUrl(QUrl::fromLocalFile(path));
});
connect(ui->change_sdmc_dir, &QPushButton::clicked, this, [this]() {
const QString dir_path = QFileDialog::getExistingDirectory(
this, tr("Select SDMC Directory"), QString::fromStdString(Settings::values.sdmc_dir),
QFileDialog::ShowDirsOnly);
if (!dir_path.isEmpty()) {
Settings::values.sdmc_dir = dir_path.toStdString();
SetConfiguration();
}
});
connect(ui->toggle_virtual_sd, &QCheckBox::clicked, this, [this]() {
ApplyConfiguration();
SetConfiguration();
});
}
ConfigureStorage::~ConfigureStorage() = default;
void ConfigureStorage::SetConfiguration() {
ui->nand_group->setVisible(Settings::values.use_virtual_sd);
QString nand_path = QString::fromStdString(Settings::values.nand_dir);
ui->nand_dir_path->setText(nand_path);
ui->open_nand_dir->setEnabled(!Settings::values.nand_dir.empty());
ui->sdmc_group->setVisible(Settings::values.use_virtual_sd);
QString sdmc_path = QString::fromStdString(Settings::values.sdmc_dir);
ui->sdmc_dir_path->setText(sdmc_path);
ui->open_sdmc_dir->setEnabled(!Settings::values.sdmc_dir.empty());
ui->toggle_virtual_sd->setChecked(Settings::values.use_virtual_sd);
ui->storage_group->setEnabled(!Core::System::GetInstance().IsPoweredOn());
}
void ConfigureStorage::ApplyConfiguration() {
Settings::values.use_virtual_sd = ui->toggle_virtual_sd->isChecked();
}
void ConfigureStorage::RetranslateUI() {
ui->retranslateUi(this);
}

View File

@ -1,26 +0,0 @@
// Copyright 2021 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include <memory>
#include <QWidget>
namespace Ui {
class ConfigureStorage;
}
class ConfigureStorage : public QWidget {
Q_OBJECT
public:
explicit ConfigureStorage(QWidget* parent = nullptr);
~ConfigureStorage() override;
void ApplyConfiguration();
void RetranslateUI();
void SetConfiguration();
std::unique_ptr<Ui::ConfigureStorage> ui;
};

View File

@ -1,188 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ConfigureStorage</class>
<widget class="QWidget" name="ConfigureStorage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>681</width>
<height>375</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_1">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="storage_group">
<property name="title">
<string>Storage</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_1">
<item>
<widget class="QCheckBox" name="toggle_virtual_sd">
<property name="text">
<string>Use Virtual SD</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="nand_group">
<property name="title">
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>NAND Directory</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="nand_dir_path">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="open_nand_dir">
<property name="text">
<string>Open</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>NOTE: this does not move the contents of the previous directory to the new one</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="change_nand_dir">
<property name="text">
<string>Change</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="sdmc_group">
<property name="title">
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>SDMC Directory</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="sdmc_dir_path">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="open_sdmc_dir">
<property name="text">
<string>Open</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>NOTE: this does not move the contents of the previous directory to the new one</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="change_sdmc_dir">
<property name="text">
<string>Change</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -12,7 +12,6 @@
#include "common/common_paths.h"
#include "common/file_util.h"
#include "common/logging/log.h"
#include "core/settings.h"
#ifdef _WIN32
#include <windows.h>
@ -717,13 +716,8 @@ void SetUserPath(const std::string& path) {
}
#endif
}
g_paths.emplace(UserPath::SDMCDir, !Settings::values.sdmc_dir.empty()
? Settings::values.sdmc_dir
: user_path + SDMC_DIR DIR_SEP);
g_paths.emplace(UserPath::NANDDir, !Settings::values.nand_dir.empty()
? Settings::values.nand_dir
: user_path + NAND_DIR DIR_SEP);
g_paths.emplace(UserPath::SDMCDir, user_path + SDMC_DIR DIR_SEP);
g_paths.emplace(UserPath::NANDDir, user_path + NAND_DIR DIR_SEP);
g_paths.emplace(UserPath::SysDataDir, user_path + SYSDATA_DIR DIR_SEP);
// TODO: Put the logs in a better location for each OS
g_paths.emplace(UserPath::LogDir, user_path + LOG_DIR DIR_SEP);
@ -768,11 +762,6 @@ const std::string& GetUserPath(UserPath path) {
SetUserPath();
return g_paths[path];
}
const void UpdateUserPath(UserPath path, const std::string& filename) {
g_paths[path] = filename + DIR_SEP;
}
std::size_t WriteStringToFile(bool text_file, const std::string& filename, std::string_view str) {
return IOFile(filename, text_file ? "w" : "wb").WriteString(str);
}

View File

@ -186,9 +186,6 @@ void SetCurrentRomPath(const std::string& path);
// directory. To be used in "multi-user" mode (that is, installed).
[[nodiscard]] const std::string& GetUserPath(UserPath path);
// Update the Global Path with the new value
const void UpdateUserPath(UserPath path, const std::string& filename);
// Returns the path to where the sys file are
[[nodiscard]] std::string GetSysDirectory();

View File

@ -121,8 +121,6 @@ void LogSettings() {
log_setting("Camera_OuterLeftConfig", values.camera_config[OuterLeftCamera]);
log_setting("Camera_OuterLeftFlip", values.camera_flip[OuterLeftCamera]);
log_setting("DataStorage_UseVirtualSd", values.use_virtual_sd);
log_setting("DataStorage_SdmcDir", values.sdmc_dir);
log_setting("DataStorage_NandDir", values.nand_dir);
log_setting("System_IsNew3ds", values.is_new_3ds);
log_setting("System_RegionValue", values.region_value);
log_setting("Debugging_UseGdbstub", values.use_gdbstub);

View File

@ -176,8 +176,6 @@ struct Values {
// Data Storage
bool use_virtual_sd;
std::string nand_dir;
std::string sdmc_dir;
// System
int region_value;

View File

@ -912,7 +912,7 @@ void Room::RoomImpl::HandleChatPacket(const ENetEvent* event) {
}
// Limit the size of chat messages to MaxMessageSize
message.resize(std::min(static_cast<u32>(message.size()), MaxMessageSize));
message.resize(MaxMessageSize);
Packet out_packet;
out_packet << static_cast<u8>(IdChatMessage);

View File

@ -62,11 +62,6 @@ RasterizerOpenGL::RasterizerOpenGL(Frontend::EmuWindow& emu_window)
"Shadow might not be able to render because of unsupported OpenGL extensions.");
}
if (!GLAD_GL_ARB_copy_image && !GLES) {
LOG_WARNING(Render_OpenGL,
"ARB_copy_image not supported. Some games might produce artifacts.");
}
// Clipping plane 0 is always enabled for PICA fixed clip plane z <= 0
state.clip_distance[0] = true;
@ -786,7 +781,7 @@ bool RasterizerOpenGL::Draw(bool accelerate, bool is_indexed) {
}
OGLTexture temp_tex;
if (need_duplicate_texture && (GLAD_GL_ARB_copy_image || GLES)) {
if (need_duplicate_texture) {
// The game is trying to use a surface as a texture and framebuffer at the same time
// which causes unpredictable behavior on the host.
// Making a copy to sample from eliminates this issue and seems to be fairly cheap.

View File

@ -843,6 +843,14 @@ void CachedSurface::DownloadGLTexture(const Common::Rectangle<u32>& rect, GLuint
return;
}
if (GLES) {
if (type == SurfaceType::Depth || type == SurfaceType::DepthStencil) {
// TODO(bunnei): This is unsupported on GLES right now, fixme
LOG_WARNING(Render_OpenGL, "Unsupported depth/stencil surface download");
return;
}
}
MICROPROFILE_SCOPE(OpenGL_TextureDL);
if (gl_buffer.empty()) {

View File

@ -387,10 +387,6 @@ void ShaderDiskCache::SaveDecompiled(u64 unique_identifier,
void ShaderDiskCache::SaveDump(u64 unique_identifier, GLuint program) {
if (!IsUsable())
return;
if (!GLAD_GL_ARB_get_program_binary) {
LOG_WARNING(Render_OpenGL, "ARB_get_program_binary is not supported. Problems may occur if "
"use_disk_shader_cache is ON.");
}
GLint binary_length{};
glGetProgramiv(program, GL_PROGRAM_BINARY_LENGTH, &binary_length);