* IPC refactor part 3 + 4: New server HIPC message processor with source generator based serialization
* Make types match on calls to AlignUp/AlignDown
* Formatting
* Address some PR feedback
* Move BitfieldExtensions to Ryujinx.Common.Utilities and consolidate implementations
* Rename Reader/Writer to SpanReader/SpanWriter and move to Ryujinx.Common.Memory
* Implement EventType
* Address more PR feedback
* Log request processing errors since they are not normal
* Rename waitable to multiwait and add missing lock
* PR feedback
* Ac_K PR feedback
This fixes an error from #3805 that caused a wrong conversion of ``AppKeyValueStorage`` to string.
As that information isn't really relevant without appropriate parsing, it was removed from ``ToString``.
This should get ride of "bell warning" in Mario Kart 8 when entering Time Trials.
* common: Make BinaryReaderExtensions Read & Write take unamanged types
This allows us to not rely on Marshal.PtrToStructure and Marshal.StructureToPtr for those.
* common: Make MemoryHelper Read & Write takes unamanged types
* Update Marshal.SizeOf => Unsafe.SizeOf when appropriate and start moving software applet to unmanaged types
* friend: Stub IsFriendListCacheAvailable and EnsureFriendListAvailable
This PR stubs IsFriendListCacheAvailable and EnsureFriendListAvailable call of friend service which close#2896.
Sadly, Super Bomberman R Online is still stuck on the loading screen and keep calling `TryPopFromFriendInvitationStorageChannel`, probably because another issue somewhere.
* Add FW version
* Apply suggestions from gdkchan
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
* Update IFriendService.cs
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
* vi: Unify resolutions values and accurate implementation of them.
To continue what was made in #2618, I've REd `vi` service a bit. Now values and checks related to displays are more accurate.
- `am` GetDefaultDisplayResolution / GetDefaultDisplayResolutionChangeEvent have more informations on what the service does.
- `vi:u/vi:m/vi:s` GetDisplayService are now accurate.
- `IApplicationDisplay` GetRelayService, GetSystemDisplayService, GetManagerDisplayService, GetIndirectDisplayTransactionService, ListDisplays, OpenDisplay, OpenDefaultDisplay, CloseDisplay, GetDisplayResolution are now properly implemented.
- Some other calls are cleaned or have extra checks accordingly to RE.
Additionnaly, `IFriendService` have some wrong aligned things, and `pm:info` service placeholder was missing.
* just use _openedDisplayInfo.Remove()
* use context.Memory.Fill()
* fix some casting
* remove unneeded comment
* cleanup
* uses TryAdd
* displayId > ulong
* GetDisplayResolution > ulong
* UL
* aoc/am: Cleanup aoc service and stub am calls
This PR implement aoc call `GetAddOnContentListChangedEventWithProcessId` (Closes#2408) and `CreateContentsServiceManager`. Additionnally, a big cleanup (checked by RE on latest firmware) is made on the whole service. I've added `CountAddOnContent`, `ListAddOnContent` and `GetAddonContentBaseId` for games which require version `1.0.0-6.2.0` too.
Am service call `ReportUserIsActive` is stubbed (checked by RE, closes#2413).
Since some logic in the service (aoc) which handle the DLCs has been changed, it could be nice to have some testing to be sure there is no regression.
* Remove wrong check
* Addresses gdkchan feedback
* Fix GetAddOnContentLostErrorCode
* fix null pid in services
* Add missing comment
* remove leftover comment
* 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
* 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
* 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
* Logger class changes only
Now compile-time checking is possible with the help of Nullable Value
types.
* Misc formatting
* Manual optimizations
PrintGuestLog
PrintGuestStackTrace
Surfaceflinger DequeueBuffer
* Reduce SendVibrationXX log level to Debug
* Add Notice log level
This level is always enabled and used to print system info, etc...
Also, rewrite LogColor to switch expression as colors are static
* Unify unhandled exception event handlers
* Print enabled LogLevels during init
* Re-add App Exit disposes in proper order
nit: switch case spacing
* Revert PrintGuestStackTrace to Info logs due to #1407
PrintGuestStackTrace is now called in some critical error handlers
so revert to old behavior as KThread isn't part of Guest.
* Batch replace Logger statements
* friend: Implement GetPlayHistoryRegistrationKey
This implement IServiceCreator::GetPlayHistoryRegistrationKey call accordingly to RE.
Close#1110
* Fix comments
* Fix guid and comment some codes
* Improve guid casting and remove unused vars
* Implement a new physical memory manager and replace DeviceMemory
* Proper generic constraints
* Fix debug build
* Add memory tests
* New CPU memory manager and general code cleanup
* Remove host memory management from CPU project, use Ryujinx.Memory instead
* Fix tests
* Document exceptions on MemoryBlock
* Fix leak on unix memory allocation
* Proper disposal of some objects on tests
* Fix JitCache not being set as initialized
* GetRef without checks for 8-bits and 16-bits CAS
* Add MemoryBlock destructor
* Throw in separate method to improve codegen
* Address PR feedback
* QueryModified improvements
* Fix memory write tracking not marking all pages as modified in some cases
* Simplify MarkRegionAsModified
* Remove XML doc for ghost param
* Add back optimization to avoid useless buffer updates
* Add Ryujinx.Cpu project, move MemoryManager there and remove MemoryBlockWrapper
* Some nits
* Do not perform address translation when size is 0
* Address PR feedback and format NativeInterface class
* Remove ghost parameter description
* Update Ryujinx.Cpu to .NET Core 3.1
* Address PR feedback
* Fix build
* Return a well defined value for GetPhysicalAddress with invalid VA, and do not return unmapped ranges as modified
* Typo
* Fix inconsistencies with UserId
The account user id isn't an UUID. This PR adds a new UserId type with
the correct value ordering to avoid mismatch with LibHac's Uid. This also fix
an hardcoded value of the UserId.
As the userid has been invalid for quite some time (and to avoid forcing
users to their recreate saves), the userid has been changed to "00000000000000010000000000000000".
Also implement a stub for IApplicationFunctions::GetSaveDataSize. (see
the sources for the reason)
Fix#626
* Address jd's & Ac_k's comments
* Refactoring HOS folder structure
Refactoring HOS folder structure:
- Added some subfolders when needed (Following structure decided in private).
- Added some `Types` folders when needed.
- Little cleanup here and there.
- Add services placeholders for every HOS services (close#766 and #753).
* Remove Types namespaces
* refactoring result codes
- Add a main enum who can handle some orphalin result codes and the default `ResultCode.Success` one.
- Add sub-enum by services when it's needed.
- Remove some empty line.
- Recast all service calls to ResultCode.
- Remove some unneeded static declaration.
- Delete unused `NvHelper` class.
* NvResult is back
* Fix
* Refactoring commands handling
- Use Reflection to handle commands ID.
- Add all symbols (from SwIPC so not all time accurate).
- Re-sort some services commands methods.
- Some cleanup.
- Keep some empty constructor for consistency.
* Fix order in IProfile
* IPC services refactoring
- Use custom Attributes to handle services.
- Add a way to set the permissions and fix the bsd service to use it.
- Little cleanup.
- C#7.1 is required.
* fix var name
* fix syntax
* Change Permission to Parameter
* Delete BsdServicePermissionLevel.cs
* Fix Linq
* Refactor the friend namespace and UInt128
This commit also:
- Fix GetFriendsList arguments ordering.
- Add GetFriendListIds.
- Expose the permission level of the port instance.
- InvalidUUID => InvalidArgument
* friend: add all cmds as commments
* add Friend structure layout
* Rename FriendErr to FriendError
* Accurately implement INotificationService
* Fix singleton lock of NotificationEventHandler
* Address comments
* Add comments for IDaemonSuspendSessionService cmds
* Explicitly define the Charset when needed
Also make "Nickname" a string
* Address gdk's comments
* Fix typos
* Remove unneeded using statements
* Enforce var style more
* Remove redundant qualifiers
* Fix some indentation
* Disable naming warnings on files with external enum names
* Fix build
* Mass find & replace for comments with no spacing
* Standardize todo capitalization and for/if spacing
* friends: INotificationService Implementation of GetEvent
According to the RE, the event isn't signaled when handle is returned.
```C
long nn::friends::detail::service::NotificationService::GetEvent(long this, uint *output_handle)
{
long inner_struct_event;
int result;
if (this->event_created)
{
inner_struct_event = &this->event_object;
}
else
{
inner_struct_event = &this->event_object;
result = CreateEvent(&this->event_object, 0, 1);
if ( result )
{
Assert();
}
this->event_created = true;
}
uint event_handle = nn::os::detail::DetachReadableHandleOfInterProcessEvent(inner_struct_event);
*output_handle = event_handle;
int unknown = *((char *)output_handle + 4);
*((char *)output_handle + 4) = 1;
if (unknown)
{
CloseHandle(*output_handle);
}
return 0LL;
}
```
Co-Authored-By: Thomas Guillemard <me@thog.eu>
* Refactoring of acc:u0
- Move all account things to the account service
- More accurate IAccountServiceForApplication
- Add helper to UInt128
* FIx my engrish
* FIx my engrish #2
* Refactor Ryujinx.Common and HLE Stub Logging
* Resolve review comments
* Rename missed loop variable
* Optimize PrintStub logging function
* Pass the call-sites Thread ID through to the logger
* Remove superfluous lock from ConsoleLog
* Process logged data objects in the logger target
Pass the data object all the way to the output logger targets, to allow them to "serialize" this in whatever appropriate format they're logging in.
* Use existing StringBuilder to build the properties string
* Add a ServiceNotImplemented Exception
Useful for printing debug information about unimplemented service calls
* Resolve Style Nits
* Resolve Merge Issues
* Fix typo and align declarations
* Some style fixes and nits on ITimeZoneService
* Remove some unneeded usings
* Remove the Ryujinx.HLE.OsHle.Handles namespace
* Remove hbmenu automatic load on process exit
* Rename Ns to Device, rename Os to System, rename SystemState to State
* Move Exceptions and Utilities out of OsHle
* Rename OsHle to HOS
* Rename OsHle folder to HOS
* IManagerDisplayService and ISystemDisplayService style fixes
* BsdError shouldn't be public
* Add a empty new line before using static
* Remove unused file
* Some style fixes on NPDM
* Exit gracefully when the application is closed
* Code style fixes on IGeneralService
* Add 0x prefix on values printed as hex
* Small improvements on finalization code
* Move ProcessId and ThreadId out of AThreadState
* Rename VFs to FileSystem
* FsAccessHeader shouldn't be public. Also fix file names casing
* More case changes on NPDM
* Remove unused files
* Move using to the correct place on NPDM
* Use properties on KernelAccessControlMmio
* Address PR feedback