Commit Graph

351 Commits

Author SHA1 Message Date
lynxnb
8991ccac65 Pass ViewHolder on bind to RecyclerView items instead of ViewBinding
This change lets items get the updated position of their view holder in the adapter. Fixes an issue where the position of items was not updated after being removed from a `SelectableGenericAdapter`.
2022-08-06 22:00:19 +05:30
lynxnb
240e7033d7 Support loading a user-selected driver during vulkan initialization 2022-08-06 22:00:19 +05:30
lynxnb
c812de48ea Show an undo button after deleting a gpu driver
After a driver has been deleted, a snackbar will be shown confirming the deletion, with an button to undo it.
2022-08-06 22:00:19 +05:30
lynxnb
59c60df993 Add GPU Driver Configuration preference
This preference launches `GpuDriverActivity` for managing custom gpu drivers. When the device has an incompatible GPU, the preference will be disabled and greyed out.
2022-08-06 22:00:19 +05:30
lynxnb
48cf1263bc Add a custom GPU driver configuration activity
The activity adds the following functionalities:
* Lists installed drivers
* Allows the user to install new drivers, or remove installed ones
* Allows the user to select the driver that will be used by the emulator
2022-08-06 22:00:19 +05:30
lynxnb
e9f609b923 Add a gpuDriver preference setting
This setting represent the GPU driver selected by the user to be used by the emulator.
2022-08-06 22:00:19 +05:30
lynxnb
1815199d2b Add utilities for reading and installing gpu driver packages 2022-08-06 22:00:19 +05:30
lynxnb
f3dd3e53c1 Miscellaneous imports cleanup in preference package 2022-08-06 22:00:19 +05:30
lynxnb
1dfea9ef6f Create an ItemDecorations file for all RecyclerView item decorations
All item decorations are now placed in one file so that any `RecyclerView` in the app can use the same ones.
2022-08-06 22:00:19 +05:30
lynxnb
a59f2baa3a Add a SelectableGenericAdapter as subclass of GenericAdapter
`SelectableGenericAdapter` extends `GenericAdapter` with support for marking one item as selected.
2022-08-06 22:00:19 +05:30
lynxnb
e93fdce845 Add support for removal of items from GenericAdapter 2022-08-06 22:00:19 +05:30
lynxnb
0d1c7965df Add a ZipUtils class for unpacking zip files 2022-08-06 22:00:19 +05:30
lynxnb
30667a0899 Remove unused Compact Logs settings
Since we don't have a log viewer in the app anymore, the setting was left unused and can be safely removed.
2022-07-26 20:16:24 +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
f734c4d145 Make log level setting changes immediately active 2022-07-26 20:16:24 +05:30
lynxnb
bb4937121f Remove settings from SharedPreference if they are of the wrong type 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
69cf25b1a7 Initial support for updating settings during emulation + observing settings changes 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
lynxnb
4be8b4cf66 Add missing SPDX licence header 2022-07-26 20:16:24 +05:30
lynxnb
365ca66b1b Make integer settings use IntegerListPreference
Avoids unnecessary type casting of setting values and duplication in resource files.
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
MCredstoner2004
a9ee06914d Add ByteBufferSerializable
This allows sending C-like structs between Kotlin and C++ without struct-specific code
2022-06-30 01:17:32 +05:30
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
PixelyIon
37453ed7fa Use DocumentsProvider for log sharing
We used a `FileProvider` for log sharing prior, this is no longer necessary since it comes under the `DocumentsProvider` now which can be utilized to share the log document directly.
2022-06-01 21:41:14 +05:30
PixelyIon
8efa9298f9 Fix name conflict resolution for copyDocument
Any documents with the same name existing in a directory that is copied to would cause an exception due to existing already, this fixes that by handling conflict resolution in those cases and automatically determining a file name that would avoid a conflict.
2022-06-01 21:41:14 +05:30
PixelyIon
e1cc8676cf Add option to view internal directory
With the Skyline document provider, easy access to the internal directory is required which may be hard to navigate to through the system file manager. This adds an option in settings to directly open up the directory in the system file manager.
2022-05-31 01:25:18 +05:30
PixelyIon
ba97985b55 Revise DocumentsProvider URI structure
The URIs (Document ID + Root) of the Skyline `DocumentsProvider` was unoptimal as it wasn't relative to a base directory. This is required for opening a root without knowledge of the full path in advance, it is therefore cleaner to provide a uniform `ROOT_ID` in a companion class.
2022-05-31 01:25:18 +05:30
Mylah Dee
ee7da31fc6 Add DocumentProvider for accessing internal files
On Android 12 and above, files from an application's external storage directory cannot be accessed by the user. The only proper SAF-compliant way to solve this is to create a `DocumentProvider` which proxies access to internal storage accordingly.
2022-05-30 15:09:30 +05:30
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
36a7ad06bd Use built-in vibrator by default for controller #0
The vibration device had to be set manually prior which led to it generally not being set at all even though a user might want vibration, this commit fixes that by making controller #0 use the built-in vibrator by default.
2022-04-14 14:14:52 +05:30
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
5dea15632c Add Controller Setup Guide
A setup guide for controllers that goes through every available button/stick sequentially and opens up a corresponding dialog to map them.
2022-04-14 14:14:52 +05:30
PixelyIon
e2cae74425 Fix RecyclerView height in CoordinatorLayout for non touch-mode
Any `RecyclerView`s with an app bar in a `CoordinatorLayout` would end up going off-screen due to the layout behavior implementing an offset by using a transform which would not correctly handle focusing on off-screen objects. This has now been fixed by manually adjusting height to be clipped to what is visible on the screen.
2022-04-14 14:14:52 +05:30
PixelyIon
3ae62c7fcc Collapse appBarLayout on appList focus
We collapse the app bar when the focus is on the app list which only occurs while using a controller, this is required as the app bar will never be collapsed otherwise. It also removes the older code to work around the limitation on `View.FOCUS_DOWN` by collapsing only when the end of the list was reached.
2022-04-14 14:14:52 +05:30
PixelyIon
bac7c526ef Make layout selectable for grid items
The entire layout is now selectable for grid items rather than just the card, this greatly increases the visibility of the selection when not in touch mode as the contrast of a darken effect on the icon can be minimal depending on how dark the icon already is.
2022-04-14 14:14:52 +05:30
PixelyIon
1d070e6332 Close InputStream after usage in KeyReader
The `InputStream` would not be closed after reading the key file in `KeyReader#import`, it's now wrapped with `use{ }` which handles closing the stream after usage.
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
PixelyIon
62c16fa73e Upgrade Gradle (7.4), AGP (7.1.2) and Kotlin Dependencies 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
PixelyIon
8f0db18624 Fix ControllerActivity Controller Type Change Crash
If the controller type was changed from a type with a larger amount of buttons/axes to one with a fewer amount, a crash would occur due to the transition animation retaining those elements as children yet returning `NO_POSITION` from `getChildAdapterPosition` in `DividerItemDecoration` which was an unhandled case and led to an OOB array access.
2022-04-14 14:14:52 +05:30
PixelyIon
2c46709064 Fix ControllerPreference's index not being passed to Activity
A bug caused by not passing the index argument to `ControllerActivity` led to all preferences opening the activity that pertained to Controller #1. This was fixed by passing the `index` argument in the activity launch intent.
2022-04-14 14:14:52 +05:30
lynxnb
a9d4e6bb1a Add screen orientation setting 2022-04-14 14:14:52 +05:30
lynxnb
882b939335 Automatically import key files from search location 2022-03-25 09:40:21 +05:30
Robin Kertels
6cf2ef8fb9 Grant Uri permission when sharing logs 2022-03-24 03:39:41 +05:30
Robin Kertels
2993f65a1c Ignore empty lines in key files 2022-02-04 23:51:46 +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
6913a90361 Use the new log file name & ext for every logger context 2021-11-11 16:32:19 +01:00
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
69ef93bfa8 Add Dividers to ControllerActivity's RecyclerView
Dividers after titles were missing in `ControllerActivity` which made it look inconsistent with `SettingsActivity` which did have them. They have now been added by extending `DividerItemDecoration` to be drawn before any `ControllerHeaderItem`.
2021-11-11 20:20:19 +05:30
PixelyIon
36a1f2a2ec Make all Dialogs use @color/backgroundColor as the background color
We wanted the color of the modals used by the dialogs to be the same as our regular background color rather than a lighter grey. This has now been enforced with style attributes in the case of `AlertDialog` and `setBackground` in the case of `BottomSheetDialog`.
2021-11-11 16:34:38 +05:30
lynxnb
df120ab76d Fix unicode characters being turned into emojis for some vendors 2021-11-10 17:41:07 +01:00
lynxnb
b7b0f07ba8 Update application branding
- Logo is now displayed next to the app name
- Remove search bar animation
- New color accent
- Improve visibility of controller binding setting's glyphs
2021-11-10 17:41:07 +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
1d57bab08f Revamp LicenseDialog + Update Licenses + Stop Bintray Usage
* Update licenses for dependent projects
* Add copyright notices (as provided)
* Revamp styling for `LicenseDialog` 
* Fix invisible `PreferenceDialog` buttons in Settings
* Consolidating color variables into `colorPrimary`, `backgroundColor` and `backgroundColorVariant`
* Use `com.google.android.flexbox:flexbox:3.0.0` (Google Maven) rather than `com.google.android:flexbox:2.0.1` (Bintray)
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
4d20d7a4d0 Address CR + Code formatting 2021-09-30 02:19:19 +05:30
sspacelynx
6135f531ae Add refreshRequired xml attribute in IntegerListPreference
This attribute controls whether a rom list refresh will be triggered when the setting value changes.
2021-09-30 02:19:19 +05:30
sspacelynx
221039084e Make languages setting use IntegerListPreference 2021-09-30 02:19:19 +05:30
sspacelynx
c1a3ddcd1c Implement an IntegerListPreference
Unlike `ListPreference`, this preference class uses integers as its values instead of strings, avoiding unnecessary casting. It also doesn't require an array for values: in that case it will be using the clicked entry position as its value.
2021-09-30 02:19:19 +05:30
sspacelynx
fdc7e1238a Implement language support for rom loaders 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
bf2e20565f Check if fragment is attached when doing animations 2021-06-17 20:30:22 +05:30
Willi Ye
ce60101989 Filter on screen buttons by controller type 2021-06-17 20:30:22 +05:30
Willi Ye
2ff06d5421 Apply changed layout to all items
* Fix memory leaks
2021-06-17 20:30:22 +05:30
Willi Ye
7a5684e57f Rework focus for controller 2021-06-17 20:30:22 +05:30
Willi Ye
3c23302b82 Make rom extensions case insensitive
* Use standard margins
* Some clean up
2021-06-17 20:30:22 +05:30
Willi Ye
61c489dc68 Increase trigger distance of swipe to refresh 2021-06-17 20:30:22 +05:30
Willi Ye
e50f5a5d72 Make controller layout more preferences like 2021-06-17 20:30:22 +05:30
Willi Ye
4b7cb176f6 Add mime type to key picker 2021-06-17 20:30:22 +05:30
Willi Ye
8f3390f073 Use activity contracts for callbacks 2021-06-17 20:30:22 +05:30
Willi Ye
8dd4858612 Fix sorting in search 2021-06-17 20:30:22 +05:30
Willi Ye
d225bc9bef Fix search similarity average 2021-06-17 20:30:22 +05:30
Willi Ye
2e76fbe4b6 Add flexbox layout for wrapping
* Save filter selection
* Handle ini comments in key reader
2021-06-17 20:30:22 +05:30
Willi Ye
bcdd2d9027 main: Move title text up and add sub text 2021-06-17 20:30:22 +05:30
Willi Ye
4db75022d2 Add filter and move search bar down
* Fix crashes
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
571e189ecd Make serialVersionUID static
* Some minor cleanup
2021-06-17 20:30:22 +05:30
Willi Ye
dca632d0d8 Correct reset value of global scale 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
1fae3488ad Add button pairings to allow simultaneous pressing 2021-06-17 20:30:22 +05:30
Willi Ye
696f0c7769 Remove injection in dialog fragments
* Set result code in document activity
2021-06-17 20:30:22 +05:30
Willi Ye
a261ff8413 Add extension to retrieve input manager from context 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
ff1b9cb510 Show nsps first 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
sspacelynx
666df1eb43 Add XCI file format support 2021-03-07 22:55:59 +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
◱ PixelyIon
779884edcf Introduce TID to Logger + Fix VMM Bug + Fix NSO Backtrace + Improve Logger 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
Willi Ye
22140defae Rewrite adapter to handle any layout 2020-11-12 22:19:55 +05:30
Willi Ye
e023dbbf0a Add joystick press and general clean up 2020-11-12 22:19:55 +05:30
Willi Ye
3057e4b29a Add on screen controls
* Fix missing default constructor for dialog fragments
2020-11-12 22:19:55 +05:30
◱ PixelyIon
7ad86ec46f Improve span::as_string and other minor fixes 2020-10-02 15:28:48 +00:00
◱ PixelyIon
97ac45d83b Update Logger to use NDK Logger APIs + Improve Backing API + Fix FDSAN issues 2020-10-02 15:28:48 +00:00
◱ PixelyIon
157c54f918 Implement a few HID Functions + Fix FAB handler 2020-10-02 15:28:48 +00:00
◱ PixelyIon
4cc3a3b2e8 Move NVDRV + IHOSBinder Internals to Discrete Components + Fix Lint 2020-09-20 20:07:33 +00:00
Willi Ye
4076d84efc
NCA decryption (#99)
* NCA decryption
* Remove unnecessary new lines
* Remove loader error dialog
* Always show ROMs
* Address CRs
* Add subtitle padding in grid mode
2020-09-14 19:23:40 +05:30
◱ PixelyIon
65019375ca Implement Guest Touch-Screen Support 2020-09-08 12:55:33 +00:00
◱ PixelyIon
1a58a2e967 Implement Rumble Support for Controllers and Device Vibrators 2020-09-06 15:31:20 +00:00
◱ PixelyIon
7290a80c3e Move to Callback for Input Initialization + ConditionalVariable for Surface 2020-08-21 11:48:29 +00:00
◱ PixelyIon
07c2f2d891 Significantly Improve Accuracy of HID
This commit significantly increases the accuracy of the prior HID code due to testing on the Switch. It is now fully accurate in all supported scenarios, them being assignment mode, orientation, color writes and system properties. In addition, review comments were addressed and fixed in the PR.
2020-08-21 11:48:29 +00:00
◱ PixelyIon
ee2fdbdf6a Fix Joy-Con Pair Crash + Implement More HID Service Functions
This fixes a Joy-Con Pair bug which caused a crash when a partner device was set to none while being set as a partner. In addition, the following HID service functions were implemented:
* GetSupportedNpadStyleSet
* ActivateNpadWithRevision
* GetNpadJoyHoldType
* AcquireNpadStyleSetUpdateEventHandle
2020-08-21 11:48:29 +00:00
◱ PixelyIon
6a931b95b0 Implement C++ Support for Controller Configuration
This commit adds support to the C++ end of things for controller configuration. It isn't targeting being 1:1 to HOS for controller assignment but is rather based on intuition of how things should be.
2020-08-21 11:48:29 +00:00
◱ PixelyIon
75d485a9a7 Addition of Controller Configuration UI
This commit adds in the UI for Controller Configuration to Settings, in addition to introducing the storage and loading of aforementioned configurations to a file that can be saved/loaded at runtime. This commit also fixes updating of individual fields in Settings when changed from an external activity.
2020-08-21 11:48:29 +00:00
◱ PixelyIon
8e1f8ae7e9 Make UI fully usable using a controller
This commit focuses on making the UI completely usable using a controller so that a user won't have to switch between their device's touch screen and a controller constantly.
2020-08-21 11:48:29 +00:00
◱ PixelyIon
102f26d08e Refactor C++ Input
This commit refactors the C++ end of Input so it'll be in line with the rest of the codebase and be ready for the extension with multiple players and controller configuration.
2020-08-21 11:48:29 +00:00
◱ PixelyIon
5fec7eefd0 Refactor HID Shared Memory
This commit refactors and reorders a lot of the HID Shared Memory from the previous commits to be in line with the rest of the codebase.
2020-08-21 11:48:29 +00:00
Billy Laws
b167abcdb7 Initial Kotlin Input Implementation
This commit contains the Kotlin side of the initial Input implementation, this is based on the work done in the `hid` branch in `bylaws/skyline`.
Co-authored-by: ◱ PixelyIon <pixelyion@protonmail.com>
2020-08-21 11:48:29 +00:00
Billy Laws
0219eda2db Initial C++ Input Implementation
This commit contains the C++ side of the initial Input implementation, this is based on the work done in the `hid` branch in `bylaws/skyline`.
Co-authored-by: ◱ PixelyIon <pixelyion@protonmail.com>
2020-08-21 11:48:29 +00:00
Billy Laws
6edf89b538
Initial Savedata Implementation (#75)
* Rework VFS to support creating and writing files and introduce OsFileSystem
OsFileSystem abstracts a directory on the device using the filesystem API.
This also introduces GetEntryType and changes FileExists to use it.

* Implement the Horizon FileSystem APIs using our VFS framework
Horizon provides access to files through its IFileSystem class, we can
closely map this to our vfs::FileSystem class.

* Add support for creating application savedata
This implements basic savedata creation using the OsFileSystem API. The
data is stored in Skyline's private directory is stored in the same
format as yuzu.
2020-08-09 01:08:51 +05:30
Willi Ye
f72b81fcea
Make sure icons have a 1:1 ratio (#80)
* Make sure icons have a 1:1 ratio
* Use recyclerview padding to increase grid edge margins
* Fix race condition in searching roms
* Use notify insert for adapter
2020-08-08 23:31:21 +05:30
Willi Ye
1f282af87e More code style aligning
* Null terminate nickname array and correct character limit in settings perference
2020-07-21 18:29:45 +00:00
Willi Ye
93da9f2826 Align code style with project
* Return correct error code for invalid user
* Always return first icon color
2020-07-21 18:29:45 +00:00
Willi Ye
ffb9e743dd Add profile service to support custom usernames 2020-07-21 18:29:45 +00:00
Willi Ye
b86aac26d7 Align with code style and remove unnecessary code 2020-07-21 18:11:43 +00:00
Willi Ye
c3e54d1abf Redesign cards in grid view
* Refactor some classes and clean up
* Refresh style on the fly
2020-07-21 18:11:43 +00:00
Willi Ye
27d7839bcb MainActivity: Fix snackbar overlapping FABs 2020-07-14 09:15:57 +00:00
Billy Laws
b1e15efbab Use new android R APIs for hiding insets 2020-07-08 20:11:55 +00:00
Billy Laws
af709efb15 Kotlin updates for compatibility with the Android R SDK preview 2020-07-08 20:11:55 +00:00
Billy Laws
45b4811c5b Create adaptive icons for pinned games 2020-07-01 06:24:41 +00:00
Billy Laws
a53d6266c7 Implement a basic NSP loader
An NSP (Nintendo Submission Package) is effectively a PFS0 containing
NCAs, there are also tickets and a CNMT file which contains metadata
about updates. The current implementation is very basic and only
support Control and Program NCAs which is enough for loading games.

Support for updates and dlc will be added at a later date.
2020-07-01 06:24:41 +00:00
Billy Laws
a5513bd7e6 Implement an NCA parser and loader
Nintendo Content Archives are used to store the assets, executables
and updates of applications. They support holding either a PFS0 or a
RomFS.

An NCA's ExeFS can be loaded by placing each NSO sequentially into
memory, starting with rtld which will link them together.

Currently only decrypted NCAs are supported, encryption and BKTR
handling will be added at a later time.
2020-07-01 06:24:41 +00:00
Billy Laws
3a23ec06a4 Implement NSO loader
The NSO format is used by all retail games and some homebrew. It
supports compressing sections with lz4 and dynamic linking through the
use of rtld.
2020-06-28 07:54:12 +00:00
Billy Laws
1bb979a7e1 Introduce new loader JNI for parsing application data and port Kotlin
code to use it

This will help ease the process of implementing new formats in the
future and remove duplicated code.
2020-06-20 20:26:53 +00:00
◱ PixelyIon
4d787c904e Improvements to UI/UX
This commit makes a few improvements to the UI/UX:
* Crop Game Icons to ImageView
* Controller Support for Game List
* EmulationActivity is fullscreen now
2020-04-24 17:09:13 +05:30
◱ PixelyIon
05f3e3c3ac Improve NCE and Finish Up Refactor
This commit mainly finishes up refactor by fixing everything brought up in the CR + Improving NCE somewhat and actually killing the child processes properly now.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
c76ef3730b Move to MPL-2.0
We earlier moved to LGPLv3.0 or Later. This was a mistake as what we wanted was being able to link to proprietary libraries but LGPL is the opposite and it allows linking proprietary libraries to libskyline instead. After further consideration, we've moved to MPL-2.0, it allows linking to proprietary libraries and is a standardized license as compared to adding an exception to GPL.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
1c54bff215 Make AppDialog Expand Fully and Fix Race in MainActivity::addEntries
This commit mainly fixes the issue with `AppDialog` where it didn't expand fully in landscape leading to UX issues. In addition, a race condition was fixed in `MainActivity::addEntries`, in regards to `foundCurrent` being returned incorrectly. The text in the performance counters were also made yellow and much more opaque.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
7f78a679c3 Add Performance Statistics to EmulationActivity
This commit adds performance statistics to the emulator that can be toggled in preferences. The layout of `EmulationActivity` was also changed from `ConstraintLayout` to `RelativeLayout` due to poor performance of the former.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
91644255da Add Preference For Always Showing Game Information
This commit mainly adds a preference for always showing the game information. In addition to a tiny tweak to the contributing guidelines.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
4500f54e85 Refactor Activities and Improve MainActivity
This commit mainly refactors all activities to bring them in-line with the guidelines and makes certain improvements such as using `Snackbar`s rather than `Toast`s where possible, Using `CoordinatorLayout` to allow the app bar to hide itself when possible, the app bar has also been consolidated into it's own layout file to increase layout redraw performance as existing views can be used.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
0a5460f4fc Refactor Utilities
This refactors the utilities which at the moment is only `RandomAccessDocument`.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
2ce8581aa6 Refactor + Redesign AppDialog
This commit refactors `AppDialog` by bringing it in line with the guidelines. In addition, it improves the design of it substantially by modifying the layout and making it a `BottomSheetDialogFragment`.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
ce4d295d81 Refactor Preferences and Loaders
This refactors all preferences and loaders in regards to This commit mainly refactors the adapters by adding spacing, comments and following other guidelines. In addition, preferences are now moved into their own sub-package and `LicensePreference` has a minor UI update.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
c9dcb070ad Grid Layout Support
With `RecyclerView` being used rather than `ListView` or `GridView`. It's now possible to display the items in a flexible manner and so support for a grid view in addition to the already existing list view was added in.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
d86d5c1a35 Refactor and Convert Adapters to RecyclerView.Adapter
This commit mainly refactors the adapters by adding spacing, comments and following other guidelines. In addition, it moves from using `BaseAdapter` to `RecyclerView.Adapter` which leads to much cleaner adapter classes.
a
2020-04-23 22:26:27 +05:30
◱ PixelyIon
55a9f8e937 Refactor all Game-related Kotlin Classes/Objects
This refactors most game-related classes and objects mainly adding spacing, adding comments and making improvements if possible.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
f4968793b8 Fix minor inaccuracy with VMM and mutexes
This commit fixes a tiny inaccuracy with the VMM which was a problem with block insertion, The mutexes on the other hand had a minor issue regarding owner checks.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
41ddaf7f33 Add in Licenses to Settings
This commit adds in all the licenses to the end of settings by introducing a new type of preference: "LicensePreference"
2020-04-23 22:26:27 +05:30
◱ PixelyIon
820bbaede5 Fix occurrence of multiple headers in game list + Make TinyXML2 Static
This commit mainly fixes multiple headers in the game list, which was caused by using the wrong variable for the recursive function. In addition, it makes TinyXML2 statically linked to libskyline which makes it the lone shared objects present in APKs.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
72272fa4c2 Replace xdrop/fuzzywuzzy with tdebatty/java-string-similarity
This commit replaced `xdrop/fuzzywuzzy` with `tdebatty/java-string-similarity` as the former is under an incompatible GPLv3 license.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
c37f350c02 Move from GPLv3 to LGPLv3 or later
Skyline has been licensed with GPLv3 but as we want to look into optional ads in the future, and that would require linking AdMob SDKs which are proprietary. So, we decided to move to LGPLv3 so we could keep that option open as a revenue stream. 

We've gathered consent from all contributors for the license change:
* PixelyIon - https://github.com/PixelyIon (Commit Author)
* Zephyren25 - https://github.com/zephyren25
* ByLaws - https://github.com/bylaws
* IvarWithoutBones - https://github.com/IvarWithoutBones
* Cyuubi - https://github.com/Cyuubi
* greggamesplayer - https://github.com/greggameplayer
2020-04-23 22:26:27 +05:30
Max K
38f63eced3 Some small refactoring for the app (#38)
* Add Gradle versions plugin for simple dependency updates
* Update dependency versions
* Refactor MainActivity to be more Kotlin-like
* Simplify LogActivity a little
* Remove useless run calls in GameDialog
2020-04-23 22:26:27 +05:30
◱ PixelyIon
08bbc66b09 Fix CR issues and Game Duplication + Move to Vector for Memory Map
This commit fixed the issues outlined in the CR (Mainly correlated to formatting), moves to a sorted vector from a sorted list for the memory map in addition to using binary search for sorting through rather than iteratively and fixes item duplication in the game list when directory is changed in Settings.
2020-02-15 10:25:14 +00:00
◱ PixelyIon
66d20a9429 Fix GroupMutex and Clock Rescaling
This commit mainly fixes GroupMutex and clock rescaling. In addition, clock rescaling is no longer performed if the CNTFRQ_EL0 of the host device is same as that of the Switch (19.2MHz) which is fairly common on higher end devices.
2020-02-15 10:25:14 +00:00
◱ PixelyIon
d02267c34f Add support for threads and mutexes
This commit adds support for threading and mutexes. However, there is also a basis of conditional variables but these don't work due to the lack of a shared memory model between the guest and host. So, conditional variables will be deferred to after the shared memory model is in place.
2020-02-15 10:25:14 +00:00
◱ PixelyIon
de6d8d8f48 Work on making the kernel thread-safe #1 + add asynchronous ROM scanning
This commit makes the kernel thread safe in some instances (but not fully) and showcases the significantly improved performance over the ptrace method used prior. In addition, scanning for ROMs is now done asynchronously.
2020-02-15 10:25:14 +00:00
◱ PixelyIon
48d47a2b25 Move from dependency on JNI and Implement AtomicMutex
This commit is the start of moving towards a lockless and faster kernel which can run multiple independent threads with fast userspace synchronization.
2020-02-15 10:25:14 +00:00
◱ PixelyIon
abaa404baa Support creating launcher shortcuts for ROMs
This commit adds the ability to create launcher shortcuts to specific ROMs for convenience.
2019-12-11 17:31:12 +00:00
◱ PixelyIon
4a72704c4d Associate with NRO files
This commit adds the ability to open NRO files directly from a file browser rather than the emulator itself.
2019-12-11 17:31:12 +00:00
◱ PixelyIon
8d1545aabf Addition of Dark Theme and Compatibility with Android 10 Dark Mode
This commit adds support for Android Night Mode and adds in a dark theme for the UI.
2019-12-11 17:31:12 +00:00
◱ PixelyIon
4ab9af04ff Add ability to open a ROM directly and Make URI Persistent
Before ROMs needed to be opened by setting the path, now they can be directly opened using the file picker. In addition, Document Tree URIs are now set to be persistent rather than being revoked after reboot.
2019-12-11 17:31:12 +00:00
◱ PixelyIon
c5dce22a8c Fix JNI Race Condition, Fix Release Builds and Fix Searching
This commit fixes JNI race conditions by usage of a mutex, fixes a bug in release builds due to ProGuard member obfuscation and fix searching by fixing the HeaderAdapter filter.
2019-12-11 17:31:12 +00:00
◱ PixelyIon
b3e811d488 Adapt C++ backend to changes
This commit adapts the C++ backend to the Kotlin frontend by moving to usage of file descriptors and, provides an interface to access frontend code via JNI which is used to check the state of the activity and catch events such as surface destruction. In addition, this commit fixes some minor linting errors and changes the CMake version to 3.10.2+.
2019-12-11 17:31:12 +00:00
◱ PixelyIon
e4dc602f4d Migrate to SAF APIs for file access
This commit moves from conventional file access to using URIs and such provided by the SAF APIs.
2019-12-11 17:31:12 +00:00
◱ PixelyIon
9db0c20c92 Move from Java to Kotlin
This commit converts all Java code to Kotlin and improves the structure and performance of most rewritten parts.
2019-12-11 17:31:12 +00:00
◱ PixelyIon
c005d7df74 Framebuffer and NativeActivity
What was added:
* Framebuffer
* NativeActivity
* NV Services
* IOCTL Handler
* NV Devices:
* * /dev/nvmap - 0xC0080101, 0xC0080103, 0xC0200104, 0xC0180105, 0xC00C0109, 0xC008010E
* * /dev/nvhost-as-gpu
* * /dev/nvhost-channel - 0x40044801, 0xC0104809, 0xC010480B, 0xC018480C, 0x4004480D, 0xC020481A, 0x40084714
* * /dev/nvhost-ctrl
* * /dev/nvhost-ctrl-gpu - 0x80044701, 0x80284702, 0xC0184706, 0xC0B04705, 0x80084714
* SVCs:
* * SetMemoryAttribute
* * CreateTransferMemory
* * ResetSignal
* * GetSystemTick
* Addition of Compact Logger
What was fixed:
* SVCs:
* * SetHeapSize
* * SetMemoryAttribute
* * QueryMemory
* A release build would not set CMAKE_BUILD_TYPE to "RELEASE"
* The logger code was simplified
2019-11-15 19:30:04 +00:00
◱ PixelyIon
7ad2e11705 Milestone 3 - Services API
This commit adds the Services API and implements some services. It also changes the name of the application to Skyline and replaces the icon.
2019-09-25 02:28:25 +05:30
◱ PixelyIon
a54f5ff578 Milestone 2 - Memory & IPC Marshalling
This commit introduces a new memory model that supports true shared memory with separate permissions for remote and local processes, implements svcQueryMemory and completes svcGetInfo further, adds IPC support with the IpcRequest and IpcResponse classes.
2019-09-25 02:28:25 +05:30
◱ PixelyIon
9e1e06c64b Milestone 1 - Processes & Threads
Reworks the API a fair bit and adds documentation to almost everything.
2019-09-25 02:28:25 +05:30
◱ PixelyIon
62cb561888 Implement sharing of logs using Hastebin 2019-08-29 18:10:39 +05:30
◱ PixelyIon
3855daa849 Rename to LightSwitch and emu.lightswitch 2019-08-18 12:57:55 +05:30
◱ PixelyIon
3bdbe41c13 Fix: Crash if log file is missing + Crash on random interrupt 2019-07-25 02:31:31 +05:30
◱ PixelyIon
696ebde527 Rewrite C++ parts and UI update
This update took way way too long to create. However, it was worthwhile. :)
2019-07-25 01:49:43 +05:30
◱ PixelyIon
c7fafd3f72 Remove pop-up image for non-libnx NROs 2019-07-04 02:21:45 +05:30
◱ PixelyIon
4da7a9cdbc Support non-libnx NROs 2019-07-04 02:18:43 +05:30
Ryan Teal
07fb87b441
Use NRO0 verification instead of ASET verification 2019-07-03 21:02:59 +01:00
◱ PixelyIon
012b1df5d8 NRO Validation
The NRO files are now validated before they're added to the game list.
2019-07-04 01:25:06 +05:30
◱ PixelyIon
3ed3365d81 UI update: Pop-up Icons
The icons of games will now pop-up if you click on them.
2019-07-04 00:49:21 +05:30
◱ PixelyIon
ae6dddf9f6 UI update: Snackbars + NRO Metadata
This UI updates adds Snackbar notifications for actions and extracts metadata in the form of an icon, name and author from NRO files to display in the game list.

Co-Authored-By: Ryan Teal <zephyren25@users.noreply.github.com>
2019-07-04 00:14:28 +05:30
Ryan Teal
bbf02e29e5
Fix hacky icon loading method 2019-07-03 18:42:12 +01:00
Ryan Teal
f0daeebb03
Clean up imports 2019-07-03 18:28:22 +01:00
Ryan Teal
e84e0c7705
Add NRO icon loading 2019-07-03 18:27:49 +01:00
Ryan Teal
eb8f9928ed
Add NRO TitleEntry parsing 2019-07-03 15:42:08 +01:00
◱ PixelyIon
15f8c4b5f0 Addition of a UI: Settings and NRO list
This update adds a minimal UI.
2019-07-03 04:49:45 +05:30
Ryan Teal
64f2f90087
Add external storage permission dialog 2019-06-30 15:35:25 +01:00
◱ PixelyIon
875fe194f6 Structure Code and Link libunicorn 2019-06-29 19:05:24 +05:30