Commit Graph

621 Commits

Author SHA1 Message Date
Flyinghead 8c07a2e1d6 sdl: detect half-axes using initial state. Fix axis range and direction
Assume that full axes are roughly centered at start up and determine
which axis are half ones, and the axis direction.
Fixes driving wheel pedals range to the expected [0, 32767].
Issue #2014
2025-07-18 11:38:15 +02:00
scribam b787427446 android: update gradle and agp 2025-07-06 18:08:54 +02:00
Isaac Marovitz af043c55cd
CMake Refactors (#1979)
Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>
2025-06-24 16:33:12 +02:00
scribam b150ba2b62 android: update project 2025-03-12 18:30:06 +01:00
Flyinghead d23b3b6bc7 rcheevos: include flycast version in user-agent header
Issue #1798
2025-02-27 11:26:52 +01:00
scribam b92ac1544e android: update project 2025-01-25 17:02:56 +01:00
Flyinghead 20517cf0da vgamepad: enable touch mouse when lightgun used
Use unique touch mouse class for iOS and Android.
Enable touch mouse for arcade lightgun games or when maple device A is a
lg. Disable it otherwise.
android: only display controllers that actually send events, including
system mouse and keyboard. Use separate Touch Mouse and System Mouse.
iOS: fix missing button input for touch mouse. Don't bubble up touch
events that hit vgampad buttons or controls.
2024-12-14 16:18:35 +01:00
Flyinghead 354d649ebd Merge remote-tracking branch 'origin/master' into dev 2024-12-07 20:38:55 +01:00
Flyinghead 92c5892d4c android: fix scaling when editing vgamepad. vgamepad code clean up 2024-12-04 18:17:11 +01:00
Flyinghead 21f9e9fbc2 android,ios: arcade vgamepad layout. android vgamepad rewrite
Refactor common virtual gamepad code.
Distinct layouts for console and arcade.
Add arcade buttons 5 and 6, insert card button, service mode toggle.
System SP support
2024-12-03 21:04:51 +01:00
Flyinghead a085fd2f6d ui: never disable Up and Down buttons on iOS. rename source files 2024-11-28 17:45:40 +01:00
Flyinghead 36c2f5137c ios, android: load custom vgamepad image. disable unused controls
User can choose a custom vgamepad image or reset to default.
Unused controls are disabled and hidden based on the game (arcade) or
maple device (console).
2024-11-28 17:09:09 +01:00
Flyinghead 5e9c168fc9 android: add BooleanArray to jni util. refactor using templates 2024-11-28 17:01:39 +01:00
Flyinghead 59c2343cad android: add mime-type argument to addStorage() 2024-11-28 16:46:17 +01:00
Flyinghead 516982c66c ios: allow virtual gamepad layout customization
Use same display code as android.
Support custom buttons.png.
Allow layout customization as in android.
Save layout in emu.cfg.
Allow transparency setting.
Issue #990
2024-11-26 10:46:02 +01:00
Flyinghead b4dcc64ef6 android: draw onscreen gamepad with imgui
Get rid of Renderer::DrawOSD.
gl: make a GlQuadDrawer class.
Draw on-screen gamepad using imgui.
Clean up vgamepad interface.
2024-11-22 14:42:51 +01:00
Flyinghead d8a3ee9c3a android: disable openmp affinity on some devices
Disable omp affinity on POCO F5, Redmi Note 12 Turbo, Redmi Note 13 Pro
5G and POCO X6 5G to avoid crashes.
2024-11-06 16:40:11 +01:00
Flyinghead f3a64e5891 android: clean exit when using the exit hotkey
Finish the activity in dc_exit.
Issue #1713
2024-10-29 17:35:25 +01:00
Flyinghead 54e8589f63 android: disable import/export home when SAF is disabled. Code clean up
Disable import/export home folder buttons when not using SAF file
picker.
Get rid of unused home migration feature when onboarding.
Android TV screenshots and banner.
2024-10-18 19:23:03 +02:00
Flyinghead 4750ddb646 android: new option to use legacy file picker instead of new SAF one
Android 9 and earlier can use the legacy file browser. This fixes issues
with broken SAF file picker on Android TV 9.
Catch exception when no file picker is installed on the device (Android
TV 12) and instruct the user to install one.
Issue #1657
2024-10-17 16:21:06 +02:00
scribam 6edad8eaba android: update gradle and agp 2024-10-13 13:25:02 +02:00
Flyinghead 55e0211a57 android: use ASS to select custom adreno driver 2024-10-04 16:36:56 +02:00
Flyinghead 210e8ca6e3 android: get rid of ouya sdk 2024-09-23 20:46:33 +02:00
Flyinghead a46dc71156 android: target android 14 / sdk 34 2024-09-23 18:01:21 +02:00
Flyinghead 63ef3aaab4 android: avoid crash when app is run in restricted mode
App may be run in restricted mode, where the Application object is a
generic android.app.Application. Disallow backup to avoid this. If
Application object isn't of the expected type, restart the app.
2024-09-23 17:21:02 +02:00
Flyinghead abe71409b5 android: race condition with render thread. ANR with auto save state
Race condition when starting then stopping the render thread:
mainui_enabled isn't set until after the thread has started. If stopped
during that time, it will hang.
Auto save state in a background thread to avoid ANR.
2024-09-23 17:17:46 +02:00
Flyinghead f8c12d2835 android: fix getFileInfo for document uri. cheats: limit file size
android: Fix AndroidStorage.getFileInfo for document uri (cheat file)
cheats: limit cheat file size to 1MB to avoid parsing garbage forever. Save file path only if valid.
2024-09-23 17:08:57 +02:00
Flyinghead 0e97f97bb7 android: virtual gamepad rumble power wasn't set at app startup
Make sure emu.cfg is loaded before setting rumble power.
Issue #1640
2024-09-16 11:28:25 +02:00
Flyinghead 8ea12443d3 android: fix touchscreen coords when view is scaled
Samsung phones/tablets can scale down the emulator view to improve
performance. In this case, getPointerCoords() returns screen, not view
coordinates. Use MotionEvent.getX/Y() instead.
2024-08-16 13:12:27 +02:00
Flyinghead 6679cb2f31 android: show/hide keyboard in main thread to avoid deadlock
Tentative fix for deadlock when main thread is calling
JNIdc.rendinitNative(null), and render thread is blocked on a lock
trying to hide on-screen keyboard.
2024-08-16 10:17:06 +02:00
Flyinghead f1fd8b12e2 android: do all rumble/haptic on background thread
Haptic effects for the virtual gamepad must be done on a background
thread. Not sure about gamepad rumble but it shouldn't hurt.
Reuse haptic duration for haptic power (0-100).
Fix crash when power is zero (createOneShot needs power >= 1)
2024-08-15 17:25:02 +02:00
Flyinghead aafa9f0bf0 android: intent url ignored unless external storage legacy is enabled
Issue #1584

Accept fileDir (internal storage) as home folder in case it was created
without external storage.
2024-08-15 12:09:27 +02:00
Flyinghead dae3676979 android: NPE in NativeGLView when Emulator.currentActivity is null 2024-08-15 11:58:45 +02:00
Flyinghead 8b2c1bc5dc android: bug fixes
onInputDeviceAdded may be called with an invalid device id. Avoid NPE
onGenericMotionEvent: event may have a null device. Avoid NPE
getExternalFilesDir may return null if no external storage available.
Use getFilesDir in this case.
Catch exceptions in HomeMover and continue.
addStorage: catch SecurityException and alert user. Graceful failure.
2024-07-20 10:30:27 +02:00
Flyinghead 2b83df86cd boxart: don't save database when pausing (android, uwp)
Avoids ANR on android. Unnecessary since database is now saved
regularly.
2024-07-20 10:07:18 +02:00
Flyinghead a01edd22c7 Merge remote-tracking branch 'origin/dev' into playstore 2024-06-30 11:24:46 +02:00
Flyinghead fefdb6c661 Merge remote-tracking branch 'origin/master' into dev 2024-06-23 16:15:13 +02:00
Flyinghead 4dd490034a android: disable home folder migration 2024-06-23 16:13:28 +02:00
Flyinghead f50d6204dd android: tentative fix for touchscreen not working on android 14
Use more generic source test to detect touch events. Also get rid of
Retroid Pocket 2+ specific test.
Issue #1421
2024-06-23 11:05:40 +02:00
Flyinghead 07172416c1 android: tentative fix for touchscreen not working on android 14
Use more generic source test to detect touch events. Also get rid of
Retroid Pocket 2+ specific test.
Issue #1421
2024-06-22 15:07:05 +02:00
Flyinghead 83a27b9125 android: import/export home folder
Use "folder" instead of "directory" in UI.
When game list is empty, show button to easily add a new content path.
Improve folder paths display in settings with middle ellipsis.
android: import/export home folder content
2024-06-21 18:37:34 +02:00
Flyinghead 9976fe10fb android: gamepad rumble support (untested)
Use single thread to handle rumble for virtual and physical gamepads.
Use heavy click effect for vgamepad buttons when available (android 10)
Handle rumble inclination param.
2024-06-21 18:32:25 +02:00
Flyinghead af7edadedb Merge remote-tracking branch 'origin/dev' into playstore 2024-06-21 18:20:40 +02:00
Flyinghead d882c48b4f android screenshots 2024-06-20 18:18:01 +02:00
Flyinghead 0a9eaa6cb8 android: storage fixes
storage: add file update date to FileInfo.
Savestates and custom textures can be loaded from content path / ASS.
Cache last savestate update date to improve perf on android.
android: Don't use scoped storage for android < 5. Optimize listContent.
Fix getSubPath
android: instrumented storage test
2024-06-17 09:53:32 +02:00
Flyinghead 977d6c6f95 android: upload to google play 2024-06-14 12:59:19 +02:00
Flyinghead 2103dd5a7a storage: add exists() method. load bios from content path. android fix
Add Storage::exists() method
Allow dc and arcade bios to be loaded from content path.
Fix android getSubPath when called on a root uri.
2024-06-14 12:39:32 +02:00
Flyinghead 9df12f950b android: target android 13
disable non-android CI jobs
2024-06-13 20:25:12 +02:00
Flyinghead aed4d21a4f android: prepare transition to sdk 30+. cache last savestate path
Migrate home folder to externalFilesDir
(/sdcard/Android/data/com.flycast.emulator/files) if running on android
10+.
Use externalFilesDir for home by default. No more onboarding on first
install.
Use content uri instead of hacking out real path since the latter won't
work on higher target sdk.
Cache last readable savestate path in hostfs::getSavestatePath(). All
content folders are scanned when not found, which is very slow with ASS
2024-06-13 15:36:29 +02:00
Flyinghead bad55204f2 android: rename packages and activities 2024-06-01 19:03:58 +02:00