Commit Graph

146 Commits

Author SHA1 Message Date
◱ PixelyIon
5f072da2b8 Fix GitHub Actions Build + Move Stack to Shared Memory
This commit mainly fixes GitHub Actions builds which were broken due to an outdated version of Android NDK. In addition, it moves all stack to shared memory.
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
Billy Laws
4af37c4367 Refactor am services
Use the new service naming scheme.
Remove redundant casts and template specifiers in response.Push.
2020-04-23 22:26:27 +05:30
Billy Laws
616222a6db Refactor apm services
Use the new service naming scheme.
Switch to std::array for performanceConfig.
2020-04-23 22:26:27 +05:30
Billy Laws
52d47120a8 Refactor audio backend and services
Use the new service naming convention.
Move both audout and audren into one directory.
Close the audio stream upon emulator exit.
2020-04-23 22:26:27 +05:30
Billy Laws
2e0ac9bdd5 Refactor fatal services
Use the new service naming convention.
2020-04-23 22:26:27 +05:30
Billy Laws
644cfbe332 Refactor filesystem services
Use the new service naming convention.
2020-04-23 22:26:27 +05:30
Billy Laws
524cd26649 Refactor HID services
Use the new service naming convention.
Tidy up some unused includes.
Move constants to service namespace.
2020-04-23 22:26:27 +05:30
Billy Laws
f4620dd992 Refactor settings services
Use the new service naming convention.
2020-04-23 22:26:27 +05:30
Billy Laws
c8846ca07b Refactor service manager services
Use the new service naming convention.
Fix some small code style issues with {} on if statements
2020-04-23 22:26:27 +05:30
Billy Laws
ab33f692c6 Refactor time services
Use the new service naming convention.
Split out each sub-service into it's own file.
Fix some incorrect comments.
2020-04-23 22:26:27 +05:30
Billy Laws
704a5bdcb1 Refactor base service implementation
Remove looping support - it is slow and no services use it.
Store service name in in base service class - removes the
need for having sub-services in the service name map.
General code clean up - remove {} from single if statements etc.
2020-04-23 22:26:27 +05:30
Billy Laws
bbe61e37f2 Add support for audio renderer services
Audren is used by many games and homebrews to make use of more advanced
audio features than audout.
2020-02-16 12:53:50 +00:00
Billy Laws
ddd1fc61ef audio: Add support for resampling tracks
Uses the resampling algorithm derived from HOS by the Ryujinx team
to resample the stream on the fly to 48KHz.
It is currently used only in audout.
2020-02-16 12:53:50 +00:00
Billy Laws
93206d5a3c Add support for audio playback via audout
Adds an audio manager to state to manage the creation of audio tracks and an audout service implementation that interfaces with it.
2020-02-16 12:53:50 +00:00
◱ 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
003e9c5a01 Fix issues with not being able to run ROMs concurrently
This commit fixes GroupMutex and by extension issues with trying to run ROMs without quitting the application in between.
2020-02-15 10:25:14 +00:00
◱ PixelyIon
694c8ef4e2 Addition of Conditional Variables
This commit adds working conditional variables, in addition to the mutex and threading implementation. It directly depends on the memory optimization from the previous commit to be able to perform atomic operations on the mutex.
2020-02-15 10:25:14 +00:00
◱ PixelyIon
03b65bd90a Optimize Memory Implementation using Shared Memory
This commit further improves the memory implementation by using shared memory for all allocations so we won't have to depend on a kernel call for doing any host <-> guest memory transfers.
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
Billy Laws
2aebf04b4b guest: Add memory barrier after saving context
Forces all registers to be saved before signalling to the kernel that we
are ready; without this the kernel may read incorrect context data
causing undefined behaviour.
2020-02-15 10:25:14 +00:00
◱ PixelyIon
00cdc1fd6f Refactor the memory implementation and add Regions
This commit does a major refactor of the memory implementation, it forms a memory map which is far cleaner than trying to access it through a handle table lookup. In addition, it creates a common interface for all memory kernel objects: KMemory from which all other kernel memory objects inherit. This allows doing resizing, permission change, etc without casting to the base memory type.
2020-02-15 10:25:14 +00:00
◱ PixelyIon
b13002f0e1 Fix some minor inaccuracies in SVCs and Services
This commit fixes some minor inaccuracies in SVCs and some Service functions.
2020-02-15 10:25:14 +00:00
◱ PixelyIon
36f05ee7e0 Fix svcSignalProcessWideKey and svcWaitSynchronization timeout overflow
This commit mainly just fixes svcSignalProcessWideKey and svcWaitSynchronization and their related issues.
2020-02-15 10:25:14 +00:00
◱ PixelyIon
493a1a93ec Use .clang-tidy and remove madvise DO_FORK/DONT_FORK calls
This commit causes Android Studio to use the .clang-tidy file for configuration and removes madvise DO_FORK/DONT_FORK calls as they cause problems on many devices and are mostly unnecessary.
2020-02-15 10:25:14 +00:00
Billy Laws
81dba3da4b KProcess: Use process_{read, write}_vm to access guest memory
This is much quicker than pread/write however we now need to abide by the
regions permissions, so fallback to pread/write if read/write vm fails.
2020-02-15 10:25:14 +00:00
◱ PixelyIon
65018aedbc Complete making the kernel thread-safe #2 + Fix Shared Memory Implementation
This commit makes the kernel completely thread-safe and fixes an issue that caused libNX games to not work due to an error with KSharedMemory. In addition, implement GroupMutex to allow the kernel threads to run in parallel but still allow them to not overlap with the JNI thread.
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
970dde8c27 Move from ptrace to junction branching and make kernel multithreaded
This commit is a huge step in the direction of better performance, as we move from ptrace to junction branching and have kernel call overhead similar to that of a native kernel call! In addition, this sets the base for the kernel to go fully multi-threaded. However, the kernel is currently not thread-safe and therefore this commit currently causes a crash.
2020-02-15 10:25:14 +00:00
◱ PixelyIon
b84859d352 Remove support for multiple guest processes
This commit removes support for more than one guest processes as it requires a fair bit of extra code to support in addition the HLE service implementations don't support it anyway.
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
3e9bfaec0e Introduce Basic Junction Patching
This commit introduces basic junction patching or patching code to jump to a junction then execute intermediate functions and jump back.
2020-02-15 10:25:14 +00:00
◱ PixelyIon
f7ad017726 Adapt GetDefaultDisplayResolution to Push/Pop System
The PR: https://github.com/skyline-emu/skyline/pull/13 added in GetDefaultDisplayResolution but it used the older WriteValue function to write the data back. Moving to the Push/Pop system fixes this.
2019-12-11 17:31:12 +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
38716989ae Improve IPC interface
This commit changes how IPC is interacted with in two ways:
* Simplify all buffers into just InputBuffer and OutputBuffer
* Use pushing/popping for data payload
2019-12-11 17:31:12 +00:00
◱ PixelyIon
745cb208a6 Optimize deswizzling implementation and support multiple formats
The deswizzling implementation currently writes linearly and reads non-linearly, this is non optimal as the MMU cannot read ahead. This flips that and reads linearly while it writes non-linearly. This is based on: 324a3624ac/nx/source/display/framebuffer.c (L189).
2019-12-11 17:31:12 +00:00
◱ PixelyIon
e11d7d9ce0 Fix threading implementation & Fix SVC logging
This commit fixes the threading implementation and fixes errors in SVC logging and improves them in general.
2019-12-11 17:31:12 +00:00
◱ PixelyIon
1956a3bbbb Make SVCs more accurate & Improve KSharedMemory
This commit adds logging to almost all SVCs with the exception of svcGetSystemTick and adds accurate error handling to them. It also improves how KSharedMemory is handled.
2019-12-11 17:31:12 +00:00
◱ PixelyIon
26a67f70b7 Move services out of the kernel and fix service registration
In addition, this adds a constructor for "RegionInfo".
2019-12-11 17:31:12 +00:00
◱ PixelyIon
8aea45170f Move to GitHub Actions for CI
This commit adds a GitHub Actions Workflow for Continuous Integration.
2019-12-11 22:32:47 +05:30
greggameplayer
42239ae58b Implement additional applet services and functions
This commit implements the services ISystemAppletProxy, IOverlayAppletProxy & IAppletCommonFunctions and implements the function GetDefaultDisplayResolution.
2019-11-17 22:29:58 +00:00
◱ PixelyIon
0d141b71e9 Min. API version to 26 (8.0) and use ASharedMemory
Move Minimum API version to Android 8.0 and switch from /dev/ashmem to ASharedMemory APIs.
2019-11-16 01:08:50 +05:30