Commit graph

2165 commits

Author SHA1 Message Date
Lioncash
73b7748984 am/applets: Make the applet data broker part of the applet itself.
The accessor should be doing just that, accessing, rather than retaining
the lifetime of the data broker as well.
2018-11-20 12:36:33 -05:00
Lioncash
8b4b560df5 am/applets: Replace includes with forward declarations where applicable
Also resolve places where includes should have been provided, but
weren't.
2018-11-20 11:53:55 -05:00
Lioncash
dd254c603d am/applets: Relocate comments above the relevant data member in AppletDataBroker
Avoids wonky wrapping and makes it nicer to read.
2018-11-20 11:49:49 -05:00
bunnei
b6d2c64f4d
Merge pull request #1667 from DarkLordZach/swkbd
am: Implement HLE software keyboard applet
2018-11-20 08:24:11 -08:00
Lioncash
34e4aaddd9 lm: Implement SetDestination by doing nothing
This service function was likely intended to be a way to redirect where
the output of a log went. e.g. Firing a log over a network, dumping over
a tunneling session, etc.

Given we always want to see the log and not change its output. It's one
of the lucky service functions where the easiest implementation is to
just do nothing at all and return success.
2018-11-19 18:09:40 -05:00
Zach Hilman
a9fa890f14 software_keyboard: Fix erroneous extra PushNormalData 2018-11-19 16:30:17 -05:00
Zach Hilman
d68795c665 software_keyboard: Return correct result code on user cancel operation 2018-11-19 15:10:01 -05:00
Zach Hilman
32775125b7 applet: Add AppletDataBroker to manage HLE to AM service interaction
This cleans up most of the callbacks and such in the Applets::Applet interface, while also properly implementing all four data channels.
2018-11-19 14:24:36 -05:00
Zach Hilman
96535c13a5 software_keyboard: Use correct offset for inital text string 2018-11-19 11:22:04 -05:00
Lioncash
43e7c6cf49 ldr: Clean up error codes
The separate enum isn't particularly necessary here, and the values can
just be directly put into the ResultCode instances, given the names are
also self-documenting here.
2018-11-19 08:12:25 -05:00
Zach Hilman
c3becdbca7 filesystem: Clear registered union paths on factory creation 2018-11-18 23:31:30 -05:00
Zach Hilman
3a6cd5b3c8 hid: Use player-defined controller type as PREFERRED_CONTROLLER 2018-11-18 23:22:36 -05:00
Zach Hilman
55ded706d6 hid/npad: Update NPad to use player controller bindings and type 2018-11-18 23:22:36 -05:00
Zach Hilman
e9145c3e16 hid/touchscreen: Update Touchscreen to use advanced parameters
Including finger ID, diamater x/y, and angle. Additionally, checks if the touchscreen is enabled.
2018-11-18 23:22:36 -05:00
Zach Hilman
3b25426bd9 hid: Add controller bindings for Mouse controller 2018-11-18 23:22:36 -05:00
Zach Hilman
0fd45e78f4 hid: Add keyboard bindings for Keyboard controller 2018-11-18 23:22:36 -05:00
Zach Hilman
06cf050c0a hid: Add controller bindings for DebugPad controller
Used by developers to test games, not present on retail systems. Some games are known to respond to DebugPad input though, for example Kirby Star Allies.
2018-11-18 23:22:36 -05:00
David Marcec
0c3e7b7086 Added missing start/end touch attributes to touchscreen 2018-11-18 23:21:33 -05:00
David Marcec
f66c6fe554 Added debugpad skeleton 2018-11-18 23:21:33 -05:00
David Marcec
362b28d052 Added controller helper funcs 2018-11-18 23:21:33 -05:00
David Marcec
a69b9d73f5 Changed polling rate of hid and Right joycon rotation 2018-11-18 23:21:33 -05:00
David Marcec
7fbe2c83a7 Left joycon rotation button remapping 2018-11-18 23:21:33 -05:00
David Marcec
b9c1e4b0e7 Added automatic npad switch based on supported stylesets 2018-11-18 23:21:33 -05:00
David Marcec
beab38601b Added multi-input support and controller assignment at any port 2018-11-18 23:21:33 -05:00
David Marcec
60fecee1ec Removed hard coded values for width and height 2018-11-19 15:20:47 +11:00
Zach Hilman
ea680bea60 software_keyboard: Check for UTF-8 config flag 2018-11-18 23:14:48 -05:00
bunnei
e34d47e6e3
Merge pull request #1620 from DarkLordZach/ldr-ro
ldr_ro: Complete LDR:RO implementation
2018-11-18 19:23:38 -08:00
bunnei
f08b4cbbc8
Merge pull request #1718 from ogniK5377/lets-go-softlock
Implemented CalculateStandardUserSystemClockDifferenceByUser
2018-11-18 19:22:47 -08:00
bunnei
611141e09f
Merge pull request #1671 from DarkLordZach/vi-disconnect
vi: Implement TransactParcel for Disconnect and DetachBuffer
2018-11-18 19:18:46 -08:00
Zach Hilman
02e6602baa software_keyboard: Push all data over all channels on dialog completion 2018-11-18 10:53:47 -05:00
Zach Hilman
4ee087fb3c applet: Use std::queue instead of std::vector for storage stack 2018-11-18 10:53:47 -05:00
Zach Hilman
19b2571aec applet: Add operation completed callback 2018-11-18 10:53:47 -05:00
Zach Hilman
6209fe0c27 software_keyboard: Push buffer size to offset 0x4 in output data 2018-11-18 10:53:47 -05:00
Zach Hilman
8b433beff3 software_keyboard: Make GetText asynchronous
a
2018-11-18 10:53:47 -05:00
Zach Hilman
7cfb29de23 am: Allow applets to push multiple and different channels of data 2018-11-18 10:53:47 -05:00
Zach Hilman
3cf7246e37 am: Implement ILibraryAppletAccessor IsCompleted and GetResult 2018-11-18 10:53:47 -05:00
Zach Hilman
fed6ab14c3 am: Implement text check software keyboard mode
Allows the game to verify and send a message to the frontend.
2018-11-18 10:53:47 -05:00
Zach Hilman
e696ed1f4d am: Deglobalize software keyboard applet 2018-11-18 10:53:47 -05:00
Zach Hilman
48fcb43585 am: Construct and use proper applets with ILibraryAppletAccessor
Allows use of software keyboard applet and future applets to be easily added by adding enum ID and a switch case.
2018-11-18 10:53:47 -05:00
Zach Hilman
de16c1e453 am/applets: Add connector between frontend and AM applet classes
Provides a middleman between the Frontend provider class and the expected AM::Applets::Applet class needed by ILibraryAppletAccessor
2018-11-18 10:53:47 -05:00
Zach Hilman
5b95de0c9c am/applets: Add Applet superclass to describe a generic applet
Adds an Initialize and Execute methods which are used by the ILibraryAppletAccessor to start and control the applet.
2018-11-18 10:53:47 -05:00
Zach Hilman
731b4bd691 am: Unstub ILibraryAppletAccessor::Start
Now starts the applet provided in constructor.
2018-11-18 10:53:47 -05:00
Zach Hilman
ba03bfa430 am: Implement PopInteractiveOutData and PushInteractiveInData
Used by software keyboard applet for data transfer.
2018-11-18 10:53:47 -05:00
Zach Hilman
5ce6b8fea7 am: Convert storage stack to vector
std::stack was no longer suitable for non-trivial operations
2018-11-18 10:53:47 -05:00
Zach Hilman
0682a908c0 am: Move AM::IStorage to header
Needs to be accessible by applet files.
2018-11-18 10:53:47 -05:00
Zach Hilman
c7b6c9de9c am: Move IStorageAccessor to header and update backing buffer
Writes to an AM::IStorage object through an IStorageAccessor will now be preserved once the accessor is destroyed.
2018-11-18 10:53:47 -05:00
Zach Hilman
76d515327b am: Implement CreateTransferMemoryStorage
Creates an AM::IStorage object with the contents of the transfer memory located at the handle provided.
2018-11-18 10:53:47 -05:00
Zach Hilman
51af996854 ldr_ro: Add error check for memory allocation failure 2018-11-17 21:40:26 -05:00
Zach Hilman
c91dc417d5 vi: Implement TransactParcel for Disconnect and DetachBuffer
Used by homebrew on exit. According to switchbrew, returns an empty response parcel with one zero in it.
2018-11-17 17:10:19 -05:00
MysticExile
03f274d8c1 Stubbed am:EnableApplicationCrashReport 2018-11-17 15:05:55 +01:00
bunnei
0149b4245c
Merge pull request #1711 from ogniK5377/bluetooth-lets-go
Added various bluetooth based cmds for palma
2018-11-16 20:08:36 -08:00
bunnei
585e6fd426 hwopus: DecodeInterleavedWithPerformance: Fix ordering of output parameters.
- Fixes audio issues with Pokemon: Let's Go Pikachu & Eevee.
2018-11-16 22:54:38 -05:00
David Marcec
c440e8b8e1 Implemented CalculateStandardUserSystemClockDifferenceByUser
Seems pokemon calls this sometimes and it caused "random crashes"
2018-11-17 14:01:16 +11:00
bunnei
5b8f70ea2e
Merge pull request #1632 from DarkLordZach/keys-manager-optimizations
game_list: Optimize game list refresh
2018-11-16 07:02:37 -08:00
bunnei
238bc4a077
Merge pull request #1706 from lioncash/file-err
file_sys/errors: Clean up error code values
2018-11-16 06:59:07 -08:00
David Marcec
e8899e7027 Added various bluetooth based cmds for palma
It seems palma is done through bluetooth, we need this for pokemon go however more research needs to be done when we actually get palma working. This is presumably used for transfering data between the controller and the console, it does not seem for actual input as far as I know.
2018-11-17 01:42:17 +11:00
David Marcec
e658118aa9 Added SetIsPalmaAllConnectable, SetPalmaBoostMode
Currently unclear what these do yet, will be researched at a later time when we want to implement palma.
2018-11-17 01:40:18 +11:00
David Marcec
9359655712 Report resolution scaling support for vi and am
Specifying an internal resolution in yuzu now will report the scaled changes to vi and am.
2018-11-16 18:07:42 +11:00
Lioncash
b725d1fdf7 file_sys/errors: Extract FS-related error codes to file_sys/errors.h
Keeps filesystem-related error codes in one spot.
2018-11-16 00:13:50 -05:00
David
87eca5b209 Fixed priority switching edge case for handheld (#1675)
* Fixed priority switching edge case for handheld

We accidently used controller index instead of npad id

* Moved NPadIdToIndex
2018-11-15 20:31:27 -08:00
bunnei
75640c9c71
Merge pull request #1699 from DarkLordZach/deterministic-rng-3
csrng: Use random integer distribution instead of raw engine
2018-11-15 20:18:47 -08:00
Zach Hilman
4838bc8ddc fsp_srv: Add support for using open source archive if not found in NAND 2018-11-15 22:35:16 -05:00
Zach Hilman
8cb2e7d881 csrng: Use random integer distribution instead of raw engine
Prevents returning the same value every single call.
2018-11-15 18:44:26 -05:00
bunnei
97605e36f7
Merge pull request #1618 from DarkLordZach/dump-nso
patch_manager: Add support for dumping uncompressed NSOs
2018-11-15 14:46:10 -08:00
bunnei
98060c6f7b
Merge pull request #1691 from lioncash/audren
service/audren_u: Forward RequestUpdateAuto through the same function as RequestUpdate
2018-11-15 14:44:36 -08:00
Zach Hilman
c0a9abc3e1 ldr_ro: Implement UnloadNro (command 1)
Includes actual unmapping and address error checking.
2018-11-15 12:48:09 -05:00
Zach Hilman
056fa43dcd ldr_ro: Fully Implement LoadNro (command 0)
Includes NRO and BSS error checking, maximum loaded NRO check, NRR hash check, and proper remapping of BSS data.
2018-11-15 12:48:09 -05:00
Zach Hilman
5e8e7b6019 ldr_ro: Implement UnloadNrr (command 3)
Includes initialization check, proper address check, alignment check, and actual unloading of a loaded NRR.
2018-11-15 12:48:09 -05:00
Zach Hilman
6cd504feb9 ldr_ro: Fully implement LoadNrr (command 2)
Includes parameter error checking, hash enforcement, initialization check, and max NRR load check.
2018-11-15 12:48:09 -05:00
Zach Hilman
8aa17f0480 pl_u: Resize buffers in shared font data getter to what game requests
Fixes unmapped spam in SMP and buffer size errors in some other games
2018-11-15 12:47:36 -05:00
bunnei
c6c74248fe
Merge pull request #1697 from lioncash/acc
acc/profile_manager: Minor cleanup-related changes
2018-11-14 19:02:25 -08:00
bunnei
0478308094
Merge pull request #1696 from lioncash/acc-cond
service/acc: Correct error case within TrySelectUserWithoutInteraction()
2018-11-14 19:02:16 -08:00
Lioncash
cd47af8af0 service/acc: Correct error case within TrySelectUserWithoutInteraction()
empty() in this case will always return false, since the returned
container is a std::array. Instead, check if all given users are invalid
before returning the error code.
2018-11-14 17:43:23 -05:00
Lioncash
9761936e02 profile_manager: Replace iterative loop with a ranged-for loop in ParseUserSaveFile() 2018-11-14 17:13:17 -05:00
Lioncash
1af13e0802 profile_manager: Move UUID Format function definitions into the cpp file
Avoids relying on fmt always being indirectly included.
2018-11-14 17:08:59 -05:00
bunnei
c681690358
Merge pull request #1690 from lioncash/nfp
nfp: Correct erroneous sizeof expression within GetTagInfo()
2018-11-14 11:55:09 -08:00
bunnei
7384b33c4f
Merge pull request #1689 from lioncash/break
hid/npad: Add missing break in switch statement within Controller_NPad::OnUpdate
2018-11-14 11:54:45 -08:00
bunnei
c95ded3a4a
Merge pull request #1688 from lioncash/unused
service: Mark MakeFunctionString with the [[maybe_unused]] attribute.
2018-11-14 11:54:29 -08:00
Lioncash
b4f63db04e nfp: Correct erroneous sizeof expression within GetTagInfo()
The previous expression would copy sizeof(size_t) amount of bytes (8 on
a 64-bit platform) rather than the full 10 bytes comprising the uuid
member.

Given the source and destination types are the same, we can just use an
assignment here instead.
2018-11-14 12:53:39 -05:00
Lioncash
3619b31fc0 service/audren_u: Forward RequestUpdateAuto through the same function as RequestUpdate
Based off RE, they both currently go through the same codepath with no
difference in behavior.
2018-11-14 02:36:21 -05:00
Lioncash
fcde356f15 hid/npad: Add missing break in switch statement within Controller_NPad::OnUpdate() 2018-11-14 00:59:17 -05:00
Lioncash
958fa15a4c service: Mark MakeFunctionString with the [[maybe_unused]] attribute.
When yuzu is compiled in release mode this function is unused, however,
when compiled in debug mode, it's used within a LOG_TRACE statement.
This prevents erroneous compilation warnings about an unused function
(that isn't actually totally unused).
2018-11-14 00:49:04 -05:00
bunnei
a80467db57
Merge pull request #1682 from lioncash/audio
hle/audren_u: Implement Get/SetRenderingTimeLimit
2018-11-13 18:51:44 -08:00
bunnei
9b12623743
Merge pull request #1608 from DarkLordZach/save-data-reader
[ns|fsp_srv]: Implement various functions to boot Checkpoint
2018-11-13 18:51:08 -08:00
Lioncash
454cf1dc09 hle/audren_u: Implement Get/SetRenderingTimeLimit
These appear to be a basic getter and setter pair, so these are fairly
trivial to implement and get out of the way.
2018-11-13 13:49:09 -05:00
bunnei
7f3c2525e6
Merge pull request #1670 from DarkLordZach/deterministic-rng
csrng: Add config option to set RNG seed
2018-11-12 21:10:08 -08:00
bunnei
fd72d889bf
Merge pull request #1665 from ogniK5377/GetClockSnapshot
Implement GetClockSnapshot, ToPosixTime & ToPosixTimeWithMyRule
2018-11-12 20:13:47 -08:00
Zach Hilman
4b4f883aef csrng: Use std::mt19937 engine for random number generation 2018-11-11 23:08:39 -05:00
James Rowe
93fca5d9cf
Merge pull request #1656 from ogniK5377/message-queue
Ability to switch between docked and undocked mode in-game
2018-11-10 11:27:17 -07:00
David Marcec
48cd61d9c8 Added maybe_unused 2018-11-10 18:07:34 +11:00
David Marcec
ddc242dd51 Added ToPosixTime & ToPosixTimeWithMyRule
Added instead of using a seperate PR to prevent conflicts
2018-11-10 17:41:57 +11:00
David Marcec
84c6134264 Added consts and static 2018-11-10 12:31:48 +11:00
David Marcec
4f78f5c0df Implement GetClockSnapshot
Needed by megaman 11
2018-11-10 01:25:56 +11:00
bunnei
0e05a9d58f
Merge pull request #1658 from ogniK5377/holdtype-style
Updated npad styles on holdtype switches
2018-11-07 20:59:01 -08:00
David Marcec
a9c25ab9e4 Updated npad styles on holdtype switches
Fixes input for megaman
2018-11-08 01:07:14 +11:00
David Marcec
fd1ef25257 Fixups 2018-11-07 20:12:27 +11:00
David Marcec
41e99d8880 Ability to switch between docked and undocked mode in-game
Started implementation of the AM message queue mainly used in state getters. Added the ability to switch docked mode whilst in game without stopping emulation. Also removed some things which shouldn't be labelled as stubs as they're implemented correctly
2018-11-07 18:01:33 +11:00
David Marcec
ad45d68871 fixed spelling error 2018-11-07 12:04:43 +11:00
David Marcec
49cb4fa37b Added missing log 2018-11-07 11:46:04 +11:00
David Marcec
92fcc6d15a Implement acc:TrySelectUserWithoutInteraction
Needed for Shantae - Half-Genie Hero - Ultimate Edition!
2018-11-07 11:45:01 +11:00
bunnei
722e7c05de
Merge pull request #1633 from ogniK5377/reload-input
Fixed HID crash when launching more than 1 game & signaled styleset change event
2018-11-05 00:21:27 -05:00
Frederic Laing
1c4365d928 Fix typo in BufferTransformFlags 2018-11-04 16:56:10 +01:00
Zach Hilman
0080a8da58 sm: Implement RegisterService and UnregisterService
These are needed by Edizon to boot. They are used to see if a user is using SX OS, as SX OS registers a custom service called 'tx' and attempting to register a service of the same name lets the application know if it is present.
2018-11-03 20:02:18 -04:00
David Marcec
03c26d3406 Fixed incorrect hwopus assert 2018-11-02 15:23:38 +11:00
David Marcec
0bc323bafb Fixed HID crash when launching more than 1 game & signaled syleset change event
This should fix crashes when launching multiple games in yuzu
2018-11-02 12:35:49 +11:00
Zach Hilman
8f183a47dd filesystem: Cache RegisteredCacheUnion instead of constructing on demand
Prevents unnecessary re-reads of the metadata and unnecessary temporary objects.
2018-11-01 20:24:32 -04:00
bunnei
1069eced84
Merge pull request #1615 from lioncash/input
configure_system: Contrain profile usernames to 32 characters
2018-11-01 19:10:26 -04:00
Lioncash
a6830e61b8 configure_system: Contrain profile usernames to 32 characters
Previously, we would let a user enter an unbounded name and then
silently truncate away characters that went over the 32-character limit.
This is kind of bad from the UX point of view, because we're essentially
not doing what the user intended in certain scenarios.

Instead, we clamp it to 32 characters and make that visually apparent in
the dialog box to provide a name for a user.
2018-10-31 02:05:00 -04:00
Lioncash
9b9c586dff service/usb: Update IPdSession's function table
Updated based off information on SwitchBrew.
2018-10-30 15:23:49 -04:00
Frederic L
7a5eda5914 global: Use std::optional instead of boost::optional (#1578)
* get rid of boost::optional

* Remove optional references

* Use std::reference_wrapper for optional references

* Fix clang format

* Fix clang format part 2

* Adressed feedback

* Fix clang format and MacOS build
2018-10-30 00:03:25 -04:00
Zach Hilman
bdaa76c0db ns: Implement command 400: GetApplicationControlData
Returns the raw NACP bytes and the raw icon bytes into a title-provided buffer. Pulls from Registration Cache for control data, returning all zeros should it not exist.
2018-10-29 16:20:16 -04:00
Zach Hilman
9078bb9854 bis_factory: Add getter for mod dump root for a title ID
Equates to yuzu_dir/dump/<title id>/
2018-10-29 16:08:03 -04:00
Zach Hilman
5ee19add1b fsp_srv: Implement ISaveDataInfoReader
An object to read SaveDataInfo objects, which describe a unique save on the system. This implementation iterates through all the directories in the save data space and uses the paths to reconstruct the metadata.
2018-10-29 13:54:39 -04:00
Zach Hilman
2e8177f0c9 fsp_srv: Implement command 61: OpenSaveDataInfoReaderBySaveDataSpaceId
Needed by Checkpoint. Returns an object that can iterate through all savedata on the system.
2018-10-29 13:54:39 -04:00
Zach Hilman
df264d2ccb savedata_factory: Expose accessors for SaveDataSpace 2018-10-29 13:54:38 -04:00
DeeJayBro
3b1e4c0995 service/filesystem: Add DirectoryDelete & DirectoryDeleteRecursively 2018-10-27 11:56:39 +02:00
bunnei
debabf1fa6
Merge pull request #1569 from lioncash/amiibo
yuzu/main: Notify user of loading errors with Amiibo data
2018-10-25 22:10:08 -04:00
bunnei
cebce2a93a ldr: Partially implement LoadNro.
- This is an incomplete implementation. It was tested with Super Mario Party.
2018-10-25 18:03:54 -04:00
bunnei
2bc2b32662
Merge pull request #1579 from lioncash/usb
service/usb: Update service function tables
2018-10-25 12:22:57 -04:00
bunnei
0634aee267
Merge pull request #1576 from lioncash/acc-warn
service/acc: Silence compiler truncation warnings
2018-10-25 12:22:10 -04:00
Lioncash
fbbb58b226 service/usb: Update service function tables
Updated based off the information provided by Hexkyz on Switchbrew.
2018-10-24 19:07:55 -04:00
Lioncash
1e3b139cd7 service/acc: Move fallback image to file scope
This is just flat data, so it doesn't really need to be in the function
itself. This also allows deduplicating the constant for the backup size
in GetImageSize().
2018-10-24 18:22:24 -04:00
Lioncash
6f00628564 service/acc: Silence compiler warnings
Silences compiler warnings related to truncation. This also introduces a
small helper function to perform the clamping of the image size.
2018-10-24 18:22:24 -04:00
Lioncash
3ec90dc6ef service/acc: Early return in failure case in LoadImage()
Allows unindenting the other branch's code.
2018-10-24 18:22:20 -04:00
bunnei
9aa5c1894e
Merge pull request #1570 from lioncash/optional
profile_manager: Use std::optional instead of boost::optional
2018-10-24 18:11:03 -04:00
bunnei
ce2403d975
Merge pull request #1564 from lioncash/npad
npad: Remove unused controller variable from OnInit()
2018-10-24 17:36:55 -04:00
bunnei
d14ba122e2
Merge pull request #1562 from lioncash/aoc
aoc_u: Make use of previously-unused CheckAOCTitleIDMatchesBase() function
2018-10-24 16:28:56 -04:00
Lioncash
4a31f99a02 profile_manager: Use std::optional instead of boost::optional
Now that we can actually use std::optional on macOS, we don't need to
continue using boost::optional here.
2018-10-24 11:06:52 -04:00
Lioncash
bed2d6c425 yuzu/main: Notify user of loading errors with Amiibo data
We shouldn't silently continue if loading failed, since the general
assumption is that no messages showing up implicitly indicates success.
2018-10-24 10:39:31 -04:00
Lioncash
93596d03ec
npad: Remove unused controller variable from OnInit()
This also gets rid of variable shadowing related to the lambda parameter
a little bit below this code as well.
2018-10-24 00:38:03 -04:00
Lioncash
a3d1ede25f
aoc_u: Make use of previously-unused CheckAOCTitleIDMatchesBase() function
We can just call the function instead of duplicating the code here. This
also prevents an unused function warning.

We also don't need to take the lambda capture by reference. It's just a
u64 value, so by value is fine here.
2018-10-24 00:13:08 -04:00
Zach Hilman
bfad41b0c1 profile_manager: Create save data if it doesn't exist on use 2018-10-23 19:31:28 -04:00
Zach Hilman
45f2a2fe29 acc: Fix account UUID duplication error 2018-10-23 19:31:28 -04:00
Zach Hilman
e408bbceed configure_system: Clear selection after user delete 2018-10-23 19:31:28 -04:00
Zach Hilman
702622b8f1 profile_manager: Load user icons, names, and UUIDs from system save 2018-10-23 19:31:28 -04:00
Zach Hilman
19c5cf9c63 acc: Load user images from config dir 2018-10-23 19:31:28 -04:00
Zach Hilman
d3fbf45705 am: Pass current user UUID to launch parameters 2018-10-23 19:31:28 -04:00
Zach Hilman
aeffd4b436 profile_manager: Load users from emulator settings 2018-10-23 19:31:28 -04:00
David
50e4e81fd3 Added Amiibo support (#1390)
* Fixed conflict with nfp

* Few fixups for nfc

* Conflict 2

* Fixed AttachAvailabilityChangeEvent

* Conflict 3

* Fixed byte padding

* Refactored amiibo to not reside in "System"

* Removed remaining references of nfc from system

* used enum for Nfc GetStateOld

* Added missing newline

* Moved file operations to front end

* Conflict 4

* Amiibos now use structs and added mutexes

* Removed amiibo_path
2018-10-23 19:28:17 -04:00
bunnei
5edb2403c2
Merge pull request #1515 from DarkLordZach/dlc-lfs
patch_manager: Add support for LayeredFS on DLC RomFS
2018-10-23 19:26:57 -04:00
bunnei
ff6b2d4574
Merge pull request #1545 from DarkLordZach/psm
psm: Add psm service and stub commands 0 and 1
2018-10-22 15:27:05 -04:00
Zach Hilman
314a948373 psm: Stub GetChargerType
Used by LovePotion Lua Homebrew. Stubbed as connected to official Nintendo Switch dock.
2018-10-21 22:03:25 -04:00
Lioncash
ca5a93167e service: Add the basic skeleton for the NPNS services 2018-10-21 17:11:05 -04:00
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
Zach Hilman
10a2d20e26 psm: Stub GetBatteryChargePercentage
Used by LovePotion Lua Homebrew. Stubbed to return 100% charge.
2018-10-20 18:01:11 -04:00
Zach Hilman
3b8c0f8885 service: Add skeleton for psm service
Seems to be the power controller. Listed in switchbrew under the category PTM services.
2018-10-20 18:01:07 -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
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
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
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
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
Zach Hilman
780c21ab2d fsp_srv: Apply patches to Data storage in OpenDataStorageByDataId 2018-10-17 09:04:20 -04: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
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
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
Zach Hilman
7e2096db8a aoc: Return size in ListAddOnContent 2018-10-13 22:52:54 -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
0f7ab3e21a
Merge pull request #1478 from ogniK5377/remap-invalidhandle-remap
Passing an invalid nmap handle to Remap should throw an error
2018-10-12 12:07:14 -04:00
bunnei
dc328440c8
Merge pull request #1479 from ogniK5377/nmap-revamped
Added error codes for nvmap
2018-10-12 12:06:22 -04:00
David Marcec
4d2de6564f Returned an error before processing other remaps 2018-10-12 17:10:41 +11:00
David Marcec
c55b5de0fb Made the minimum alignment more clear 2018-10-12 17:06:46 +11:00
David Marcec
98b760c645 Wip 2018-10-12 16:28:00 +11:00
bunnei
9bf409f275
Merge pull request #1474 from ogniK5377/hwopus-decodeinterleavedwithperformance
HwOpus, Implemented DecodeInterleavedWithPerformance
2018-10-11 16:52:13 -04:00
David Marcec
85b0d9a7be Dynamically decide handheld variant based on supported npad id priority
Kirby input still doesn't work, should fix a lot of other games
2018-10-12 02:56:49 +11:00
David Marcec
c7763603ef Added error codes for nvmap 2018-10-11 23:06:34 +11:00
David Marcec
5dd538cace Passing an invalid nmap handle to Remap should throw an error
Added error for invalid nmap handles
2018-10-11 20:32:21 +11:00
bunnei
bf795edac4 nvhost_as_gpu: Flush CPU VAddr on UnmapBuffer. 2018-10-11 00:19:36 -04:00
David Marcec
fa10905e1e HwOpus, Implemented DecodeInterleavedWithPerformance
Used by sonic ages
2018-10-11 13:06:56 +11:00
David Marcec
9e924f2ef2 Added BeginPermitVibrationSession and EndPermitVibrationSession
Used by Mario Party
2018-10-11 00:58:47 +11:00
David Marcec
3d75c9cd7a Added GetLedPattern and HandheldVariant
HandheldVariant is for specific games which expect handheld controllers to be at position 8(kirby), however this doesn't fix all games as some games require handhelds to be at position 0(snipperclips)
2018-10-10 21:38:43 +11:00
David Marcec
46cdeb4549 Kirby expects handheld controllers to be at position 8 2018-10-10 14:21:56 +11:00
David Marcec
f43815af5d Added the ability to "disconnect" individual npads
Fixes arms
2018-10-10 13:15:39 +11:00
David Marcec
b79c294c02 Removed unneeded forward declarations 2018-10-10 13:15:37 +11:00
David Marcec
5857aea94e Addressed changes for better hid 2018-10-10 13:15:37 +11:00
David Marcec
56f35ab262 "Better Hid" rework part 1 2018-10-10 13:15:35 +11:00
bunnei
fd891ee9c0
Merge pull request #1456 from ogniK5377/aoc-u-fixups
Fixed assertion due to CountAddOnContent & Casting warnings
2018-10-08 01:21:05 -04:00
David Marcec
c5c184246d Unmapping an unmapped buffer should succeed
Hardware tests show that trying to unmap an unmapped buffer already should always succeed. Hardware test was tested up to 32 iterations of attempting to unmap
2018-10-08 13:26:48 +11:00
David Marcec
fa3f3cd07f Fixed assertion due to CountAddOnContent
Word count should be 3 since we're pushing a result code and a u32.

Also fixed up compiler warnings due to casting
2018-10-08 00:25:46 +11:00
bunnei
6e4d2e672d
Merge pull request #1396 from DarkLordZach/packed-updates
loader: Add support for packed updates
2018-10-06 23:58:24 -04:00
David Marcec
f84b9ed4e8 Ported #4296 from citra
This will allow us to easily remove the use of "NFC" in "System"
2018-10-06 16:49:01 +10:00
Zach Hilman
38c2ac95af romfs_factory: Extract packed update setter to new function 2018-10-05 08:53:51 -04:00
bunnei
cf3a6dd4a1
Merge pull request #1434 from DarkLordZach/dlc-edge-case
aoc_u: Fix edge case with DLC that causes breaks
2018-10-03 21:39:23 -04:00
bunnei
39f08e551d
Merge pull request #1433 from lioncash/fs
services/fsp_srv: Amend service function table
2018-10-03 19:13:57 -04:00
Zach Hilman
9aaf1c0df8 aoc_u: Fix edge case with DLC that causes breaks
In some games (Splatoon 2 and Splatoon 2 Splatfest World Premiere, notably), pass offset=0 and count=2047 into the ListAddOnContent method which should return all DLCs for the current title. The (presumably) intended behavior is to successfully return a empty array but because of a < v. <= in an if statement, a failure error code was returned causing these games to svcBreak. This fixes that if statement.
2018-10-02 21:56:32 -04:00
Lioncash
cba78dc70a services/fsp_srv: Amend service function table
Adds new functions that have been given names to the table. Information
is based off what is provided on Switchbrew.
2018-10-02 21:34:33 -04:00
Lioncash
d80dd2b812 service/lbl: Update service function table
Amends the lbl service table to include new names of functions that were
added to Switchbrew.
2018-10-02 21:15:59 -04:00
Zach Hilman
f72046099a aoc_u: Extract AccumulateAOCTitleIDs to separate function 2018-09-30 21:07:22 -04:00
Zach Hilman
7d86a008e2 aoc_u: Implement GetAddOnContentBaseId
Command #5
2018-09-30 21:01:35 -04:00
Zach Hilman
62225ae050 aoc_u: Implement Count, List and Prepare AddOnContent
Commands #2, #3, and #7
2018-09-30 21:01:35 -04:00
bunnei
8f2ad3a66d
Merge pull request #1338 from raven02/service_vi
Implement ISystemDisplayService::GetDisplayMode
2018-09-30 15:39:54 -04:00
Lioncash
cf9d6c6f52 kernel/process: Make data member variables private
Makes the public interface consistent in terms of how accesses are done
on a process object. It also makes it slightly nicer to reason about the
logic of the process class, as we don't want to expose everything to
external code.
2018-09-30 02:30:01 -04:00
raven02
4092907687 Implement ISystemDisplayService::GetDisplayMode 2018-09-30 10:04:03 +08:00
bunnei
fc2419e441
Merge pull request #1394 from lioncash/stream
stream: Preserve enum class type in GetState()
2018-09-27 17:05:03 -04:00
bunnei
efcb83fb41
Merge pull request #1400 from lioncash/header
service: Add missing headers inclusions where applicable
2018-09-26 16:11:19 -04:00
Lioncash
e42bb5e003 service: Add missing headers inclusions where applicable
Gets rid of a few indirect inclusions.
2018-09-25 17:14:38 -04:00
bunnei
7b81e1e525
Merge pull request #1365 from DarkLordZach/lfs
file_sys: Add support for LayeredFS mods
2018-09-25 16:59:44 -04:00
David
367c52ff0d Implemented fatal:u properly (#1347)
* Implemented fatal:u properly

fatal:u now is properly implemented with all the ipc cmds. Error reports/Crash reports are also now implemented for fatal:u. Crash reports save to yuzu/logs/crash_reports/
The register dump is currently known as sysmodules send all zeros. If there are any non zero values for the "registers" or the unknown values, let me know!

* Fatal:U fixups

* Made fatal:u execution break more clear

* Fatal fixups
2018-09-23 22:34:11 -04:00
David
2513e086ab Stubbed IRS (#1349)
* Stubbed IRS

Currently we have no ideal way of implementing IRS. For the time being we should have the functions stubbed until we come up with a way to emulate IRS properly.

* Added IRS to logging backend

* Forward declared shared memory for irs
2018-09-23 22:33:29 -04:00
bunnei
f2c1fd08f9
Merge pull request #1354 from ogniK5377/ssl-version
Corrected SSL::SetInterfaceVersion
2018-09-23 22:32:14 -04:00
Lioncash
2f6a611311 stream: Preserve enum class type in GetState()
Preserves the meaning/type-safetiness of the stream state instead of
making it an opaque u32. This makes it usable for other things outside
of the service HLE context.
2018-09-23 20:03:38 -04:00
David Marcec
c461188f51 Added audren:u#GetAudioRendererState 2018-09-23 22:32:01 +10:00
Zach Hilman
940a711caf filesystem: Add LayeredFS VFS directory getter 2018-09-21 19:53:33 -04:00
bunnei
b0b57c21e6
Merge pull request #1368 from ogniK5377/nifm-fix
Added IRequest::Submit
2018-09-20 23:30:11 -04:00
David Marcec
b918925bd5 Revert GetRequestState
Even though setting this value to 3 is more correct. We break more games than we fix due to missing implementations. We should keep this as 0 for the time being
2018-09-21 12:15:49 +10:00
David Marcec
3f49725a51 Fixed submit 2018-09-21 00:51:13 +10:00
David Marcec
cfc9fe4460 Added IRequest::Submit
This fixes updated versions of SMO. Currently unable to test as I don't have an updated version
2018-09-21 00:47:30 +10:00
David Marcec
583137709f Removed unneeded event clear 2018-09-20 15:16:08 +10:00
David Marcec
335e9d18ae Implemented NTC & IEnsureNetworkClockAvailabilityService
Needed because of the recent nim fixes
2018-09-20 15:14:07 +10:00
David
0432af5ad1 Reworked incorrect nifm stubs (#1355)
* Reworked incorrect nifm stubs

Need confirmation on `CreateTemporaryNetworkProfile`, unsure which game uses it but according to reversing. It should return a uuid which we currently don't do.

Any 0 client id is considered an invalid client id.

GetRequestState 0 is considered invalid.

* Fixups for nifm
2018-09-19 11:59:01 -04:00
bunnei
8dff92c5f6
Merge pull request #1359 from ogniK5377/nes
Fixed GetAccountId stub, Added error code for OpenDirectory and added ActivateNpadWithRevision
2018-09-19 10:01:36 -04:00
David Marcec
cbc7ad8f6d Fixed GetAccountId stub, Added error code for OpenDirectory and added ActivateNpadWithRevision
With these, `Nintendo Entertainment System - Nintendo Switch Online` loads
2018-09-19 23:25:00 +10:00
David Marcec
d06f4cfc63 Corrected SSL::SetInterfaceVersion
Should be a single u32
2018-09-19 16:46:11 +10:00
David Marcec
6a0612f2bf Removed the use of rp.MakeBuilder
Due to keeping the code style consistent in the yuzu codebase. `rb = rp.MakeBuilder(...)` was replaced with `rb{ctx, ...}`
2018-09-19 15:09:59 +10:00
bunnei
b33ce787b7
Merge pull request #1348 from ogniK5377/GetImageSize
Implemented IProfile::GetImageSize
2018-09-18 22:15:18 -04:00
bunnei
c9942fe46e
Merge pull request #1351 from ogniK5377/GetDefaultDisplayResolution
Implemented GetDefaultDisplayResolution
2018-09-18 22:13:28 -04:00
bunnei
e9abbcae85
Merge pull request #1350 from ogniK5377/Six-Axis-Stub
Stubbed ActivateConsoleSixAxisSensor & StartConsoleSixAxisSensor
2018-09-18 22:12:12 -04:00
Philippe Babin
9155c8daeb Invalid default value of username in yuzu_cmd (#1334)
* Fix bug where default username value for yuzu_cmd create an userprofile with uninitialize data as username

* Fix format

* Apply code review changes

* Remove nullptr check
2018-09-18 19:58:28 -04:00
David Marcec
de9604d63e Added ActivateGesture 2018-09-19 01:13:58 +10:00
David Marcec
1a2d33eeb4 Implemented GetDefaultDisplayResolution 2018-09-19 01:10:16 +10:00
David Marcec
a8b1c7763b Added StopSixAxisSensor 2018-09-19 00:56:02 +10:00
David Marcec
717889e93c Stubbed ActivateConsoleSixAxisSensor & StartConsoleSixAxisSensor 2018-09-19 00:52:20 +10:00
David Marcec
528e5cee67 Implemented GetImageSize 2018-09-19 00:16:52 +10:00
bunnei
2c9c0d70a3
Merge pull request #1312 from lioncash/fwd
service/vi: Replace includes with forward declarations where applicable
2018-09-17 12:32:28 -04:00
bunnei
fc46183e03
Merge pull request #1318 from lioncash/errors-sm
services/sm: Amend error code constants
2018-09-17 12:27:01 -04:00
fearlessTobi
63c2e32e20 Port #4182 from Citra: "Prefix all size_t with std::" 2018-09-15 15:21:06 +02:00
Lioncash
da64da367b services/sm: Amend error code constants
Courtesy of @ogniK5377.

This also moves them into the cpp file and limits the visibility to
where they're directly used. It also gets rid of unused or duplicate
error codes.
2018-09-14 01:44:02 -04:00
bunnei
df5a44a40b
Merge pull request #1310 from lioncash/kernel-ns
kernel/thread: Include thread-related enums within the kernel namespace
2018-09-13 19:50:47 -04:00
bunnei
fb65076b0f
Merge pull request #1309 from lioncash/nested
service: Use nested namespace specifiers where applicable
2018-09-13 19:50:11 -04:00
Lioncash
0258b444ef service/vi: Replace includes with forward declarations where applicable 2018-09-13 16:55:47 -04:00
Lioncash
2ea45fe75b kernel/thread: Include thread-related enums within the kernel namespace
Previously, these were sitting outside of the Kernel namespace, which
doesn't really make sense, given they're related to the Thread class
which is within the Kernel namespace.
2018-09-13 16:05:57 -04:00
Lioncash
a0e51d8b98 service: Use nested namespace specifiers where applicable
There were a few places where nested namespace specifiers weren't being
used where they could be within the service code. This amends that to
make the namespacing a tiny bit more compact.
2018-09-13 15:52:55 -04:00
Lioncash
ce97d8ef6c services/pl_u: Add missing Korean font to the fallback case for shared fonts
Previously this wasn't using the Korean font at all.
2018-09-12 19:23:51 -04:00
bunnei
d9e21eebe8
Merge pull request #1297 from lioncash/pl
pl_u: Eliminate mutable file-scope state
2018-09-12 16:03:53 -04:00
bunnei
475222a496
Merge pull request #1296 from lioncash/prepo
service/prepo: Move class into the cpp file
2018-09-11 23:15:07 -04:00
Lioncash
c243bc09d4 service/audio: Replace includes with forward declarations where applicable
A few headers were including other headers when a forward declaration
can be used instead, allowing the include to be moved to the cpp file.
2018-09-11 21:54:33 -04:00
Lioncash
c061e27155 pl_u: Eliminate mutable file-scope state
Converts the PL_U internals to use the PImpl idiom and makes the state
part of the Impl struct, eliminating mutable global/file state.
2018-09-11 21:24:19 -04:00
Lioncash
325c259fc5 service/prepo: Move class into the cpp file
This doesn't need to be exposed within the header and be kept in the
translation unit, eliminating the need to include anything within the
header.
2018-09-11 20:49:01 -04:00
bunnei
1470b85af9
Merge pull request #1291 from lioncash/default
hle/service: Default constructors and destructors in the cpp file where applicable
2018-09-11 11:42:05 -04:00
Lioncash
46ba1bc40f externals: Place font data within cpp files
This places the font data within cpp files, which mitigates the
possibility of the font data being duplicated within the binary if it's
referred to in more than one translation unit in the future. It also
stores the data within a std::array, which is more flexible when it
comes to operating with the standard library.

Furthermore, it makes the data arrays const. This is what we want, as it
allows the compiler to store the data within the read-only segment. As
it is, having several large sections of mutable data like this just
leaves spots in memory that we can accidentally write to (via accidental
overruns, what have you) and actually have it work. This ensures the
font data remains the same no matter what.
2018-09-11 04:25:33 -04:00
Lioncash
6ac955a0b4 hle/service: Default constructors and destructors in the cpp file where applicable
When a destructor isn't defaulted into a cpp file, it can cause the use
of forward declarations to seemingly fail to compile for non-obvious
reasons. It also allows inlining of the construction/destruction logic
all over the place where a constructor or destructor is invoked, which
can lead to code bloat. This isn't so much a worry here, given the
services won't be created and destroyed frequently.

The cause of the above mentioned non-obvious errors can be demonstrated
as follows:

------- Demonstrative example, if you know how the described error happens, skip forwards -------

Assume we have the following in the header, which we'll call "thing.h":

\#include <memory>

// Forward declaration. For example purposes, assume the definition
// of Object is in some header named "object.h"
class Object;

class Thing {
public:
    // assume no constructors or destructors are specified here,
    // or the constructors/destructors are defined as:
    //
    // Thing() = default;
    // ~Thing() = default;
    //

    // ... Some interface member functions would be defined here

private:
    std::shared_ptr<Object> obj;
};

If this header is included in a cpp file, (which we'll call "main.cpp"),
this will result in a compilation error, because even though no
destructor is specified, the destructor will still need to be generated by
the compiler because std::shared_ptr's destructor is *not* trivial (in
other words, it does something other than nothing), as std::shared_ptr's
destructor needs to do two things:

1. Decrement the shared reference count of the object being pointed to,
   and if the reference count decrements to zero,

2. Free the Object instance's memory (aka deallocate the memory it's
   pointing to).

And so the compiler generates the code for the destructor doing this inside main.cpp.

Now, keep in mind, the Object forward declaration is not a complete type. All it
does is tell the compiler "a type named Object exists" and allows us to
use the name in certain situations to avoid a header dependency. So the
compiler needs to generate destruction code for Object, but the compiler
doesn't know *how* to destruct it. A forward declaration doesn't tell
the compiler anything about Object's constructor or destructor. So, the
compiler will issue an error in this case because it's undefined
behavior to try and deallocate (or construct) an incomplete type and
std::shared_ptr and std::unique_ptr make sure this isn't the case
internally.

Now, if we had defaulted the destructor in "thing.cpp", where we also
include "object.h", this would never be an issue, as the destructor
would only have its code generated in one place, and it would be in a
place where the full class definition of Object would be visible to the
compiler.

---------------------- End example ----------------------------

Given these service classes are more than certainly going to change in
the future, this defaults the constructors and destructors into the
relevant cpp files to make the construction and destruction of all of
the services consistent and unlikely to run into cases where forward
declarations are indirectly causing compilation errors. It also has the
plus of avoiding the need to rebuild several services if destruction
logic changes, since it would only be necessary to recompile the single
cpp file.
2018-09-10 23:55:31 -04:00
Tobias
3bac3051fc Use open-source shared fonts if no dumped file is available (#1269)
* Add open-source shared fonts

* Address review comments
2018-09-10 21:31:01 -04:00
Markus Wick
0cfb0bacb2 video_core: Move command buffer loop.
This moves the hot loop into video_core. This refactoring shall reduce the CPU overhead of calling ProcessCommandList.
2018-09-10 22:06:13 +02:00
bunnei
50c191439d
Merge pull request #1276 from FearlessTobi/fix-stupid-stub
hid: Implement ReloadInputDevices
2018-09-09 22:31:04 -04:00
Lioncash
136040ee15 service: Remove unused g_kernel_named_ports variable
With the named port functionality all migrated over to the kernel,
there's no need to keep this around anymore.
2018-09-09 22:10:54 -04:00
fearlessTobi
500e81429a hid: Implement ReloadInputDevices 2018-09-09 00:57:41 +02:00
Lioncash
56ab608044 core/core: Remove unnecessary sm/controller include
The only reason this include was necessary, was because the constructor
wasn't defaulted in the cpp file and the compiler would inline it
wherever it was used. However, given Controller is forward declared, all
those inlined constructors would see an incomplete type, causing a
compilation failure. So, we just place the constructor in the cpp file,
where it can see the complete type definition, allowing us to remove
this include.
2018-09-06 14:38:39 -04:00
Zach Hilman
c913136eb2 bktr: Fix bucket overlap error 2018-09-04 17:01:54 -04:00
Zach Hilman
9951f6d054 registration: Add RegisteredCacheUnion
Aggregates multiple caches into one interface
2018-09-04 16:21:40 -04:00
bunnei
8ec1e16867
Merge pull request #1235 from lioncash/forward-decl
file_sys: Replace includes with forward declarations where applicable
2018-09-04 11:51:54 -04:00
bunnei
c156ee8eb8
Merge pull request #1230 from lioncash/ssl
ssl: Move SSL class to cpp file
2018-09-04 11:49:22 -04:00
Lioncash
a813c10e1c file_sys: Replace includes with forward declarations where applicable
Cuts down on include dependencies, resulting in less files that need to
be rebuilt when certain things are changed.
2018-09-03 22:52:24 -04:00
Lioncash
1242c1ec0a service: Migrate global named port map to the KernelCore class
Now that we have a class representing the kernel in some capacity, we
now have a place to put the named port map, so we move it over and get
rid of another piece of global state within the core.
2018-09-02 12:35:30 -04:00
Lioncash
41cd766438 ssl: Move SSL class to cpp file
This isn't required to be visible to anything outside of the main source
file, and will eliminate needing to rebuild anything else including the
header if the SSL class needs to be changed in the future.
2018-09-02 11:45:26 -04:00
bunnei
325f3e0693
Merge pull request #1213 from DarkLordZach/octopath-fs
filesystem/maxwell_3d: Various changes to boot Project Octopath Traveller
2018-09-02 10:49:18 -04:00
Lioncash
fda8f1da20 filesystem: Move dir retrieval after path checking in DeleteFile()
We don't need to do the lookup if the path is considered empty
currently.
2018-09-02 09:20:17 -04:00
Zach Hilman
19d0951ae6 filesystem: Implement OpenReadOnlySaveDataFilesystem 2018-08-31 23:19:49 -04:00
Zach Hilman
7939ea18e8 filesystem: Add OpenFileSystemWithPatch 2018-08-31 23:19:23 -04:00
Lioncash
4a587b81b2 core/core: Replace includes with forward declarations where applicable
The follow-up to e2457418da, which
replaces most of the includes in the core header with forward declarations.

This makes it so that if any of the headers the core header was
previously including change, then no one will need to rebuild the bulk
of the core, due to core.h being quite a prevalent inclusion.

This should make turnaround for changes much faster for developers.
2018-08-31 16:30:14 -04:00
bunnei
d647d9550c gl_renderer: Cache textures, framebuffers, and shaders based on CPU address. 2018-08-31 13:07:27 -04:00
Lioncash
e2457418da core: Make the main System class use the PImpl idiom
core.h is kind of a massive header in terms what it includes within
itself. It includes VFS utilities, kernel headers, file_sys header,
ARM-related headers, etc. This means that changing anything in the
headers included by core.h essentially requires you to rebuild almost
all of core.

Instead, we can modify the System class to use the PImpl idiom, which
allows us to move all of those headers to the cpp file and forward
declare the bulk of the types that would otherwise be included, reducing
compile times. This change specifically only performs the PImpl portion.
2018-08-31 07:16:57 -04:00
Lioncash
0cbcd6ec9a kernel: Eliminate kernel global state
As means to pave the way for getting rid of global state within core,
This eliminates kernel global state by removing all globals. Instead
this introduces a KernelCore class which acts as a kernel instance. This
instance lives in the System class, which keeps its lifetime contained
to the lifetime of the System class.

This also forces the kernel types to actually interact with the main
kernel instance itself instead of having transient kernel state placed
all over several translation units, keeping everything together. It also
has a nice consequence of making dependencies much more explicit.

This also makes our initialization a tad bit more correct. Previously we
were creating a kernel process before the actual kernel was initialized,
which doesn't really make much sense.

The KernelCore class itself follows the PImpl idiom, which allows
keeping all the implementation details sealed away from everything else,
which forces the use of the exposed API and allows us to avoid any
unnecessary inclusions within the main kernel header.
2018-08-28 22:31:51 -04:00
Lioncash
45fb74d262 gpu: Make memory_manager private
Makes the class interface consistent and provides accessors for
obtaining a reference to the memory manager instance.

Given we also return references, this makes our more flimsy uses of
const apparent, given const doesn't propagate through pointers in the
way one would typically expect. This makes our mutable state more
apparent in some places.
2018-08-28 11:11:50 -04:00
bunnei
8c66a5a9a5
Merge pull request #1162 from ogniK5377/ttf-plu
PL:U Added SharedFonts loading via TTF
2018-08-27 15:43:10 -04:00
bunnei
34a447d24e
Merge pull request #1168 from lioncash/header
hid: Move core include to cpp file
2018-08-27 15:42:52 -04:00
tech4me
d26a46feed set: Fixed GetAvailableLanguageCodes() to follow the max_entries
Rightnow, in games use GetAvailableLanguageCodes(), there is a WriteBuffer() with size larger than the buffer_size. (Core Critical core\hle\kernel\hle_ipc.cpp:WriteBuffer:296: size (0000000000000088) is greater than buffer_size (0000000000000078))

0x88 = 17(languages) * 8
0x78 = 15(languages) * 8

GetAvailableLanguageCodes() can only support 15 languages.
After firmware 4.0.0 there are 17 supported language instead of 15, to enable this GetAvailableLanguageCodes2() need to be used.
So GetAvailableLanguageCodes() will be caped at 15 languages.
Reference:
http://switchbrew.org/index.php/Settings_services
2018-08-26 00:11:13 -07:00
Sebastian Valle
f170159fde
Merge pull request #1166 from lioncash/typo
filesystem: Fix typo in log message
2018-08-25 07:19:46 -05:00
Mat M
6426b0f551
Merge pull request #1094 from DarkLordZach/nax0
file_sys: Add support for NAX archives
2018-08-24 23:47:46 -04:00
Lioncash
ec59e4a6c5 hid: Move core include to cpp file
This isn't required to be in the header. Instead, directly include what
this header needs and move it to the cpp file where it belongs.
2018-08-23 23:20:35 -04:00
Lioncash
f6f5c2e4d8 filesystem: Fix typo in log message 2018-08-23 22:12:31 -04:00
David
5049ca5d8c Added GetBootMode (#1107)
* Added GetBootMode

Used by homebrew

* Added enum for GetBootMode
2018-08-23 18:31:45 -04:00
David Marcec
78b109d195 Addressed plu TTF changes 2018-08-24 02:18:04 +10:00
Zach Hilman
ef3768f323 filesystem: Add CreateFactories methods to fs
Allows frontend to create registration caches for use before a game has booted.
2018-08-23 11:52:44 -04:00
Zach Hilman
410062031b filesystem: Add logging to registration getters 2018-08-23 11:52:44 -04:00
David Marcec
eccc77a8c8 Added SharedFonts loading via TTF
By having the following TTF files in your yuzu sysdata directory. You can load sharedfonts via TTF files.
FontStandard.ttf
FontChineseSimplified.ttf
FontExtendedChineseSimplified.ttf
FontChineseTraditional.ttf
FontKorean.ttf
FontNintendoExtended.ttf
FontNintendoExtended2.ttf
2018-08-23 14:42:06 +10:00
David Marcec
15cc34b93e Added missing include for pl:u
Should fix any compile errors
2018-08-22 12:39:52 +10:00