Commit Graph

83 Commits

Author SHA1 Message Date
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
ade8a711fb Format code and misc cleanup 2020-08-15 10:21:41 +00:00
Billy Laws
9fd0dd848b Add support for processing GP Entries and the pushbuffers they contain
This is the backbone of the GPU, in the future this will be expanded to
support calling into engines.
2020-08-15 10:21:41 +00:00
Billy Laws
be70f8715d Enable the use of C++20 2020-08-15 10:21:41 +00:00
Billy Laws
8dc9a10324 Implement the host side of host1x syncpoints
This will be extended in the future to support interfacing with the GPU.
2020-08-15 10:21:41 +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
ffb9e743dd Add profile service to support custom usernames 2020-07-21 18:29:45 +00:00
Billy Laws
b23779bda1 Implement a block based GPU virtual memory manager
The GPU has it's own seperate address space to the CPU. It is able to
address 40 bit addresses and accesses the system memory. A sorted vector
has been used to store blocks as insertions are not very frequent.
2020-07-17 16:21:34 +00:00
Billy Laws
c2fadffe60 Extend time services with support for the steady clock
The steady clock has a fixed timepoint that can not change while an
application is running.
2020-07-17 14:30:53 +00:00
Billy Laws
6548d4914d Implement IAudioDevice for accessing audio output properties
This is used by Super Mario Odyssey in its init routine.
2020-07-09 18:42:36 +00:00
Billy Laws
2e60b5e60d Stub play reporting services 2020-07-09 18:42:36 +00:00
Billy Laws
378e494d82 Add an empty ssl service implementation
This stubs a single function that is needed for SMO's init.
2020-07-09 18:42:36 +00:00
Billy Laws
a2c6a2a4ff Add a base socket (bsd) services implementation
This stubs enough to pass SMO's socket init.
2020-07-09 18:42:36 +00:00
Billy Laws
2aefb4ae84 Implement network interface services
nifm:u is used by applications to enable a connection to the network.
2020-07-09 18:42:36 +00:00
Billy Laws
7102fa910e Implement nfp services 2020-07-09 18:42:36 +00:00
Billy Laws
4cf7f9288e Add an empty friend service implementation
This is used to access a users friends. It is used by Super Mario
Odyssey.
2020-07-09 18:42:36 +00:00
Billy Laws
ff5dddbd5b Extend account services to support BAAS and some user operations
These are needed by Super Mario Odyssey and several other games.
2020-07-09 18:42:36 +00:00
Billy Laws
ef9760570b Extend parental control services 2020-07-09 18:42:36 +00:00
Billy Laws
6e074d596c Extend applet manager services for the library applet
This commit adds stubs for the library applet and adds support for
writing to an AM IStorage.
2020-07-09 13:57:28 +00:00
Billy Laws
30936ce6dc Implement an ADPCM decoder for audren
This is used by many retail games, it only supports mono sound.

This implementation is based on Ryu's.
2020-07-09 13:56:04 +00:00
Billy Laws
7fed6ca73d Enable -Wall for compilation
This gives some useful warnings for less significant issues.
Warnings for reordering are left disabled as they are rather pedantic
and serve little benefit.
2020-07-08 20:11:55 +00:00
Billy Laws
ff1c0e254f Add an empty account services implementation
This implements the base account service and stubs
InitializeApplicationInfoV0 which is used by Puyo Puyo Tetris. Support
for the entirety of account services will be added in the future.
2020-07-06 21:04:31 +01:00
Billy Laws
3a343d3a48 Implement log services (lm)
lm is used by applications to print messages to the system log. Log
messages are made up of a header and then several fields containing
metadata or string messages.
2020-07-06 19:59:26 +00:00
Billy Laws
8985fe705f Implement IStorage services in Applet Manager
In the case of am, IStorage is used to exchange buffers of data such
as application launch parameters or an applets result. It has no
relation to fsp-srv's IStorage.
2020-07-06 19:57:00 +00:00
Billy Laws
162df93870 Add an empty pctl implementation
This is required by Puyo Puyo Tetris. It may be stubbed further if
needed in the future.
2020-07-06 20:46:38 +01:00
Billy Laws
23d6b596b2 Add an empty aoc:u implementation
This is required by Puyo Puyo Tetris, it will be extended in the future
to allow using real DLC with the emulator.
2020-07-06 19:43:17 +00:00
Billy Laws
4a88adafb6 Implement the set service together with GetAvailableLanguageCodes
The 'set' service is used to obtain user settings such as language.
This is used by Puyo Puyo Tetris.
2020-07-06 19:17:20 +00:00
Billy Laws
801382e43a Implement pl:u for accessing shared fonts
Fonts are stored in an array of TTF data with an 8 byte header
containing a magic and an XOR'd length. Instead of requiring users to
provide original Nintendo fonts we pack open source replacements.
They are generated with the scripts here
https://github.com/FearlessTobi/yuzu_system_archives. All the fonts are
licenced under the Open Font or Apache 2 License so we can include them
all freely.
2020-07-06 19:17:02 +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
db64f53cfb Implement filesystem backends for RomFS and Partition FS
RomFS is a hierarchial filesystem where each level is made up of a
linked list of files and child directories. It is used in NCAs to store
the applications icon as well as by applications themselves for
accessing assets.

Partition FS encapsulates both the HFS0 found in XCIs and the PFS0 used
for ExeFS images and NSPs, it is purely file based and has no support at
all for directories aside from the root.
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
bf46293fc7 Commonise executable loading infrastructure
Mapping and writing segments into memory is now handled by a common
function that can be shared between all loaders. All they need to do now
is to pack each segment into a common struct.
2020-06-28 07:54:12 +00:00
Billy Laws
c423a66020
Fixes for control IPC (#57)
* Correctly handle -WithContext IPC Requests

They should be treated the same as the non WithContext variants.

* Only send domain data on non-control IPC responses

Control IPC doesn't make use of domains so we shouldn't send extra data
in the response.

* Add the IStorage implementation to CMakeLists
2020-06-23 18:49:06 +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
Billy Laws
4950dd5638 Introduce NACP class for reading control data
This contains info such as the application name and publisher.
2020-06-20 20:26:53 +00:00
Billy Laws
5c103ce9a6 Introduce basic VFS backing system together with two implementations
- The backing system provides a flexible way to access a a region of
   abstract memory.

- It is currently barebones and only has support for reading data but
   this will be expanded as necessary.

The current implementations are:
- OsBacking - A backing that abstracts a linux file descriptor
- RegionBacking - A backing that creates a region from a portion of an
   existing one
2020-06-20 20:26:53 +00:00
◱ PixelyIon
63154d05d1 Move vkhpp to it's own repository
This commit moves vkhpp (https://github.com/skyline-emu/vkhpp) to it's own repository and include it as a submodule instead
2020-04-23 22:26:27 +05:30
◱ PixelyIon
4e4ed5aac0 Refactor Audio
This commit refactors a lot of audio by fixing a lot of nitpicks here and there.
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
d75d30b809 Minor Audio Refactor (and fix sm:IUserManager service name)
This makes some tiny changes to audio to make them compliant with the guidelines. In addition, to changing `IUserManager:IUserManager` to `sm:IUserManager`.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
618353c1fa Move to linking libraries statically
We used to link libraries dynamically before, this has obvious disadvantages and extra run-time overhead. Linking them statically instead has a lot of benefits as memory allocations and such don't need to be done independently, interaction with external libraries should be faster in general due to functions not being needed to be called virtually.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
42d982c6fb Refactor Display Services and GPU
This commit addresses the incorrect hierarchy of the GPU and refactors them at the same time. Now, the hierarchy much closely matches HOS. This commit also introduces a texture classes, albeit they're not complete and only partially implemented.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
500b49d329 Add Vulkan-Hpp to libraries
This commit adds Vulkan-Hpp as a library to the project. The headers are from a modified version of `VulkanHppGenerator`. They are broken into multiple files to avoid exceeding the Intellisense file size limit of Android Studio.
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