* 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
* infra: Migrate to .NET 6
* Rollback version naming change
* Workaround .NET 6 ZipArchive API issues
* ci: Switch to VS 2022 for AppVeyor
CI is now ready for .NET 6
* Suppress WebClient warning in DoUpdateWithMultipleThreads
* Attempt to workaround System.Drawing.Common changes on 6.0.0
* Change keyboard rendering from System.Drawing to ImageSharp
* Make the software keyboard renderer multithreaded
* Bump ImageSharp version to 1.0.4 to fix a bug in Image.Load
* Add fallback fonts to the keyboard renderer
* Fix warnings
* Address caian's comment
* Clean up linux workaround as it's uneeded now
* Update readme
Co-authored-by: Caian Benedicto <caianbene@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
* 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
* 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
* Add background mode configuration to SoftwareKeyboardApplet
* Add placeholder text generator for Software Keyboard in background mode
* Add stub for GetIndirectLayerImageMap
* Fix default state of DecidedCancel response
* Add GUI text input to Software Keyboard in background mode
* Fix graphical glitch when Inline Software Keyboard appears
* Improve readability of InlineResponses class
* Improve code styling and fix compiler warnings
* Replace ServiceDisplay log class by ServiceVi
* Replace static readonly by const
* Add proper finalization to the keyboard applet in inline mode
* Rename constants to start with uppercase
* Fix inline keyboard not working with some games
* Improve code readability
* Fix code styling
* IPC refactor part 2: Use ReplyAndReceive on HLE services and remove special handling from kernel
* Fix for applet transfer memory + some nits
* Keep handles if possible to avoid server handle table exhaustion
* Fix IPC ZeroFill bug
* am: Correctly implement CreateManagedDisplayLayer and implement CreateManagedDisplaySeparableLayer
CreateManagedDisplaySeparableLayer is requires since 10.x+ when appletResourceUserId != 0
* Make it exit properly
* Make ServiceNotImplementedException show the full message again
* Allow yielding execution to avoid starving other threads
* Only wait if active
* Merge IVirtualMemoryManager and IAddressSpaceManager
* Fix Ro loading data from the wrong process
Co-authored-by: Thog <me@thog.eu>
* Changes to allow explicit management of service threads
* Remove now unused code
* Remove ThreadCounter, its no longer needed
* Allow and use separate server per service, also fix exit issues
* New policy change: PTC version now uses PR number
* 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
This implement GetIndirectLayerImageRequiredMemoryInfo call from vi service, accordingly to RE.
Thanks to Thog and gdkchan for helping me to understand some GPU things.
Close#942
* 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
* Rewrite SurfaceFlinger
Reimplement accurately SurfaceFlinger (based on my 8.1.0 reversing of it)
TODO: support swap interval properly and reintroduce disabled "game vsync" support.
* Some fixes for SetBufferCount
* uncomment a test from last commit
* SurfaceFlinger: don't free the graphic buffer in SetBufferCount
* SurfaceFlinger: Implement swap interval correctly
* SurfaceFlinger: Reintegrate Game VSync toggle
* SurfaceFlinger: do not push a fence on buffer release on the consumer side
* Revert "SurfaceFlinger: do not push a fence on buffer release on the consumer side"
This reverts commit 586b52b0bfab2d11f361f4b59ab7b7141020bbad.
* Make the game vsync toggle work dynamically again
* Unregister producer's Binder object when closing layer
* Address ripinperi's comments
* Add a timeout on syncpoint wait operation
Syncpoint aren't supposed to be waited on for more than a second.
This effectively workaround issues caused by not having a channel
scheduling in place yet.
PS: Also introduce Android WaitForever warning about fence being not
signaled for 3s
* Fix a print of previous commit
* Address Ac_K's comments
* Address gdkchan's comments
* Address final 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
* Start of the ARMeilleure project
* Refactoring around the old IRAdapter, now renamed to PreAllocator
* Optimize the LowestBitSet method
* Add CLZ support and fix CLS implementation
* Add missing Equals and GetHashCode overrides on some structs, misc small tweaks
* Implement the ByteSwap IR instruction, and some refactoring on the assembler
* Implement the DivideUI IR instruction and fix 64-bits IDIV
* Correct constant operand type on CSINC
* Move division instructions implementation to InstEmitDiv
* Fix destination type for the ConditionalSelect IR instruction
* Implement UMULH and SMULH, with new IR instructions
* Fix some issues with shift instructions
* Fix constant types for BFM instructions
* Fix up new tests using the new V128 struct
* Update tests
* Move DIV tests to a separate file
* Add support for calls, and some instructions that depends on them
* Start adding support for SIMD & FP types, along with some of the related ARM instructions
* Fix some typos and the divide instruction with FP operands
* Fix wrong method call on Clz_V
* Implement ARM FP & SIMD move instructions, Saddlv_V, and misc. fixes
* Implement SIMD logical instructions and more misc. fixes
* Fix PSRAD x86 instruction encoding, TRN, UABD and UABDL implementations
* Implement float conversion instruction, merge in LDj3SNuD fixes, and some other misc. fixes
* Implement SIMD shift instruction and fix Dup_V
* Add SCVTF and UCVTF (vector, fixed-point) variants to the opcode table
* Fix check with tolerance on tester
* Implement FP & SIMD comparison instructions, and some fixes
* Update FCVT (Scalar) encoding on the table to support the Half-float variants
* Support passing V128 structs, some cleanup on the register allocator, merge LDj3SNuD fixes
* Use old memory access methods, made a start on SIMD memory insts support, some fixes
* Fix float constant passed to functions, save and restore non-volatile XMM registers, other fixes
* Fix arguments count with struct return values, other fixes
* More instructions
* Misc. fixes and integrate LDj3SNuD fixes
* Update tests
* Add a faster linear scan allocator, unwinding support on windows, and other changes
* Update Ryujinx.HLE
* Update Ryujinx.Graphics
* Fix V128 return pointer passing, RCX is clobbered
* Update Ryujinx.Tests
* Update ITimeZoneService
* Stop using GetFunctionPointer as that can't be called from native code, misc. fixes and tweaks
* Use generic GetFunctionPointerForDelegate method and other tweaks
* Some refactoring on the code generator, assert on invalid operations and use a separate enum for intrinsics
* Remove some unused code on the assembler
* Fix REX.W prefix regression on float conversion instructions, add some sort of profiler
* Add hardware capability detection
* Fix regression on Sha1h and revert Fcm** changes
* Add SSE2-only paths on vector extract and insert, some refactoring on the pre-allocator
* Fix silly mistake introduced on last commit on CpuId
* Generate inline stack probes when the stack allocation is too large
* Initial support for the System-V ABI
* Support multiple destination operands
* Fix SSE2 VectorInsert8 path, and other fixes
* Change placement of XMM callee save and restore code to match other compilers
* Rename Dest to Destination and Inst to Instruction
* Fix a regression related to calls and the V128 type
* Add an extra space on comments to match code style
* Some refactoring
* Fix vector insert FP32 SSE2 path
* Port over the ARM32 instructions
* Avoid memory protection races on JIT Cache
* Another fix on VectorInsert FP32 (thanks to LDj3SNuD
* Float operands don't need to use the same register when VEX is supported
* Add a new register allocator, higher quality code for hot code (tier up), and other tweaks
* Some nits, small improvements on the pre allocator
* CpuThreadState is gone
* Allow changing CPU emulators with a config entry
* Add runtime identifiers on the ARMeilleure project
* Allow switching between CPUs through a config entry (pt. 2)
* Change win10-x64 to win-x64 on projects
* Update the Ryujinx project to use ARMeilleure
* Ensure that the selected register is valid on the hybrid allocator
* Allow exiting on returns to 0 (should fix test regression)
* Remove register assignments for most used variables on the hybrid allocator
* Do not use fixed registers as spill temp
* Add missing namespace and remove unneeded using
* Address PR feedback
* Fix types, etc
* Enable AssumeStrictAbiCompliance by default
* Ensure that Spill and Fill don't load or store any more than necessary
* 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
* 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
* Renaming part 1
* Renaming part 2
* Renaming part 3
* Renaming part 4
* Renaming part 5
* Renaming part 6
* Renaming part 7
* Renaming part 8
* Renaming part 9
* Renaming part 10
* General cleanup
* Thought I got all of these
* Apply #595
* Additional renaming
* Tweaks from feedback
* Rename files
* Initial non 2D textures support
- Shaders still need to be changed
- Some types aren't yet implemented
* Start implementing texture instructions suffixes
Fix wrong texture type with cube and TEXS
Also support array textures in TEX and TEX.B
Clean up TEX and TEXS coords managment
Fix TEXS.LL with non-2d textures
Implement TEX.AOFFI
Get the right arguments for TEX, TEXS and TLDS
Also, store suffix operands in appropriate values to support multiple
suffix combinaisons
* Support depth in read/writeTexture
Also support WrapR and detect mipmap
* Proper cube map textures support + fix TEXS.LZ
* Implement depth compare
* some code clean up
* Implement CubeMap textures in OGLTexture.Create
* Implement TLD4 and TLD4S
* Add Texture 1D support
* updates comments
* fix some code style issues
* Fix some nits + rename some things to be less confusing
* Remove GetSuffix local functions
* AOFFI => AOffI
* TextureType => GalTextureTarget
* finish renaming TextureType to TextureTarget
* Disable LL, LZ and LB support in the decompiler
This needs more work at the GL level (GLSL implementation should be
right)
* Revert "Disable LL, LZ and LB support in the decompiler"
This reverts commit 64536c3d9f673645faff3152838d1413c3203395.
* Fix TEXS ARRAY_2D index
* ImageFormat depth should be 1 for all image format
* Fix shader build issues with sampler1DShadow and texture
* Fix DC & AOFFI combinaison with TEX/TEXS
* Support AOFFI with TLD4 and TLD4S
* Fix shader compilation error for TLD4.AOFFI with no DC
* Fix binding isuses on the 2d copy engine
TODO: support 2d array copy
* Support 2D array copy operation in the 2D engine
This make every copy right in the GPU side.
Thie CPU copy probably needs to be updated
* Implement GetGpuSize + fix somes issues with 2d engine copies
TODO: mipmap level in it
* Don't throw an exception in the layer handling
* Fix because of rebase
* Reject 2d layers of non textures in 2d copy engine
* Add 3D textures and mipmap support on BlockLinearSwizzle
* Fix naming on new BitUtils methods
* gpu cache: Make sure to invalidate textures that doesn't have the same target
* Add the concept of layer count for array instead of using depth
Also cleanup GetGpuSize as Swizzle can compute the size with mipmap
* Support multi layer with mip map in ReadTexture
* Add more check for cache invalidation & remove cubemap and cubemap array code for now
Also fix compressed 2d array
* Fix texelFetchOffset shader build error
* Start looking into cube map again
Also add some way to log write in register in engines
* fix write register log levles
* Remove debug logs in WriteRegister
* Disable AOFFI support on non NVIDIA drivers
* Fix code align
* Implement ConvertScalingMode properly
* Fix up the naming
* Only values 2 and 4 are allowed
* Return a nullable enum from ConvetScalingMode
* Fix typo on method name
* Use convertedScalingMode
* 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
* Initial fixes for last release of libnx
For now, the framebuffer aren't okay but it will not crash/
* Improve code reaadability in NvFlinger parsing
* Make surfaces access more userfriendly
* Add ColorFormat
* Fix code style in ColorFormat.cs
* Add multiple framebuffer support in nvnflinger
This fix libnx console rendering
* Move ReadStruct/WriteStruct to Ryujinx.Common
* fix the last nit
* Fix inverted color for R5G6B5
Also add some other format that libnx might uses.
* Remove hardcoded BlockHeight in nvflinger
* Initial implementation of KProcess
* Some improvements to the memory manager, implement back guest stack trace printing
* Better GetInfo implementation, improve checking in some places with information from process capabilities
* Allow the cpu to read/write from the correct memory locations for accesses crossing a page boundary
* Change long -> ulong for address/size on memory related methods to avoid unnecessary casts
* Attempt at implementing ldr:ro with new KProcess
* Allow BSS with size 0 on ldr:ro
* Add checking for memory block slab heap usage, return errors if full, exit gracefully
* Use KMemoryBlockSize const from KMemoryManager
* Allow all methods to read from non-contiguous locations
* Fix for TransactParcelAuto
* Address PR feedback, additionally fix some small issues related to the KIP loader and implement SVCs GetProcessId, GetProcessList, GetSystemInfo, CreatePort and ManageNamedPort
* Fix wrong check for source pages count from page list on MapPhysicalMemory
* Fix some issues with UnloadNro on ldr:ro
* Change naming convention for Ryujinx project
* Change naming convention for ChocolArm64 project
* Fix NaN
* Remove unneeded this. from Ryujinx project
* Adjust naming from new PRs
* Name changes based on feedback
* How did this get removed?
* Rebasing fix
* Change FP enum case
* Remove prefix from ChocolArm64 classes - Part 1
* Remove prefix from ChocolArm64 classes - Part 2
* Fix alignment from last commit's renaming
* Rename namespaces
* Rename stragglers
* Fix alignment
* Rename OpCode class
* Missed a few
* Adjust alignment
* Simplify render target bindings
* Implement multiple viewports
* Pack glViewportIndexed calls into a single glViewportArray
* Use ARB_viewport_array when available
* Cache framebuffer attachments
* Use get accessors in OGLExtension
* Address feedback
* Started to rewrite the thread scheduler
* Add a single core-like scheduling mode, enabled by default
* Clear exclusive monitor on context switch
* Add SetThreadActivity, misc fixes
* Implement WaitForAddress and SignalToAddress svcs, misc fixes
* Misc fixes (on SetActivity and Arbiter), other tweaks
* Rebased
* Add missing null check
* Rename multicore key on config, fix UpdatePriorityInheritance
* Make scheduling data MLQs private
* nit: Ordering
* (Re)Implement format reinterpretation, other changes
* Implement writeback to guest memory, some refactoring
* More refactoring, implement reinterpretation the old way again
* Clean up
* Some fixes on M2MF (old Dma engine), added partial support for P2MF, fix conditional ssy, add Z24S8 zeta format, other fixes
* nit: Formatting
* Address PR feedback
* Initial Framerate limit implementation
* use seperate event for limiter
* check for vsync signal after queue up framebuffer
* removed ingame toggle
* fix nits