Commit graph

2728 commits

Author SHA1 Message Date
Lioncash
981faea4d6 hid: Update service function table for hidbus
Updated based off information provided by Switchbrew.
2018-10-21 16:51:46 -04:00
Lioncash
5ea4cfd499 am: Add the basic skeleton for the tcap service
Added based off information provided by Switchbrew.
2018-10-21 16:50:17 -04:00
Lioncash
edb1c36a87 am: Update service function tables
Updated based off information from Switchbrew
2018-10-21 16:40:20 -04:00
Lioncash
ae7f55947e prepo: Update service function table.
Also introduces the new prepo:a2 service.

Updated based off information provided by Switchbrew.
2018-10-21 16:22:10 -04:00
Lioncash
a806c78a1a lbl: Update service function table names
Updated based off information provided by Switchbrew.
2018-10-21 16:15:32 -04:00
David Marcec
a03600ba28 Added auto controller switching to supported controllers and single joycon button rotation
This is a subset of the better-hid-2 changes, this fixes input in various games which don't support dual joycons. This pr will search for the next best controller which is supported by the current game
2018-10-20 15:07:18 +11:00
bunnei
60317e6306
Merge pull request #1520 from lioncash/san
svc: Add missing sanitizing checks for MapSharedMemory/UnmapSharedMemory
2018-10-19 22:58:57 -04:00
bunnei
bf66930fb9
Merge pull request #1526 from lioncash/svc-id
service: Update function tables
2018-10-19 22:53:26 -04:00
bunnei
52b25e0fb9
Merge pull request #1530 from DarkLordZach/aoc-8
aoc_u: Stub GetAddOnContentListChangedEvent
2018-10-19 22:53:00 -04:00
bunnei
298ebf444f
Merge pull request #1516 from lioncash/hid
hid: Minor cleanup-related changes
2018-10-19 22:52:31 -04:00
Zach Hilman
7e0d2fc994 aoc_u: Stub GetAddOnContentListChangedEvent
This event signals the game when new DLC is purchased from the eShop while the game is running. Since, for the forseeable future, yuzu will not have this ability, it seems safe to stub with a dummy event that will never fire. This is needed to boot Sonic Mania Plus (update v1.04).
2018-10-19 21:21:37 -04:00
David Marcec
7a7dad05c0 Stubbed home blocking
Needed by arms due to new hid rework
2018-10-20 00:01:10 +11:00
Lioncash
1833498617 es: Update service function tables
Updated based off information provided by Switchbrew.
2018-10-19 04:12:28 -04:00
Lioncash
a653be3510 audio: Update service function tables
Updated based off information provided by Switchbrew.
2018-10-19 04:09:12 -04:00
Lioncash
2b9fd23058 omm: Update service function tables
Updated based off information provided by Switchbrew.
2018-10-19 04:04:59 -04:00
Lioncash
4f52800822 nifm: Update service function tables
Updated based off information provided by switchbrew.
2018-10-19 04:00:41 -04:00
Lioncash
f6c5a48dd1 hid: Update service function tables
Updated based off information provided by Switchbrew.
2018-10-19 03:59:15 -04:00
Lioncash
d0cda7fe40 nim: Add the basic skeleton of the nim:eca service
Added based off information provided by Switchbrew
2018-10-19 03:46:18 -04:00
Lioncash
d16bafc99d ns: Update service function table
Updated based off information provided by Switchbrew.
2018-10-19 03:41:38 -04:00
Lioncash
a056b284cf set_cal: Update service function table
Updated based on information from Switchbrew.
2018-10-19 03:26:56 -04:00
bunnei
fdd82b754a
Merge pull request #1523 from lioncash/lock
svc: Add missing error checks in svcArbitrateLock/svcArbitrateUnlock
2018-10-18 21:50:45 -04:00
Lioncash
4b5ae8dbaa svc: Check for word alignment of addresses within svcArbitrateLock/svcArbitrateUnlock
The kernel itself checks whether or not the provided addresses are word
aligned before continuing, so we should be doing the same.
2018-10-18 13:01:29 -04:00
Lioncash
d27f4a4928 common: Move Is4KBAligned() to alignment.h
Aligning on 4KB pages isn't a Switch-specific thing, so this can be
moved to common so it can be used with other things as well.
2018-10-18 12:57:02 -04:00
David Marcec
98c7a6d622 Used better names for mm:u and fixed bad stub
InitializeWithId needs to return an id which is a u32 which should be a non zero value
2018-10-19 01:09:34 +11:00
Lioncash
33830aa65a svc: Add missing sanitizing checks for MapSharedMemory/UnmapSharedMemory
Now that the changes clarifying the address spaces has been merged, we
can wrap the checks that the kernel performs when mapping shared memory
(and other forms of memory) into its own helper function and then use
those within MapSharedMemory and UnmapSharedMemory to complete the
sanitizing checks that are supposed to be done.
2018-10-18 02:01:21 -04:00
Lioncash
452aa30cb7 hid/controller: Remove unused header inclusions
swap.h only needs to be present in the header for the type aliases and
definitions, it's not actually needed in the cpp files though. input.h
is just unused entirely in xpad.h
2018-10-17 20:52:45 -04:00
Lioncash
7f52dc1790 hid/controller/npad: Remove unused dump_idx member variable
Given it's unused, we may as well toss it.
2018-10-17 20:52:45 -04:00
Lioncash
7eb2328d8e hid/controller/npad: Remove unnecessary semicolon from the closing brace of LedPattern's constructor 2018-10-17 20:52:45 -04:00
Lioncash
929ed59f1f hid/controller/npad: Remove #pragma once from the cpp file
This is only useful in headers.
2018-10-17 20:52:45 -04:00
Lioncash
aeda743446 hid/controller/npad: Move npad_id_list into the cpp file
This is just a lookup table, and since it's private, there's nothing
really stateful about it, so we can just move it into the cpp file.
2018-10-17 20:52:45 -04:00
Lioncash
aeca224890 hid/controller/npad: Remove unnecessary const from void return type
This literally does nothing.
2018-10-17 20:52:45 -04:00
Lioncash
46202e984e hid/controller: Default the destructors of all controller types in the cpp file
These classes are non-trivial and are definitely going to be changed in
the future, so we default these to prevent issues with forward
declarations, and to keep the compiler from inlining tear-down code.
2018-10-17 20:52:43 -04:00
Lioncash
119b47f366 controller_base: Default the base class constructor and destructor in the cpp file
The destructor doesn't need to be a pure-virtual function.
2018-10-17 20:51:54 -04:00
bunnei
7dee60d7d2
Merge pull request #1444 from ogniK5377/better-hid
"Better Hid" Rework Part 1
2018-10-17 20:25:17 -04:00
bunnei
6e8752881c
Merge pull request #1498 from lioncash/aslr
svc: Clarify enum values for AddressSpaceBaseAddr and AddressSpaceSize in svcGetInfo()
2018-10-17 18:31:51 -04:00
David Marcec
8144fa42bd Using dual joycons as the default controller
Reason for the change is to allow both docked and undocked mode to work
2018-10-18 00:11:47 +11:00
David
92d8ad3770 Implement VI ConvertScalingMode (#1475)
* Implement VI ConvertScalingMode

* Fixed push enum

* Scale mode now uses Nintendo scale mode as an enum as well
2018-10-16 11:25:42 -04:00
bunnei
88b8383da2
Merge pull request #1502 from lioncash/unique
core: Convert shared_ptr instances into unique_ptr instances where applicable for System and Cpu
2018-10-16 11:21:42 -04:00
Lioncash
39ae73b356 file_sys/registered_cache: Use unique_ptr and regular pointers instead of shared_ptrs where applicable
The data retrieved in these cases are ultimately chiefly owned by either
the RegisteredCache instance itself, or the filesystem factories. Both
these should live throughout the use of their contained data. If they
don't, it should be considered an interface/design issue, and using
shared_ptr instances here would mask that, as the data would always be
prolonged after the main owner's lifetime ended.

This makes the lifetime of the data explicit and makes it harder to
accidentally create cyclic references. It also makes the interface
slightly more flexible than the previous API, as a shared_ptr can be
created from a unique_ptr, but not the other way around, so this allows
for that use-case if it ever becomes necessary in some form.
2018-10-16 09:38:52 -04:00
bunnei
9b21fbd1eb
Merge pull request #1494 from DarkLordZach/aoc-signature-fixes
aoc: Fix various bugs in current AOC implementation
2018-10-15 18:34:02 -04:00
Lioncash
5484742fda core_cpu: Make Cpu scheduler instances unique_ptrs instead of shared_ptrs 2018-10-15 14:15:56 -04:00
Lioncash
90f8474fc1 svc: Clarify enum values for AddressSpaceBaseAddr and AddressSpaceSize in svcGetInfo()
So, one thing that's puzzled me is why the kernel seemed to *not* use
the direct code address ranges in some cases for some service functions.
For example, in svcMapMemory, the full address space width is compared
against for validity, but for svcMapSharedMemory, it compares against
0xFFE00000, 0xFF8000000, and 0x7FF8000000 as upper bounds, and uses
either 0x200000 or 0x8000000 as the lower-bounds as the beginning of the
compared range. Coincidentally, these exact same values are also used in
svcGetInfo, and also when initializing the user address space, so this
is actually retrieving the ASLR extents, not the extents of the address
space in general.
2018-10-14 20:11:16 -04:00
Zach Hilman
5737441374 aoc: Read DLC base title ID from RegisteredCache
Falls back to title ID + 0x1000, which is what HOS does.
2018-10-14 18:58:14 -04:00
bunnei
0d2ba0a320
Merge pull request #1491 from lioncash/reference
filesystem: Make CreateFactories() and InstallInterface() take a VfsFilesystem by reference
2018-10-14 14:42:57 -04:00
bunnei
2f8ca32020
Merge pull request #1492 from lioncash/proc
svc: Implement svcGetProcessInfo
2018-10-14 14:37:58 -04:00
David Marcec
92fae7e1ab Stop all threads on svcBreak
This should help diagnose crashes easier and prevent many users thinking that a game is still running when in fact it's just an audio thread still running(this is typically not killed when svcBreak is hit since the game expects us to do this)
2018-10-14 18:14:51 +11:00
Zach Hilman
7e2096db8a aoc: Return size in ListAddOnContent 2018-10-13 22:52:54 -04:00
Lioncash
1c7a7ed79b svc: Implement svcGetProcessInfo
A fairly basic service function, which only appears to currently support
retrieving the process state. This also alters the ProcessStatus enum to
contain all of the values that a kernel process seems to be able of
reporting with regards to state.
2018-10-13 17:00:43 -04:00
Lioncash
0149162dba filesystem: Make CreateFactories() and InstallInterface() take a VfsFilesystem instance by reference
Neither of these functions alter the ownership of the provided pointer,
so we can simply make the parameters a reference rather than a direct
shared pointer alias. This way we also disallow passing incorrect memory values like
nullptr.
2018-10-13 11:36:35 -04:00
bunnei
c2aa4293ec
Merge pull request #1483 from lioncash/codeset
kernel/process: Make CodeSet a regular non-inherited object
2018-10-12 22:52:12 -04:00