Commit Graph

107 Commits

Author SHA1 Message Date
Niccolò Betto
80471a4750
Merge 3cae2e05ae into dc20a61527 2023-05-13 15:30:50 +01:00
lynxnb
d86b2ec3e9 Implement OSC stick regions
Stick regions extend the activation area of the sticks to rectangles covering the corresponding half of the screen.
E.g. for the left stick: when any point of the left side of the screen is touched, the stick is repositioned there, and acts as if it was centered in the touched position. When the finger is lifter, the stick is hidden.
2023-05-02 12:27:57 +01:00
Abandoned Cart
fe4ccd1ee0 Suppress or resolve common warnings 2023-05-02 12:27:06 +01:00
Abandoned Cart
96c5b94429 Always resume emulator, even if running
Fixes skyline-emu/skyline#2305
2023-05-02 12:27:06 +01:00
lynxnb
3bb24a52ab Implement graphics pipelines loading screen core logic 2023-04-25 01:36:37 +02:00
lynxnb
a799cb63f1 Add separate L3 and R3 buttons to OSC
As part of this commit, a `defaultEnabled` property was added to `OnScreenButton` to determine the default visibility of buttons. This is required because L3 and R3 should be hidden by default and only enabled by the user on demand.
Additionally, the buttons' mask values were added to `ButtonId` members, as adding entries in the middle of the class conflicted with the `ordinal` enum property, making it unfit to use for our purposes.
Finally, the `ControllerType` class was extended with an array of optional buttons. Optional buttons represent buttons that are allowed to be displayed on screen, but shouldn't be included in the controller mapping activity.
2023-04-02 18:16:10 +02:00
lynxnb
17f45c0366 Retrieve the vibrator service outside of OSC View
Retrieving the vibrator service inside the view crashes the layout editor. Fix by retrieving it in the activity and passing it to the view.
2023-04-02 18:16:10 +02:00
Billy Laws
c928084bb1 Show a toast when per-game settings are active 2023-03-19 13:52:15 +00:00
Abandoned Cart
905c0a47fa Allow the options, even if they're useless
Since this is instantiated in `onCreate` and may be recycled with different settings, relying on the audio to be disabled to determine if a mute action is available seems like a risky gamble.
2023-03-14 23:22:32 +00:00
Abandoned Cart
39393ec310 Move picture-in-picture configuration to method
This will also make the transition to per-game settings less of a collision later.
2023-03-14 23:22:32 +00:00
Abandoned Cart
a906c6d689 Use BuildConfig package name to forgo Context
This should adapt to the package name, despite not actually relying on the value of it to function. Intents are one of the most analyzed items for vulnerabilities and exploits.
2023-03-14 23:22:32 +00:00
Abandoned Cart
bd9050f6c7 Add an emulator pause button to the OSC 2023-03-14 23:22:32 +00:00
Abandoned Cart
69e322b76b Pausing should mute audio for looped music
Also adds pausing the surface in onPause and restoring it in onResume to avoid wasting resources when the activity is legitimately in the background.
2023-03-14 23:22:32 +00:00
Abandoned Cart
df96d74ca1 No use assigning null surface if null already
This also prevents any possibility a null value is falsely assigned to a valid surface for whatever reason.
2023-03-14 23:22:32 +00:00
Abandoned Cart
95a679e5cd Add an action to pause the emulator process 2023-03-14 23:22:32 +00:00
Abandoned Cart
a1143ee5de Respect the existing "mute" user preference 2023-03-14 23:22:32 +00:00
Abandoned Cart
bdc368e039 Add a mute button as a PiP window action 2023-03-14 23:22:32 +00:00
Abandoned Cart
4298415134 Add picture in picture for emulation activity 2023-03-14 23:22:32 +00:00
Abandoned Cart
6703a875f0 Support deprecation of getSerializableExtra 2023-03-11 18:27:15 +00:00
lynxnb
b2228a93da Reorder settings pt.2 2023-02-27 19:56:53 +01:00
lynxnb
ddfa9013a9 Use a proper tag for AppItem in intent extras and arguments 2023-02-27 19:56:53 +01:00
lynxnb
2f4778247c Use per-game settings during emulation 2023-02-27 19:56:53 +01:00
lynxnb
cd426d9f18 Split PreferenceSettings into AppSettings and EmulationSettings
`PreferenceSettings` was removed in favor of:
* `AppSettings`: stores general purpose settings mostly used for UI configuration and state
* `EmulationSettings`: stores emulation-related settings, most of these are passed to native emulation code
2023-02-27 19:56:53 +01:00
lynxnb
a1ca84f95e Move Kotlin settings to a dedicate package 2023-02-27 19:56:53 +01:00
lynxnb
180d1efd4d Revert "Toggle DisableFrameThrottling setting by clicking on FPS"
This commit reverts PR #2037. Passing `NativeSettings` to emulation code through a member reference, instead of a local variable, caused unpredictable crashes when using custom GPU drivers (v615+) on some Qualcomm SoCs.
The exact cause of the issue remains unknown, my best guess is that it was caused by an incorrect optimization performed on the Kotlin bytecode in release mode, which caused an issue when reading memory that had been forked, because of running emulation in a separate process.
Runtime settings modification will be reimplemented in the future via an alternative method.
2023-02-27 19:00:52 +01:00
lynxnb
5b0a397165 Update native settings after toggling frame throttling 2023-02-20 21:45:30 +00:00
Matesic Darko
f850271e2d toggle DisableFrameThrottling setting by clicking on FPS display
s/jSurface/vkSurface
2023-02-20 21:45:30 +00:00
Abandoned Cart
b20c6e9fc4 onBackPressed -> onBackPressedDispatcher 2023-02-16 14:50:02 +01:00
german77
56d43a70c0 Implement SixAxis sensor 2023-02-07 16:16:41 +00:00
Billy Laws
28b2a7a8a1 Dynamically apply GPU turbo clocks only when GPU submissions are queued
Allows for the GPU to clock down in cases where it's idle for most of the time, while still forcing maximum clocks when we care.
2023-01-08 19:30:52 +00:00
Billy Laws
77214a98dd Add a setting to force maximum GPU clocks on KGSL devices 2023-01-08 19:30:52 +00:00
Abandoned Cart
cfd3bfecba Add a rudimentary OSC button vibration setting 2022-12-10 14:57:33 +00:00
lynxnb
675e8dbb2e Move input handling code to a dedicated class 2022-11-17 21:54:15 +01:00
lybxlpsv
18861d73a3 Set systemUiVisibility during onResume for A11 2022-11-17 14:04:57 +01:00
lynxnb
cc71e7b56c Run emulation in a separate process
Exiting from emulation has always been a big issue for Skyline, with guest and host threads that would keep running in the background unless the app was manually killed. Running emulation in a separate process allows us to kill it when we are done, avoiding the need for complex exiting management code.
2022-11-11 11:49:33 +00:00
lynxnb
b17364bb92 Introduce a dev app flavor for side-by-side installation 2022-10-01 13:01:46 +02:00
PixelyIon
2636a37b31
Introduce alternative FPS measurement for disabled frame throttling
The FPS is implicitly bound to the refresh rate due to the timestamp being that of the presentation time, this leads to a misleading FPS figure for disabled frame throttling. It has now been fixed by using the frame submission time rather than the presentation time when frame throttling is disabled and to make this more apparent the color of the OSD FPS has been changed.
2022-08-06 22:20:54 +05:30
lynxnb
240e7033d7 Support loading a user-selected driver during vulkan initialization 2022-08-06 22:00:19 +05:30
lynxnb
5aa2a4cd1c Rename SettingsValues to NativeSettings
The previous name was chosen as an afterthought and didn't clearly indicate what the purpose of the class is. We needed a separate, simple class without delegates members (like PreferenceSettings), so that its fields can be easily accessed via JNI to get settings values from native code.
2022-07-26 20:16:24 +05:30
lynxnb
5b4ca79dc8 Rename Settings Kotlin class to PreferenceSettings
SharedPreferences will be partially swapped out in the future to support per-game settings. In the meantime, make it clear from which class settings are coming from.
2022-07-26 20:16:24 +05:30
lynxnb
3b27540250 Rename operationMode setting to isDocked 2022-07-26 20:16:24 +05:30
lynxnb
c5dde5953a Rework how settings are shared between Kotlin and native side
Settings are now shared to the native side by passing an instance of the Kotlin's `Settings` class. This way the C++ `Settings` class doesn't need to parse the SharedPreferences xml anymore.
2022-07-26 20:16:24 +05:30
MCredstoner2004
f9a0394577
Implement Software Keyboard applet
This implements the non-inline version of the Software Keyboard (swkbd) applet, which games use to get text input from the user.
2022-07-01 15:19:53 -05:00
Billy Laws
b75a06af1b Support forcing 60Hz display on Xiaomi MIUI
Uses an API found through RE since none of the AOSP APIs work, additionaly the code for setting RR was consolidated to a single function that can be ran after all display updates.
2022-06-09 19:29:18 +01:00
Narr the Reg
7aa6a5c4ca
Add HID touch attribute and index reporting
Adds missing parameter TouchAttribute and emulates correctly the touch point index. Both changes are necessary on Voez to keep track of each finger.
2022-05-29 10:28:51 +01:00
PixelyIon
b45437b78b Move Skyline internal files to external directory
Any Skyline files that should have been user-accessible were moved from `/data/data/skyline.emu/files` to `/sdcard/Android/data/skyline.emu/files` as the former directory is entirely private and cannot be accessed without either adb or root. This made retrieving certain data such as saves or loading custom driver shared objects extremely hard to do while this can be trivially done now.
2022-04-14 14:14:52 +05:30
lynxnb
08e24915d8 Add support for drawing inside the display cutout areas 2022-04-14 14:14:52 +05:30
PixelyIon
b41d8b7997 Use Surface#setFrameRate for suggesting display refresh rate
Setting the refresh rate via the Display API's`preferredDisplayModeId` is an outdated method to do it on Android 11 and above, we now use `Surface#setFrameRate` alongside it to suggest a refresh rate for the display.
2022-04-14 14:14:52 +05:30
Billy Laws
dd91d063a5 Pass native library dir to OS + reorder OS init order so paths are first
This is required for integrating libadrenotools, which needs access to
library and app directories in the GPU class constructor.
2022-04-14 14:14:52 +05:30
lynxnb
58c871ed9a Correctly hide system bars in EmulationActivity on Android >= 11 2022-04-14 14:14:52 +05:30