Commit Graph

74 Commits

Author SHA1 Message Date
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
lynxnb
a9d4e6bb1a Add screen orientation setting 2022-04-14 14:14:52 +05:30
MCredstoner2004
0ceecbba4f Implement fixed aspect ratio surface
Adds a setting to letterbox the surface with black bars to 16:9 or 21:9 aspect ratio to avoid stretching out the rendered image
2022-01-12 22:09:39 +05:30
lynxnb
769e6c933d Make Logger class static and introduce LoggerContext
A thread local LoggerContext is now used to hold the output file stream instead of the `Logger` class. Before doing any logging operations, a LoggerContext must be initialized.
This commit will not build successfully on purpose.
2021-11-11 16:13:24 +01:00
PixelyIon
bed9fbf5e7 Fix EmulationActivity.vibrateDevice assert due to null Vibrator
`EmulationActivity.vibrateDevice` would assert when a `null` Vibrator is provided due to one not being set in the controller configuration. This has now been fixed by the code not playing a vibration when a vibration device isn't selected.
2021-11-01 00:28:11 +05:30
PixelyIon
9e3b7a75b2 Use finishAffinity instead of finishAndRemoveTask
The method used to finish (`finishAndRemoveTask`) an activity prior to going back to `MainActivity` or restarting the process led to the process prematurely exiting entirely and would result in it not being restarted or another activity not being launched. This has now been fixed by utilizing `finishAffinity` in its place which correctly only ends the activities with the same affinity as the caller.
2021-10-29 21:20:04 +05:30
PixelyIon
cfdb2abf9e Fix Non-builtin Uncached Vibrator Getter
If a non-builtin vibrator was attempted to be fetched, it'd insert it in the vibrator cache and return directly as opposed to playing the vibration on it prior to returning. This has now been fixed, the value is both put into the cache and the vibration is played on it.
2021-10-26 21:54:33 +05:30
PixelyIon
39e924aec8 Resume rather than relaunch when same shortcut is used 2021-10-26 10:46:36 +05:30
PixelyIon
bbf28d1942 Improve Clean Exit + Audio Pausing + Improve System Language Setting
* Clean Exiting was improved by implementing a robust system for when to abandon clean exiting and simply restart the process alongside moving clean exiting to the background when the application is quit by using the back button
* Audio is now automatically paused whenever the application is moved to the background and automatically resumed when it's brought to the foreground
* The system language setting had several errors and inconsistencies which have now been fixed, it's been brought more in line with HOS language (Albeit not entirely due to no region setting in Skyline)
* Fix a bug with `ThreadLocal` where the atomic `list` pointer was uninitialized resulting in a `SEGFAULT` during the destructor
2021-10-26 10:46:36 +05:30
PixelyIon
a7548c79a0 Android 12 Support + Update Libraries + Include Khronos Validation Layer
* Fix handling `SA_EXPOSE_TAGBITS` bit being set in Android 12 `sigaction`
* Fix CMake bug using `CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE` when not supported causing `-fuse-ld=gold` to be emitted as a linker flag
* Support using `VIBRATOR_MANAGER_SERVICE` rather than `VIBRATOR_SERVICE` on Android 12
* Optimize Imports for Kotlin code
* Move away from deprecated APIs in Kotlin or explicitly mark where it's not possible
* Update SDK, NDK and libraries
* Enable Gradle Configuration Cache
2021-10-26 10:46:36 +05:30
sspacelynx
221039084e Make languages setting use IntegerListPreference 2021-09-30 02:19:19 +05:30
sspacelynx
3fffde3061 Rework OS to allow passing a language 2021-09-30 02:19:19 +05:30
PixelyIon
6595670a5d Rework Performance Statistics
We used instantaneous values for FPS previously which led to a lot of variation in it and the inability to determine a proper FPS value due to constant fluctuations. All FPS values are now averaged to allow reading out a stable value and a deviation statistic has been added for the frame-time to judge judder and frame-pacing which allows for a significantly better measure of overall performance. The formatting for all the floating-point numbers is now fixed-point to prevent shifting of position due to decimal digits becoming 0.
2021-07-12 21:27:49 +05:30
PixelyIon
6854e07356 Replace LogActivity with "Share Logs" + Add Timestamp to Logger 2021-07-12 21:27:49 +05:30
PixelyIon
e511e158e3 Implement Display Settings + Attach Texture to FenceCycle 2021-07-12 21:27:49 +05:30
PixelyIon
36547cd5dc Redesign Texture Class + Improve Presentation Engine
This commit reworks the `Texture` class to include a Vulkan Image backing that can be optionally owning or non-owning and swapped in with consideration for Vulkan image layout, it also adds CPU-sided synchronization for the texture objects with FenceCycle. It also makes the appropriate changes to `PresentationEngine` and `GraphicBufferProducer` to work with the new `Texture` class while setting the groundwork for supporting swapchain recreation. It also fixes a log in `IpcResponse` and improves the display mode selection algorithm by further weighing refresh rate.
2021-07-12 21:27:49 +05:30
PixelyIon
2143b43068 Vulkan PhysicalDevice + Device Initialization + Report Accurate Version
Vulkan Device initialization is handled now, it supports required extensions but support for optional extensions/features/properties will come in later when we require those. In addition, we now correctly report the version of Skyline to Vulkan which can be accessed from debugging tools. 

There's also a minor change regarding the search pattern for `SkylineLibraries` which now only searches in headers of libraries and it also explicitly excludes the redundant `vulkan.hpp` from the `Vulkan-Headers` repository.
2021-07-12 21:27:49 +05:30
Willi Ye
ce60101989 Filter on screen buttons by controller type 2021-06-17 20:30:22 +05:30
Willi Ye
479209886b Rework search
* Call search once for all formats
2021-06-17 20:30:22 +05:30
Willi Ye
4b53a3b1a6 Enable full screen on resume
* Fix registering of buttons pairs in OSC with multiple fingers
* Enable OSC by default
* Increased OSC scale by default
2021-06-17 20:30:22 +05:30
Willi Ye
f5d5caf939 Switch to viewbinding and di with hilt 2021-06-17 20:30:22 +05:30
Willi Ye
b12b4df35b Assign recenter setting to osc
* Make handheld/pro controller default for controller id 0
2021-06-17 20:30:22 +05:30
Willi Ye
71ca46fe1a Update dependencies and gradle
* Enable OSC if controller id is 0
* Fix night colors
2021-06-17 20:30:22 +05:30
Willi Ye
9f6a5df5e0 Redesign UI
* Change colors
* Replace toolbar in main activity
* Initial implementation of ViewModel
2021-06-17 20:30:22 +05:30
Billy Laws
63c54207d2 Add AndroidAsset{Backing,FileSystem} for accessing built-in assets
These only implement the subset of VFS needed for time, implementing
more is difficult due to some issues in the AAsset API which make
support quite ugly. The abstract asset filesystem can be accessed by
services through the OS class allowing other implementations to be used
in the future.
2021-03-21 18:56:31 +05:30
PixelyIon
fe5061a8e0 Address CR Comments (#132) + Change Core Migration API
This addresses all CR comments including more codebase-wide changes arising from certain review comments like proper usage of its/it's and consistent contraction of it is into it's. 

An overhaul was made to the presentation and formatting of `KThread.h` and `LoadBalance` works has been superseded by `GetOptimalCoreForThread` which can be used alongside `InsertThread` or `MigrateToCore`. It makes the API far more atomic and neater. This was a major point of contention for the design prior, it's simplified some code and potentially improved performance.
2021-03-05 14:55:34 +05:30
◱ PixelyIon
80302cf1ad Update NDK, Gradle and dependencies + Improve Settings API + Migrate to PugiXML 2021-03-05 14:55:34 +05:30
◱ PixelyIon
a5927c5c7b Fix Native-Initiated Exiting 2020-11-22 23:56:17 +05:30
◱ PixelyIon
668f623256 Implement Exceptional Signal Handler + Fix Destruction Behavior
An exceptional signal handler allows us to convert an OS signal into a C++ exception, this allows us to alleviate a lot of crashes that would otherwise occur from signals being thrown during execution of games and be able to handle them gracefully.
2020-11-22 23:56:17 +05:30
◱ PixelyIon
3cde568c51 Run Guest on Main Emulator Thread + Remove Mutex/GroupMutex + Introduce PresentationEngine 2020-11-22 23:56:17 +05:30
Willi Ye
7b13f2d387 Add visibility toggle for osc 2020-11-12 22:19:55 +05:30
Willi Ye
f479aeb4ac Add comments 2020-11-12 22:19:55 +05:30
Willi Ye
7526a985fb Use property delegate to handle preferences
* Add option to disable joystick recentering
2020-11-12 22:19:55 +05:30
Willi Ye
5c4aa95da6 Add on screen controls layout edit settings 2020-11-12 22:19:55 +05:30