Commit graph

419 commits

Author SHA1 Message Date
Mary bec67dbef7
misc: Move configuration management to the Ryujinx project (#2269)
* Decouple configuration from Ryujinx.HLE and Ryujinx.Input

* Move Configuration to the Ryujinx project
2021-05-16 17:12:14 +02:00
LDj3SNuD 57ea3f93a3
PPTC meets ExeFS Patching. (#1865)
* PPTC meets ExeFS Patching.

* InternalVersion = 1865

* Ready!

* Optimized the PtcProfiler Load/Save methods.
2021-05-13 20:05:15 +02:00
gdkchan a8022ca3a1
Fix race in SM initialization (#2280) 2021-05-12 00:57:21 +02:00
gdkchan ebdbaa6db0
Fix a specific core migration bug on the scheduler (#2271) 2021-05-11 13:18:50 -03:00
Mary b94dc01d43
SM instance & TIPC fixes (#2241)
This PR addresses the following issues:
- SM was previously instancied once and reused on all sessions. This
  could cause inconsistency on the service initialization.
- TIPC replies were not matching what is generated on hardware.
2021-05-05 23:44:26 +02:00
Ac_K f0fe434bd8
nsd: Cleanup the service and implement some calls (#2250)
* nim: Cleanup the service and implement some calls

* Fix symbol typo

* add ApplicationServerEnvironmentType enum

* Change condition
2021-05-05 23:16:51 +02:00
Mary 3443023a08
hid: Rewrite shared memory management (#2257)
* hid: Rewrite shared memory management

This entirely rewrite our ancient (and original) HID shared memory
interface to be more usable and accurate.

HID update logics were updated to reflect those changes but should work
still the same way it previously did.

This need heavy testing just in case to avoid possible regressions.

* Silence warnings

* Address gdkchan's comments

* Address Ac_K's comments

* Address one missing nit
2021-05-02 22:01:30 +02:00
Ac_K 8a81be9eca
nfp: Increase Amiibo scanning delay (#2256) 2021-04-30 19:32:58 +02:00
gdkchan 20d2347971
Fix GetClockSnapshot not writing steady clock timepoint (#2249) 2021-04-26 23:56:14 +02:00
Caian Benedicto ec97a8a1fa
Initialize hid inputs on activation (#2246) 2021-04-26 10:44:20 +02:00
EmulationFanatic cac4f31dfa
Fix uint -> int typo. (#2245) 2021-04-25 02:50:00 +02:00
gdkchan 992133e9ca
Fix IsRegionInUse check on NV memory allocator (#2243) 2021-04-25 02:13:58 +02:00
Mary 305f06eb71
HLE: Fix integer sign inconcistency accross the codebase (#2222)
* Make all title id instances unsigned

* Replace address and size with ulong instead of signed types

Long overdue change.
Also change some logics here and there to optimize with the new memory
manager.

* Address Ac_K's comments

* Remove uneeded cast all around

* Fixes some others misalignment
2021-04-24 12:16:01 +02:00
Ac_K c46f6879ff
account: add Custom User Profiles support (#2227)
* Initial Impl

* Fix names

* remove useless ContentManager

* Support backgrounds and improve avatar loading

* Fix firmware checks

* Addresses gdkchan feedback
2021-04-23 22:26:31 +02:00
Ac_K 3e61fb0268
mm: Cleaned up the service a bit (#2233) 2021-04-22 23:35:01 +02:00
riperiperi dc8c781d7a
Return focus from controller applet after completion (#2218)
* Return focus from controller applet after completion

This fixes controller applet related in Mario Kart 8 Deluxe, in 2 player mode or when opening the applet in character select.

* Return focus for player select
2021-04-17 18:57:03 +02:00
Ac_K e520eecb5b
am: Stub ExtendSaveData (#2209) 2021-04-14 14:55:11 +02:00
Ac_K 9575a7638a
nsd/ssl: Fix Resolve/ResolveEx and stub GetConnectionCount (#2208) 2021-04-14 14:47:19 +02:00
VocalFan 978b69b706
[ImgBot] Optimize images (#2205)
*Total -- 555.93kb -> 486.47kb (12.49%)

/Ryujinx/Ui/Resources/Logo_GitHub.png -- 26.25kb -> 15.48kb (41.04%)
/Ryujinx/Ui/Resources/Logo_Discord.png -- 13.29kb -> 7.89kb (40.63%)
/Ryujinx/Ui/Resources/Logo_Patreon.png -- 15.12kb -> 9.79kb (35.27%)
/Ryujinx/Ui/Resources/Icon_NRO.png -- 13.58kb -> 11.06kb (18.5%)
/Ryujinx/Ui/Resources/Icon_NCA.png -- 13.35kb -> 10.96kb (17.92%)
/Ryujinx/Ui/Resources/Icon_NSO.png -- 13.62kb -> 11.20kb (17.76%)
/Ryujinx/Ui/Resources/Icon_XCI.png -- 12.79kb -> 10.53kb (17.61%)
/Ryujinx/Ui/Resources/Icon_NSP.png -- 12.89kb -> 10.66kb (17.32%)
/Ryujinx/Ui/Resources/Logo_Twitter.png -- 16.54kb -> 14.40kb (12.93%)
/Ryujinx/Ui/Resources/Controller_JoyConPair.svg -- 74.83kb -> 65.64kb (12.28%)
/Ryujinx/Ui/Resources/Controller_ProCon.svg -- 66.51kb -> 58.83kb (11.55%)
/Ryujinx/Ui/Resources/Controller_JoyConRight.svg -- 87.82kb -> 80.99kb (7.77%)
/Ryujinx.HLE/HOS/Services/Account/Acc/DefaultUserImage.jpg -- 51.73kb -> 47.85kb (7.49%)
/Ryujinx/Ui/Resources/Controller_JoyConLeft.svg -- 73.68kb -> 68.34kb (7.25%)
/Ryujinx/Ui/Resources/Logo_Amiibo.png -- 11.40kb -> 11.08kb (2.82%)
/Ryujinx/Ui/Resources/Logo_Ryujinx.png -- 52.52kb -> 51.76kb (1.45%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>

Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com>
2021-04-14 01:20:30 +02:00
Mary 0746b83edf
Initial support for the new 12.x IPC system (#2182)
* Rename CommandAttribute as CommandHIpcAttribute to prepare for 12.x changes

* Implement inital support for TIPC and adds SM command ids

* *Ipc to *ipc

* Missed a ref in last commit...

* CommandAttributeTIpc to CommandAttributeTipc

* Addresses comment and fixes some bugs around

TIPC doesn't have any padding requirements as buffer C isn't a thing
Fix for RegisterService inverting two argument only on TIPC
2021-04-14 00:01:24 +02:00
Mark Araujo faa654dbaf
Improves logging to console. (#2146)
* Restore removed text

* Adds more items to logs:

- Remove #1942

* Further removal of changes from #1942

* Removes hardcoded config state variables for logging
- Adds Configuration logging

* Decoupled logging from ReactiveObject
- Event handler added to Configuration state to handle logging of value changes

* Decoupled logging from ReactiveObject
- Event handler added to Configuration state to handle logging of value changes
2021-04-13 21:58:47 +02:00
Ac_K 7344dee475
account: Adds AccountManager (#2184)
* account: Adds Account Manager

In a way to have Custom User Profiles merged in master faster, this PR adds a `AccountManager` class (based on `AccountUtils` class) and the following changes have been made:
- Adds a "default profile values" which were the old hardcoded ones.
- The image profile is moved to the Account service folder.
- The hardcoded UserId for the savedata is now using the `AccountManager` last opened one.
- The DeviceId in Mii service is changed to the right value (checked by REd sys:set call).

* Fix csproj

* Addresses gdkchan's comments

* Fix UserProfile fields

* Fix mii GetDeviceId()

* Update Ryujinx.HLE.csproj
2021-04-13 03:16:43 +02:00
Ac_K b662a26c7e
nifm/ssl: Implement GetCurrentNetworkProfile and stub Ssl Service (#2186)
* nifm/ssl: Implement GetCurrentNetworkProfile and stub Ssl Service

* remove InterfaceVersion
2021-04-13 03:04:18 +02:00
Mary 73881fad19
Surface Flinger: Fix an oversight when closing a layer (#2192)
* Surface Flinger: Fix an oversight when closing a layer

As the title say.
I also took the liberty of changing the logic on how we select the
current layer being rendered to make it more explicit when opening and
creating layers.

NOTE: Found by Ac_k.

* check for RenderLayerId and not the dictionary size

This fix a possible race condition between the time you create a layer and set the one currently used for rendering
2021-04-13 02:56:16 +02:00
Ac_K 58660c8536
friend: Fixes PermissionLevel names (#2185)
This PR fixes the permission level names, nothing more.
2021-04-08 00:42:06 +02:00
gdkchan 874540bb5c
Allow DRAM size to be increased from 4GB to 6GB (#2174)
* Allow DRAM size to be increased from 4GB to 6GB

* Add option on the UI
2021-04-04 14:06:59 +02:00
Caian Benedicto 9ae60207c4
Fix Tamper Machine crash and timings (#2159)
* Add missing return

* Change TamperMachine sleep to 83ms

* Change constant name to PascalCase
2021-04-02 15:42:25 +02:00
mageven 4443e18909
Patch up DNS Blacklist (#2153)
Make the regex patterns case insensitive for robustness
2021-03-30 00:55:53 +02:00
Ac_K 0d984f61b2
am: Stub ILibraryAppletAccessor RequestExit (#2142)
This PR stub ILibraryAppletAccessor (20) RequestExit call which is needed by Monster Hunter Rise when you press "Private Policy" at the beginning.
The game try to run the `WebApplet` which is already partially stubbed, then call `RequestExit` to know when the applet exits. If the call does nothing, the game just hang forever. If you signals the event, you can interracts with the menu again.
2021-03-28 01:13:01 +01:00
Ac_K e60bae1a94
misc: Add credit to AmiiboAPI properly and fix a wrong warning code (#2150)
* misc: Add credit to AmiiboAPI properly and fix a warning disable

This PR adds a properly credit to AmiiboAPI which is used in our Amiibo emulation in the Readme and in the about window.
I've changed a wrong warning code added in a recent PR too.

* Update README.md

* Fix aligment
2021-03-27 15:41:09 +01:00
Caian Benedicto 0c1ea1212a
Add the TamperMachine module for runtime mods and cheats (#1928)
* Add initial implementation of the Tamper Machine

* Implement Atmosphere opcodes 0, 4 and 9

* Add missing TamperCompilationException class

* Implement Atmosphere conditional and loop opcodes 1, 2 and 3

* Inplement input conditional opcode 8

* Add register store opcode A

* Implement extended pause/resume opcodes FF0 and FF1

* Implement extended log opcode FFF

* Implement extended register conditional opcode C0

* Refactor TamperProgram to an interface

* Moved Atmosphere classes to a separate subdirectory

* Fix OpProcCtrl class not setting process

* Implement extended register save/restore opcodes C1, C2 and C3

* Refactor code emitters to separate classes

* Supress memory access errors from the Tamper Machine

* Add debug information to tamper register and memory writes

* Add block stack check to Atmosphere Cheat compiler

* Add handheld input support to Tamper Machine

* Fix code styling

* Fix build id and cheat case mismatch

* Fix invalid immediate size selection

* Print build ids of the title

* Prevent Tamper Machine from change code regions

* Remove Atmosphere namespace

* Remove empty cheats from the list

* Prevent code modification without disabling the tampering

* Fix missing addressing mode in LoadRegisterWithMemory

* Fix wrong addressing in RegisterConditional

* Add name to the tamper machine thread

* Fix code styling
2021-03-27 15:12:05 +01:00
Ac_K 32be8caa9d
caps: Implement SaveScreenShot calls and cleanup (#2140)
* caps: Implement SaveScreenShot calls and cleanup

This PR implement:
- caps:u IAlbumApplicationService (32) SetShimLibraryVersion
- caps:c IAlbumControlService (33) SetShimLibraryVersion
- caps:su IScreenShotApplicationService (32) SetShimLibraryVersion
- caps:su IScreenShotApplicationService (203/205/210) SaveScreenShotEx0/SaveScreenShotEx1/SaveScreenShotEx2

ImageSharp is used to save the raw screenshot data as a JPG file following what the service does.
All screenshots are save in: `%AppData%\Ryujinx\sdcard\Nintendo\Album` folder. (as example a screenshot file path will be `%AppData%\Ryujinx\sdcard\Nintendo\Album\2021\03\26\2021032601020300-0123456789ABCDEF0123456789ABCDEF.jpg`

This is needed by Animal Crossing: New Horizon where screenshots looks like this:

And this is needed in Monster Hunter Rise but screenshots are currently empty due to another issue.

* remove useless comment

* Addresses gdkchan feedback

* Addresses gdkchan feedback 2

* remove useless comment 2

* Fix nits
2021-03-26 01:16:08 +01:00
Ac_K 53b9267b47
am/ectx: Implement SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled and add service placeholder (#2136)
* am/ectx: Implement SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled and add service placeholder

This PR implements `am` service call `SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled` (closes #2028) accordingly to RE and adds placeholder for the `ectx` service. Both were added in 11.0.0+ firmware and are needed to boots games which needs this version.
Some games are now playable/bootable:

* Remove unused warning
2021-03-25 23:25:49 +01:00
Ac_K e5741fae2d
sfdnsres: Cleanup service and implements some calls (#2130)
* sfdnsres: Cleanup service and implements some calls

This PR is a big cleanup to our current implementation of `sfdnsres` service.
Additionnaly to that, some calls and fix have been done by @Thog (PRd with approval, thanks to her).
- Implementation of `GetAddrInfoRequest` (Fixes #637).
- Partial implementation of `GetHostByNameRequestWithOptions`, `GetHostByAddrRequestWithOptions` and `GetAddrInfoRequestWithOptions` (Fixes #642, Fixes #1233).

A DNS Blacklist have been done by @riperiperi (which is currently used in LDN build, then that reduces code differences between the LDN build and master.

Now a lot of games are playable or are blocked to the menu because it needs online service:

Co-Authored-By: Mary <1760003+Thog@users.noreply.github.com>
Co-Authored-By: riperiperi <6294155+riperiperi@users.noreply.github.com>

* Addressed gdkchan's comments

* IPAddress[] to IEnumerable

* Nits

Co-authored-by: Mary <1760003+Thog@users.noreply.github.com>
Co-authored-by: riperiperi <6294155+riperiperi@users.noreply.github.com>
2021-03-24 18:43:23 +01:00
Ac_K 39899c0407
IPC: Remove IIpcService interface (#2121)
This PR remove the IIpcService.cs interface usage which isn't needed anymore since the interface is only used by IpcService class. We can use it directly.
2021-03-19 00:31:08 +01:00
Joshi234 a8c945f35f
Add items to standard logs (#1942)
* Added more items to log

* Update MainWindow.cs

* Added log when changing settings

* fix formating and add log when toggling vsync and docked

* Update Ryujinx/Ui/MainWindow.cs

Co-authored-by: Ac_K <Acoustik666@gmail.com>

* Update Ryujinx/Ui/MainWindow.cs

Co-authored-by: Ac_K <Acoustik666@gmail.com>

* Update Ryujinx/Ui/Windows/SettingsWindow.cs

Co-authored-by: Ac_K <Acoustik666@gmail.com>

* Fix formating

* Change Location according to suggestion

* Implemented OpenDataStorageWithProgramIndex

* Update IFileSystemProxy.cs

* Update IFileSystemProxy.cs

* Commited that file on accidant

* Revert "Merge branch 'master' of https://github.com/Joshi234/Ryujinx"

This reverts commit 375f430455, reversing
changes made to 672e2c8f7d.

* Revert "Update IFileSystemProxy.cs"

This reverts commit 672e2c8f7d.

* Update IFileSystemProxy.cs

* Update ISystemSettingsServer.cs

* removed accidantel addition of IFileSystemProxy.OpenDataStorageWithProgramIndex

* Fix formating and add missing stub

* Update ISystemSettingsServer.cs

* Added more items to log

* Update MainWindow.cs

* Added log when changing settings

* fix formating and add log when toggling vsync and docked

* Fix formating

* Update Ryujinx/Ui/MainWindow.cs

Co-authored-by: Ac_K <Acoustik666@gmail.com>

* Update Ryujinx/Ui/MainWindow.cs

Co-authored-by: Ac_K <Acoustik666@gmail.com>

* Update Ryujinx/Ui/Windows/SettingsWindow.cs

Co-authored-by: Ac_K <Acoustik666@gmail.com>

* Change Location according to suggestion

* Fix Rebase stuff

* Change Logger.Notice to Loger.Info

* Update ISystemSettingsServer.cs

* Update ISystemSettingsServer.cs

Co-authored-by: Ac_K <Acoustik666@gmail.com>
2021-03-19 00:09:33 +01:00
Ac_K db56b2166d
ErrorApplet: Implement ApplicationErrorArg (#2123)
This PR implement `ApplicationErrorArg` to the Error Applet. It's used by the guest to throw some specific error messages.
The code was done for (and merged) LDN2 build since long time ago and have been tested a bunch of times because of that! In a way to reduce the differences between LDN and master build it's fine to add it to master.
2021-03-19 00:04:49 +01:00
Ac_K a56423802c
nfp: Amiibo scanning support (#2006)
* Initial Impl.

* You just want me cause I'm next

* Fix some logics

* Fix close button
2021-03-18 21:40:20 +01:00
gdkchan 5ab5b0e709
Close ILibraryAppletAccessor handles on disposal (#2094) 2021-03-10 21:36:38 +01:00
Billy Laws bab6eedccf
Fix SetStandardSteadyClockInternalOffset permission check (#2076)
I happened to notice this when checking Ryu's IPC structures. After double checking with RE it seems the current check is incorrect so use the correct member to fix that.
2021-03-04 11:58:21 +01:00
Caian Benedicto 8b4e4fc076
Improve heuristic for showing the keyboard (#2066) 2021-02-28 11:26:00 +01:00
Mary f556c80d02
Haydn: Part 1 (#2007)
* Haydn: Part 1

Based on my reverse of audio 11.0.0.

As always, core implementation under LGPLv3 for the same reasons as for Amadeus.

This place the bases of a more flexible audio system while making audout & audin accurate.

This have the following improvements:
- Complete reimplementation of audout and audin.
- Audin currently only have a dummy backend.
- Dramatically reduce CPU usage by up to 50% in common cases (SoundIO and OpenAL).
- Audio Renderer now can output to 5.1 devices when supported.
- Audio Renderer init its backend on demand instead of keeping two up all the time.
- All backends implementation are now in their own project.
- Ryujinx.Audio.Renderer was renamed Ryujinx.Audio and was refactored because of this.

As a note, games having issues with OpenAL haven't improved and will not
because of OpenAL design (stopping when buffers finish playing causing
possible audio "pops" when buffers are very small).

* Update for latest hexkyz's edits on Switchbrew

* audren: Rollback channel configuration changes

* Address gdkchan's comments

* Fix typo in OpenAL backend driver

* Address last comments

* Fix a nit

* Address gdkchan's comments
2021-02-26 01:11:56 +01:00
Ac_K 8cdb50d703
appletAE: Implement SetLcdBacklighOffEnabled (#2037)
This PR implement `appletAE ICommonStateGetter SetLcdBacklighOffEnabled` accordingly to RE.

Closes #2021
2021-02-21 09:21:32 +01:00
mageven 65eb9901f1
Allow modding AddOnContent RomFS (#2024)
Simplify some misc logic
2021-02-20 01:25:01 +01:00
Ac_K b93fe5979a
nifm: Fix returned buffer size of GetClientId (#2036)
This PR fix an issue introduced on last IPC rewrite PRs where some returned buffer size have to be explicit now.
`GetClientId` without an explicit buffer size return some garbage to the guest and then `nifm` service crashes because of a wrong ClientId. It's fixed now.

Horizon Chase Turbo and Doom regression are fixed now.  (Probably some other games too)
2021-02-19 20:18:13 +01:00
Ac_K c6d3c4207a
settings: Fix returned buffer size of GetFirmwareVersion (#2029) 2021-02-17 21:10:53 +01:00
Ac_K 80ed8596c1
prepo: Implement GetSystemSessionId and add perms (#2014)
* prepo: Implement GetSystemSessionId and add perms

* address feedbacks
2021-02-11 20:24:54 +01:00
Caian Benedicto f16d7f91f1
Improve inline keyboard compatibility (#1959)
* Improve compatibility of the inline keyboard with some games

* Send an empty first text to avoid crashing some games

* Implement SetCustomizedDictionaries and fix SetCustomizeDic

* Expand Bg and Fg –abbreviations in the swkbd applet

* Fix variable names and add comments to software keyboard
2021-02-11 01:28:44 +01:00
Joshi234 51f7cc1483
Implemented ISystemSettingsServer.IsUserSystemClockAutomaticCorrectionEnabled (#1932)
* Added IsUserSystemClockAutomaticCorrectionEnabled

This is used when a game want to check if you game is synced with a server

* Update ISystemSettingsServer.cs

* Implemented OpenDataStorageWithProgramIndex

* Update IFileSystemProxy.cs

* Commited that file on accidant

* Update IFileSystemProxy.cs

* Revert "Merge branch 'master' of https://github.com/Joshi234/Ryujinx"

This reverts commit 375f430455, reversing
changes made to 672e2c8f7d.

* Revert "Update IFileSystemProxy.cs"

This reverts commit 672e2c8f7d.

* Update IFileSystemProxy.cs

* Update ISystemSettingsServer.cs

* removed accidantel addition of IFileSystemProxy.OpenDataStorageWithProgramIndex

* Update Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs

Co-authored-by: Ac_K <Acoustik666@gmail.com>

* Update Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs

Co-authored-by: Ac_K <Acoustik666@gmail.com>

* Fix formating and add missing stub

* Update ISystemSettingsServer.cs

* Update ISystemSettingsServer.cs

Co-authored-by: Ac_K <Acoustik666@gmail.com>
2021-02-09 09:41:31 +01:00
gdkchan 5ea7d77981
Fix inter-process data copy on non-contiguous physical regions (#1988) 2021-02-08 10:54:49 +11:00