Commit graph

2207 commits

Author SHA1 Message Date
TheASVigilante ae1566a482 Fix accidental recursion with trap handling 2024-04-28 20:04:22 +02:00
lynxnb 83111c2ae7 Move memory trapping infrastructure outside of NCE 2024-04-27 16:15:29 +02:00
TheASVigilante 9dd03dc2bb Replace sirit submodule 2024-04-27 15:52:09 +02:00
lynxnb a503ca19bc Use a repository variable to control CI artifact upload for PRs 2024-03-01 10:54:05 +01:00
lynxnb d5d6e677ca Rework CI to only upload artifacts for PR builds
CI now performs build checks on pushes to the master branch only.
For pull requests, the dev variant of the app is built and artifacts are uploaded for ease of testing and side-by-side installation. PR builds use autogenerated debug signing keys, resulting in different keys being used for each build on purpose to ensure they cannot be installed over each other, avoiding any possible conflict between two PRs.
2024-02-27 23:11:15 +01:00
TGP17 812b1d7646
Build the correct app variant in CI (#248) 2024-02-27 11:04:05 +01:00
lynxnb 686a25120b Move SvcTable definition out of header files 2024-02-23 15:06:40 +01:00
lynxnb 18626a4251 Introduce a generic register context for SVCs
`SvcContext` represents a common interface for accessing registers from SVCs, decoupling them from a particular thread context.
2024-02-23 15:06:40 +01:00
Niccolò Betto 44225a6237
Merge pull request #245 from strato-emu/memman-guestaddr
Rework `MemoryManager` to use guest addresses everywhere
2024-02-22 08:59:33 +01:00
lynxnb 80b3b223c8 KProcess: correctly handle empty optional chunk 2024-02-22 08:53:45 +01:00
lynxnb b51c31dc72 memory: update KMemory to use guest addresses 2024-02-21 15:40:23 +01:00
lynxnb 8addba3273 memory: use guest addresses everywhere
The memory manager has been reworked to handle addresses in the guest address space, and applying an offset to get the address on the host whenever memory needs to be mapped/unmapped/reprotected.
2024-02-21 15:40:05 +01:00
lynxnb d693cac5da memory: fix insertion at the beginning of the chunks map
The memory manager was incorrectly inserting chunks when the new chunk was being inserted at the beginning of the chunks map (no previous chunk available). The existing chunk was resized to an empty chunk (correctly), but the new chunk was never inserted because of `std::map::insert` skipping insertion on an already existing key.
This resulted in an empty chunk being left at the beginning of the map, causing infinite loops for code that worked by scanning the chunks map.

Usages of `std::map::operator[]` have also been replaced with the safer `insert_or_assign`.
2024-02-21 15:39:48 +01:00
Niccolò Betto 914c28aa91
Merge pull request #244 from strato-emu/symbol
Loader modifications to support 32-bit executables
2024-02-21 15:37:00 +01:00
lynxnb f9f9b6de71 Loader: skip patching non 64-bit executables 2024-02-21 15:17:51 +01:00
lynxnb bdb4e3fdd8 Loader: make dynsym handling more generic
dynsym is not hardcoded to handle Elf64_Sym only anymore, and a templated ResolveSymbol function has been introduced to easily support Elf32_Sym lookup in the future.
2024-02-21 15:04:44 +01:00
lynxnb 1102f42730 Move symbol hooking setup code out of loader 2024-02-21 15:04:35 +01:00
Pablo González c87f753893
Make navigation bar transparent (#203) 2024-01-29 17:31:08 +01:00
Niccolò Betto 0b0e48c647
Fix invalid switch-case syntax resulting from nvdrv macro expansion (#242) 2024-01-29 17:19:03 +01:00
Adrien Bouillon 6346c2693c
Add basic support for Google Game Dashboard (#240) 2024-01-29 17:11:05 +01:00
Pablo González d2b2b0fabe
Add toString to exceptions in Gradle (#241) 2024-01-29 17:10:06 +01:00
Pablo González f15d0ef22c
Use string resources in ProfilePicturePreference (#198) 2024-01-29 17:09:43 +01:00
Pablo González b4e763202f
Fix try-catch in save import (#197) 2024-01-29 17:09:29 +01:00
Dubrova Dzmitry 135b7f31c9
Implement info reading from Ro section (#173) 2024-01-13 19:32:38 +01:00
Pablo González 1323259155
Iterate through siblings without recursion in vfs::TraverseDirectory (#205)
Prevents a stack overflow because of recursion depth.
2024-01-05 15:50:14 +01:00
Ishan0981 3fb7f9b81a
Fixed hide invalid files preference title not showing (#231) 2024-01-05 15:41:35 +01:00
lynxnb 2ee8d36b9e Misc Gradle build script cleanup 2024-01-05 02:19:03 +01:00
lynxnb 29d1717ce9 Update CI to use the latest dependencies 2024-01-05 02:19:03 +01:00
lynxnb 557f8ae9c8 Update JVM target to Java 17 2024-01-05 02:19:03 +01:00
lynxnb 91353a8dd8 Update Kotlin to 1.9.22 2024-01-05 02:19:03 +01:00
lynxnb 4c59723149 Update Android dependencies + bump compileSdk to 34 2024-01-05 02:19:03 +01:00
lynxnb b73d5bd4f0 Disable unused jetifier
As it is unused, Android Studio suggests to disable it for faster builds.
2024-01-05 02:19:03 +01:00
lynxnb 63d17dd9fb Update to Gradle 8.2 + AGP 8.2.1
- Migrated to buildConfig gradle attribute
- Migrated to non-transitive R classes
2024-01-05 02:19:03 +01:00
lynxnb fbb139a179 Disable Gradle configuration cache
Configuration cache causes issues with our version generation code in the gradle build script. We compute the version name and version code based on git information, and configuration cache saves those values by default, needing a manual reload of the gradle project to refresh them.
There's currently no way to avoid caching the version name and version code in the configuration cache, so we need to turn it off altogether.
2024-01-05 02:19:03 +01:00
lynxnb 350f36d52f Remove the LLVM submodule 2024-01-04 17:52:52 +01:00
lynxnb 45aa3945a3 Update NDK to 26.1.10909125
Starting from version 26+, the NDK is based on LLVM 17 and comes with Clang 17 featuring full language and library C++20 support.
This means we can get rid of the massive LLVM submodule in the repo, which will be done in a following commit.
2024-01-04 17:52:52 +01:00
lynxnb c3f14ba2a7 Remove hasFragileUserData from the app manifest
It was effectively unused, and only caused issues for users, even after proper implementation that enabled it on signed builds only.
2024-01-04 16:40:57 +01:00
lynxnb da33f10a2a Show the current version in main activity 2024-01-04 16:40:57 +01:00
lynxnb 3fa832c5c9 Introduce proper versioning based on git tags
Version code uses the number of commits until the last tag.
Version name uses the tag name if HEAD is a tag, otherwise it uses the last tag name followed by the branch name and the short commit hash.
2024-01-04 16:40:57 +01:00
lynxnb cf1f01fa17 Remove outdated Skyline credits 2024-01-04 16:40:57 +01:00
lynxnb 421c2f4653 Change package name to org.stratoemu.strato 2024-01-04 16:40:57 +01:00
lynxnb 396bc64fb7 Delete outdated translations 2024-01-04 16:40:57 +01:00
lynxnb 7f92a435f7 Update IDE scopes 2024-01-04 16:40:57 +01:00
lynxnb cbc9c8ba04 ide: Update run configurations + exclude new files 2024-01-04 16:40:57 +01:00
lynxnb 74173a3967 Rework signal handling to remove per-thread handlers
Since the latest Android updates, which most users received in the form of August 2023 security patches, the Android runtime seems to rely on handling SIGSEGV via sigchain while performing JNI calls. We were hooking libc directly to inject our own signal handlers, so that they could run and restore the host TLS since the signal might have been generated in guest code. However, due to how we dispatched signals, the ART handlers were never called and the app crashed whenever a JNI call was made after installing our handlers.

This commit reworks signal handling to remove per-thread handlers. We now make a distinction between guest signals and host signals, and two new functions to set signal handlers have been introduced: `SetGuestSignalHandler` and `SetHostSignalHandler`. This greatly simplifies our signal handling code and allows us to get rid of some thread-local state.

Because of the above distinction, we install a "guest-safe" signal handler only when a guest signal is set. The guest-safe signal handler calls guest handlers only for guest signals, or falls back to the host handler if that's not the case.
Once a guest handler exists for a particular signal, we query libc sigaction as well as the sigchain-hooked sigaction and compare the results, and in case they differ we call sigchain's sigaction so that the host handler is correctly chained, ensuring no host handler can accidentally override the sigchain handler.
2023-11-30 22:45:50 +01:00
lynxnb 644c8f3cd4 Construct queue consumer threads after queues
CommandScheduler and PresentationEngine both constructed the consumer threads before their CircularQueues, this resulted in a data race that would lead to a segfault if the threads were scheduled for execution quickly enough, as they would read uninitialized memory.
2023-11-30 22:45:50 +01:00
PabloG02 b0207ab645 Address feedback 2023-09-21 11:07:48 +02:00
PabloG02 35b90c96a5 Stub ActivateConsoleSixAxisSensor and InitializeSevenSixAxisSensor 2023-09-21 11:07:48 +02:00
PabloG02 4f6d5b2884 Stub SetShimLibraryVersion 2023-09-21 11:07:48 +02:00
PabloG02 395e08d002 Stub GetIndirectLayerConsumerHandle 2023-09-21 11:07:48 +02:00