Commit graph

302 commits

Author SHA1 Message Date
gdkchan
18814d44b2 Address PR feedback
Add TODO comment for GL_EXT_polygon_offset_clamp
2020-01-09 02:13:00 +01:00
gdkchan
59fdaa744b GPU resource disposal 2020-01-09 02:13:00 +01:00
gdkchan
647d0962df Initialize GPU physical memory accessor from KProcess, to allow homebrew that never maps anything on the GPU to work 2020-01-09 02:13:00 +01:00
gdk
16d88c21fc Improved and simplified window texture presentation 2020-01-09 02:13:00 +01:00
gdk
8cba252b23 Add per-source type memory change tracking, simplified state change tracking, other fixes 2020-01-09 02:13:00 +01:00
gdk
1876b346fe Initial work 2020-01-09 02:13:00 +01:00
Thog
f617fb542a Fix timezone month being reported incorrectly to games (#861)
Nintendo actually uses range from 1 to 12 for months (when original timezone code manage 0-11)
2020-01-09 11:08:57 +11:00
Alex Barney
63b24b4af2 Rename "RyuFs" directory to "Ryujinx" and use the same savedata system the Switch uses (#801)
* Use savedata FS commands from LibHac

* Add EnsureSaveData. Use ApplicationControlProperty struct

* Add a function to migrate to the new directory layout

* LibHac update

* Change backup structure

* Don't create UI files in the save path

* Update RyuFs paths

* Add GetProgramIndexForAccessLog

Ryujinx only runs one program at a time, so always return values reflecting that

* Load control NCA when loading from an NSP

* Skip over UI stats when exiting

* Set TitleName and TitleId in more cases. Fix TitleID naming style

* Completely comment out GUI play stats code

* rebase

* Update LibHac

* Update LibHac

* Revert UI changes

* Do migration automatically at startup

* Rename RyuFs directory to Ryujinx

* Update RyuFs text

* Store savedata paths in the GUI

* Make "Open Save Directory" work

* Use a dummy NACP in EnsureSaveData if one is not loaded

* Remove manual migration button

* Respond to feedback

* Don't read the installer config to get a version string

* Delete nuget.config

* Exclude 'sdcard' and 'bis' during migration

Co-authored-by: Thog <thog@protonmail.com>
2020-01-05 12:49:44 +01:00
Thog
e0e12b1672
Fix EphemeralNetworkSystemClock wrong steady clock (#858)
oops
2020-01-04 18:39:27 +01:00
Thog
ad84f3a7b3
Fix GUI freeze wehn closing without any emulation running (#853) 2019-12-29 23:37:54 +01:00
Thog
1db3a66da3 Fix LibHac.IStorage not being disposed in FileSystem proxy (#851) 2019-12-26 02:58:38 +01:00
Thog
55c956e2ec Make HLE disposable safely (#850)
* Make HLE disposable safely

This fix the oldest issue with the HLE code: the kernel side
disposability.

Changelog:

- Implement KProcess::UnpauseAndTerminateAllThreadsExcept, KThread::Terminate, KThread::TerminateCurrentProcess, KThread::PrepareForTermiation and the svc post handler accurately.
- Implement svcTerminateProcess and svcExitProcess. (both untested)
- Fix KHandleTable::Destroy not decrementing refcount of all objects stored in the table.
- Spawn a custom KProcess with the maximum priority to terminate every guest KProcess. (terminating kernel emulation safely)
- General system stability improvements to enhance the user's experience.

* Fix a typo in a comment in KProcess.cs

* Address gdk's comments
2019-12-26 02:50:17 +01:00
gdkchan
87bfe681ef Fix remap ioctl map offset (#852)
* Fix remap ioctl map offset

* Correct offset type
2019-12-25 02:54:26 +01:00
Thog
bce8972e7a Fix an endge case in bsd IClient::Poll implementation (#848)
This add some code to handle usage of poll without any fds.

This is required by Dark Souls Remastered main loop logic as it's
calling it without any fds during initialization.

===
General system stability improvements to enhance the user's experience.
2019-12-23 06:33:59 +11:00
Thog
01a4c80ed5
Rewrite the configuration system (#831)
The configuration system was quite fragile and too dependent on everything, this fix #812 .

The changes:

    The file configuration is now entirely independent from the internal configuration state.
    The file configuration is versioned (current version is 1).
    Every configuration elements are now reactive properties that the emulator can register on to handle initialization and configuration changes.
    The configuration system is now in Ryujinx.Common to be accessible on every projects.
    Discord integration is now independent from the UI and can be reloaded.
    The primary controller is now configurable at runtime (NOTE: the UI currently doesn't have any options to configure real controller).
    The logger is entirely reloadable.
    You can now hotplug your controller when the emulator is running.
    The logger now takes name for every LogTarget to make them removable at runtime.
    The logger now always add the default "console" target to avoid loosing early init logs.
    The configuration system now generates a default file configuration if it's missing or too new.
    General system stability improvements to enhance the user's experience
2019-12-21 20:52:31 +01:00
Thog
d925de2d0e
Fix ILogger type and size decoding (#842)
* Fix ILogger type and size decoding

The type and size are custom encoded integer not byte.

This fix issues on games that send messages longer than 127 characters.

* Address gdk's comments
2019-12-08 14:35:25 +01:00
jduncanator
d562ba37a0 Fully reverse swkbd configuration structure and follow-up to swkbd implementation (#839)
* am: Fully reverse swkbd configuration structure

* Add documentation

* Remove explicit access modifiers

* Fix formatting

* Fix further formatting issues
2019-12-03 05:00:56 +01:00
Ac_K
bb7600e215 prepo: Silent error while parsing report (#837)
Due to a guessed parsing implementation of the report, sometime it throw an error, since the data isn't really useful, it's better to silent possible exceptions with a message.
2019-11-29 15:42:44 +11:00
Xpl0itR
da4e0856c9 Add features to GUI (#757)
* controller image changes depending on the selected controller type

the new controller image assets are temporary until i get new ones

* Game list scans subdirs for games

* Key file existence check

* Only shows Program NCAs in Application list

* Change shown GUI columns without restarting

* Sort by column if you click on the column header

Columns are sorted as text so there are inaccuracies on some columns

* Fix sort on Time Played, Last Played and File Size columns

* Add ability to designate favourite games #1

TODO:
- Make fav games persistent
- Fix invisible check marks due to theme

* Add ability to designate favourite games #2

Also removed default theme

* Added a Windows specific build condition and a Linux bug fix

* bugfix

* Load metadata from JSONs

* Temp bug fix for MacOS

* lil clean up

* requested changes

* Misc fixes

* edited schema and config

* Show the TitleID of games on the title bar

* gui column config option have names

* Async loading of game list

* bugfix and cleanup

* thog's requested changes

* requested changes and cleanup

still need to fix the gtk seizure

* Fix issue where an ExeFS as a NSP didn't show up in the application list

* Minor fixes

* catch glib unhandled exceptions

* Make sure to do UI manipulation in the main thread

* Print path of invalid files

* Ac_k's requested changes

* Return of the dark theme

* move AboutInfo struct to another file

* sort usings

* changes

- gdkchan's requested changes that have been marked resolved
- made some structs internal as they aren't used outside of the GUI
- renamed Ryujinx.UI to Ryujinx.Ui to fit naming convention and folder structure
- fixed bug where controller type dropdown box is stretched
2019-11-29 15:32:51 +11:00
Thog
c24e1892ad time: Fix wrong buffer usage in CalculateStandardUserSystemClockDifferenceByUser & CalculateSpanBetween (#836) 2019-11-27 19:27:30 +01:00
Thog
69329dc569 Fix issues on ro implementation (#834)
* ro: Fixes some bugs

* Fix critical overflow in random computation
2019-11-26 19:41:17 +01:00
Ac_K
3f3ae99a0f prepo: Implement calls of IPrepoService (#830)
* prepo: Implement calls of IPrepoService

- Implement `SaveReportOld`, `SaveReportWithUserOld`, `SaveReport`, `SaveReportWithUser` not accurate by RE (except for result codes). It's  here to do something with the data since we will never use the `Play Report` sent by the game. So it's better than just a stub.
- Fix a typo in `ldn` result code.

Close #807

* Add a processing method

* Address some comments

* remove unneeded using

* Resolve requested changes

* Typo

* Update IPrepoService.cs
2019-11-25 10:45:54 +11:00
Thog
a0e0745f2f Remove one extraneous incrementation (#833)
This incrementation is entirely wrong.
2019-11-25 10:32:07 +11:00
Ac_K
bb74aeae54 Use BinaryPrimitives.ReverseEndianness instead EndianSwap class (#832)
This PR remove the `EndianSwap` class who isn't needed anymore since .NET Core 3.0 got a buildin method `BinaryPrimitives.ReverseEndianness` who did the same thing.
2019-11-23 13:15:15 +11:00
Ac_K
cfcc360d06 ldn: Implement calls of UserLocalCommunicationService (#829)
* ldn: Implement calls of UserLocalCommunicationService

- Implement `IUserServiceCreator: CreateUserLocalCommunicationService` according to RE.
- Implement `IUserLocalCommunicationService` calls:
  - Every calls in this interface are layered to `NetworkInterface`.
  - `GetState` according to RE.
  - `InitializeOld`, `Initialize` and `Finalize` stubbed with the appropriate result code and some TODO according to RE.
  - `AttachStateChangeEvent` according to RE.

* Fix var name and TODO comments

* Fix review
2019-11-21 13:24:06 +01:00
jduncanator
ee81ab547e Initial swkbd implementation (#826)
* am: Initial swkbd implementation

Currently only implements the full screen keyboard, inline keyboard will come later.

* Remove unnecessary logging

* Miscellaneous tidy up

* am: Always pop incoming interactive session data

* am: Add a reminder to implement the full config struct

* am: Check for a max length of zero

We should only limit/truncate text when the max length is set to a non-zero value.

* Add documentation

* am: Return IStorage not available when queue is empty

We should be returning the appropriate error code when the FIFO is empty, rather than just throwing an exception and killing the emulator.

* Fix typo

* Code style changes
2019-11-18 12:16:26 +01:00
Ac_K
79abc6ed93 Implement IApplicationFunctions & IQueryService commands (#823)
* Implement IApplicationFunctions & IQueryService commands

- Fix some nits in `IApplicationFunctions`
- Implement `QueryApplicationPlayStatistics` and `QueryApplicationPlayStatisticsByUid` checked by RE.
- Implement `QueryApplicationPlayStatisticsForSystem` and `QueryApplicationPlayStatisticsByUserAccountIdForSystem` checked by RE.
- Implement `QueryPlayStatisticsManager` to get/set played games statistics. We currently don't store any statistics because it's handled by qlaunch (or maybe am service?) on Switch.
We can add support later if games use returned statistics for something.

* Fix reviews
2019-11-15 01:25:22 +01:00
Natalie C
b9ae0b09d9 Set AArch32 mode in KThread (#818)
* Set AArch32 mode in KThread

* Update ProgramLoader.cs
2019-11-14 15:28:13 +01:00
Ac_K
dead89576e Fix GetAudioDeviceServiceWithRevisionInfo logging (#822)
* Fix GetAudioDeviceServiceWithRevisionInfo logging

`revisionInfo` and `appletResourceUserId` were read in the wrong order.

* Fix comment
2019-11-14 10:06:28 +01:00
jduncanator
35e5612766 Implement a rudimentary applets system (#804)
* Implement Player Select applet

* Initialize the Horizon system reference

* Tidy up namespaces

* Resolve nits

* Resolve nits

* Rename stack to queue

* Implement an applet FIFO

* Remove debugging log

* Log applet creation events

* Reorganise AppletFifo

* More reorganisation

* Final changes
2019-11-14 06:18:44 +01:00
Thomas Guillemard
2ea8d5bd5f Improve IRoInterface logic (#809)
* hle: Improve IRoInterface logic

This commit contains a little rewrite of IRoInterface to fix some issues
that we were facing on some recent games (AC3 Remastered & Final Fantasy
VIII Remastered)

Related issues:

- https://github.com/Ryujinx/Ryujinx-Games-List/issues/196

* Address comments
2019-11-08 15:49:48 +01:00
Thomas Guillemard
88593bf872 Add detail of ZbcSetTableArguments (#810)
* Add detail of ZbcSetTableArguments

This is a missing part of the #800 PR that cause an assert to be
triggered in debug mode.

Also, remove Fence in SurfaceFlinger as it's a duplicate of NvFence.

* Fix critical issue in size checking of ioctl

oops
2019-11-08 15:49:28 +01:00
Thomas Guillemard
b29950dbd6 hle: Fix some inconsistencies in namespace naming in Services (#808)
Also fix IShopServiceAccessSystemInterface being in the wrong namespace.
2019-11-03 18:26:29 +01:00
Thomas Guillemard
9426ef3f06 Rewrite nvservices (#800)
* Start rewriting nvservices internals

TODO:

- nvgpu device interface
- nvhost generic device interface

* Some clean up and fixes

- Make sure to remove the fd of a closed channel.
- NvFileDevice now doesn't implement Disposable as it was never used.
- Rename NvHostCtrlGetConfigurationArgument to GetConfigurationArguments
to follow calling convention.
- Make sure to check every ioctls magic.

* Finalize migration for ioctl standard variant

TODO: ioctl2 migration

* Implement SubmitGpfifoEx and fix nvdec

* Implement Ioctl3

* Implement some ioctl3 required by recent games

* Remove unused code and outdated comments

* Return valid event handles with QueryEvent

Also add an exception for unimplemented event ids.

This commit doesn't implement accurately the events, this only define
different events for different event ids.

* Rename all occurance of FileDevice to DeviceFile

* Restub SetClientPid to not cause regressions

* Address comments

* Remove GlobalStateTable

* Address comments

* Align variables in ioctl3

* Some missing alignments

* GetVaRegionsArguments realign

* Make Owner public in NvDeviceFile

* Address LDj3SNuD's comments
2019-11-03 09:47:56 +11:00
LDj3SNuD
eee639d6ba .NET Core 3.0 is here! (#784)
* .NET Core 3.0 is here!

* Remove IMemoryManager.cs and its references.

* Add T Math/F.FusedMultiplyAdd(T, T, T). Nits.

* Nit.

* Update appveyor.yml

* Revert "Resolve Visual Studio build issues"

This reverts commit 1772128ce0.

* Update SvcTable.cs
2019-10-31 19:09:03 +01:00
jduncanator
d059ffb15d
Increase IPC buffer size (#803)
This is a hack, but it works for now. We should really determine a way to automatically calculate the required buffer size to avoid situations where specific IPC calls "overflow" the maximum size.
2019-10-31 15:50:12 +11:00
LDj3SNuD
59f48e3710 Fix ghost users bug. (#799)
* Fix ghost users bug.
* Update IAccountServiceForApplication.cs
2019-10-28 11:50:50 +11:00
jduncanator
86b42f176a
svc: Implement ref parameters (#798)
Allows passing data into and out of the same registers when calling via the Kernel ABI. This allows implementing specific supervisor calls like "CallSecureMonitor", that expect their args and results in the same registers.
2019-10-25 10:34:35 +11:00
Thomas Guillemard
2b5ec23aa7 Fix latest version of hbl/hb-menu (#795)
* Fix latest version of hbl/hb-menu

This implement GetSettingsItemValueSize (required by hbl) and
GetInternetConnectionStatus (required by hb-menu).

* Address comments
2019-10-19 00:47:50 +02:00
Alex Barney
8a8ea4c8c0 Update to LibHac 0.6.0 (#792)
* Update to LibHac 0.6.0

* Create an IFileSystemProxy object from LibHac

* Rename rc -> result

* Alignment and spacing

* Result formatting

* Spacing

* Sort usings
2019-10-17 08:17:44 +02:00
Ac_K
c0fe6cdca0 Move InvalidSystemResourceException with the other Exceptions (#794)
* Move InvalidSystemResourceException with the other

`InvalidSystemResourceException.cs` was in `Ryujinx.HLE/Resource` who didn't make sense since it's the only file in the folder, and other exceptions class are in `Ryujinx.HLE/Exceptions`.

* Fix empty lines
2019-10-16 11:30:36 +11:00
Thomas Guillemard
0bce40e2ed Fix TimeZoneBinary dispose issues (#785)
* Fix TimeZoneBinary dispose issues

THis fix a regression on Pokémon Let's Go Eevee! (and
probably other games) caused by #783.

* Address Moosehunter's comment
2019-10-11 18:05:10 +02:00
Ac_K
c17e1f99f0 audout:u: Implement SetAudioOutVolume and GetAudioOutVolume (#781)
* audout:u: Implement SetAudioOutVolume and GetAudioOutVolume

- Implementation of `audout:u` SetAudioOutVolume and GetAudioOutVolume (checked with RE).
- Add Get and Set for Volume into audio backends.
- Cleanup of all audio backends to follow the `IAalOutput` structure and .NET standard.
- Split OpenAL backend into 2 files for consistency.

* Address comments

* Fix the volume calculation
2019-10-11 17:54:29 +02:00
Thomas Guillemard
4210fe2b7b Fix error code returned by CloseSession (#787)
When we close a session via IPC, we should return an error code.

This fix an assert in some games that are shipped with debug modules.
2019-10-11 17:53:45 +02:00
Thomas Guillemard
9142aca48f Fix hwopus DecodeInterleaved implementation (#786)
* Fix hwopus DecodeInterleaved implementation

Also implement new variants of this api.

This should fix #763

* Sample rate shouldn't be hardcoded

This fix issues while opening Pokémon Let's Go pause menu.

* Apply Ac_K's suggestion about EndianSwap

* Address gdkchan's comment

* Address Ac_k's comment
2019-10-11 17:22:24 +02:00
Thomas Guillemard
1aba033ba7 Update time implementation to 9.0.0 (#783)
* Fix 9.0.0 related services bindings

This was wrong because of a mistake on switchbrew.

* Fix wronog cmdid for ISteadyClock::GetTestOffset/SetTestOffset

* Update ClockCore logics to 9.0.0

Also apply 9.0.0 permissions and comment time:u, and time:a (as those
are going to be moved)

* Move every clocks instances + timezone to a global manager

* Start implementing time:m

Also prepare the skeleton of the shared memory

* Implement SystemClockContextUpdateCallback and co

* Update StaticService to 9.0.0

* Update ISystemClock to 9.0.0

* Rename IStaticService and add glue's IStaticService

* Implement psc's ITimeZoneService

* Integrate psc layer into glue for TimeZoneService

* Rename TimeZoneManagerForPsc => TimeZoneManager

* Use correct TimeZoneService interface for both StaticService implementations

* Accurately implement time shared memory operations

* Fix two critical flaws in TimeZone logic

The first one was the month range being different fron Nintendo one
(0-11 instead of 1-12)

The other flaw was a bad incrementation order during days & months
computation.

* Follow Nintendo's abort logic for TimeManager

* Avoid crashing when timezone sysarchive isn't present

* Update Readme

* Address comments

* Correctly align fields in ISystemClock

* Fix code style and some typos

* Improve timezone system archive warning/error messages

* Rearrange using definitions in Horizon.cs

* Address comments
2019-10-08 14:48:49 +11:00
Ac_K
92e5e3c505 am: IApplicationFunctions GetGpuErrorDetectedSystemEvent implementation (#775) 2019-09-20 14:42:32 +10:00
Ac_K
f48df486e2 Remove IntUtils and use BitUtils instead. (#774) 2019-09-20 14:41:57 +10:00
LDj3SNuD
72b9f8f0a0 Misc fixes (#772)
* Update Logger.cs

* Update MainWindow.cs

* Update SvcTable.cs

* Update SvcTable.cs

* Update SvcTable.cs
2019-09-19 20:59:48 -03:00
Ac_K
f17b772c56 audren: Fix AudioRenderer implementation (#773)
* Fix AudioRenderer implementation

According to RE:
- `GetAudioRendererWorkBufferSize` is updated and improved to support `REV7`
- `RequestUpdateAudioRenderer` is updated to `REV7` too

Should improve results on recent game and close #718 and #707

* Fix NodeStates.GetWorkBufferSize

* Use BitUtils instead of IntUtils

* Nits
2019-09-20 01:49:05 +02:00