Compare commits

..

18 Commits

Author SHA1 Message Date
c5258cf082 Ability to hide file types in Game List (#4555)
* Added HiddenFileTypes to config state, and check to file enumeration

* Added hiddenfiletypes checkboxes to the UI

* Added Ava version of HiddenFileTypes

* Inverted Hide to Show with file types, minor formatting

* all variables with a reference to 'hidden' is now 'shown'

* one more variable name changed

* review feedback

* added FileTypes extension methof to get the correlating config value

* moved extension method to new folder and file in Ryujinx.Ui.Common

* added default case for ToggleFileType

* changed exception type to OutOfRangeException
2023-04-16 01:03:35 +00:00
5c89e22bb9 Added check for eventual symlink when displaying game files. (#4526)
* Added check for eventual symlink when displaying game files.

* Moved symlink check logic

* Moved symlink check logic

* Fixed prev commit

---------

Co-authored-by: Daniel Shala <danielshala00@gmail.com>
2023-04-15 16:11:24 +00:00
11ecff2ff0 Rename Hipc to Cmif where appropriate (#3880) 2023-04-14 20:00:34 -03:00
4c3f09644a Move swkbd message null check into constructor (#4671) 2023-04-12 21:18:40 +02:00
e187a8870a HLE: Deal with empty title names properly (#4643)
* hle: Deal with empty titleNames in some languages

* gui: Fix displaying the wrong title name

* Remove unnecessary bounds check

* Fix a NRE when getting the version string

* Restore empty string logic
2023-04-12 01:09:47 +00:00
a64fee29dc Vulkan: add situational "Fast Flush" mode (#4667)
* Flush in the middle of long command buffers.

* Vulkan: add situational "Fast Flush" mode

The AutoFlushCounter class was added to periodically flush Vulkan command buffers throughout a frame, which reduces latency to the GPU as commands are submitted and processed much sooner. This was done by allowing command buffers to flush when framebuffer attachments changed.

However, some games have incredibly long render passes with a large number of draws, and really aggressive data access that forces GPU sync.

The Vulkan backend could potentially end up building a single command buffer for 4-5ms if a pass has enough draws, such as in BOTW. In the scenario where sync is waited on immediately after submission, this would have to wait for the completion of a much longer command buffer than usual.

The solution is to force command buffer submission periodically in a "fast flush" mode. This will end up splitting render passes, but it will only enable if sync is aggressive enough.

This should improve performance in GPU limited scenarios, or in games that aggressively wait on synchronization. In some games, it may only kick in when res scaling. It won't trigger in games like SMO where sync is not an issue.

Improves performance in Pokemon Scarlet/Violet (res scaled) and BOTW (in general).

* Add conversions in milliseconds next to flush timers.
2023-04-11 09:23:41 +02:00
9ef94c8292 ARMeilleure: Move TPIDR_EL0 and TPIDRRO_EL0 to NativeContext (#4661)
* ARMeilleure: Move TPIDR_EL0 and TPIDRRO_EL0 to NativeContext

Some games access these system registers several tens of thousands of times in a second from many different threads. While this isn't really crippling, it is a lot of wasted time spent in a reverse pinvoke transition.

Example games are Pokemon Scarlet/Violet and BOTW. These games have a lot of different potential bottlenecks so it's unlikely you will see a consistent improvement, but it definitely disappears from the cpu profile.

* Remove unreachable code.

* Add ulong conversion for offsets

* Nit
2023-04-11 08:55:04 +02:00
915d6d044c OpenGL: Fix OBS/Overlays again by binding FB before present (#4668)
This seems to have been removed by the Post-Processing PR, but it is required for the display in OBS to be the right way up and properly scaled.

I've tested this with AA and FSR on MK8D and it seems to behave properly. Testing is welcome.
2023-04-11 08:32:31 +02:00
a4780ab33b Force activate parent window before dialog is shown (#4663) 2023-04-11 00:04:31 +02:00
a947a45d81 gtk: Fix a NRE when disposing OpenGL (#4648) 2023-04-10 17:00:23 +02:00
9db73f74cf ARMeilleure: Respect FZ/RM flags for all floating point operations (#4618)
* ARMeilleure: Respect Fz flag for all floating point operations.

This is a change in strategy for emulating the Fz FPCR flag. Before, it was set before instructions that "needed it" and reset after. However, this missed a few hot instructions like the multiplication instruction, and the entirety of A32.

The new strategy is to set the Fz flag only in the following circumstances:

- Set to match FPCR before translated functions/loop are executed.
- Reset when calling SoftFloat methods, set when returning.
- Reset when exiting execution.

This allows us to remove the code around the existing Fz aware instructions, and get the accuracy benefits on all floating point instructions executed while in translated code.

Single step executions now need to be called with a context wrapper - right now it just contains the Fz flag initialization, and won't actually do anything on ARM.

This fixes a bug in Breath of the Wild where some physics interactions could randomly crash the game due to subnormal values not flushing to zero.

This is draft right now because I need to answer the questions:
- Does dotnet avoid changing the value of Mxcsr?
- Is it a good idea to assume that? Or should the flag set/restore be done on every managed method call, not just softfloat?
- If we assume that, do we want a unit test to verify the behaviour?

I recommend testing a bunch of games, especially games affected when this was originally added, such as #1611.

* Remove unused method

* Use FMA for Fmadd, Fmsub, Fnmadd, Fnmsub, Fmla, Fmls

...when available.

Similar implementation to A32

* Use FMA for Frecps, Frsqrts

* Don't set DAZ.

* Add round mode to ARM FP mode

* Fix mistakes

* Add test for FP state when calling managed methods

* Add explanatory comment to test.

* Cleanup

* Add A64 FPCR flags

* Vrintx_S A32 fast path on A64 backend

* Address feedback 1, re-enable DAZ

* Fix FMA instructions By Elem

* Address feedback
2023-04-10 12:22:58 +02:00
a1efd87c45 Implement remaining Arm64 HINT instructions as NOP (#4658)
* Implement remaining HINT instructions as NOP

* Split HINT encodings more to account for CSDB
2023-04-09 13:21:16 -03:00
49be977588 Eliminate boxing allocations caused by ISampledData structs (#4556)
* Redesign use of ISampledData for accessing the SamplingNumber value on input data structs.

* Always read SamplingNumber as little-endian

* Restored field order for SixAxisSensorState. Rework to allow possibility of non-zero offsets for the SamplingNumber field. Set StructLayout Pack=8 - the KeyboardState struct is 4 bytes shorter with any other value.

* fix spelling

Co-authored-by: riperiperi <rhy3756547@hotmail.com>

* set Pack = 1 for ISampledDataStruct types, added Unknown field to KeyboardState

* extend size of KeyboardModifier

---------

Co-authored-by: riperiperi <rhy3756547@hotmail.com>
2023-04-05 17:42:32 -03:00
c95be55091 vulkan: Cleanup PhysicalDevice and Instance querying (#4632)
* vulkan: Move most of the properties enumeration to VulkanPhysicalDevice

That clean up a bit of duplicate logic.
Also move to use an hashset for device extensions.

* vulkan: Move instance querying to VulkanInstance

Also cleanup code to use span when possible instead of unsafe pointers.

* Address gdkchan's comments
2023-04-05 14:48:38 -03:00
63dedbda86 nuget: bump System.IdentityModel.Tokens.Jwt from 6.27.0 to 6.28.1 (#4639)
Bumps [System.IdentityModel.Tokens.Jwt](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet) from 6.27.0 to 6.28.1.
- [Release notes](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/releases)
- [Changelog](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/compare/6.27.0...6.28.1)

---
updated-dependencies:
- dependency-name: System.IdentityModel.Tokens.Jwt
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-05 07:55:57 +02:00
c532118d94 Use index fragment shader output when dual source blend is enabled (#4404)
* Use index fragment shader output when dual source blend is enabled

* Shader cache version bump

* Actually set DualSourceBlendEnabled to true

* Fix XML doc

---------

Co-authored-by: Ac_K <Acoustik666@gmail.com>
2023-04-05 05:25:19 +02:00
52d6f2e656 hle: Set ProcessResult name from NACP (#4633)
* Extract titleName from nacp

* Address formatting feedback

* Check if the desired language is actually available
2023-04-05 03:34:21 +02:00
c9bc4eaf58 Fix missing string enum converters for the config (#4634)
* Fix missing string enum converters for the config

* Revert changing KeyboardHotkeys to struct

This needs to be done because
Avalonia's TwoWay Binding breaks otherwise.
2023-04-03 15:37:27 +02:00
232 changed files with 3115 additions and 1779 deletions

View File

@ -226,6 +226,8 @@ namespace ARMeilleure.CodeGen.Arm64
Add(Intrinsic.Arm64MlsVe, new IntrinsicInfo(0x2f004000u, IntrinsicType.VectorTernaryRdByElem)); Add(Intrinsic.Arm64MlsVe, new IntrinsicInfo(0x2f004000u, IntrinsicType.VectorTernaryRdByElem));
Add(Intrinsic.Arm64MlsV, new IntrinsicInfo(0x2e209400u, IntrinsicType.VectorTernaryRd)); Add(Intrinsic.Arm64MlsV, new IntrinsicInfo(0x2e209400u, IntrinsicType.VectorTernaryRd));
Add(Intrinsic.Arm64MoviV, new IntrinsicInfo(0x0f000400u, IntrinsicType.VectorMovi)); Add(Intrinsic.Arm64MoviV, new IntrinsicInfo(0x0f000400u, IntrinsicType.VectorMovi));
Add(Intrinsic.Arm64MrsFpcr, new IntrinsicInfo(0xd53b4400u, IntrinsicType.GetRegister));
Add(Intrinsic.Arm64MsrFpcr, new IntrinsicInfo(0xd51b4400u, IntrinsicType.SetRegister));
Add(Intrinsic.Arm64MrsFpsr, new IntrinsicInfo(0xd53b4420u, IntrinsicType.GetRegister)); Add(Intrinsic.Arm64MrsFpsr, new IntrinsicInfo(0xd53b4420u, IntrinsicType.GetRegister));
Add(Intrinsic.Arm64MsrFpsr, new IntrinsicInfo(0xd51b4420u, IntrinsicType.SetRegister)); Add(Intrinsic.Arm64MsrFpsr, new IntrinsicInfo(0xd51b4420u, IntrinsicType.SetRegister));
Add(Intrinsic.Arm64MulVe, new IntrinsicInfo(0x0f008000u, IntrinsicType.VectorBinaryByElem)); Add(Intrinsic.Arm64MulVe, new IntrinsicInfo(0x0f008000u, IntrinsicType.VectorBinaryByElem));

View File

@ -268,11 +268,13 @@ namespace ARMeilleure.CodeGen.X86
Add(X86Instruction.Vblendvps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3a4a, InstructionFlags.Vex | InstructionFlags.Prefix66)); Add(X86Instruction.Vblendvps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3a4a, InstructionFlags.Vex | InstructionFlags.Prefix66));
Add(X86Instruction.Vcvtph2ps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3813, InstructionFlags.Vex | InstructionFlags.Prefix66)); Add(X86Instruction.Vcvtph2ps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3813, InstructionFlags.Vex | InstructionFlags.Prefix66));
Add(X86Instruction.Vcvtps2ph, new InstructionInfo(0x000f3a1d, BadOp, BadOp, BadOp, BadOp, InstructionFlags.Vex | InstructionFlags.Prefix66)); Add(X86Instruction.Vcvtps2ph, new InstructionInfo(0x000f3a1d, BadOp, BadOp, BadOp, BadOp, InstructionFlags.Vex | InstructionFlags.Prefix66));
Add(X86Instruction.Vfmadd231pd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38b8, InstructionFlags.Vex | InstructionFlags.Prefix66 | InstructionFlags.RexW));
Add(X86Instruction.Vfmadd231ps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38b8, InstructionFlags.Vex | InstructionFlags.Prefix66)); Add(X86Instruction.Vfmadd231ps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38b8, InstructionFlags.Vex | InstructionFlags.Prefix66));
Add(X86Instruction.Vfmadd231sd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38b9, InstructionFlags.Vex | InstructionFlags.Prefix66 | InstructionFlags.RexW)); Add(X86Instruction.Vfmadd231sd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38b9, InstructionFlags.Vex | InstructionFlags.Prefix66 | InstructionFlags.RexW));
Add(X86Instruction.Vfmadd231ss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38b9, InstructionFlags.Vex | InstructionFlags.Prefix66)); Add(X86Instruction.Vfmadd231ss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38b9, InstructionFlags.Vex | InstructionFlags.Prefix66));
Add(X86Instruction.Vfmsub231sd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38bb, InstructionFlags.Vex | InstructionFlags.Prefix66 | InstructionFlags.RexW)); Add(X86Instruction.Vfmsub231sd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38bb, InstructionFlags.Vex | InstructionFlags.Prefix66 | InstructionFlags.RexW));
Add(X86Instruction.Vfmsub231ss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38bb, InstructionFlags.Vex | InstructionFlags.Prefix66)); Add(X86Instruction.Vfmsub231ss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38bb, InstructionFlags.Vex | InstructionFlags.Prefix66));
Add(X86Instruction.Vfnmadd231pd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38bc, InstructionFlags.Vex | InstructionFlags.Prefix66 | InstructionFlags.RexW));
Add(X86Instruction.Vfnmadd231ps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38bc, InstructionFlags.Vex | InstructionFlags.Prefix66)); Add(X86Instruction.Vfnmadd231ps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38bc, InstructionFlags.Vex | InstructionFlags.Prefix66));
Add(X86Instruction.Vfnmadd231sd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38bd, InstructionFlags.Vex | InstructionFlags.Prefix66 | InstructionFlags.RexW)); Add(X86Instruction.Vfnmadd231sd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38bd, InstructionFlags.Vex | InstructionFlags.Prefix66 | InstructionFlags.RexW));
Add(X86Instruction.Vfnmadd231ss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38bd, InstructionFlags.Vex | InstructionFlags.Prefix66)); Add(X86Instruction.Vfnmadd231ss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38bd, InstructionFlags.Vex | InstructionFlags.Prefix66));

View File

@ -249,10 +249,9 @@ namespace ARMeilleure.CodeGen.X86
case IntrinsicType.Mxcsr: case IntrinsicType.Mxcsr:
{ {
Operand offset = operation.GetSource(0); Operand offset = operation.GetSource(0);
Operand bits = operation.GetSource(1);
Debug.Assert(offset.Kind == OperandKind.Constant && bits.Kind == OperandKind.Constant); Debug.Assert(offset.Kind == OperandKind.Constant);
Debug.Assert(offset.Type == OperandType.I32 && bits.Type == OperandType.I32); Debug.Assert(offset.Type == OperandType.I32);
int offs = offset.AsInt32() + context.CallArgsRegionSize; int offs = offset.AsInt32() + context.CallArgsRegionSize;
@ -261,21 +260,23 @@ namespace ARMeilleure.CodeGen.X86
Debug.Assert(HardwareCapabilities.SupportsSse || HardwareCapabilities.SupportsVexEncoding); Debug.Assert(HardwareCapabilities.SupportsSse || HardwareCapabilities.SupportsVexEncoding);
context.Assembler.Stmxcsr(memOp); if (operation.Intrinsic == Intrinsic.X86Ldmxcsr)
if (operation.Intrinsic == Intrinsic.X86Mxcsrmb)
{ {
context.Assembler.Or(memOp, bits, OperandType.I32); Operand bits = operation.GetSource(1);
Debug.Assert(bits.Type == OperandType.I32);
context.Assembler.Mov(memOp, bits, OperandType.I32);
context.Assembler.Ldmxcsr(memOp);
} }
else /* if (intrinOp.Intrinsic == Intrinsic.X86Mxcsrub) */ else if (operation.Intrinsic == Intrinsic.X86Stmxcsr)
{ {
Operand notBits = Const(~bits.AsInt32()); Operand dest = operation.Destination;
Debug.Assert(dest.Type == OperandType.I32);
context.Assembler.And(memOp, notBits, OperandType.I32); context.Assembler.Stmxcsr(memOp);
context.Assembler.Mov(dest, memOp, OperandType.I32);
} }
context.Assembler.Ldmxcsr(memOp);
break; break;
} }

View File

@ -60,6 +60,7 @@ namespace ARMeilleure.CodeGen.X86
Add(Intrinsic.X86Haddpd, new IntrinsicInfo(X86Instruction.Haddpd, IntrinsicType.Binary)); Add(Intrinsic.X86Haddpd, new IntrinsicInfo(X86Instruction.Haddpd, IntrinsicType.Binary));
Add(Intrinsic.X86Haddps, new IntrinsicInfo(X86Instruction.Haddps, IntrinsicType.Binary)); Add(Intrinsic.X86Haddps, new IntrinsicInfo(X86Instruction.Haddps, IntrinsicType.Binary));
Add(Intrinsic.X86Insertps, new IntrinsicInfo(X86Instruction.Insertps, IntrinsicType.TernaryImm)); Add(Intrinsic.X86Insertps, new IntrinsicInfo(X86Instruction.Insertps, IntrinsicType.TernaryImm));
Add(Intrinsic.X86Ldmxcsr, new IntrinsicInfo(X86Instruction.None, IntrinsicType.Mxcsr));
Add(Intrinsic.X86Maxpd, new IntrinsicInfo(X86Instruction.Maxpd, IntrinsicType.Binary)); Add(Intrinsic.X86Maxpd, new IntrinsicInfo(X86Instruction.Maxpd, IntrinsicType.Binary));
Add(Intrinsic.X86Maxps, new IntrinsicInfo(X86Instruction.Maxps, IntrinsicType.Binary)); Add(Intrinsic.X86Maxps, new IntrinsicInfo(X86Instruction.Maxps, IntrinsicType.Binary));
Add(Intrinsic.X86Maxsd, new IntrinsicInfo(X86Instruction.Maxsd, IntrinsicType.Binary)); Add(Intrinsic.X86Maxsd, new IntrinsicInfo(X86Instruction.Maxsd, IntrinsicType.Binary));
@ -75,8 +76,6 @@ namespace ARMeilleure.CodeGen.X86
Add(Intrinsic.X86Mulps, new IntrinsicInfo(X86Instruction.Mulps, IntrinsicType.Binary)); Add(Intrinsic.X86Mulps, new IntrinsicInfo(X86Instruction.Mulps, IntrinsicType.Binary));
Add(Intrinsic.X86Mulsd, new IntrinsicInfo(X86Instruction.Mulsd, IntrinsicType.Binary)); Add(Intrinsic.X86Mulsd, new IntrinsicInfo(X86Instruction.Mulsd, IntrinsicType.Binary));
Add(Intrinsic.X86Mulss, new IntrinsicInfo(X86Instruction.Mulss, IntrinsicType.Binary)); Add(Intrinsic.X86Mulss, new IntrinsicInfo(X86Instruction.Mulss, IntrinsicType.Binary));
Add(Intrinsic.X86Mxcsrmb, new IntrinsicInfo(X86Instruction.None, IntrinsicType.Mxcsr)); // Mask bits.
Add(Intrinsic.X86Mxcsrub, new IntrinsicInfo(X86Instruction.None, IntrinsicType.Mxcsr)); // Unmask bits.
Add(Intrinsic.X86Paddb, new IntrinsicInfo(X86Instruction.Paddb, IntrinsicType.Binary)); Add(Intrinsic.X86Paddb, new IntrinsicInfo(X86Instruction.Paddb, IntrinsicType.Binary));
Add(Intrinsic.X86Paddd, new IntrinsicInfo(X86Instruction.Paddd, IntrinsicType.Binary)); Add(Intrinsic.X86Paddd, new IntrinsicInfo(X86Instruction.Paddd, IntrinsicType.Binary));
Add(Intrinsic.X86Paddq, new IntrinsicInfo(X86Instruction.Paddq, IntrinsicType.Binary)); Add(Intrinsic.X86Paddq, new IntrinsicInfo(X86Instruction.Paddq, IntrinsicType.Binary));
@ -160,6 +159,7 @@ namespace ARMeilleure.CodeGen.X86
Add(Intrinsic.X86Sqrtps, new IntrinsicInfo(X86Instruction.Sqrtps, IntrinsicType.Unary)); Add(Intrinsic.X86Sqrtps, new IntrinsicInfo(X86Instruction.Sqrtps, IntrinsicType.Unary));
Add(Intrinsic.X86Sqrtsd, new IntrinsicInfo(X86Instruction.Sqrtsd, IntrinsicType.Unary)); Add(Intrinsic.X86Sqrtsd, new IntrinsicInfo(X86Instruction.Sqrtsd, IntrinsicType.Unary));
Add(Intrinsic.X86Sqrtss, new IntrinsicInfo(X86Instruction.Sqrtss, IntrinsicType.Unary)); Add(Intrinsic.X86Sqrtss, new IntrinsicInfo(X86Instruction.Sqrtss, IntrinsicType.Unary));
Add(Intrinsic.X86Stmxcsr, new IntrinsicInfo(X86Instruction.None, IntrinsicType.Mxcsr));
Add(Intrinsic.X86Subpd, new IntrinsicInfo(X86Instruction.Subpd, IntrinsicType.Binary)); Add(Intrinsic.X86Subpd, new IntrinsicInfo(X86Instruction.Subpd, IntrinsicType.Binary));
Add(Intrinsic.X86Subps, new IntrinsicInfo(X86Instruction.Subps, IntrinsicType.Binary)); Add(Intrinsic.X86Subps, new IntrinsicInfo(X86Instruction.Subps, IntrinsicType.Binary));
Add(Intrinsic.X86Subsd, new IntrinsicInfo(X86Instruction.Subsd, IntrinsicType.Binary)); Add(Intrinsic.X86Subsd, new IntrinsicInfo(X86Instruction.Subsd, IntrinsicType.Binary));
@ -170,11 +170,13 @@ namespace ARMeilleure.CodeGen.X86
Add(Intrinsic.X86Unpcklps, new IntrinsicInfo(X86Instruction.Unpcklps, IntrinsicType.Binary)); Add(Intrinsic.X86Unpcklps, new IntrinsicInfo(X86Instruction.Unpcklps, IntrinsicType.Binary));
Add(Intrinsic.X86Vcvtph2ps, new IntrinsicInfo(X86Instruction.Vcvtph2ps, IntrinsicType.Unary)); Add(Intrinsic.X86Vcvtph2ps, new IntrinsicInfo(X86Instruction.Vcvtph2ps, IntrinsicType.Unary));
Add(Intrinsic.X86Vcvtps2ph, new IntrinsicInfo(X86Instruction.Vcvtps2ph, IntrinsicType.BinaryImm)); Add(Intrinsic.X86Vcvtps2ph, new IntrinsicInfo(X86Instruction.Vcvtps2ph, IntrinsicType.BinaryImm));
Add(Intrinsic.X86Vfmadd231pd, new IntrinsicInfo(X86Instruction.Vfmadd231pd, IntrinsicType.Fma));
Add(Intrinsic.X86Vfmadd231ps, new IntrinsicInfo(X86Instruction.Vfmadd231ps, IntrinsicType.Fma)); Add(Intrinsic.X86Vfmadd231ps, new IntrinsicInfo(X86Instruction.Vfmadd231ps, IntrinsicType.Fma));
Add(Intrinsic.X86Vfmadd231sd, new IntrinsicInfo(X86Instruction.Vfmadd231sd, IntrinsicType.Fma)); Add(Intrinsic.X86Vfmadd231sd, new IntrinsicInfo(X86Instruction.Vfmadd231sd, IntrinsicType.Fma));
Add(Intrinsic.X86Vfmadd231ss, new IntrinsicInfo(X86Instruction.Vfmadd231ss, IntrinsicType.Fma)); Add(Intrinsic.X86Vfmadd231ss, new IntrinsicInfo(X86Instruction.Vfmadd231ss, IntrinsicType.Fma));
Add(Intrinsic.X86Vfmsub231sd, new IntrinsicInfo(X86Instruction.Vfmsub231sd, IntrinsicType.Fma)); Add(Intrinsic.X86Vfmsub231sd, new IntrinsicInfo(X86Instruction.Vfmsub231sd, IntrinsicType.Fma));
Add(Intrinsic.X86Vfmsub231ss, new IntrinsicInfo(X86Instruction.Vfmsub231ss, IntrinsicType.Fma)); Add(Intrinsic.X86Vfmsub231ss, new IntrinsicInfo(X86Instruction.Vfmsub231ss, IntrinsicType.Fma));
Add(Intrinsic.X86Vfnmadd231pd, new IntrinsicInfo(X86Instruction.Vfnmadd231pd, IntrinsicType.Fma));
Add(Intrinsic.X86Vfnmadd231ps, new IntrinsicInfo(X86Instruction.Vfnmadd231ps, IntrinsicType.Fma)); Add(Intrinsic.X86Vfnmadd231ps, new IntrinsicInfo(X86Instruction.Vfnmadd231ps, IntrinsicType.Fma));
Add(Intrinsic.X86Vfnmadd231sd, new IntrinsicInfo(X86Instruction.Vfnmadd231sd, IntrinsicType.Fma)); Add(Intrinsic.X86Vfnmadd231sd, new IntrinsicInfo(X86Instruction.Vfnmadd231sd, IntrinsicType.Fma));
Add(Intrinsic.X86Vfnmadd231ss, new IntrinsicInfo(X86Instruction.Vfnmadd231ss, IntrinsicType.Fma)); Add(Intrinsic.X86Vfnmadd231ss, new IntrinsicInfo(X86Instruction.Vfnmadd231ss, IntrinsicType.Fma));

View File

@ -0,0 +1,15 @@
using System;
namespace ARMeilleure.CodeGen.X86
{
[Flags]
enum Mxcsr
{
Ftz = 1 << 15, // Flush To Zero.
Rhi = 1 << 14, // Round Mode high bit.
Rlo = 1 << 13, // Round Mode low bit.
Um = 1 << 11, // Underflow Mask.
Dm = 1 << 8, // Denormal Mask.
Daz = 1 << 6 // Denormals Are Zero.
}
}

View File

@ -120,12 +120,18 @@ namespace ARMeilleure.CodeGen.X86
break; break;
case Instruction.Extended: case Instruction.Extended:
if (node.Intrinsic == Intrinsic.X86Mxcsrmb || node.Intrinsic == Intrinsic.X86Mxcsrub) if (node.Intrinsic == Intrinsic.X86Ldmxcsr)
{ {
int stackOffset = stackAlloc.Allocate(OperandType.I32); int stackOffset = stackAlloc.Allocate(OperandType.I32);
node.SetSources(new Operand[] { Const(stackOffset), node.GetSource(0) }); node.SetSources(new Operand[] { Const(stackOffset), node.GetSource(0) });
} }
else if (node.Intrinsic == Intrinsic.X86Stmxcsr)
{
int stackOffset = stackAlloc.Allocate(OperandType.I32);
node.SetSources(new Operand[] { Const(stackOffset) });
}
break; break;
} }
} }

View File

@ -208,11 +208,13 @@ namespace ARMeilleure.CodeGen.X86
Vblendvps, Vblendvps,
Vcvtph2ps, Vcvtph2ps,
Vcvtps2ph, Vcvtps2ph,
Vfmadd231pd,
Vfmadd231ps, Vfmadd231ps,
Vfmadd231sd, Vfmadd231sd,
Vfmadd231ss, Vfmadd231ss,
Vfmsub231sd, Vfmsub231sd,
Vfmsub231ss, Vfmsub231ss,
Vfnmadd231pd,
Vfnmadd231ps, Vfnmadd231ps,
Vfnmadd231sd, Vfnmadd231sd,
Vfnmadd231ss, Vfnmadd231ss,

View File

@ -108,6 +108,13 @@ namespace ARMeilleure.Decoders
SetA64("11001010xx0xxxxxxxxxxxxxxxxxxxxx", InstName.Eor, InstEmit.Eor, OpCodeAluRs.Create); SetA64("11001010xx0xxxxxxxxxxxxxxxxxxxxx", InstName.Eor, InstEmit.Eor, OpCodeAluRs.Create);
SetA64("00010011100xxxxx0xxxxxxxxxxxxxxx", InstName.Extr, InstEmit.Extr, OpCodeAluRs.Create); SetA64("00010011100xxxxx0xxxxxxxxxxxxxxx", InstName.Extr, InstEmit.Extr, OpCodeAluRs.Create);
SetA64("10010011110xxxxxxxxxxxxxxxxxxxxx", InstName.Extr, InstEmit.Extr, OpCodeAluRs.Create); SetA64("10010011110xxxxxxxxxxxxxxxxxxxxx", InstName.Extr, InstEmit.Extr, OpCodeAluRs.Create);
SetA64("11010101000000110010000011011111", InstName.Hint, InstEmit.Nop, OpCodeSystem.Create); // Reserved Hint
SetA64("11010101000000110010000011111111", InstName.Hint, InstEmit.Nop, OpCodeSystem.Create); // Reserved Hint
SetA64("110101010000001100100001xxx11111", InstName.Hint, InstEmit.Nop, OpCodeSystem.Create); // Reserved Hint
SetA64("1101010100000011001000100xx11111", InstName.Hint, InstEmit.Nop, OpCodeSystem.Create); // Reserved Hint
SetA64("1101010100000011001000101>>11111", InstName.Hint, InstEmit.Nop, OpCodeSystem.Create); // Reserved Hint
SetA64("110101010000001100100011xxx11111", InstName.Hint, InstEmit.Nop, OpCodeSystem.Create); // Reserved Hint
SetA64("11010101000000110010>>xxxxx11111", InstName.Hint, InstEmit.Nop, OpCodeSystem.Create); // Reserved Hint
SetA64("11010101000000110011xxxx11011111", InstName.Isb, InstEmit.Isb, OpCodeSystem.Create); SetA64("11010101000000110011xxxx11011111", InstName.Isb, InstEmit.Isb, OpCodeSystem.Create);
SetA64("xx001000110xxxxx1xxxxxxxxxxxxxxx", InstName.Ldar, InstEmit.Ldar, OpCodeMemEx.Create); SetA64("xx001000110xxxxx1xxxxxxxxxxxxxxx", InstName.Ldar, InstEmit.Ldar, OpCodeMemEx.Create);
SetA64("1x001000011xxxxx1xxxxxxxxxxxxxxx", InstName.Ldaxp, InstEmit.Ldaxp, OpCodeMemEx.Create); SetA64("1x001000011xxxxx1xxxxxxxxxxxxxxx", InstName.Ldaxp, InstEmit.Ldaxp, OpCodeMemEx.Create);

View File

@ -615,14 +615,11 @@ namespace ARMeilleure.Instructions
{ {
return EmitSse41ProcessNaNsOpF(context, (op1, op2) => return EmitSse41ProcessNaNsOpF(context, (op1, op2) =>
{ {
return EmitSseOrAvxHandleFzModeOpF(context, (op1, op2) => IOpCodeSimd op = (IOpCodeSimd)context.CurrOp;
{
IOpCodeSimd op = (IOpCodeSimd)context.CurrOp;
Intrinsic addInst = (op.Size & 1) == 0 ? Intrinsic.X86Addps : Intrinsic.X86Addpd; Intrinsic addInst = (op.Size & 1) == 0 ? Intrinsic.X86Addps : Intrinsic.X86Addpd;
return context.AddIntrinsic(addInst, op1, op2); return context.AddIntrinsic(addInst, op1, op2);
}, scalar: false, op1, op2);
}, scalar: false, op1, op2); }, scalar: false, op1, op2);
}); });
} }
@ -696,17 +693,33 @@ namespace ARMeilleure.Instructions
Operand n = GetVec(op.Rn); Operand n = GetVec(op.Rn);
Operand m = GetVec(op.Rm); Operand m = GetVec(op.Rm);
Operand res;
if (op.Size == 0) if (op.Size == 0)
{ {
Operand res = context.AddIntrinsic(Intrinsic.X86Mulss, n, m); if (Optimizations.UseFma)
res = context.AddIntrinsic(Intrinsic.X86Addss, a, res); {
res = context.AddIntrinsic(Intrinsic.X86Vfmadd231ss, a, n, m);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulss, n, m);
res = context.AddIntrinsic(Intrinsic.X86Addss, a, res);
}
context.Copy(d, context.VectorZeroUpper96(res)); context.Copy(d, context.VectorZeroUpper96(res));
} }
else /* if (op.Size == 1) */ else /* if (op.Size == 1) */
{ {
Operand res = context.AddIntrinsic(Intrinsic.X86Mulsd, n, m); if (Optimizations.UseFma)
res = context.AddIntrinsic(Intrinsic.X86Addsd, a, res); {
res = context.AddIntrinsic(Intrinsic.X86Vfmadd231sd, a, n, m);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulsd, n, m);
res = context.AddIntrinsic(Intrinsic.X86Addsd, a, res);
}
context.Copy(d, context.VectorZeroUpper64(res)); context.Copy(d, context.VectorZeroUpper64(res));
} }
@ -730,10 +743,7 @@ namespace ARMeilleure.Instructions
{ {
EmitSse41ProcessNaNsOpF(context, (op1, op2) => EmitSse41ProcessNaNsOpF(context, (op1, op2) =>
{ {
return EmitSseOrAvxHandleFzModeOpF(context, (op1, op2) => return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: true);
{
return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: true);
}, scalar: true, op1, op2);
}, scalar: true); }, scalar: true);
} }
else else
@ -755,10 +765,7 @@ namespace ARMeilleure.Instructions
{ {
EmitSse41ProcessNaNsOpF(context, (op1, op2) => EmitSse41ProcessNaNsOpF(context, (op1, op2) =>
{ {
return EmitSseOrAvxHandleFzModeOpF(context, (op1, op2) => return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: true);
{
return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: true);
}, scalar: false, op1, op2);
}, scalar: false); }, scalar: false);
} }
else else
@ -886,10 +893,7 @@ namespace ARMeilleure.Instructions
{ {
return EmitSse41ProcessNaNsOpF(context, (op1, op2) => return EmitSse41ProcessNaNsOpF(context, (op1, op2) =>
{ {
return EmitSseOrAvxHandleFzModeOpF(context, (op1, op2) => return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: true);
{
return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: true);
}, scalar: false, op1, op2);
}, scalar: false, op1, op2); }, scalar: false, op1, op2);
}); });
} }
@ -914,10 +918,7 @@ namespace ARMeilleure.Instructions
{ {
return EmitSse41ProcessNaNsOpF(context, (op1, op2) => return EmitSse41ProcessNaNsOpF(context, (op1, op2) =>
{ {
return EmitSseOrAvxHandleFzModeOpF(context, (op1, op2) => return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: true);
{
return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: true);
}, scalar: false, op1, op2);
}, scalar: false, op1, op2); }, scalar: false, op1, op2);
}); });
} }
@ -940,10 +941,7 @@ namespace ARMeilleure.Instructions
{ {
EmitSse41ProcessNaNsOpF(context, (op1, op2) => EmitSse41ProcessNaNsOpF(context, (op1, op2) =>
{ {
return EmitSseOrAvxHandleFzModeOpF(context, (op1, op2) => return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: false);
{
return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: false);
}, scalar: true, op1, op2);
}, scalar: true); }, scalar: true);
} }
else else
@ -965,10 +963,7 @@ namespace ARMeilleure.Instructions
{ {
EmitSse41ProcessNaNsOpF(context, (op1, op2) => EmitSse41ProcessNaNsOpF(context, (op1, op2) =>
{ {
return EmitSseOrAvxHandleFzModeOpF(context, (op1, op2) => return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: false);
{
return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: false);
}, scalar: false, op1, op2);
}, scalar: false); }, scalar: false);
} }
else else
@ -1096,10 +1091,7 @@ namespace ARMeilleure.Instructions
{ {
return EmitSse41ProcessNaNsOpF(context, (op1, op2) => return EmitSse41ProcessNaNsOpF(context, (op1, op2) =>
{ {
return EmitSseOrAvxHandleFzModeOpF(context, (op1, op2) => return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: false);
{
return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: false);
}, scalar: false, op1, op2);
}, scalar: false, op1, op2); }, scalar: false, op1, op2);
}); });
} }
@ -1124,10 +1116,7 @@ namespace ARMeilleure.Instructions
{ {
return EmitSse41ProcessNaNsOpF(context, (op1, op2) => return EmitSse41ProcessNaNsOpF(context, (op1, op2) =>
{ {
return EmitSseOrAvxHandleFzModeOpF(context, (op1, op2) => return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: false);
{
return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: false);
}, scalar: false, op1, op2);
}, scalar: false, op1, op2); }, scalar: false, op1, op2);
}); });
} }
@ -1146,6 +1135,37 @@ namespace ARMeilleure.Instructions
{ {
InstEmitSimdHelperArm64.EmitScalarTernaryOpFRdByElem(context, Intrinsic.Arm64FmlaSe); InstEmitSimdHelperArm64.EmitScalarTernaryOpFRdByElem(context, Intrinsic.Arm64FmlaSe);
} }
else if (Optimizations.UseFma)
{
OpCodeSimdRegElemF op = (OpCodeSimdRegElemF)context.CurrOp;
Operand d = GetVec(op.Rd);
Operand n = GetVec(op.Rn);
Operand m = GetVec(op.Rm);
int sizeF = op.Size & 1;
if (sizeF == 0)
{
int shuffleMask = op.Index | op.Index << 2 | op.Index << 4 | op.Index << 6;
Operand res = context.AddIntrinsic(Intrinsic.X86Shufps, m, m, Const(shuffleMask));
res = context.AddIntrinsic(Intrinsic.X86Vfmadd231ss, d, n, res);
context.Copy(d, context.VectorZeroUpper96(res));
}
else /* if (sizeF == 1) */
{
int shuffleMask = op.Index | op.Index << 1;
Operand res = context.AddIntrinsic(Intrinsic.X86Shufpd, m, m, Const(shuffleMask));
res = context.AddIntrinsic(Intrinsic.X86Vfmadd231sd, d, n, res);
context.Copy(d, context.VectorZeroUpper64(res));
}
}
else else
{ {
EmitScalarTernaryOpByElemF(context, (op1, op2, op3) => EmitScalarTernaryOpByElemF(context, (op1, op2, op3) =>
@ -1171,11 +1191,19 @@ namespace ARMeilleure.Instructions
int sizeF = op.Size & 1; int sizeF = op.Size & 1;
Operand res;
if (sizeF == 0) if (sizeF == 0)
{ {
Operand res = context.AddIntrinsic(Intrinsic.X86Mulps, n, m); if (Optimizations.UseFma)
{
res = context.AddIntrinsic(Intrinsic.X86Addps, d, res); res = context.AddIntrinsic(Intrinsic.X86Vfmadd231ps, d, n, m);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulps, n, m);
res = context.AddIntrinsic(Intrinsic.X86Addps, d, res);
}
if (op.RegisterSize == RegisterSize.Simd64) if (op.RegisterSize == RegisterSize.Simd64)
{ {
@ -1186,9 +1214,15 @@ namespace ARMeilleure.Instructions
} }
else /* if (sizeF == 1) */ else /* if (sizeF == 1) */
{ {
Operand res = context.AddIntrinsic(Intrinsic.X86Mulpd, n, m); if (Optimizations.UseFma)
{
res = context.AddIntrinsic(Intrinsic.X86Addpd, d, res); res = context.AddIntrinsic(Intrinsic.X86Vfmadd231pd, d, n, m);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulpd, n, m);
res = context.AddIntrinsic(Intrinsic.X86Addpd, d, res);
}
context.Copy(d, res); context.Copy(d, res);
} }
@ -1224,8 +1258,15 @@ namespace ARMeilleure.Instructions
Operand res = context.AddIntrinsic(Intrinsic.X86Shufps, m, m, Const(shuffleMask)); Operand res = context.AddIntrinsic(Intrinsic.X86Shufps, m, m, Const(shuffleMask));
res = context.AddIntrinsic(Intrinsic.X86Mulps, n, res); if (Optimizations.UseFma)
res = context.AddIntrinsic(Intrinsic.X86Addps, d, res); {
res = context.AddIntrinsic(Intrinsic.X86Vfmadd231ps, d, n, res);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulps, n, res);
res = context.AddIntrinsic(Intrinsic.X86Addps, d, res);
}
if (op.RegisterSize == RegisterSize.Simd64) if (op.RegisterSize == RegisterSize.Simd64)
{ {
@ -1240,8 +1281,15 @@ namespace ARMeilleure.Instructions
Operand res = context.AddIntrinsic(Intrinsic.X86Shufpd, m, m, Const(shuffleMask)); Operand res = context.AddIntrinsic(Intrinsic.X86Shufpd, m, m, Const(shuffleMask));
res = context.AddIntrinsic(Intrinsic.X86Mulpd, n, res); if (Optimizations.UseFma)
res = context.AddIntrinsic(Intrinsic.X86Addpd, d, res); {
res = context.AddIntrinsic(Intrinsic.X86Vfmadd231pd, d, n, res);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulpd, n, res);
res = context.AddIntrinsic(Intrinsic.X86Addpd, d, res);
}
context.Copy(d, res); context.Copy(d, res);
} }
@ -1261,6 +1309,37 @@ namespace ARMeilleure.Instructions
{ {
InstEmitSimdHelperArm64.EmitScalarTernaryOpFRdByElem(context, Intrinsic.Arm64FmlsSe); InstEmitSimdHelperArm64.EmitScalarTernaryOpFRdByElem(context, Intrinsic.Arm64FmlsSe);
} }
else if (Optimizations.UseFma)
{
OpCodeSimdRegElemF op = (OpCodeSimdRegElemF)context.CurrOp;
Operand d = GetVec(op.Rd);
Operand n = GetVec(op.Rn);
Operand m = GetVec(op.Rm);
int sizeF = op.Size & 1;
if (sizeF == 0)
{
int shuffleMask = op.Index | op.Index << 2 | op.Index << 4 | op.Index << 6;
Operand res = context.AddIntrinsic(Intrinsic.X86Shufps, m, m, Const(shuffleMask));
res = context.AddIntrinsic(Intrinsic.X86Vfnmadd231ss, d, n, res);
context.Copy(d, context.VectorZeroUpper96(res));
}
else /* if (sizeF == 1) */
{
int shuffleMask = op.Index | op.Index << 1;
Operand res = context.AddIntrinsic(Intrinsic.X86Shufpd, m, m, Const(shuffleMask));
res = context.AddIntrinsic(Intrinsic.X86Vfnmadd231sd, d, n, res);
context.Copy(d, context.VectorZeroUpper64(res));
}
}
else else
{ {
EmitScalarTernaryOpByElemF(context, (op1, op2, op3) => EmitScalarTernaryOpByElemF(context, (op1, op2, op3) =>
@ -1286,11 +1365,19 @@ namespace ARMeilleure.Instructions
int sizeF = op.Size & 1; int sizeF = op.Size & 1;
Operand res;
if (sizeF == 0) if (sizeF == 0)
{ {
Operand res = context.AddIntrinsic(Intrinsic.X86Mulps, n, m); if (Optimizations.UseFma)
{
res = context.AddIntrinsic(Intrinsic.X86Subps, d, res); res = context.AddIntrinsic(Intrinsic.X86Vfnmadd231ps, d, n, m);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulps, n, m);
res = context.AddIntrinsic(Intrinsic.X86Subps, d, res);
}
if (op.RegisterSize == RegisterSize.Simd64) if (op.RegisterSize == RegisterSize.Simd64)
{ {
@ -1301,9 +1388,15 @@ namespace ARMeilleure.Instructions
} }
else /* if (sizeF == 1) */ else /* if (sizeF == 1) */
{ {
Operand res = context.AddIntrinsic(Intrinsic.X86Mulpd, n, m); if (Optimizations.UseFma)
{
res = context.AddIntrinsic(Intrinsic.X86Subpd, d, res); res = context.AddIntrinsic(Intrinsic.X86Vfnmadd231pd, d, n, m);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulpd, n, m);
res = context.AddIntrinsic(Intrinsic.X86Subpd, d, res);
}
context.Copy(d, res); context.Copy(d, res);
} }
@ -1339,8 +1432,15 @@ namespace ARMeilleure.Instructions
Operand res = context.AddIntrinsic(Intrinsic.X86Shufps, m, m, Const(shuffleMask)); Operand res = context.AddIntrinsic(Intrinsic.X86Shufps, m, m, Const(shuffleMask));
res = context.AddIntrinsic(Intrinsic.X86Mulps, n, res); if (Optimizations.UseFma)
res = context.AddIntrinsic(Intrinsic.X86Subps, d, res); {
res = context.AddIntrinsic(Intrinsic.X86Vfnmadd231ps, d, n, res);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulps, n, res);
res = context.AddIntrinsic(Intrinsic.X86Subps, d, res);
}
if (op.RegisterSize == RegisterSize.Simd64) if (op.RegisterSize == RegisterSize.Simd64)
{ {
@ -1355,8 +1455,15 @@ namespace ARMeilleure.Instructions
Operand res = context.AddIntrinsic(Intrinsic.X86Shufpd, m, m, Const(shuffleMask)); Operand res = context.AddIntrinsic(Intrinsic.X86Shufpd, m, m, Const(shuffleMask));
res = context.AddIntrinsic(Intrinsic.X86Mulpd, n, res); if (Optimizations.UseFma)
res = context.AddIntrinsic(Intrinsic.X86Subpd, d, res); {
res = context.AddIntrinsic(Intrinsic.X86Vfnmadd231pd, d, n, res);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulpd, n, res);
res = context.AddIntrinsic(Intrinsic.X86Subpd, d, res);
}
context.Copy(d, res); context.Copy(d, res);
} }
@ -1385,17 +1492,33 @@ namespace ARMeilleure.Instructions
Operand n = GetVec(op.Rn); Operand n = GetVec(op.Rn);
Operand m = GetVec(op.Rm); Operand m = GetVec(op.Rm);
Operand res;
if (op.Size == 0) if (op.Size == 0)
{ {
Operand res = context.AddIntrinsic(Intrinsic.X86Mulss, n, m); if (Optimizations.UseFma)
res = context.AddIntrinsic(Intrinsic.X86Subss, a, res); {
res = context.AddIntrinsic(Intrinsic.X86Vfnmadd231ss, a, n, m);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulss, n, m);
res = context.AddIntrinsic(Intrinsic.X86Subss, a, res);
}
context.Copy(d, context.VectorZeroUpper96(res)); context.Copy(d, context.VectorZeroUpper96(res));
} }
else /* if (op.Size == 1) */ else /* if (op.Size == 1) */
{ {
Operand res = context.AddIntrinsic(Intrinsic.X86Mulsd, n, m); if (Optimizations.UseFma)
res = context.AddIntrinsic(Intrinsic.X86Subsd, a, res); {
res = context.AddIntrinsic(Intrinsic.X86Vfnmadd231sd, a, n, m);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulsd, n, m);
res = context.AddIntrinsic(Intrinsic.X86Subsd, a, res);
}
context.Copy(d, context.VectorZeroUpper64(res)); context.Copy(d, context.VectorZeroUpper64(res));
} }
@ -1669,25 +1792,39 @@ namespace ARMeilleure.Instructions
Operand n = GetVec(op.Rn); Operand n = GetVec(op.Rn);
Operand m = GetVec(op.Rm); Operand m = GetVec(op.Rm);
Operand res;
if (op.Size == 0) if (op.Size == 0)
{ {
Operand mask = X86GetScalar(context, -0f); if (Optimizations.UseFma)
{
res = context.AddIntrinsic(Intrinsic.X86Vfnmsub231ss, a, n, m);
}
else
{
Operand mask = X86GetScalar(context, -0f);
Operand aNeg = context.AddIntrinsic(Intrinsic.X86Xorps, mask, a);
Operand aNeg = context.AddIntrinsic(Intrinsic.X86Xorps, mask, a); res = context.AddIntrinsic(Intrinsic.X86Mulss, n, m);
res = context.AddIntrinsic(Intrinsic.X86Subss, aNeg, res);
Operand res = context.AddIntrinsic(Intrinsic.X86Mulss, n, m); }
res = context.AddIntrinsic(Intrinsic.X86Subss, aNeg, res);
context.Copy(d, context.VectorZeroUpper96(res)); context.Copy(d, context.VectorZeroUpper96(res));
} }
else /* if (op.Size == 1) */ else /* if (op.Size == 1) */
{ {
Operand mask = X86GetScalar(context, -0d); if (Optimizations.UseFma)
{
res = context.AddIntrinsic(Intrinsic.X86Vfnmsub231sd, a, n, m);
}
else
{
Operand mask = X86GetScalar(context, -0d);
Operand aNeg = context.AddIntrinsic(Intrinsic.X86Xorpd, mask, a);
Operand aNeg = context.AddIntrinsic(Intrinsic.X86Xorpd, mask, a); res = context.AddIntrinsic(Intrinsic.X86Mulsd, n, m);
res = context.AddIntrinsic(Intrinsic.X86Subsd, aNeg, res);
Operand res = context.AddIntrinsic(Intrinsic.X86Mulsd, n, m); }
res = context.AddIntrinsic(Intrinsic.X86Subsd, aNeg, res);
context.Copy(d, context.VectorZeroUpper64(res)); context.Copy(d, context.VectorZeroUpper64(res));
} }
@ -1716,25 +1853,39 @@ namespace ARMeilleure.Instructions
Operand n = GetVec(op.Rn); Operand n = GetVec(op.Rn);
Operand m = GetVec(op.Rm); Operand m = GetVec(op.Rm);
Operand res;
if (op.Size == 0) if (op.Size == 0)
{ {
Operand mask = X86GetScalar(context, -0f); if (Optimizations.UseFma)
{
res = context.AddIntrinsic(Intrinsic.X86Vfmsub231ss, a, n, m);
}
else
{
Operand mask = X86GetScalar(context, -0f);
Operand aNeg = context.AddIntrinsic(Intrinsic.X86Xorps, mask, a);
Operand aNeg = context.AddIntrinsic(Intrinsic.X86Xorps, mask, a); res = context.AddIntrinsic(Intrinsic.X86Mulss, n, m);
res = context.AddIntrinsic(Intrinsic.X86Addss, aNeg, res);
Operand res = context.AddIntrinsic(Intrinsic.X86Mulss, n, m); }
res = context.AddIntrinsic(Intrinsic.X86Addss, aNeg, res);
context.Copy(d, context.VectorZeroUpper96(res)); context.Copy(d, context.VectorZeroUpper96(res));
} }
else /* if (op.Size == 1) */ else /* if (op.Size == 1) */
{ {
Operand mask = X86GetScalar(context, -0d); if (Optimizations.UseFma)
{
res = context.AddIntrinsic(Intrinsic.X86Vfmsub231sd, a, n, m);
}
else
{
Operand mask = X86GetScalar(context, -0d);
Operand aNeg = context.AddIntrinsic(Intrinsic.X86Xorpd, mask, a);
Operand aNeg = context.AddIntrinsic(Intrinsic.X86Xorpd, mask, a); res = context.AddIntrinsic(Intrinsic.X86Mulsd, n, m);
res = context.AddIntrinsic(Intrinsic.X86Addsd, aNeg, res);
Operand res = context.AddIntrinsic(Intrinsic.X86Mulsd, n, m); }
res = context.AddIntrinsic(Intrinsic.X86Addsd, aNeg, res);
context.Copy(d, context.VectorZeroUpper64(res)); context.Copy(d, context.VectorZeroUpper64(res));
} }
@ -1830,13 +1981,22 @@ namespace ARMeilleure.Instructions
int sizeF = op.Size & 1; int sizeF = op.Size & 1;
Operand res;
if (sizeF == 0) if (sizeF == 0)
{ {
Operand mask = X86GetScalar(context, 2f); Operand mask = X86GetScalar(context, 2f);
Operand res = context.AddIntrinsic(Intrinsic.X86Mulss, n, m); if (Optimizations.UseFma)
{
res = context.AddIntrinsic(Intrinsic.X86Vfnmadd231ss, mask, n, m);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulss, n, m);
res = context.AddIntrinsic(Intrinsic.X86Subss, mask, res);
}
res = context.AddIntrinsic(Intrinsic.X86Subss, mask, res);
res = EmitSse41RecipStepSelectOpF(context, n, m, res, mask, scalar: true, sizeF); res = EmitSse41RecipStepSelectOpF(context, n, m, res, mask, scalar: true, sizeF);
context.Copy(GetVec(op.Rd), context.VectorZeroUpper96(res)); context.Copy(GetVec(op.Rd), context.VectorZeroUpper96(res));
@ -1845,9 +2005,16 @@ namespace ARMeilleure.Instructions
{ {
Operand mask = X86GetScalar(context, 2d); Operand mask = X86GetScalar(context, 2d);
Operand res = context.AddIntrinsic(Intrinsic.X86Mulsd, n, m); if (Optimizations.UseFma)
{
res = context.AddIntrinsic(Intrinsic.X86Vfnmadd231sd, mask, n, m);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulsd, n, m);
res = context.AddIntrinsic(Intrinsic.X86Subsd, mask, res);
}
res = context.AddIntrinsic(Intrinsic.X86Subsd, mask, res);
res = EmitSse41RecipStepSelectOpF(context, n, m, res, mask, scalar: true, sizeF); res = EmitSse41RecipStepSelectOpF(context, n, m, res, mask, scalar: true, sizeF);
context.Copy(GetVec(op.Rd), context.VectorZeroUpper64(res)); context.Copy(GetVec(op.Rd), context.VectorZeroUpper64(res));
@ -1877,14 +2044,23 @@ namespace ARMeilleure.Instructions
int sizeF = op.Size & 1; int sizeF = op.Size & 1;
Operand res;
if (sizeF == 0) if (sizeF == 0)
{ {
Operand mask = X86GetAllElements(context, 2f); Operand mask = X86GetAllElements(context, 2f);
Operand res = context.AddIntrinsic(Intrinsic.X86Mulps, n, m); if (Optimizations.UseFma)
res = EmitSse41RecipStepSelectOpF(context, n, m, res, mask, scalar: false, sizeF); {
res = context.AddIntrinsic(Intrinsic.X86Vfnmadd231ps, mask, n, m);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulps, n, m);
res = context.AddIntrinsic(Intrinsic.X86Subps, mask, res);
}
res = context.AddIntrinsic(Intrinsic.X86Subps, mask, res); res = EmitSse41RecipStepSelectOpF(context, n, m, res, mask, scalar: false, sizeF);
if (op.RegisterSize == RegisterSize.Simd64) if (op.RegisterSize == RegisterSize.Simd64)
{ {
@ -1897,10 +2073,17 @@ namespace ARMeilleure.Instructions
{ {
Operand mask = X86GetAllElements(context, 2d); Operand mask = X86GetAllElements(context, 2d);
Operand res = context.AddIntrinsic(Intrinsic.X86Mulpd, n, m); if (Optimizations.UseFma)
res = EmitSse41RecipStepSelectOpF(context, n, m, res, mask, scalar: false, sizeF); {
res = context.AddIntrinsic(Intrinsic.X86Vfnmadd231pd, mask, n, m);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulpd, n, m);
res = context.AddIntrinsic(Intrinsic.X86Subpd, mask, res);
}
res = context.AddIntrinsic(Intrinsic.X86Subpd, mask, res); res = EmitSse41RecipStepSelectOpF(context, n, m, res, mask, scalar: false, sizeF);
context.Copy(GetVec(op.Rd), res); context.Copy(GetVec(op.Rd), res);
} }
@ -2113,20 +2296,32 @@ namespace ARMeilleure.Instructions
public static void Frintx_S(ArmEmitterContext context) public static void Frintx_S(ArmEmitterContext context)
{ {
// TODO Arm64: Fast path. Should we set host FPCR? if (Optimizations.UseAdvSimd)
EmitScalarUnaryOpF(context, (op1) =>
{ {
return EmitRoundByRMode(context, op1); InstEmitSimdHelperArm64.EmitScalarUnaryOpF(context, Intrinsic.Arm64FrintxS);
}); }
else
{
EmitScalarUnaryOpF(context, (op1) =>
{
return EmitRoundByRMode(context, op1);
});
}
} }
public static void Frintx_V(ArmEmitterContext context) public static void Frintx_V(ArmEmitterContext context)
{ {
// TODO Arm64: Fast path. Should we set host FPCR? if (Optimizations.UseAdvSimd)
EmitVectorUnaryOpF(context, (op1) =>
{ {
return EmitRoundByRMode(context, op1); InstEmitSimdHelperArm64.EmitVectorUnaryOpF(context, Intrinsic.Arm64FrintxV);
}); }
else
{
EmitVectorUnaryOpF(context, (op1) =>
{
return EmitRoundByRMode(context, op1);
});
}
} }
public static void Frintz_S(ArmEmitterContext context) public static void Frintz_S(ArmEmitterContext context)
@ -2237,16 +2432,25 @@ namespace ARMeilleure.Instructions
int sizeF = op.Size & 1; int sizeF = op.Size & 1;
Operand res;
if (sizeF == 0) if (sizeF == 0)
{ {
Operand maskHalf = X86GetScalar(context, 0.5f); Operand maskHalf = X86GetScalar(context, 0.5f);
Operand maskThree = X86GetScalar(context, 3f); Operand maskThree = X86GetScalar(context, 3f);
Operand maskOneHalf = X86GetScalar(context, 1.5f); Operand maskOneHalf = X86GetScalar(context, 1.5f);
Operand res = context.AddIntrinsic(Intrinsic.X86Mulss, n, m); if (Optimizations.UseFma)
{
res = context.AddIntrinsic(Intrinsic.X86Vfnmadd231ss, maskThree, n, m);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulss, n, m);
res = context.AddIntrinsic(Intrinsic.X86Subss, maskThree, res);
}
res = context.AddIntrinsic(Intrinsic.X86Subss, maskThree, res); res = context.AddIntrinsic(Intrinsic.X86Mulss, maskHalf, res);
res = context.AddIntrinsic(Intrinsic.X86Mulss, maskHalf, res);
res = EmitSse41RecipStepSelectOpF(context, n, m, res, maskOneHalf, scalar: true, sizeF); res = EmitSse41RecipStepSelectOpF(context, n, m, res, maskOneHalf, scalar: true, sizeF);
context.Copy(GetVec(op.Rd), context.VectorZeroUpper96(res)); context.Copy(GetVec(op.Rd), context.VectorZeroUpper96(res));
@ -2257,10 +2461,17 @@ namespace ARMeilleure.Instructions
Operand maskThree = X86GetScalar(context, 3d); Operand maskThree = X86GetScalar(context, 3d);
Operand maskOneHalf = X86GetScalar(context, 1.5d); Operand maskOneHalf = X86GetScalar(context, 1.5d);
Operand res = context.AddIntrinsic(Intrinsic.X86Mulsd, n, m); if (Optimizations.UseFma)
{
res = context.AddIntrinsic(Intrinsic.X86Vfnmadd231sd, maskThree, n, m);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulsd, n, m);
res = context.AddIntrinsic(Intrinsic.X86Subsd, maskThree, res);
}
res = context.AddIntrinsic(Intrinsic.X86Subsd, maskThree, res); res = context.AddIntrinsic(Intrinsic.X86Mulsd, maskHalf, res);
res = context.AddIntrinsic(Intrinsic.X86Mulsd, maskHalf, res);
res = EmitSse41RecipStepSelectOpF(context, n, m, res, maskOneHalf, scalar: true, sizeF); res = EmitSse41RecipStepSelectOpF(context, n, m, res, maskOneHalf, scalar: true, sizeF);
context.Copy(GetVec(op.Rd), context.VectorZeroUpper64(res)); context.Copy(GetVec(op.Rd), context.VectorZeroUpper64(res));
@ -2290,15 +2501,24 @@ namespace ARMeilleure.Instructions
int sizeF = op.Size & 1; int sizeF = op.Size & 1;
Operand res;
if (sizeF == 0) if (sizeF == 0)
{ {
Operand maskHalf = X86GetAllElements(context, 0.5f); Operand maskHalf = X86GetAllElements(context, 0.5f);
Operand maskThree = X86GetAllElements(context, 3f); Operand maskThree = X86GetAllElements(context, 3f);
Operand maskOneHalf = X86GetAllElements(context, 1.5f); Operand maskOneHalf = X86GetAllElements(context, 1.5f);
Operand res = context.AddIntrinsic(Intrinsic.X86Mulps, n, m); if (Optimizations.UseFma)
{
res = context.AddIntrinsic(Intrinsic.X86Vfnmadd231ps, maskThree, n, m);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulps, n, m);
res = context.AddIntrinsic(Intrinsic.X86Subps, maskThree, res);
}
res = context.AddIntrinsic(Intrinsic.X86Subps, maskThree, res);
res = context.AddIntrinsic(Intrinsic.X86Mulps, maskHalf, res); res = context.AddIntrinsic(Intrinsic.X86Mulps, maskHalf, res);
res = EmitSse41RecipStepSelectOpF(context, n, m, res, maskOneHalf, scalar: false, sizeF); res = EmitSse41RecipStepSelectOpF(context, n, m, res, maskOneHalf, scalar: false, sizeF);
@ -2315,9 +2535,16 @@ namespace ARMeilleure.Instructions
Operand maskThree = X86GetAllElements(context, 3d); Operand maskThree = X86GetAllElements(context, 3d);
Operand maskOneHalf = X86GetAllElements(context, 1.5d); Operand maskOneHalf = X86GetAllElements(context, 1.5d);
Operand res = context.AddIntrinsic(Intrinsic.X86Mulpd, n, m); if (Optimizations.UseFma)
{
res = context.AddIntrinsic(Intrinsic.X86Vfnmadd231pd, maskThree, n, m);
}
else
{
res = context.AddIntrinsic(Intrinsic.X86Mulpd, n, m);
res = context.AddIntrinsic(Intrinsic.X86Subpd, maskThree, res);
}
res = context.AddIntrinsic(Intrinsic.X86Subpd, maskThree, res);
res = context.AddIntrinsic(Intrinsic.X86Mulpd, maskHalf, res); res = context.AddIntrinsic(Intrinsic.X86Mulpd, maskHalf, res);
res = EmitSse41RecipStepSelectOpF(context, n, m, res, maskOneHalf, scalar: false, sizeF); res = EmitSse41RecipStepSelectOpF(context, n, m, res, maskOneHalf, scalar: false, sizeF);
@ -4728,53 +4955,6 @@ namespace ARMeilleure.Instructions
} }
} }
public static Operand EmitSseOrAvxHandleFzModeOpF(
ArmEmitterContext context,
Func2I emit,
bool scalar,
Operand n = default,
Operand m = default)
{
Operand nCopy = n == default ? context.Copy(GetVec(((OpCodeSimdReg)context.CurrOp).Rn)) : n;
Operand mCopy = m == default ? context.Copy(GetVec(((OpCodeSimdReg)context.CurrOp).Rm)) : m;
EmitSseOrAvxEnterFtzAndDazModesOpF(context, out Operand isTrue);
Operand res = emit(nCopy, mCopy);
EmitSseOrAvxExitFtzAndDazModesOpF(context, isTrue);
if (n != default || m != default)
{
return res;
}
int sizeF = ((IOpCodeSimd)context.CurrOp).Size & 1;
if (sizeF == 0)
{
if (scalar)
{
res = context.VectorZeroUpper96(res);
}
else if (((OpCodeSimdReg)context.CurrOp).RegisterSize == RegisterSize.Simd64)
{
res = context.VectorZeroUpper64(res);
}
}
else /* if (sizeF == 1) */
{
if (scalar)
{
res = context.VectorZeroUpper64(res);
}
}
context.Copy(GetVec(((OpCodeSimdReg)context.CurrOp).Rd), res);
return default;
}
private static Operand EmitSse2VectorMaxMinOpF(ArmEmitterContext context, Operand n, Operand m, bool isMax) private static Operand EmitSse2VectorMaxMinOpF(ArmEmitterContext context, Operand n, Operand m, bool isMax)
{ {
IOpCodeSimd op = (IOpCodeSimd)context.CurrOp; IOpCodeSimd op = (IOpCodeSimd)context.CurrOp;
@ -4834,10 +5014,7 @@ namespace ARMeilleure.Instructions
Operand res = EmitSse41ProcessNaNsOpF(context, (op1, op2) => Operand res = EmitSse41ProcessNaNsOpF(context, (op1, op2) =>
{ {
return EmitSseOrAvxHandleFzModeOpF(context, (op1, op2) => return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: isMaxNum);
{
return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: isMaxNum);
}, scalar: scalar, op1, op2);
}, scalar: scalar, nCopy, mCopy); }, scalar: scalar, nCopy, mCopy);
if (n != default || m != default) if (n != default || m != default)
@ -4872,10 +5049,7 @@ namespace ARMeilleure.Instructions
Operand res = EmitSse41ProcessNaNsOpF(context, (op1, op2) => Operand res = EmitSse41ProcessNaNsOpF(context, (op1, op2) =>
{ {
return EmitSseOrAvxHandleFzModeOpF(context, (op1, op2) => return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: isMaxNum);
{
return EmitSse2VectorMaxMinOpF(context, op1, op2, isMax: isMaxNum);
}, scalar: scalar, op1, op2);
}, scalar: scalar, nCopy, mCopy); }, scalar: scalar, nCopy, mCopy);
if (n != default || m != default) if (n != default || m != default)

View File

@ -356,9 +356,11 @@ namespace ARMeilleure.Instructions
? typeof(SoftFloat64_16).GetMethod(nameof(SoftFloat64_16.FPConvert)) ? typeof(SoftFloat64_16).GetMethod(nameof(SoftFloat64_16.FPConvert))
: typeof(SoftFloat32_16).GetMethod(nameof(SoftFloat32_16.FPConvert)); : typeof(SoftFloat32_16).GetMethod(nameof(SoftFloat32_16.FPConvert));
context.ExitArmFpMode();
context.StoreToContext(); context.StoreToContext();
Operand res = context.Call(method, src); Operand res = context.Call(method, src);
context.LoadFromContext(); context.LoadFromContext();
context.EnterArmFpMode();
InsertScalar16(context, op.Vd, op.T, res); InsertScalar16(context, op.Vd, op.T, res);
} }
@ -372,9 +374,11 @@ namespace ARMeilleure.Instructions
? typeof(SoftFloat16_64).GetMethod(nameof(SoftFloat16_64.FPConvert)) ? typeof(SoftFloat16_64).GetMethod(nameof(SoftFloat16_64.FPConvert))
: typeof(SoftFloat16_32).GetMethod(nameof(SoftFloat16_32.FPConvert)); : typeof(SoftFloat16_32).GetMethod(nameof(SoftFloat16_32.FPConvert));
context.ExitArmFpMode();
context.StoreToContext(); context.StoreToContext();
Operand res = context.Call(method, src); Operand res = context.Call(method, src);
context.LoadFromContext(); context.LoadFromContext();
context.EnterArmFpMode();
InsertScalar(context, op.Vd, res); InsertScalar(context, op.Vd, res);
} }
@ -542,10 +546,17 @@ namespace ARMeilleure.Instructions
// VRINTX (floating-point). // VRINTX (floating-point).
public static void Vrintx_S(ArmEmitterContext context) public static void Vrintx_S(ArmEmitterContext context)
{ {
EmitScalarUnaryOpF32(context, (op1) => if (Optimizations.UseAdvSimd)
{ {
return EmitRoundByRMode(context, op1); InstEmitSimdHelper32Arm64.EmitScalarUnaryOpF32(context, Intrinsic.Arm64FrintxS);
}); }
else
{
EmitScalarUnaryOpF32(context, (op1) =>
{
return EmitRoundByRMode(context, op1);
});
}
} }
private static Operand EmitFPConvert(ArmEmitterContext context, Operand value, OperandType type, bool signed) private static Operand EmitFPConvert(ArmEmitterContext context, Operand value, OperandType type, bool signed)

View File

@ -1,3 +1,4 @@
using ARMeilleure.CodeGen.X86;
using ARMeilleure.Decoders; using ARMeilleure.Decoders;
using ARMeilleure.IntermediateRepresentation; using ARMeilleure.IntermediateRepresentation;
using ARMeilleure.State; using ARMeilleure.State;
@ -158,6 +159,75 @@ namespace ARMeilleure.Instructions
}; };
#endregion #endregion
public static void EnterArmFpMode(EmitterContext context, Func<FPState, Operand> getFpFlag)
{
if (Optimizations.UseSse2)
{
Operand mxcsr = context.AddIntrinsicInt(Intrinsic.X86Stmxcsr);
Operand fzTrue = getFpFlag(FPState.FzFlag);
Operand r0True = getFpFlag(FPState.RMode0Flag);
Operand r1True = getFpFlag(FPState.RMode1Flag);
mxcsr = context.BitwiseAnd(mxcsr, Const(~(int)(Mxcsr.Ftz | Mxcsr.Daz | Mxcsr.Rhi | Mxcsr.Rlo)));
mxcsr = context.BitwiseOr(mxcsr, context.ConditionalSelect(fzTrue, Const((int)(Mxcsr.Ftz | Mxcsr.Daz | Mxcsr.Um | Mxcsr.Dm)), Const(0)));
// X86 round modes in order: nearest, negative, positive, zero
// ARM round modes in order: nearest, positive, negative, zero
// Read the bits backwards to correct this.
mxcsr = context.BitwiseOr(mxcsr, context.ConditionalSelect(r0True, Const((int)Mxcsr.Rhi), Const(0)));
mxcsr = context.BitwiseOr(mxcsr, context.ConditionalSelect(r1True, Const((int)Mxcsr.Rlo), Const(0)));
context.AddIntrinsicNoRet(Intrinsic.X86Ldmxcsr, mxcsr);
}
else if (Optimizations.UseAdvSimd)
{
Operand fpcr = context.AddIntrinsicInt(Intrinsic.Arm64MrsFpcr);
Operand fzTrue = getFpFlag(FPState.FzFlag);
Operand r0True = getFpFlag(FPState.RMode0Flag);
Operand r1True = getFpFlag(FPState.RMode1Flag);
fpcr = context.BitwiseAnd(fpcr, Const(~(int)(FPCR.Fz | FPCR.RMode0 | FPCR.RMode1)));
fpcr = context.BitwiseOr(fpcr, context.ConditionalSelect(fzTrue, Const((int)FPCR.Fz), Const(0)));
fpcr = context.BitwiseOr(fpcr, context.ConditionalSelect(r0True, Const((int)FPCR.RMode0), Const(0)));
fpcr = context.BitwiseOr(fpcr, context.ConditionalSelect(r1True, Const((int)FPCR.RMode1), Const(0)));
context.AddIntrinsicNoRet(Intrinsic.Arm64MsrFpcr, fpcr);
// TODO: Restore FPSR
}
}
public static void ExitArmFpMode(EmitterContext context, Action<FPState, Operand> setFpFlag)
{
if (Optimizations.UseSse2)
{
Operand mxcsr = context.AddIntrinsicInt(Intrinsic.X86Stmxcsr);
// Unset round mode (to nearest) and ftz.
mxcsr = context.BitwiseAnd(mxcsr, Const(~(int)(Mxcsr.Ftz | Mxcsr.Daz | Mxcsr.Rhi | Mxcsr.Rlo)));
context.AddIntrinsicNoRet(Intrinsic.X86Ldmxcsr, mxcsr);
// Status flags would be stored here if they were used.
}
else if (Optimizations.UseAdvSimd)
{
Operand fpcr = context.AddIntrinsicInt(Intrinsic.Arm64MrsFpcr);
// Unset round mode (to nearest) and fz.
fpcr = context.BitwiseAnd(fpcr, Const(~(int)(FPCR.Fz | FPCR.RMode0 | FPCR.RMode1)));
context.AddIntrinsicNoRet(Intrinsic.Arm64MsrFpcr, fpcr);
// TODO: Store FPSR
}
}
public static int GetImmShl(OpCodeSimdShImm op) public static int GetImmShl(OpCodeSimdShImm op)
{ {
return op.Imm - (8 << op.Size); return op.Imm - (8 << op.Size);
@ -465,9 +535,11 @@ namespace ARMeilleure.Instructions
? typeof(SoftFloat32).GetMethod(name) ? typeof(SoftFloat32).GetMethod(name)
: typeof(SoftFloat64).GetMethod(name); : typeof(SoftFloat64).GetMethod(name);
context.ExitArmFpMode();
context.StoreToContext(); context.StoreToContext();
Operand res = context.Call(info, callArgs); Operand res = context.Call(info, callArgs);
context.LoadFromContext(); context.LoadFromContext();
context.EnterArmFpMode();
return res; return res;
} }
@ -1358,39 +1430,6 @@ namespace ARMeilleure.Instructions
} }
} }
[Flags]
public enum Mxcsr
{
Ftz = 1 << 15, // Flush To Zero.
Um = 1 << 11, // Underflow Mask.
Dm = 1 << 8, // Denormal Mask.
Daz = 1 << 6 // Denormals Are Zero.
}
public static void EmitSseOrAvxEnterFtzAndDazModesOpF(ArmEmitterContext context, out Operand isTrue)
{
isTrue = GetFpFlag(FPState.FzFlag);
Operand lblTrue = Label();
context.BranchIfFalse(lblTrue, isTrue);
context.AddIntrinsicNoRet(Intrinsic.X86Mxcsrmb, Const((int)(Mxcsr.Ftz | Mxcsr.Um | Mxcsr.Dm | Mxcsr.Daz)));
context.MarkLabel(lblTrue);
}
public static void EmitSseOrAvxExitFtzAndDazModesOpF(ArmEmitterContext context, Operand isTrue = default)
{
isTrue = isTrue == default ? GetFpFlag(FPState.FzFlag) : isTrue;
Operand lblTrue = Label();
context.BranchIfFalse(lblTrue, isTrue);
context.AddIntrinsicNoRet(Intrinsic.X86Mxcsrub, Const((int)(Mxcsr.Ftz | Mxcsr.Daz)));
context.MarkLabel(lblTrue);
}
public enum CmpCondition public enum CmpCondition
{ {
// Legacy Sse. // Legacy Sse.

View File

@ -1197,9 +1197,11 @@ namespace ARMeilleure.Instructions
Array.Resize(ref callArgs, callArgs.Length + 1); Array.Resize(ref callArgs, callArgs.Length + 1);
callArgs[callArgs.Length - 1] = Const(1); callArgs[callArgs.Length - 1] = Const(1);
context.ExitArmFpMode();
context.StoreToContext(); context.StoreToContext();
Operand res = context.Call(info, callArgs); Operand res = context.Call(info, callArgs);
context.LoadFromContext(); context.LoadFromContext();
context.EnterArmFpMode();
return res; return res;
} }

View File

@ -33,8 +33,8 @@ namespace ARMeilleure.Instructions
case 0b11_011_0100_0010_000: EmitGetNzcv(context); return; case 0b11_011_0100_0010_000: EmitGetNzcv(context); return;
case 0b11_011_0100_0100_000: EmitGetFpcr(context); return; case 0b11_011_0100_0100_000: EmitGetFpcr(context); return;
case 0b11_011_0100_0100_001: EmitGetFpsr(context); return; case 0b11_011_0100_0100_001: EmitGetFpsr(context); return;
case 0b11_011_1101_0000_010: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetTpidrEl0)); break; case 0b11_011_1101_0000_010: EmitGetTpidrEl0(context); return;
case 0b11_011_1101_0000_011: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetTpidrroEl0)); break; case 0b11_011_1101_0000_011: EmitGetTpidrroEl0(context); return;
case 0b11_011_1110_0000_000: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetCntfrqEl0)); break; case 0b11_011_1110_0000_000: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetCntfrqEl0)); break;
case 0b11_011_1110_0000_001: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetCntpctEl0)); break; case 0b11_011_1110_0000_001: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetCntpctEl0)); break;
case 0b11_011_1110_0000_010: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetCntvctEl0)); break; case 0b11_011_1110_0000_010: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetCntvctEl0)); break;
@ -49,19 +49,15 @@ namespace ARMeilleure.Instructions
{ {
OpCodeSystem op = (OpCodeSystem)context.CurrOp; OpCodeSystem op = (OpCodeSystem)context.CurrOp;
MethodInfo info;
switch (GetPackedId(op)) switch (GetPackedId(op))
{ {
case 0b11_011_0100_0010_000: EmitSetNzcv(context); return; case 0b11_011_0100_0010_000: EmitSetNzcv(context); return;
case 0b11_011_0100_0100_000: EmitSetFpcr(context); return; case 0b11_011_0100_0100_000: EmitSetFpcr(context); return;
case 0b11_011_0100_0100_001: EmitSetFpsr(context); return; case 0b11_011_0100_0100_001: EmitSetFpsr(context); return;
case 0b11_011_1101_0000_010: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.SetTpidrEl0)); break; case 0b11_011_1101_0000_010: EmitSetTpidrEl0(context); return;
default: throw new NotImplementedException($"Unknown MSR 0x{op.RawOpCode:X8} at 0x{op.Address:X16}."); default: throw new NotImplementedException($"Unknown MSR 0x{op.RawOpCode:X8} at 0x{op.Address:X16}.");
} }
context.Call(info, GetIntOrZR(context, op.Rt));
} }
public static void Nop(ArmEmitterContext context) public static void Nop(ArmEmitterContext context)
@ -165,6 +161,28 @@ namespace ARMeilleure.Instructions
SetIntOrZR(context, op.Rt, fpsr); SetIntOrZR(context, op.Rt, fpsr);
} }
private static void EmitGetTpidrEl0(ArmEmitterContext context)
{
OpCodeSystem op = (OpCodeSystem)context.CurrOp;
Operand nativeContext = context.LoadArgument(OperandType.I64, 0);
Operand result = context.Load(OperandType.I64, context.Add(nativeContext, Const((ulong)NativeContext.GetTpidrEl0Offset())));
SetIntOrZR(context, op.Rt, result);
}
private static void EmitGetTpidrroEl0(ArmEmitterContext context)
{
OpCodeSystem op = (OpCodeSystem)context.CurrOp;
Operand nativeContext = context.LoadArgument(OperandType.I64, 0);
Operand result = context.Load(OperandType.I64, context.Add(nativeContext, Const((ulong)NativeContext.GetTpidrroEl0Offset())));
SetIntOrZR(context, op.Rt, result);
}
private static void EmitSetNzcv(ArmEmitterContext context) private static void EmitSetNzcv(ArmEmitterContext context)
{ {
OpCodeSystem op = (OpCodeSystem)context.CurrOp; OpCodeSystem op = (OpCodeSystem)context.CurrOp;
@ -192,6 +210,8 @@ namespace ARMeilleure.Instructions
SetFpFlag(context, (FPState)flag, context.BitwiseAnd(context.ShiftRightUI(fpcr, Const(flag)), Const(1))); SetFpFlag(context, (FPState)flag, context.BitwiseAnd(context.ShiftRightUI(fpcr, Const(flag)), Const(1)));
} }
} }
context.UpdateArmFpMode();
} }
private static void EmitSetFpsr(ArmEmitterContext context) private static void EmitSetFpsr(ArmEmitterContext context)
@ -210,6 +230,19 @@ namespace ARMeilleure.Instructions
SetFpFlag(context, (FPState)flag, context.BitwiseAnd(context.ShiftRightUI(fpsr, Const(flag)), Const(1))); SetFpFlag(context, (FPState)flag, context.BitwiseAnd(context.ShiftRightUI(fpsr, Const(flag)), Const(1)));
} }
} }
context.UpdateArmFpMode();
}
private static void EmitSetTpidrEl0(ArmEmitterContext context)
{
OpCodeSystem op = (OpCodeSystem)context.CurrOp;
Operand value = GetIntOrZR(context, op.Rt);
Operand nativeContext = context.LoadArgument(OperandType.I64, 0);
context.Store(context.Add(nativeContext, Const((ulong)NativeContext.GetTpidrEl0Offset())), value);
} }
} }
} }

View File

@ -23,8 +23,6 @@ namespace ARMeilleure.Instructions
return; return;
} }
MethodInfo info;
switch (op.CRn) switch (op.CRn)
{ {
case 13: // Process and Thread Info. case 13: // Process and Thread Info.
@ -36,14 +34,12 @@ namespace ARMeilleure.Instructions
switch (op.Opc2) switch (op.Opc2)
{ {
case 2: case 2:
info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.SetTpidrEl032)); break; EmitSetTpidrEl0(context); return;
default: default:
throw new NotImplementedException($"Unknown MRC Opc2 0x{op.Opc2:X} at 0x{op.Address:X} (0x{op.RawOpCode:X})."); throw new NotImplementedException($"Unknown MRC Opc2 0x{op.Opc2:X} at 0x{op.Address:X} (0x{op.RawOpCode:X}).");
} }
break;
case 7: case 7:
switch (op.CRm) // Cache and Memory barrier. switch (op.CRm) // Cache and Memory barrier.
{ {
@ -64,8 +60,6 @@ namespace ARMeilleure.Instructions
default: default:
throw new NotImplementedException($"Unknown MRC 0x{op.RawOpCode:X8} at 0x{op.Address:X16}."); throw new NotImplementedException($"Unknown MRC 0x{op.RawOpCode:X8} at 0x{op.Address:X16}.");
} }
context.Call(info, GetIntA32(context, op.Rt));
} }
public static void Mrc(ArmEmitterContext context) public static void Mrc(ArmEmitterContext context)
@ -79,7 +73,7 @@ namespace ARMeilleure.Instructions
return; return;
} }
MethodInfo info; Operand result;
switch (op.CRn) switch (op.CRn)
{ {
@ -92,10 +86,10 @@ namespace ARMeilleure.Instructions
switch (op.Opc2) switch (op.Opc2)
{ {
case 2: case 2:
info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetTpidrEl032)); break; result = EmitGetTpidrEl0(context); break;
case 3: case 3:
info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetTpidr32)); break; result = EmitGetTpidrroEl0(context); break;
default: default:
throw new NotImplementedException($"Unknown MRC Opc2 0x{op.Opc2:X} at 0x{op.Address:X} (0x{op.RawOpCode:X})."); throw new NotImplementedException($"Unknown MRC Opc2 0x{op.Opc2:X} at 0x{op.Address:X} (0x{op.RawOpCode:X}).");
@ -110,13 +104,13 @@ namespace ARMeilleure.Instructions
if (op.Rt == RegisterAlias.Aarch32Pc) if (op.Rt == RegisterAlias.Aarch32Pc)
{ {
// Special behavior: copy NZCV flags into APSR. // Special behavior: copy NZCV flags into APSR.
EmitSetNzcv(context, context.Call(info)); EmitSetNzcv(context, result);
return; return;
} }
else else
{ {
SetIntA32(context, op.Rt, context.Call(info)); SetIntA32(context, op.Rt, result);
} }
} }
@ -321,6 +315,37 @@ namespace ARMeilleure.Instructions
SetFpFlag(context, (FPState)flag, context.BitwiseAnd(context.ShiftRightUI(fpscr, Const(flag)), Const(1))); SetFpFlag(context, (FPState)flag, context.BitwiseAnd(context.ShiftRightUI(fpscr, Const(flag)), Const(1)));
} }
} }
context.UpdateArmFpMode();
}
private static Operand EmitGetTpidrEl0(ArmEmitterContext context)
{
OpCode32System op = (OpCode32System)context.CurrOp;
Operand nativeContext = context.LoadArgument(OperandType.I64, 0);
return context.Load(OperandType.I64, context.Add(nativeContext, Const((ulong)NativeContext.GetTpidrEl0Offset())));
}
private static Operand EmitGetTpidrroEl0(ArmEmitterContext context)
{
OpCode32System op = (OpCode32System)context.CurrOp;
Operand nativeContext = context.LoadArgument(OperandType.I64, 0);
return context.Load(OperandType.I64, context.Add(nativeContext, Const((ulong)NativeContext.GetTpidrroEl0Offset())));
}
private static void EmitSetTpidrEl0(ArmEmitterContext context)
{
OpCode32System op = (OpCode32System)context.CurrOp;
Operand value = GetIntA32(context, op.Rt);
Operand nativeContext = context.LoadArgument(OperandType.I64, 0);
context.Store(context.Add(nativeContext, Const((ulong)NativeContext.GetTpidrEl0Offset())), context.ZeroExtend32(OperandType.I64, value));
} }
} }
} }

View File

@ -72,26 +72,6 @@ namespace ARMeilleure.Instructions
return (ulong)GetContext().DczidEl0; return (ulong)GetContext().DczidEl0;
} }
public static ulong GetTpidrEl0()
{
return (ulong)GetContext().TpidrEl0;
}
public static uint GetTpidrEl032()
{
return (uint)GetContext().TpidrEl0;
}
public static ulong GetTpidrroEl0()
{
return (ulong)GetContext().TpidrroEl0;
}
public static uint GetTpidr32()
{
return (uint)GetContext().TpidrroEl0;
}
public static ulong GetCntfrqEl0() public static ulong GetCntfrqEl0()
{ {
return GetContext().CntfrqEl0; return GetContext().CntfrqEl0;
@ -106,16 +86,6 @@ namespace ARMeilleure.Instructions
{ {
return GetContext().CntvctEl0; return GetContext().CntvctEl0;
} }
public static void SetTpidrEl0(ulong value)
{
GetContext().TpidrEl0 = (long)value;
}
public static void SetTpidrEl032(uint value)
{
GetContext().TpidrEl0 = (long)value;
}
#endregion #endregion
#region "Read" #region "Read"

View File

@ -53,6 +53,7 @@ namespace ARMeilleure.IntermediateRepresentation
X86Haddpd, X86Haddpd,
X86Haddps, X86Haddps,
X86Insertps, X86Insertps,
X86Ldmxcsr,
X86Maxpd, X86Maxpd,
X86Maxps, X86Maxps,
X86Maxsd, X86Maxsd,
@ -68,8 +69,6 @@ namespace ARMeilleure.IntermediateRepresentation
X86Mulps, X86Mulps,
X86Mulsd, X86Mulsd,
X86Mulss, X86Mulss,
X86Mxcsrmb,
X86Mxcsrub,
X86Paddb, X86Paddb,
X86Paddd, X86Paddd,
X86Paddq, X86Paddq,
@ -153,6 +152,7 @@ namespace ARMeilleure.IntermediateRepresentation
X86Sqrtps, X86Sqrtps,
X86Sqrtsd, X86Sqrtsd,
X86Sqrtss, X86Sqrtss,
X86Stmxcsr,
X86Subpd, X86Subpd,
X86Subps, X86Subps,
X86Subsd, X86Subsd,
@ -163,11 +163,13 @@ namespace ARMeilleure.IntermediateRepresentation
X86Unpcklps, X86Unpcklps,
X86Vcvtph2ps, X86Vcvtph2ps,
X86Vcvtps2ph, X86Vcvtps2ph,
X86Vfmadd231pd,
X86Vfmadd231ps, X86Vfmadd231ps,
X86Vfmadd231sd, X86Vfmadd231sd,
X86Vfmadd231ss, X86Vfmadd231ss,
X86Vfmsub231sd, X86Vfmsub231sd,
X86Vfmsub231ss, X86Vfmsub231ss,
X86Vfnmadd231pd,
X86Vfnmadd231ps, X86Vfnmadd231ps,
X86Vfnmadd231sd, X86Vfnmadd231sd,
X86Vfnmadd231ss, X86Vfnmadd231ss,
@ -394,6 +396,8 @@ namespace ARMeilleure.IntermediateRepresentation
Arm64MlsVe, Arm64MlsVe,
Arm64MlsV, Arm64MlsV,
Arm64MoviV, Arm64MoviV,
Arm64MrsFpcr,
Arm64MsrFpcr,
Arm64MrsFpsr, Arm64MrsFpsr,
Arm64MsrFpsr, Arm64MsrFpsr,
Arm64MulVe, Arm64MulVe,

View File

@ -27,8 +27,17 @@ namespace ARMeilleure.State
// Since EL2 isn't implemented, CNTVOFF_EL2 = 0 // Since EL2 isn't implemented, CNTVOFF_EL2 = 0
public ulong CntvctEl0 => CntpctEl0; public ulong CntvctEl0 => CntpctEl0;
public long TpidrEl0 { get; set; } public long TpidrEl0
public long TpidrroEl0 { get; set; } {
get => _nativeContext.GetTpidrEl0();
set => _nativeContext.SetTpidrEl0(value);
}
public long TpidrroEl0
{
get => _nativeContext.GetTpidrroEl0();
set => _nativeContext.SetTpidrroEl0(value);
}
public uint Pstate public uint Pstate
{ {

View File

@ -13,6 +13,8 @@ namespace ARMeilleure.State
public fixed ulong V[RegisterConsts.VecRegsCount * 2]; public fixed ulong V[RegisterConsts.VecRegsCount * 2];
public fixed uint Flags[RegisterConsts.FlagsCount]; public fixed uint Flags[RegisterConsts.FlagsCount];
public fixed uint FpFlags[RegisterConsts.FpFlagsCount]; public fixed uint FpFlags[RegisterConsts.FpFlagsCount];
public long TpidrEl0;
public long TpidrroEl0;
public int Counter; public int Counter;
public ulong DispatchAddress; public ulong DispatchAddress;
public ulong ExclusiveAddress; public ulong ExclusiveAddress;
@ -168,6 +170,12 @@ namespace ARMeilleure.State
} }
} }
public long GetTpidrEl0() => GetStorage().TpidrEl0;
public void SetTpidrEl0(long value) => GetStorage().TpidrEl0 = value;
public long GetTpidrroEl0() => GetStorage().TpidrroEl0;
public void SetTpidrroEl0(long value) => GetStorage().TpidrroEl0 = value;
public int GetCounter() => GetStorage().Counter; public int GetCounter() => GetStorage().Counter;
public void SetCounter(int value) => GetStorage().Counter = value; public void SetCounter(int value) => GetStorage().Counter = value;
@ -214,6 +222,16 @@ namespace ARMeilleure.State
} }
} }
public static int GetTpidrEl0Offset()
{
return StorageOffset(ref _dummyStorage, ref _dummyStorage.TpidrEl0);
}
public static int GetTpidrroEl0Offset()
{
return StorageOffset(ref _dummyStorage, ref _dummyStorage.TpidrroEl0);
}
public static int GetCounterOffset() public static int GetCounterOffset()
{ {
return StorageOffset(ref _dummyStorage, ref _dummyStorage.Counter); return StorageOffset(ref _dummyStorage, ref _dummyStorage.Counter);

View File

@ -188,6 +188,21 @@ namespace ARMeilleure.Translation
} }
} }
public void EnterArmFpMode()
{
InstEmitSimdHelper.EnterArmFpMode(this, InstEmitHelper.GetFpFlag);
}
public void UpdateArmFpMode()
{
EnterArmFpMode();
}
public void ExitArmFpMode()
{
InstEmitSimdHelper.ExitArmFpMode(this, (flag, value) => InstEmitHelper.SetFpFlag(this, flag, value));
}
public Operand TryGetComparisonResult(Condition condition) public Operand TryGetComparisonResult(Condition condition)
{ {
if (_optOpLastCompare == null || _optOpLastCompare != _optOpLastFlagSet) if (_optOpLastCompare == null || _optOpLastCompare != _optOpLastFlagSet)

View File

@ -105,17 +105,11 @@ namespace ARMeilleure.Translation
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetDczidEl0))); SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetDczidEl0)));
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetFunctionAddress))); SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetFunctionAddress)));
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.InvalidateCacheLine))); SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.InvalidateCacheLine)));
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetTpidrroEl0)));
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetTpidr32))); // A32 only.
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetTpidrEl0)));
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetTpidrEl032))); // A32 only.
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.ReadByte))); SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.ReadByte)));
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.ReadUInt16))); SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.ReadUInt16)));
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.ReadUInt32))); SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.ReadUInt32)));
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.ReadUInt64))); SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.ReadUInt64)));
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.ReadVector128))); SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.ReadVector128)));
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.SetTpidrEl0)));
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.SetTpidrEl032))); // A32 only.
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.SignalMemoryTracking))); SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.SignalMemoryTracking)));
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.SupervisorCall))); SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.SupervisorCall)));
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.ThrowInvalidMemoryAccess))); SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.ThrowInvalidMemoryAccess)));

View File

@ -3,4 +3,5 @@
namespace ARMeilleure.Translation namespace ARMeilleure.Translation
{ {
delegate void DispatcherFunction(IntPtr nativeContext, ulong startAddress); delegate void DispatcherFunction(IntPtr nativeContext, ulong startAddress);
delegate ulong WrapperFunction(IntPtr nativeContext, ulong startAddress);
} }

View File

@ -30,7 +30,7 @@ namespace ARMeilleure.Translation.PTC
private const string OuterHeaderMagicString = "PTCohd\0\0"; private const string OuterHeaderMagicString = "PTCohd\0\0";
private const string InnerHeaderMagicString = "PTCihd\0\0"; private const string InnerHeaderMagicString = "PTCihd\0\0";
private const uint InternalVersion = 4485; //! To be incremented manually for each change to the ARMeilleure project. private const uint InternalVersion = 4661; //! To be incremented manually for each change to the ARMeilleure project.
private const string ActualDir = "0"; private const string ActualDir = "0";
private const string BackupDir = "1"; private const string BackupDir = "1";

View File

@ -25,5 +25,10 @@ namespace ARMeilleure.Translation
{ {
return _func(context.NativeContextPtr); return _func(context.NativeContextPtr);
} }
public ulong Execute(WrapperFunction dispatcher, State.ExecutionContext context)
{
return dispatcher(context.NativeContextPtr, (ulong)FuncPointer);
}
} }
} }

View File

@ -183,7 +183,7 @@ namespace ARMeilleure.Translation
Statistics.StartTimer(); Statistics.StartTimer();
ulong nextAddr = func.Execute(context); ulong nextAddr = func.Execute(Stubs.ContextWrapper, context);
Statistics.StopTimer(address); Statistics.StopTimer(address);
@ -194,7 +194,7 @@ namespace ARMeilleure.Translation
{ {
TranslatedFunction func = Translate(address, context.ExecutionMode, highCq: false, singleStep: true); TranslatedFunction func = Translate(address, context.ExecutionMode, highCq: false, singleStep: true);
address = func.Execute(context); address = func.Execute(Stubs.ContextWrapper, context);
EnqueueForDeletion(address, func); EnqueueForDeletion(address, func);

View File

@ -21,6 +21,7 @@ namespace ARMeilleure.Translation
private readonly Translator _translator; private readonly Translator _translator;
private readonly Lazy<IntPtr> _dispatchStub; private readonly Lazy<IntPtr> _dispatchStub;
private readonly Lazy<DispatcherFunction> _dispatchLoop; private readonly Lazy<DispatcherFunction> _dispatchLoop;
private readonly Lazy<WrapperFunction> _contextWrapper;
/// <summary> /// <summary>
/// Gets the dispatch stub. /// Gets the dispatch stub.
@ -64,6 +65,20 @@ namespace ARMeilleure.Translation
} }
} }
/// <summary>
/// Gets the context wrapper function.
/// </summary>
/// <exception cref="ObjectDisposedException"><see cref="TranslatorStubs"/> instance was disposed</exception>
public WrapperFunction ContextWrapper
{
get
{
ObjectDisposedException.ThrowIf(_disposed, this);
return _contextWrapper.Value;
}
}
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="TranslatorStubs"/> class with the specified /// Initializes a new instance of the <see cref="TranslatorStubs"/> class with the specified
/// <see cref="Translator"/> instance. /// <see cref="Translator"/> instance.
@ -77,6 +92,7 @@ namespace ARMeilleure.Translation
_translator = translator; _translator = translator;
_dispatchStub = new(GenerateDispatchStub, isThreadSafe: true); _dispatchStub = new(GenerateDispatchStub, isThreadSafe: true);
_dispatchLoop = new(GenerateDispatchLoop, isThreadSafe: true); _dispatchLoop = new(GenerateDispatchLoop, isThreadSafe: true);
_contextWrapper = new(GenerateContextWrapper, isThreadSafe: true);
} }
/// <summary> /// <summary>
@ -202,6 +218,32 @@ namespace ARMeilleure.Translation
return Marshal.GetFunctionPointerForDelegate(func); return Marshal.GetFunctionPointerForDelegate(func);
} }
/// <summary>
/// Emits code that syncs FP state before executing guest code, or returns it to normal.
/// </summary>
/// <param name="context">Emitter context for the method</param>
/// <param name="nativeContext">Pointer to the native context</param>
/// <param name="enter">True if entering guest code, false otherwise</param>
private void EmitSyncFpContext(EmitterContext context, Operand nativeContext, bool enter)
{
if (enter)
{
InstEmitSimdHelper.EnterArmFpMode(context, (flag) =>
{
Operand flagAddress = context.Add(nativeContext, Const((ulong)NativeContext.GetRegisterOffset(new Register((int)flag, RegisterType.FpFlag))));
return context.Load(OperandType.I32, flagAddress);
});
}
else
{
InstEmitSimdHelper.ExitArmFpMode(context, (flag, value) =>
{
Operand flagAddress = context.Add(nativeContext, Const((ulong)NativeContext.GetRegisterOffset(new Register((int)flag, RegisterType.FpFlag))));
context.Store(flagAddress, value);
});
}
}
/// <summary> /// <summary>
/// Generates a <see cref="DispatchLoop"/> function. /// Generates a <see cref="DispatchLoop"/> function.
/// </summary> /// </summary>
@ -221,6 +263,8 @@ namespace ARMeilleure.Translation
Operand runningAddress = context.Add(nativeContext, Const((ulong)NativeContext.GetRunningOffset())); Operand runningAddress = context.Add(nativeContext, Const((ulong)NativeContext.GetRunningOffset()));
Operand dispatchAddress = context.Add(nativeContext, Const((ulong)NativeContext.GetDispatchAddressOffset())); Operand dispatchAddress = context.Add(nativeContext, Const((ulong)NativeContext.GetDispatchAddressOffset()));
EmitSyncFpContext(context, nativeContext, true);
context.MarkLabel(beginLbl); context.MarkLabel(beginLbl);
context.Store(dispatchAddress, guestAddress); context.Store(dispatchAddress, guestAddress);
context.Copy(guestAddress, context.Call(Const((ulong)DispatchStub), OperandType.I64, nativeContext)); context.Copy(guestAddress, context.Call(Const((ulong)DispatchStub), OperandType.I64, nativeContext));
@ -229,6 +273,9 @@ namespace ARMeilleure.Translation
context.Branch(beginLbl); context.Branch(beginLbl);
context.MarkLabel(endLbl); context.MarkLabel(endLbl);
EmitSyncFpContext(context, nativeContext, false);
context.Return(); context.Return();
var cfg = context.GetControlFlowGraph(); var cfg = context.GetControlFlowGraph();
@ -237,5 +284,29 @@ namespace ARMeilleure.Translation
return Compiler.Compile(cfg, argTypes, retType, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map<DispatcherFunction>(); return Compiler.Compile(cfg, argTypes, retType, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map<DispatcherFunction>();
} }
/// <summary>
/// Generates a <see cref="ContextWrapper"/> function.
/// </summary>
/// <returns><see cref="ContextWrapper"/> function</returns>
private WrapperFunction GenerateContextWrapper()
{
var context = new EmitterContext();
Operand nativeContext = context.LoadArgument(OperandType.I64, 0);
Operand guestMethod = context.LoadArgument(OperandType.I64, 1);
EmitSyncFpContext(context, nativeContext, true);
Operand returnValue = context.Call(guestMethod, OperandType.I64, nativeContext);
EmitSyncFpContext(context, nativeContext, false);
context.Return(returnValue);
var cfg = context.GetControlFlowGraph();
var retType = OperandType.I64;
var argTypes = new[] { OperandType.I64, OperandType.I64 };
return Compiler.Compile(cfg, argTypes, retType, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map<WrapperFunction>();
}
} }
} }

View File

@ -0,0 +1,148 @@
using ARMeilleure.CodeGen.X86;
using ARMeilleure.IntermediateRepresentation;
using ARMeilleure.State;
using ARMeilleure.Translation;
using System;
using System.Runtime.InteropServices;
using static ARMeilleure.IntermediateRepresentation.Operand.Factory;
namespace ARMeilleure.Translation
{
public static class TranslatorTestMethods
{
public delegate int FpFlagsPInvokeTest(IntPtr managedMethod);
private static bool SetPlatformFtz(EmitterContext context, bool ftz)
{
if (Optimizations.UseSse2)
{
Operand mxcsr = context.AddIntrinsicInt(Intrinsic.X86Stmxcsr);
if (ftz)
{
mxcsr = context.BitwiseOr(mxcsr, Const((int)(Mxcsr.Ftz | Mxcsr.Um | Mxcsr.Dm)));
}
else
{
mxcsr = context.BitwiseAnd(mxcsr, Const(~(int)Mxcsr.Ftz));
}
context.AddIntrinsicNoRet(Intrinsic.X86Ldmxcsr, mxcsr);
return true;
}
else if (Optimizations.UseAdvSimd)
{
Operand fpcr = context.AddIntrinsicInt(Intrinsic.Arm64MrsFpcr);
if (ftz)
{
fpcr = context.BitwiseOr(fpcr, Const((int)FPCR.Fz));
}
else
{
fpcr = context.BitwiseAnd(fpcr, Const(~(int)FPCR.Fz));
}
context.AddIntrinsicNoRet(Intrinsic.Arm64MsrFpcr, fpcr);
return true;
}
else
{
return false;
}
}
private static Operand FpBitsToInt(EmitterContext context, Operand fp)
{
Operand vec = context.VectorInsert(context.VectorZero(), fp, 0);
return context.VectorExtract(OperandType.I32, vec, 0);
}
public static FpFlagsPInvokeTest GenerateFpFlagsPInvokeTest()
{
EmitterContext context = new EmitterContext();
Operand methodAddress = context.Copy(context.LoadArgument(OperandType.I64, 0));
// Verify that default dotnet fp state does not flush to zero.
// This is required for SoftFloat to function.
// Denormal + zero != 0
Operand denormal = ConstF(BitConverter.Int32BitsToSingle(1)); // 1.40129846432e-45
Operand zeroF = ConstF(0f);
Operand zero = Const(0);
Operand result = context.Add(zeroF, denormal);
// Must not be zero.
Operand correct1Label = Label();
context.BranchIfFalse(correct1Label, context.ICompareEqual(FpBitsToInt(context, result), zero));
context.Return(Const(1));
context.MarkLabel(correct1Label);
// Set flush to zero flag. If unsupported by the backend, just return true.
if (!SetPlatformFtz(context, true))
{
context.Return(Const(0));
}
// Denormal + zero == 0
Operand resultFz = context.Add(zeroF, denormal);
// Must equal zero.
Operand correct2Label = Label();
context.BranchIfTrue(correct2Label, context.ICompareEqual(FpBitsToInt(context, resultFz), zero));
SetPlatformFtz(context, false);
context.Return(Const(2));
context.MarkLabel(correct2Label);
// Call a managed method. This method should not change Fz state.
context.Call(methodAddress, OperandType.None);
// Denormal + zero == 0
Operand resultFz2 = context.Add(zeroF, denormal);
// Must equal zero.
Operand correct3Label = Label();
context.BranchIfTrue(correct3Label, context.ICompareEqual(FpBitsToInt(context, resultFz2), zero));
SetPlatformFtz(context, false);
context.Return(Const(3));
context.MarkLabel(correct3Label);
// Success.
SetPlatformFtz(context, false);
context.Return(Const(0));
// Compile and return the function.
ControlFlowGraph cfg = context.GetControlFlowGraph();
OperandType[] argTypes = new OperandType[] { OperandType.I64 };
return Compiler.Compile(cfg, argTypes, OperandType.I32, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map<FpFlagsPInvokeTest>();
}
}
}

View File

@ -44,7 +44,7 @@
<PackageVersion Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta11" /> <PackageVersion Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta11" />
<PackageVersion Include="SPB" Version="0.0.4-build28" /> <PackageVersion Include="SPB" Version="0.0.4-build28" />
<PackageVersion Include="System.Drawing.Common" Version="7.0.0" /> <PackageVersion Include="System.Drawing.Common" Version="7.0.0" />
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="6.27.0" /> <PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="6.28.1" />
<PackageVersion Include="System.IO.Hashing" Version="7.0.0" /> <PackageVersion Include="System.IO.Hashing" Version="7.0.0" />
<PackageVersion Include="System.Management" Version="7.0.0" /> <PackageVersion Include="System.Management" Version="7.0.0" />
<PackageVersion Include="UnicornEngine.Unicorn" Version="2.0.2-rc1-fb78016" /> <PackageVersion Include="UnicornEngine.Unicorn" Version="2.0.2-rc1-fb78016" />

View File

@ -321,17 +321,15 @@ namespace Ryujinx.Ava
_viewModel.IsGameRunning = true; _viewModel.IsGameRunning = true;
var activeProcess = Device.Processes.ActiveApplication; var activeProcess = Device.Processes.ActiveApplication;
var nacp = activeProcess.ApplicationControlProperties;
int desiredLanguage = (int)Device.System.State.DesiredTitleLanguage;
string titleNameSection = string.IsNullOrWhiteSpace(nacp.Title[desiredLanguage].NameString.ToString()) ? string.Empty : $" - {nacp.Title[desiredLanguage].NameString.ToString()}"; string titleNameSection = string.IsNullOrWhiteSpace(activeProcess.Name) ? string.Empty : $" {activeProcess.Name}";
string titleVersionSection = string.IsNullOrWhiteSpace(nacp.DisplayVersionString.ToString()) ? string.Empty : $" v{nacp.DisplayVersionString.ToString()}"; string titleVersionSection = string.IsNullOrWhiteSpace(activeProcess.DisplayVersion) ? string.Empty : $" v{activeProcess.DisplayVersion}";
string titleIdSection = string.IsNullOrWhiteSpace(activeProcess.ProgramIdText) ? string.Empty : $" ({activeProcess.ProgramIdText.ToUpper()})"; string titleIdSection = $" ({activeProcess.ProgramIdText.ToUpper()})";
string titleArchSection = activeProcess.Is64Bit ? " (64-bit)" : " (32-bit)"; string titleArchSection = activeProcess.Is64Bit ? " (64-bit)" : " (32-bit)";
Dispatcher.UIThread.InvokeAsync(() => Dispatcher.UIThread.InvokeAsync(() =>
{ {
_viewModel.Title = $"Ryujinx {Program.Version}{titleNameSection}{titleVersionSection}{titleIdSection}{titleArchSection}"; _viewModel.Title = $"Ryujinx {Program.Version} -{titleNameSection}{titleVersionSection}{titleIdSection}{titleArchSection}";
}); });
_viewModel.SetUIProgressHandlers(Device); _viewModel.SetUIProgressHandlers(Device);

View File

@ -429,6 +429,7 @@
"DlcManagerEnableAllButton": "Enable All", "DlcManagerEnableAllButton": "Enable All",
"DlcManagerDisableAllButton": "Disable All", "DlcManagerDisableAllButton": "Disable All",
"MenuBarOptionsChangeLanguage": "Change Language", "MenuBarOptionsChangeLanguage": "Change Language",
"MenuBarShowFileTypes": "Show File Types",
"CommonSort": "Sort", "CommonSort": "Sort",
"CommonShowNames": "Show Names", "CommonShowNames": "Show Names",
"CommonFavorite": "Favorite", "CommonFavorite": "Favorite",

View File

@ -53,6 +53,8 @@ namespace Ryujinx.Ava.UI.Applet
bool opened = false; bool opened = false;
_parent.Activate();
UserResult response = await ContentDialogHelper.ShowDeferredContentDialog(_parent, UserResult response = await ContentDialogHelper.ShowDeferredContentDialog(_parent,
title, title,
message, message,

View File

@ -23,10 +23,11 @@ namespace Ryujinx.Ava.UI.Controls
private ContentDialog _host; private ContentDialog _host;
public SwkbdAppletDialog(string mainText, string secondaryText, string placeholder) public SwkbdAppletDialog(string mainText, string secondaryText, string placeholder, string message)
{ {
MainText = mainText; MainText = mainText;
SecondaryText = secondaryText; SecondaryText = secondaryText;
Message = message ?? "";
DataContext = this; DataContext = this;
_placeholder = placeholder; _placeholder = placeholder;
InitializeComponent(); InitializeComponent();
@ -54,10 +55,7 @@ namespace Ryujinx.Ava.UI.Controls
UserResult result = UserResult.Cancel; UserResult result = UserResult.Cancel;
SwkbdAppletDialog content = new SwkbdAppletDialog(args.HeaderText, args.SubtitleText, args.GuideText) SwkbdAppletDialog content = new SwkbdAppletDialog(args.HeaderText, args.SubtitleText, args.GuideText, args.InitialText);
{
Message = args.InitialText ?? ""
};
string input = string.Empty; string input = string.Empty;

View File

@ -1336,6 +1336,23 @@ namespace Ryujinx.Ava.UI.ViewModels
} }
} }
public void ToggleFileType(string fileType)
{
_ = fileType switch
{
"NSP" => ConfigurationState.Instance.Ui.ShownFileTypes.NSP.Value = !ConfigurationState.Instance.Ui.ShownFileTypes.NSP,
"PFS0" => ConfigurationState.Instance.Ui.ShownFileTypes.PFS0.Value = !ConfigurationState.Instance.Ui.ShownFileTypes.PFS0,
"XCI" => ConfigurationState.Instance.Ui.ShownFileTypes.XCI.Value = !ConfigurationState.Instance.Ui.ShownFileTypes.XCI,
"NCA" => ConfigurationState.Instance.Ui.ShownFileTypes.NCA.Value = !ConfigurationState.Instance.Ui.ShownFileTypes.NCA,
"NRO" => ConfigurationState.Instance.Ui.ShownFileTypes.NRO.Value = !ConfigurationState.Instance.Ui.ShownFileTypes.NRO,
"NSO" => ConfigurationState.Instance.Ui.ShownFileTypes.NSO.Value = !ConfigurationState.Instance.Ui.ShownFileTypes.NSO,
_ => throw new ArgumentOutOfRangeException(fileType),
};
ConfigurationState.Instance.ToFileFormat().SaveConfig(Program.ConfigurationPath);
LoadApplications();
}
public async void ManageProfiles() public async void ManageProfiles()
{ {
await NavigationDialogHost.Show(AccountManager, ContentManager, VirtualFileSystem, LibHacHorizonManager.RyujinxClient); await NavigationDialogHost.Show(AccountManager, ContentManager, VirtualFileSystem, LibHacHorizonManager.RyujinxClient);

View File

@ -78,6 +78,7 @@
</MenuItem> </MenuItem>
<Separator /> <Separator />
<MenuItem Name="ChangeLanguageMenuItem" Header="{locale:Locale MenuBarOptionsChangeLanguage}" /> <MenuItem Name="ChangeLanguageMenuItem" Header="{locale:Locale MenuBarOptionsChangeLanguage}" />
<MenuItem Name="ToggleFileTypesMenuItem" Header="{locale:Locale MenuBarShowFileTypes}" />
<Separator /> <Separator />
<MenuItem <MenuItem
Click="OpenSettings" Click="OpenSettings"

View File

@ -11,6 +11,8 @@ using Ryujinx.Common;
using Ryujinx.Common.Utilities; using Ryujinx.Common.Utilities;
using Ryujinx.HLE.HOS; using Ryujinx.HLE.HOS;
using Ryujinx.Modules; using Ryujinx.Modules;
using Ryujinx.Ui.Common;
using Ryujinx.Ui.Common.Configuration;
using Ryujinx.Ui.Common.Helper; using Ryujinx.Ui.Common.Helper;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -29,6 +31,30 @@ namespace Ryujinx.Ava.UI.Views.Main
{ {
InitializeComponent(); InitializeComponent();
ToggleFileTypesMenuItem.Items = GenerateToggleFileTypeItems();
ChangeLanguageMenuItem.Items = GenerateLanguageMenuItems();
}
private CheckBox[] GenerateToggleFileTypeItems()
{
List<CheckBox> checkBoxes = new();
foreach (var item in Enum.GetValues(typeof (FileTypes)))
{
string fileName = Enum.GetName(typeof (FileTypes), item);
checkBoxes.Add(new CheckBox()
{
Content = $".{fileName}",
IsChecked = ((FileTypes)item).GetConfigValue(ConfigurationState.Instance.Ui.ShownFileTypes),
Command = MiniCommand.Create(() => ViewModel.ToggleFileType(fileName))
});
}
return checkBoxes.ToArray();
}
private MenuItem[] GenerateLanguageMenuItems()
{
List<MenuItem> menuItems = new(); List<MenuItem> menuItems = new();
string localePath = "Ryujinx.Ava/Assets/Locales"; string localePath = "Ryujinx.Ava/Assets/Locales";
@ -61,7 +87,7 @@ namespace Ryujinx.Ava.UI.Views.Main
menuItems.Add(menuItem); menuItems.Add(menuItem);
} }
ChangeLanguageMenuItem.Items = menuItems.ToArray(); return menuItems.ToArray();
} }
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e) protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)

View File

@ -1,5 +1,9 @@
namespace Ryujinx.Common.Configuration.Hid.Controller using Ryujinx.Common.Utilities;
using System.Text.Json.Serialization;
namespace Ryujinx.Common.Configuration.Hid.Controller
{ {
[JsonConverter(typeof(TypedStringEnumConverter<GamepadInputId>))]
public enum GamepadInputId : byte public enum GamepadInputId : byte
{ {
Unbound, Unbound,
@ -51,4 +55,4 @@
Count Count
} }
} }

View File

@ -1,5 +1,9 @@
namespace Ryujinx.Common.Configuration.Hid.Controller using Ryujinx.Common.Utilities;
using System.Text.Json.Serialization;
namespace Ryujinx.Common.Configuration.Hid.Controller
{ {
[JsonConverter(typeof(TypedStringEnumConverter<StickInputId>))]
public enum StickInputId : byte public enum StickInputId : byte
{ {
Unbound, Unbound,
@ -8,4 +12,4 @@
Count Count
} }
} }

View File

@ -1,6 +1,8 @@
namespace Ryujinx.Common.Configuration.Hid namespace Ryujinx.Common.Configuration.Hid
{ {
public struct KeyboardHotkeys // NOTE: Please don't change this to struct.
// This breaks Avalonia's TwoWay binding, which makes us unable to save new KeyboardHotkeys.
public class KeyboardHotkeys
{ {
public Key ToggleVsync { get; set; } public Key ToggleVsync { get; set; }
public Key Screenshot { get; set; } public Key Screenshot { get; set; }

View File

@ -38,4 +38,25 @@ namespace Ryujinx.Graphics.GAL
Src1AlphaGl = 0xc902, Src1AlphaGl = 0xc902,
OneMinusSrc1AlphaGl = 0xc903 OneMinusSrc1AlphaGl = 0xc903
} }
public static class BlendFactorExtensions
{
public static bool IsDualSource(this BlendFactor factor)
{
switch (factor)
{
case BlendFactor.Src1Color:
case BlendFactor.Src1ColorGl:
case BlendFactor.Src1Alpha:
case BlendFactor.Src1AlphaGl:
case BlendFactor.OneMinusSrc1Color:
case BlendFactor.OneMinusSrc1ColorGl:
case BlendFactor.OneMinusSrc1Alpha:
case BlendFactor.OneMinusSrc1AlphaGl:
return true;
}
return false;
}
}
} }

View File

@ -328,5 +328,19 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
Signal(); Signal();
} }
} }
/// <summary>
/// Sets the dual-source blend enabled state.
/// </summary>
/// <param name="enabled">True if blending is enabled and using dual-source blend</param>
public void SetDualSourceBlendEnabled(bool enabled)
{
if (enabled != _graphics.DualSourceBlendEnable)
{
_graphics.DualSourceBlendEnable = enabled;
Signal();
}
}
} }
} }

View File

@ -1183,6 +1183,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
bool blendIndependent = _state.State.BlendIndependent; bool blendIndependent = _state.State.BlendIndependent;
ColorF blendConstant = _state.State.BlendConstant; ColorF blendConstant = _state.State.BlendConstant;
bool dualSourceBlendEnabled = false;
if (blendIndependent) if (blendIndependent)
{ {
for (int index = 0; index < Constants.TotalRenderTargets; index++) for (int index = 0; index < Constants.TotalRenderTargets; index++)
@ -1200,6 +1202,15 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
FilterBlendFactor(blend.AlphaSrcFactor, index), FilterBlendFactor(blend.AlphaSrcFactor, index),
FilterBlendFactor(blend.AlphaDstFactor, index)); FilterBlendFactor(blend.AlphaDstFactor, index));
if (enable &&
(blend.ColorSrcFactor.IsDualSource() ||
blend.ColorDstFactor.IsDualSource() ||
blend.AlphaSrcFactor.IsDualSource() ||
blend.AlphaDstFactor.IsDualSource()))
{
dualSourceBlendEnabled = true;
}
_pipeline.BlendDescriptors[index] = descriptor; _pipeline.BlendDescriptors[index] = descriptor;
_context.Renderer.Pipeline.SetBlendState(index, descriptor); _context.Renderer.Pipeline.SetBlendState(index, descriptor);
} }
@ -1219,12 +1230,23 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
FilterBlendFactor(blend.AlphaSrcFactor, 0), FilterBlendFactor(blend.AlphaSrcFactor, 0),
FilterBlendFactor(blend.AlphaDstFactor, 0)); FilterBlendFactor(blend.AlphaDstFactor, 0));
if (enable &&
(blend.ColorSrcFactor.IsDualSource() ||
blend.ColorDstFactor.IsDualSource() ||
blend.AlphaSrcFactor.IsDualSource() ||
blend.AlphaDstFactor.IsDualSource()))
{
dualSourceBlendEnabled = true;
}
for (int index = 0; index < Constants.TotalRenderTargets; index++) for (int index = 0; index < Constants.TotalRenderTargets; index++)
{ {
_pipeline.BlendDescriptors[index] = descriptor; _pipeline.BlendDescriptors[index] = descriptor;
_context.Renderer.Pipeline.SetBlendState(index, descriptor); _context.Renderer.Pipeline.SetBlendState(index, descriptor);
} }
} }
_currentSpecState.SetDualSourceBlendEnabled(dualSourceBlendEnabled);
} }
/// <summary> /// <summary>

View File

@ -141,6 +141,12 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
return _oldSpecState.GraphicsState.HasConstantBufferDrawParameters; return _oldSpecState.GraphicsState.HasConstantBufferDrawParameters;
} }
/// <inheritdoc/>
public bool QueryDualSourceBlendEnable()
{
return _oldSpecState.GraphicsState.DualSourceBlendEnable;
}
/// <inheritdoc/> /// <inheritdoc/>
public InputTopology QueryPrimitiveTopology() public InputTopology QueryPrimitiveTopology()
{ {

View File

@ -22,7 +22,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
private const ushort FileFormatVersionMajor = 1; private const ushort FileFormatVersionMajor = 1;
private const ushort FileFormatVersionMinor = 2; private const ushort FileFormatVersionMinor = 2;
private const uint FileFormatVersionPacked = ((uint)FileFormatVersionMajor << 16) | FileFormatVersionMinor; private const uint FileFormatVersionPacked = ((uint)FileFormatVersionMajor << 16) | FileFormatVersionMinor;
private const uint CodeGenVersion = 4368; private const uint CodeGenVersion = 4404;
private const string SharedTocFileName = "shared.toc"; private const string SharedTocFileName = "shared.toc";
private const string SharedDataFileName = "shared.data"; private const string SharedDataFileName = "shared.data";

View File

@ -157,6 +157,12 @@ namespace Ryujinx.Graphics.Gpu.Shader
return _state.GraphicsState.HasUnalignedStorageBuffer || _state.ComputeState.HasUnalignedStorageBuffer; return _state.GraphicsState.HasUnalignedStorageBuffer || _state.ComputeState.HasUnalignedStorageBuffer;
} }
/// <inheritdoc/>
public bool QueryDualSourceBlendEnable()
{
return _state.GraphicsState.DualSourceBlendEnable;
}
/// <inheritdoc/> /// <inheritdoc/>
public InputTopology QueryPrimitiveTopology() public InputTopology QueryPrimitiveTopology()
{ {

View File

@ -92,6 +92,11 @@ namespace Ryujinx.Graphics.Gpu.Shader
/// </summary> /// </summary>
public Array8<AttributeType> FragmentOutputTypes; public Array8<AttributeType> FragmentOutputTypes;
/// <summary>
/// Indicates whether dual source blend is enabled.
/// </summary>
public bool DualSourceBlendEnable;
/// <summary> /// <summary>
/// Creates a new GPU graphics state. /// Creates a new GPU graphics state.
/// </summary> /// </summary>
@ -111,6 +116,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
/// <param name="hasConstantBufferDrawParameters">Indicates that the draw is writing the base vertex, base instance and draw index to Constant Buffer 0</param> /// <param name="hasConstantBufferDrawParameters">Indicates that the draw is writing the base vertex, base instance and draw index to Constant Buffer 0</param>
/// <param name="hasUnalignedStorageBuffer">Indicates that any storage buffer use is unaligned</param> /// <param name="hasUnalignedStorageBuffer">Indicates that any storage buffer use is unaligned</param>
/// <param name="fragmentOutputTypes">Type of the fragment shader outputs</param> /// <param name="fragmentOutputTypes">Type of the fragment shader outputs</param>
/// <param name="dualSourceBlendEnable">Type of the vertex attributes consumed by the shader</param>
public GpuChannelGraphicsState( public GpuChannelGraphicsState(
bool earlyZForce, bool earlyZForce,
PrimitiveTopology topology, PrimitiveTopology topology,
@ -127,7 +133,8 @@ namespace Ryujinx.Graphics.Gpu.Shader
ref Array32<AttributeType> attributeTypes, ref Array32<AttributeType> attributeTypes,
bool hasConstantBufferDrawParameters, bool hasConstantBufferDrawParameters,
bool hasUnalignedStorageBuffer, bool hasUnalignedStorageBuffer,
ref Array8<AttributeType> fragmentOutputTypes) ref Array8<AttributeType> fragmentOutputTypes,
bool dualSourceBlendEnable)
{ {
EarlyZForce = earlyZForce; EarlyZForce = earlyZForce;
Topology = topology; Topology = topology;
@ -145,6 +152,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
HasConstantBufferDrawParameters = hasConstantBufferDrawParameters; HasConstantBufferDrawParameters = hasConstantBufferDrawParameters;
HasUnalignedStorageBuffer = hasUnalignedStorageBuffer; HasUnalignedStorageBuffer = hasUnalignedStorageBuffer;
FragmentOutputTypes = fragmentOutputTypes; FragmentOutputTypes = fragmentOutputTypes;
DualSourceBlendEnable = dualSourceBlendEnable;
} }
} }
} }

View File

@ -535,6 +535,11 @@ namespace Ryujinx.Graphics.Gpu.Shader
return false; return false;
} }
if (graphicsState.DualSourceBlendEnable != GraphicsState.DualSourceBlendEnable)
{
return false;
}
return Matches(channel, ref poolState, checkTextures, isCompute: false); return Matches(channel, ref poolState, checkTextures, isCompute: false);
} }

View File

@ -833,31 +833,13 @@ namespace Ryujinx.Graphics.OpenGL
(BlendingFactorSrc)blend.AlphaSrcFactor.Convert(), (BlendingFactorSrc)blend.AlphaSrcFactor.Convert(),
(BlendingFactorDest)blend.AlphaDstFactor.Convert()); (BlendingFactorDest)blend.AlphaDstFactor.Convert());
static bool IsDualSource(BlendFactor factor)
{
switch (factor)
{
case BlendFactor.Src1Color:
case BlendFactor.Src1ColorGl:
case BlendFactor.Src1Alpha:
case BlendFactor.Src1AlphaGl:
case BlendFactor.OneMinusSrc1Color:
case BlendFactor.OneMinusSrc1ColorGl:
case BlendFactor.OneMinusSrc1Alpha:
case BlendFactor.OneMinusSrc1AlphaGl:
return true;
}
return false;
}
EnsureFramebuffer(); EnsureFramebuffer();
_framebuffer.SetDualSourceBlend( _framebuffer.SetDualSourceBlend(
IsDualSource(blend.ColorSrcFactor) || blend.ColorSrcFactor.IsDualSource() ||
IsDualSource(blend.ColorDstFactor) || blend.ColorDstFactor.IsDualSource() ||
IsDualSource(blend.AlphaSrcFactor) || blend.AlphaSrcFactor.IsDualSource() ||
IsDualSource(blend.AlphaDstFactor)); blend.AlphaDstFactor.IsDualSource());
if (_blendConstant != blend.BlendConstant) if (_blendConstant != blend.BlendConstant)
{ {

View File

@ -226,6 +226,7 @@ namespace Ryujinx.Graphics.OpenGL
// Set clip control, viewport and the framebuffer to the output to placate overlays and OBS capture. // Set clip control, viewport and the framebuffer to the output to placate overlays and OBS capture.
GL.ClipControl(ClipOrigin.LowerLeft, ClipDepthMode.NegativeOneToOne); GL.ClipControl(ClipOrigin.LowerLeft, ClipDepthMode.NegativeOneToOne);
GL.Viewport(0, 0, _width, _height); GL.Viewport(0, 0, _width, _height);
GL.BindFramebuffer(FramebufferTarget.Framebuffer, drawFramebuffer);
swapBuffersCallback(); swapBuffersCallback();

View File

@ -612,6 +612,19 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
else else
{ {
int usedAttributes = context.Config.UsedOutputAttributes; int usedAttributes = context.Config.UsedOutputAttributes;
if (context.Config.Stage == ShaderStage.Fragment && context.Config.GpuAccessor.QueryDualSourceBlendEnable())
{
int firstOutput = BitOperations.TrailingZeroCount(usedAttributes);
int mask = 3 << firstOutput;
if ((usedAttributes & mask) == mask)
{
usedAttributes &= ~mask;
DeclareOutputDualSourceBlendAttribute(context, firstOutput);
}
}
while (usedAttributes != 0) while (usedAttributes != 0)
{ {
int index = BitOperations.TrailingZeroCount(usedAttributes); int index = BitOperations.TrailingZeroCount(usedAttributes);
@ -690,6 +703,15 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
} }
} }
private static void DeclareOutputDualSourceBlendAttribute(CodeGenContext context, int attr)
{
string name = $"{DefaultNames.OAttributePrefix}{attr}";
string name2 = $"{DefaultNames.OAttributePrefix}{(attr + 1)}";
context.AppendLine($"layout (location = {attr}, index = 0) out vec4 {name};");
context.AppendLine($"layout (location = {attr}, index = 1) out vec4 {name2};");
}
private static void DeclareUsedOutputAttributesPerPatch(CodeGenContext context, HashSet<int> attrs) private static void DeclareUsedOutputAttributesPerPatch(CodeGenContext context, HashSet<int> attrs)
{ {
foreach (int attr in attrs.Order()) foreach (int attr in attrs.Order())

View File

@ -6,6 +6,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Numerics;
using static Spv.Specification; using static Spv.Specification;
namespace Ryujinx.Graphics.Shader.CodeGen.Spirv namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
@ -622,7 +623,27 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
else if (attr >= AttributeConsts.FragmentOutputColorBase && attr < AttributeConsts.FragmentOutputColorEnd) else if (attr >= AttributeConsts.FragmentOutputColorBase && attr < AttributeConsts.FragmentOutputColorEnd)
{ {
int location = (attr - AttributeConsts.FragmentOutputColorBase) / 16; int location = (attr - AttributeConsts.FragmentOutputColorBase) / 16;
context.Decorate(spvVar, Decoration.Location, (LiteralInteger)location);
if (context.Config.Stage == ShaderStage.Fragment && context.Config.GpuAccessor.QueryDualSourceBlendEnable())
{
int firstLocation = BitOperations.TrailingZeroCount(context.Config.UsedOutputAttributes);
int index = location - firstLocation;
int mask = 3 << firstLocation;
if ((uint)index < 2 && (context.Config.UsedOutputAttributes & mask) == mask)
{
context.Decorate(spvVar, Decoration.Location, (LiteralInteger)firstLocation);
context.Decorate(spvVar, Decoration.Index, (LiteralInteger)index);
}
else
{
context.Decorate(spvVar, Decoration.Location, (LiteralInteger)location);
}
}
else
{
context.Decorate(spvVar, Decoration.Location, (LiteralInteger)location);
}
} }
if (!isOutAttr) if (!isOutAttr)

View File

@ -205,6 +205,15 @@ namespace Ryujinx.Graphics.Shader
return false; return false;
} }
/// <summary>
/// Queries dual source blend state.
/// </summary>
/// <returns>True if blending is enabled with a dual source blend equation, false otherwise</returns>
bool QueryDualSourceBlendEnable()
{
return false;
}
/// <summary> /// <summary>
/// Queries host about the presence of the FrontFacing built-in variable bug. /// Queries host about the presence of the FrontFacing built-in variable bug.
/// </summary> /// </summary>

View File

@ -1,4 +1,5 @@
using System; using Ryujinx.Common.Logging;
using System;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
@ -7,12 +8,26 @@ namespace Ryujinx.Graphics.Vulkan
internal class AutoFlushCounter internal class AutoFlushCounter
{ {
// How often to flush on framebuffer change. // How often to flush on framebuffer change.
private readonly static long FramebufferFlushTimer = Stopwatch.Frequency / 1000; private readonly static long FramebufferFlushTimer = Stopwatch.Frequency / 1000; // (1ms)
// How often to flush on draw when fast flush mode is enabled.
private readonly static long DrawFlushTimer = Stopwatch.Frequency / 666; // (1.5ms)
// Average wait time that triggers fast flush mode to be entered.
private readonly static long FastFlushEnterThreshold = Stopwatch.Frequency / 666; // (1.5ms)
// Average wait time that triggers fast flush mode to be exited.
private readonly static long FastFlushExitThreshold = Stopwatch.Frequency / 10000; // (0.1ms)
// Number of frames to average waiting times over.
private const int SyncWaitAverageCount = 20;
private const int MinDrawCountForFlush = 10; private const int MinDrawCountForFlush = 10;
private const int MinConsecutiveQueryForFlush = 10; private const int MinConsecutiveQueryForFlush = 10;
private const int InitialQueryCountForFlush = 32; private const int InitialQueryCountForFlush = 32;
private readonly VulkanRenderer _gd;
private long _lastFlush; private long _lastFlush;
private ulong _lastDrawCount; private ulong _lastDrawCount;
private bool _hasPendingQuery; private bool _hasPendingQuery;
@ -23,6 +38,16 @@ namespace Ryujinx.Graphics.Vulkan
private int _queryCountHistoryIndex; private int _queryCountHistoryIndex;
private int _remainingQueries; private int _remainingQueries;
private long[] _syncWaitHistory = new long[SyncWaitAverageCount];
private int _syncWaitHistoryIndex;
private bool _fastFlushMode;
public AutoFlushCounter(VulkanRenderer gd)
{
_gd = gd;
}
public void RegisterFlush(ulong drawCount) public void RegisterFlush(ulong drawCount)
{ {
_lastFlush = Stopwatch.GetTimestamp(); _lastFlush = Stopwatch.GetTimestamp();
@ -69,6 +94,32 @@ namespace Ryujinx.Graphics.Vulkan
return _hasPendingQuery; return _hasPendingQuery;
} }
public bool ShouldFlushDraw(ulong drawCount)
{
if (_fastFlushMode)
{
long draws = (long)(drawCount - _lastDrawCount);
if (draws < MinDrawCountForFlush)
{
if (draws == 0)
{
_lastFlush = Stopwatch.GetTimestamp();
}
return false;
}
long flushTimeout = DrawFlushTimer;
long now = Stopwatch.GetTimestamp();
return now > _lastFlush + flushTimeout;
}
return false;
}
public bool ShouldFlushAttachmentChange(ulong drawCount) public bool ShouldFlushAttachmentChange(ulong drawCount)
{ {
_queryCount = 0; _queryCount = 0;
@ -102,11 +153,27 @@ namespace Ryujinx.Graphics.Vulkan
public void Present() public void Present()
{ {
// Query flush prediction.
_queryCountHistoryIndex = (_queryCountHistoryIndex + 1) % 3; _queryCountHistoryIndex = (_queryCountHistoryIndex + 1) % 3;
_remainingQueries = _queryCountHistory.Max() + 10; _remainingQueries = _queryCountHistory.Max() + 10;
_queryCountHistory[_queryCountHistoryIndex] = 0; _queryCountHistory[_queryCountHistoryIndex] = 0;
// Fast flush mode toggle.
_syncWaitHistory[_syncWaitHistoryIndex] = _gd.SyncManager.GetAndResetWaitTicks();
_syncWaitHistoryIndex = (_syncWaitHistoryIndex + 1) % SyncWaitAverageCount;
long averageWait = (long)_syncWaitHistory.Average();
if (_fastFlushMode ? averageWait < FastFlushExitThreshold : averageWait > FastFlushEnterThreshold)
{
_fastFlushMode = !_fastFlushMode;
Logger.Debug?.PrintMsg(LogClass.Gpu, $"Switched fast flush mode: ({_fastFlushMode})");
}
} }
} }
} }

View File

@ -9,21 +9,18 @@ namespace Ryujinx.Graphics.Vulkan
private ulong MaxDeviceMemoryUsageEstimate = 16UL * 1024 * 1024 * 1024; private ulong MaxDeviceMemoryUsageEstimate = 16UL * 1024 * 1024 * 1024;
private readonly Vk _api; private readonly Vk _api;
private readonly PhysicalDevice _physicalDevice; private readonly VulkanPhysicalDevice _physicalDevice;
private readonly Device _device; private readonly Device _device;
private readonly List<MemoryAllocatorBlockList> _blockLists; private readonly List<MemoryAllocatorBlockList> _blockLists;
private readonly int _blockAlignment; private readonly int _blockAlignment;
private readonly PhysicalDeviceMemoryProperties _physicalDeviceMemoryProperties;
public MemoryAllocator(Vk api, PhysicalDevice physicalDevice, Device device, uint maxMemoryAllocationCount) public MemoryAllocator(Vk api, VulkanPhysicalDevice physicalDevice, Device device)
{ {
_api = api; _api = api;
_physicalDevice = physicalDevice; _physicalDevice = physicalDevice;
_device = device; _device = device;
_blockLists = new List<MemoryAllocatorBlockList>(); _blockLists = new List<MemoryAllocatorBlockList>();
_blockAlignment = (int)Math.Min(int.MaxValue, MaxDeviceMemoryUsageEstimate / (ulong)maxMemoryAllocationCount); _blockAlignment = (int)Math.Min(int.MaxValue, MaxDeviceMemoryUsageEstimate / (ulong)_physicalDevice.PhysicalDeviceProperties.Limits.MaxMemoryAllocationCount);
_api.GetPhysicalDeviceMemoryProperties(_physicalDevice, out _physicalDeviceMemoryProperties);
} }
public MemoryAllocation AllocateDeviceMemory( public MemoryAllocation AllocateDeviceMemory(
@ -64,9 +61,9 @@ namespace Ryujinx.Graphics.Vulkan
uint memoryTypeBits, uint memoryTypeBits,
MemoryPropertyFlags flags) MemoryPropertyFlags flags)
{ {
for (int i = 0; i < _physicalDeviceMemoryProperties.MemoryTypeCount; i++) for (int i = 0; i < _physicalDevice.PhysicalDeviceMemoryProperties.MemoryTypeCount; i++)
{ {
var type = _physicalDeviceMemoryProperties.MemoryTypes[i]; var type = _physicalDevice.PhysicalDeviceMemoryProperties.MemoryTypes[i];
if ((memoryTypeBits & (1 << i)) != 0) if ((memoryTypeBits & (1 << i)) != 0)
{ {
@ -80,15 +77,11 @@ namespace Ryujinx.Graphics.Vulkan
return -1; return -1;
} }
public static bool IsDeviceMemoryShared(Vk api, PhysicalDevice physicalDevice) public static bool IsDeviceMemoryShared(VulkanPhysicalDevice physicalDevice)
{ {
// The device is regarded as having shared memory if all heaps have the device local bit. for (int i = 0; i < physicalDevice.PhysicalDeviceMemoryProperties.MemoryHeapCount; i++)
api.GetPhysicalDeviceMemoryProperties(physicalDevice, out var properties);
for (int i = 0; i < properties.MemoryHeapCount; i++)
{ {
if (!properties.MemoryHeaps[i].Flags.HasFlag(MemoryHeapFlags.DeviceLocalBit)) if (!physicalDevice.PhysicalDeviceMemoryProperties.MemoryHeaps[i].Flags.HasFlag(MemoryHeapFlags.DeviceLocalBit))
{ {
return false; return false;
} }

View File

@ -86,7 +86,7 @@ namespace Ryujinx.Graphics.Vulkan
Gd = gd; Gd = gd;
Device = device; Device = device;
AutoFlush = new AutoFlushCounter(); AutoFlush = new AutoFlushCounter(gd);
var pipelineCacheCreateInfo = new PipelineCacheCreateInfo() var pipelineCacheCreateInfo = new PipelineCacheCreateInfo()
{ {
@ -1562,6 +1562,11 @@ namespace Ryujinx.Graphics.Vulkan
private void RecreatePipelineIfNeeded(PipelineBindPoint pbp) private void RecreatePipelineIfNeeded(PipelineBindPoint pbp)
{ {
if (AutoFlush.ShouldFlushDraw(DrawCount))
{
Gd.FlushAllCommands();
}
DynamicState.ReplayIfDirty(Gd.Api, CommandBuffer); DynamicState.ReplayIfDirty(Gd.Api, CommandBuffer);
// Commit changes to the support buffer before drawing. // Commit changes to the support buffer before drawing.

View File

@ -1,6 +1,7 @@
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Silk.NET.Vulkan; using Silk.NET.Vulkan;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
namespace Ryujinx.Graphics.Vulkan namespace Ryujinx.Graphics.Vulkan
@ -26,6 +27,7 @@ namespace Ryujinx.Graphics.Vulkan
private readonly Device _device; private readonly Device _device;
private List<SyncHandle> _handles; private List<SyncHandle> _handles;
private ulong FlushId; private ulong FlushId;
private long WaitTicks;
public SyncManager(VulkanRenderer gd, Device device) public SyncManager(VulkanRenderer gd, Device device)
{ {
@ -130,6 +132,8 @@ namespace Ryujinx.Graphics.Vulkan
return; return;
} }
long beforeTicks = Stopwatch.GetTimestamp();
if (result.NeedsFlush(FlushId)) if (result.NeedsFlush(FlushId))
{ {
_gd.InterruptAction(() => _gd.InterruptAction(() =>
@ -142,12 +146,14 @@ namespace Ryujinx.Graphics.Vulkan
} }
bool signaled = result.Signalled || result.Waitable.WaitForFences(_gd.Api, _device, 1000000000); bool signaled = result.Signalled || result.Waitable.WaitForFences(_gd.Api, _device, 1000000000);
if (!signaled) if (!signaled)
{ {
Logger.Error?.PrintMsg(LogClass.Gpu, $"VK Sync Object {result.ID} failed to signal within 1000ms. Continuing..."); Logger.Error?.PrintMsg(LogClass.Gpu, $"VK Sync Object {result.ID} failed to signal within 1000ms. Continuing...");
} }
else else
{ {
WaitTicks += Stopwatch.GetTimestamp() - beforeTicks;
result.Signalled = true; result.Signalled = true;
} }
} }
@ -188,5 +194,13 @@ namespace Ryujinx.Graphics.Vulkan
} }
} }
} }
public long GetAndResetWaitTicks()
{
long result = WaitTicks;
WaitTicks = 0;
return result;
}
} }
} }

View File

@ -47,35 +47,23 @@ namespace Ryujinx.Graphics.Vulkan
KhrSwapchain.ExtensionName KhrSwapchain.ExtensionName
}; };
internal static Instance CreateInstance(Vk api, GraphicsDebugLevel logLevel, string[] requiredExtensions) internal static VulkanInstance CreateInstance(Vk api, GraphicsDebugLevel logLevel, string[] requiredExtensions)
{ {
var enabledLayers = new List<string>(); var enabledLayers = new List<string>();
var instanceExtensions = VulkanInstance.GetInstanceExtensions(api);
var instanceLayers = VulkanInstance.GetInstanceLayers(api);
void AddAvailableLayer(string layerName) void AddAvailableLayer(string layerName)
{ {
uint layerPropertiesCount; if (instanceLayers.Contains(layerName))
api.EnumerateInstanceLayerProperties(&layerPropertiesCount, null).ThrowOnError();
LayerProperties[] layerProperties = new LayerProperties[layerPropertiesCount];
fixed (LayerProperties* pLayerProperties = layerProperties)
{ {
api.EnumerateInstanceLayerProperties(&layerPropertiesCount, layerProperties).ThrowOnError(); enabledLayers.Add(layerName);
}
for (int i = 0; i < layerPropertiesCount; i++) else
{ {
string currentLayerName = Marshal.PtrToStringAnsi((IntPtr)pLayerProperties[i].LayerName); Logger.Warning?.Print(LogClass.Gpu, $"Missing layer {layerName}");
if (currentLayerName == layerName)
{
enabledLayers.Add(layerName);
return;
}
}
} }
Logger.Warning?.Print(LogClass.Gpu, $"Missing layer {layerName}");
} }
if (logLevel != GraphicsDebugLevel.None) if (logLevel != GraphicsDebugLevel.None)
@ -85,7 +73,7 @@ namespace Ryujinx.Graphics.Vulkan
var enabledExtensions = requiredExtensions; var enabledExtensions = requiredExtensions;
if (api.IsInstanceExtensionPresent("VK_EXT_debug_utils")) if (instanceExtensions.Contains("VK_EXT_debug_utils"))
{ {
enabledExtensions = enabledExtensions.Append(ExtDebugUtils.ExtensionName).ToArray(); enabledExtensions = enabledExtensions.Append(ExtDebugUtils.ExtensionName).ToArray();
} }
@ -124,7 +112,7 @@ namespace Ryujinx.Graphics.Vulkan
EnabledLayerCount = (uint)enabledLayers.Count EnabledLayerCount = (uint)enabledLayers.Count
}; };
api.CreateInstance(in instanceCreateInfo, null, out var instance).ThrowOnError(); Result result = VulkanInstance.Create(api, ref instanceCreateInfo, out var instance);
Marshal.FreeHGlobal(appName); Marshal.FreeHGlobal(appName);
@ -138,21 +126,14 @@ namespace Ryujinx.Graphics.Vulkan
Marshal.FreeHGlobal(ppEnabledLayers[i]); Marshal.FreeHGlobal(ppEnabledLayers[i]);
} }
result.ThrowOnError();
return instance; return instance;
} }
internal static PhysicalDevice FindSuitablePhysicalDevice(Vk api, Instance instance, SurfaceKHR surface, string preferredGpuId) internal static VulkanPhysicalDevice FindSuitablePhysicalDevice(Vk api, VulkanInstance instance, SurfaceKHR surface, string preferredGpuId)
{ {
uint physicalDeviceCount; instance.EnumeratePhysicalDevices(out var physicalDevices).ThrowOnError();
api.EnumeratePhysicalDevices(instance, &physicalDeviceCount, null).ThrowOnError();
PhysicalDevice[] physicalDevices = new PhysicalDevice[physicalDeviceCount];
fixed (PhysicalDevice* pPhysicalDevices = physicalDevices)
{
api.EnumeratePhysicalDevices(instance, &physicalDeviceCount, pPhysicalDevices).ThrowOnError();
}
// First we try to pick the the user preferred GPU. // First we try to pick the the user preferred GPU.
for (int i = 0; i < physicalDevices.Length; i++) for (int i = 0; i < physicalDevices.Length; i++)
@ -198,76 +179,41 @@ namespace Ryujinx.Graphics.Vulkan
EnabledLayerCount = 0 EnabledLayerCount = 0
}; };
api.CreateInstance(in instanceCreateInfo, null, out var instance).ThrowOnError(); Result result = VulkanInstance.Create(api, ref instanceCreateInfo, out var rawInstance);
// We ensure that vkEnumerateInstanceVersion is present (added in 1.1).
// If the instance doesn't support it, no device is going to be 1.1 compatible.
if (api.GetInstanceProcAddr(instance, "vkEnumerateInstanceVersion") == IntPtr.Zero)
{
api.DestroyInstance(instance, null);
return Array.Empty<DeviceInfo>();
}
// We currently assume that the instance is compatible with Vulkan 1.2
// TODO: Remove this once we relax our initialization codepaths.
uint instanceApiVerison = 0;
api.EnumerateInstanceVersion(ref instanceApiVerison).ThrowOnError();
if (instanceApiVerison < MinimalInstanceVulkanVersion)
{
api.DestroyInstance(instance, null);
return Array.Empty<DeviceInfo>();
}
Marshal.FreeHGlobal(appName); Marshal.FreeHGlobal(appName);
uint physicalDeviceCount; result.ThrowOnError();
api.EnumeratePhysicalDevices(instance, &physicalDeviceCount, null).ThrowOnError(); using VulkanInstance instance = rawInstance;
PhysicalDevice[] physicalDevices = new PhysicalDevice[physicalDeviceCount]; // We currently assume that the instance is compatible with Vulkan 1.2
// TODO: Remove this once we relax our initialization codepaths.
fixed (PhysicalDevice* pPhysicalDevices = physicalDevices) if (instance.InstanceVersion < MinimalInstanceVulkanVersion)
{ {
api.EnumeratePhysicalDevices(instance, &physicalDeviceCount, pPhysicalDevices).ThrowOnError(); return Array.Empty<DeviceInfo>();
} }
DeviceInfo[] devices = new DeviceInfo[physicalDevices.Length]; instance.EnumeratePhysicalDevices(out VulkanPhysicalDevice[] physicalDevices).ThrowOnError();
for (int i = 0; i < physicalDevices.Length; i++) List<DeviceInfo> deviceInfos = new List<DeviceInfo>();
foreach (VulkanPhysicalDevice physicalDevice in physicalDevices)
{ {
var physicalDevice = physicalDevices[i]; if (physicalDevice.PhysicalDeviceProperties.ApiVersion < MinimalVulkanVersion)
api.GetPhysicalDeviceProperties(physicalDevice, out var properties);
if (properties.ApiVersion < MinimalVulkanVersion)
{ {
continue; continue;
} }
devices[i] = new DeviceInfo( deviceInfos.Add(physicalDevice.ToDeviceInfo());
StringFromIdPair(properties.VendorID, properties.DeviceID),
VendorUtils.GetNameFromId(properties.VendorID),
Marshal.PtrToStringAnsi((IntPtr)properties.DeviceName),
properties.DeviceType == PhysicalDeviceType.DiscreteGpu);
} }
api.DestroyInstance(instance, null); return deviceInfos.ToArray();
return devices;
} }
public static string StringFromIdPair(uint vendorId, uint deviceId) private static bool IsPreferredAndSuitableDevice(Vk api, VulkanPhysicalDevice physicalDevice, SurfaceKHR surface, string preferredGpuId)
{ {
return $"0x{vendorId:X}_0x{deviceId:X}"; if (physicalDevice.Id != preferredGpuId)
}
private static bool IsPreferredAndSuitableDevice(Vk api, PhysicalDevice physicalDevice, SurfaceKHR surface, string preferredGpuId)
{
api.GetPhysicalDeviceProperties(physicalDevice, out var properties);
if (StringFromIdPair(properties.VendorID, properties.DeviceID) != preferredGpuId)
{ {
return false; return false;
} }
@ -275,68 +221,47 @@ namespace Ryujinx.Graphics.Vulkan
return IsSuitableDevice(api, physicalDevice, surface); return IsSuitableDevice(api, physicalDevice, surface);
} }
private static bool IsSuitableDevice(Vk api, PhysicalDevice physicalDevice, SurfaceKHR surface) private static bool IsSuitableDevice(Vk api, VulkanPhysicalDevice physicalDevice, SurfaceKHR surface)
{ {
int extensionMatches = 0; int extensionMatches = 0;
uint propertiesCount;
api.EnumerateDeviceExtensionProperties(physicalDevice, (byte*)null, &propertiesCount, null).ThrowOnError(); foreach (string requiredExtension in _requiredExtensions)
ExtensionProperties[] extensionProperties = new ExtensionProperties[propertiesCount];
fixed (ExtensionProperties* pExtensionProperties = extensionProperties)
{ {
api.EnumerateDeviceExtensionProperties(physicalDevice, (byte*)null, &propertiesCount, pExtensionProperties).ThrowOnError(); if (physicalDevice.IsDeviceExtensionPresent(requiredExtension))
for (int i = 0; i < propertiesCount; i++)
{ {
string extensionName = Marshal.PtrToStringAnsi((IntPtr)pExtensionProperties[i].ExtensionName); extensionMatches++;
if (_requiredExtensions.Contains(extensionName))
{
extensionMatches++;
}
} }
} }
return extensionMatches == _requiredExtensions.Length && FindSuitableQueueFamily(api, physicalDevice, surface, out _) != InvalidIndex; return extensionMatches == _requiredExtensions.Length && FindSuitableQueueFamily(api, physicalDevice, surface, out _) != InvalidIndex;
} }
internal static uint FindSuitableQueueFamily(Vk api, PhysicalDevice physicalDevice, SurfaceKHR surface, out uint queueCount) internal static uint FindSuitableQueueFamily(Vk api, VulkanPhysicalDevice physicalDevice, SurfaceKHR surface, out uint queueCount)
{ {
const QueueFlags RequiredFlags = QueueFlags.GraphicsBit | QueueFlags.ComputeBit; const QueueFlags RequiredFlags = QueueFlags.GraphicsBit | QueueFlags.ComputeBit;
var khrSurface = new KhrSurface(api.Context); var khrSurface = new KhrSurface(api.Context);
uint propertiesCount; for (uint index = 0; index < physicalDevice.QueueFamilyProperties.Length; index++)
api.GetPhysicalDeviceQueueFamilyProperties(physicalDevice, &propertiesCount, null);
QueueFamilyProperties[] properties = new QueueFamilyProperties[propertiesCount];
fixed (QueueFamilyProperties* pProperties = properties)
{ {
api.GetPhysicalDeviceQueueFamilyProperties(physicalDevice, &propertiesCount, pProperties); ref QueueFamilyProperties property = ref physicalDevice.QueueFamilyProperties[index];
}
for (uint index = 0; index < propertiesCount; index++) khrSurface.GetPhysicalDeviceSurfaceSupport(physicalDevice.PhysicalDevice, index, surface, out var surfaceSupported).ThrowOnError();
{
var queueFlags = properties[index].QueueFlags;
khrSurface.GetPhysicalDeviceSurfaceSupport(physicalDevice, index, surface, out var surfaceSupported).ThrowOnError(); if (property.QueueFlags.HasFlag(RequiredFlags) && surfaceSupported)
if (queueFlags.HasFlag(RequiredFlags) && surfaceSupported)
{ {
queueCount = properties[index].QueueCount; queueCount = property.QueueCount;
return index; return index;
} }
} }
queueCount = 0; queueCount = 0;
return InvalidIndex; return InvalidIndex;
} }
public static Device CreateDevice(Vk api, PhysicalDevice physicalDevice, uint queueFamilyIndex, string[] supportedExtensions, uint queueCount) internal static Device CreateDevice(Vk api, VulkanPhysicalDevice physicalDevice, uint queueFamilyIndex, uint queueCount)
{ {
if (queueCount > QueuesCount) if (queueCount > QueuesCount)
{ {
@ -358,8 +283,7 @@ namespace Ryujinx.Graphics.Vulkan
PQueuePriorities = queuePriorities PQueuePriorities = queuePriorities
}; };
api.GetPhysicalDeviceProperties(physicalDevice, out var properties); bool useRobustBufferAccess = VendorUtils.FromId(physicalDevice.PhysicalDeviceProperties.VendorID) == Vendor.Nvidia;
bool useRobustBufferAccess = VendorUtils.FromId(properties.VendorID) == Vendor.Nvidia;
PhysicalDeviceFeatures2 features2 = new PhysicalDeviceFeatures2() PhysicalDeviceFeatures2 features2 = new PhysicalDeviceFeatures2()
{ {
@ -380,7 +304,7 @@ namespace Ryujinx.Graphics.Vulkan
PNext = features2.PNext PNext = features2.PNext
}; };
if (supportedExtensions.Contains("VK_EXT_custom_border_color")) if (physicalDevice.IsDeviceExtensionPresent("VK_EXT_custom_border_color"))
{ {
features2.PNext = &supportedFeaturesCustomBorderColor; features2.PNext = &supportedFeaturesCustomBorderColor;
} }
@ -391,7 +315,7 @@ namespace Ryujinx.Graphics.Vulkan
PNext = features2.PNext PNext = features2.PNext
}; };
if (supportedExtensions.Contains("VK_EXT_primitive_topology_list_restart")) if (physicalDevice.IsDeviceExtensionPresent("VK_EXT_primitive_topology_list_restart"))
{ {
features2.PNext = &supportedFeaturesPrimitiveTopologyListRestart; features2.PNext = &supportedFeaturesPrimitiveTopologyListRestart;
} }
@ -402,7 +326,7 @@ namespace Ryujinx.Graphics.Vulkan
PNext = features2.PNext PNext = features2.PNext
}; };
if (supportedExtensions.Contains(ExtTransformFeedback.ExtensionName)) if (physicalDevice.IsDeviceExtensionPresent(ExtTransformFeedback.ExtensionName))
{ {
features2.PNext = &supportedFeaturesTransformFeedback; features2.PNext = &supportedFeaturesTransformFeedback;
} }
@ -412,14 +336,14 @@ namespace Ryujinx.Graphics.Vulkan
SType = StructureType.PhysicalDeviceRobustness2FeaturesExt SType = StructureType.PhysicalDeviceRobustness2FeaturesExt
}; };
if (supportedExtensions.Contains("VK_EXT_robustness2")) if (physicalDevice.IsDeviceExtensionPresent("VK_EXT_robustness2"))
{ {
supportedFeaturesRobustness2.PNext = features2.PNext; supportedFeaturesRobustness2.PNext = features2.PNext;
features2.PNext = &supportedFeaturesRobustness2; features2.PNext = &supportedFeaturesRobustness2;
} }
api.GetPhysicalDeviceFeatures2(physicalDevice, &features2); api.GetPhysicalDeviceFeatures2(physicalDevice.PhysicalDevice, &features2);
var supportedFeatures = features2.Features; var supportedFeatures = features2.Features;
@ -452,7 +376,7 @@ namespace Ryujinx.Graphics.Vulkan
PhysicalDeviceTransformFeedbackFeaturesEXT featuresTransformFeedback; PhysicalDeviceTransformFeedbackFeaturesEXT featuresTransformFeedback;
if (supportedExtensions.Contains(ExtTransformFeedback.ExtensionName)) if (physicalDevice.IsDeviceExtensionPresent(ExtTransformFeedback.ExtensionName))
{ {
featuresTransformFeedback = new PhysicalDeviceTransformFeedbackFeaturesEXT() featuresTransformFeedback = new PhysicalDeviceTransformFeedbackFeaturesEXT()
{ {
@ -466,7 +390,7 @@ namespace Ryujinx.Graphics.Vulkan
PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT featuresPrimitiveTopologyListRestart; PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT featuresPrimitiveTopologyListRestart;
if (supportedExtensions.Contains("VK_EXT_primitive_topology_list_restart")) if (physicalDevice.IsDeviceExtensionPresent("VK_EXT_primitive_topology_list_restart"))
{ {
featuresPrimitiveTopologyListRestart = new PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT() featuresPrimitiveTopologyListRestart = new PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT()
{ {
@ -481,7 +405,7 @@ namespace Ryujinx.Graphics.Vulkan
PhysicalDeviceRobustness2FeaturesEXT featuresRobustness2; PhysicalDeviceRobustness2FeaturesEXT featuresRobustness2;
if (supportedExtensions.Contains("VK_EXT_robustness2")) if (physicalDevice.IsDeviceExtensionPresent("VK_EXT_robustness2"))
{ {
featuresRobustness2 = new PhysicalDeviceRobustness2FeaturesEXT() featuresRobustness2 = new PhysicalDeviceRobustness2FeaturesEXT()
{ {
@ -497,7 +421,7 @@ namespace Ryujinx.Graphics.Vulkan
{ {
SType = StructureType.PhysicalDeviceExtendedDynamicStateFeaturesExt, SType = StructureType.PhysicalDeviceExtendedDynamicStateFeaturesExt,
PNext = pExtendedFeatures, PNext = pExtendedFeatures,
ExtendedDynamicState = supportedExtensions.Contains(ExtExtendedDynamicState.ExtensionName) ExtendedDynamicState = physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState.ExtensionName)
}; };
pExtendedFeatures = &featuresExtendedDynamicState; pExtendedFeatures = &featuresExtendedDynamicState;
@ -515,16 +439,16 @@ namespace Ryujinx.Graphics.Vulkan
{ {
SType = StructureType.PhysicalDeviceVulkan12Features, SType = StructureType.PhysicalDeviceVulkan12Features,
PNext = pExtendedFeatures, PNext = pExtendedFeatures,
DescriptorIndexing = supportedExtensions.Contains("VK_EXT_descriptor_indexing"), DescriptorIndexing = physicalDevice.IsDeviceExtensionPresent("VK_EXT_descriptor_indexing"),
DrawIndirectCount = supportedExtensions.Contains(KhrDrawIndirectCount.ExtensionName), DrawIndirectCount = physicalDevice.IsDeviceExtensionPresent(KhrDrawIndirectCount.ExtensionName),
UniformBufferStandardLayout = supportedExtensions.Contains("VK_KHR_uniform_buffer_standard_layout") UniformBufferStandardLayout = physicalDevice.IsDeviceExtensionPresent("VK_KHR_uniform_buffer_standard_layout")
}; };
pExtendedFeatures = &featuresVk12; pExtendedFeatures = &featuresVk12;
PhysicalDeviceIndexTypeUint8FeaturesEXT featuresIndexU8; PhysicalDeviceIndexTypeUint8FeaturesEXT featuresIndexU8;
if (supportedExtensions.Contains("VK_EXT_index_type_uint8")) if (physicalDevice.IsDeviceExtensionPresent("VK_EXT_index_type_uint8"))
{ {
featuresIndexU8 = new PhysicalDeviceIndexTypeUint8FeaturesEXT() featuresIndexU8 = new PhysicalDeviceIndexTypeUint8FeaturesEXT()
{ {
@ -538,7 +462,7 @@ namespace Ryujinx.Graphics.Vulkan
PhysicalDeviceFragmentShaderInterlockFeaturesEXT featuresFragmentShaderInterlock; PhysicalDeviceFragmentShaderInterlockFeaturesEXT featuresFragmentShaderInterlock;
if (supportedExtensions.Contains("VK_EXT_fragment_shader_interlock")) if (physicalDevice.IsDeviceExtensionPresent("VK_EXT_fragment_shader_interlock"))
{ {
featuresFragmentShaderInterlock = new PhysicalDeviceFragmentShaderInterlockFeaturesEXT() featuresFragmentShaderInterlock = new PhysicalDeviceFragmentShaderInterlockFeaturesEXT()
{ {
@ -552,7 +476,7 @@ namespace Ryujinx.Graphics.Vulkan
PhysicalDeviceSubgroupSizeControlFeaturesEXT featuresSubgroupSizeControl; PhysicalDeviceSubgroupSizeControlFeaturesEXT featuresSubgroupSizeControl;
if (supportedExtensions.Contains("VK_EXT_subgroup_size_control")) if (physicalDevice.IsDeviceExtensionPresent("VK_EXT_subgroup_size_control"))
{ {
featuresSubgroupSizeControl = new PhysicalDeviceSubgroupSizeControlFeaturesEXT() featuresSubgroupSizeControl = new PhysicalDeviceSubgroupSizeControlFeaturesEXT()
{ {
@ -566,7 +490,7 @@ namespace Ryujinx.Graphics.Vulkan
PhysicalDeviceCustomBorderColorFeaturesEXT featuresCustomBorderColor; PhysicalDeviceCustomBorderColorFeaturesEXT featuresCustomBorderColor;
if (supportedExtensions.Contains("VK_EXT_custom_border_color") && if (physicalDevice.IsDeviceExtensionPresent("VK_EXT_custom_border_color") &&
supportedFeaturesCustomBorderColor.CustomBorderColors && supportedFeaturesCustomBorderColor.CustomBorderColors &&
supportedFeaturesCustomBorderColor.CustomBorderColorWithoutFormat) supportedFeaturesCustomBorderColor.CustomBorderColorWithoutFormat)
{ {
@ -581,7 +505,7 @@ namespace Ryujinx.Graphics.Vulkan
pExtendedFeatures = &featuresCustomBorderColor; pExtendedFeatures = &featuresCustomBorderColor;
} }
var enabledExtensions = _requiredExtensions.Union(_desirableExtensions.Intersect(supportedExtensions)).ToArray(); var enabledExtensions = _requiredExtensions.Union(_desirableExtensions.Intersect(physicalDevice.DeviceExtensions)).ToArray();
IntPtr* ppEnabledExtensions = stackalloc IntPtr[enabledExtensions.Length]; IntPtr* ppEnabledExtensions = stackalloc IntPtr[enabledExtensions.Length];
@ -601,7 +525,7 @@ namespace Ryujinx.Graphics.Vulkan
PEnabledFeatures = &features PEnabledFeatures = &features
}; };
api.CreateDevice(physicalDevice, in deviceCreateInfo, null, out var device).ThrowOnError(); api.CreateDevice(physicalDevice.PhysicalDevice, in deviceCreateInfo, null, out var device).ThrowOnError();
for (int i = 0; i < enabledExtensions.Length; i++) for (int i = 0; i < enabledExtensions.Length; i++)
{ {
@ -610,21 +534,5 @@ namespace Ryujinx.Graphics.Vulkan
return device; return device;
} }
public static string[] GetSupportedExtensions(Vk api, PhysicalDevice physicalDevice)
{
uint propertiesCount;
api.EnumerateDeviceExtensionProperties(physicalDevice, (byte*)null, &propertiesCount, null).ThrowOnError();
ExtensionProperties[] extensionProperties = new ExtensionProperties[propertiesCount];
fixed (ExtensionProperties* pExtensionProperties = extensionProperties)
{
api.EnumerateDeviceExtensionProperties(physicalDevice, (byte*)null, &propertiesCount, pExtensionProperties).ThrowOnError();
}
return extensionProperties.Select(x => Marshal.PtrToStringAnsi((IntPtr)x.ExtensionName)).ToArray();
}
} }
} }

View File

@ -0,0 +1,127 @@
using Ryujinx.Common.Utilities;
using Silk.NET.Core;
using Silk.NET.Vulkan;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Runtime.InteropServices;
namespace Ryujinx.Graphics.Vulkan
{
class VulkanInstance : IDisposable
{
private readonly Vk _api;
public readonly Instance Instance;
public readonly Version32 InstanceVersion;
private bool _disposed;
private VulkanInstance(Vk api, Instance instance)
{
_api = api;
Instance = instance;
if (api.GetInstanceProcAddr(instance, "vkEnumerateInstanceVersion") == IntPtr.Zero)
{
InstanceVersion = Vk.Version10;
}
else
{
uint rawInstanceVersion = 0;
if (api.EnumerateInstanceVersion(ref rawInstanceVersion) != Result.Success)
{
rawInstanceVersion = Vk.Version11.Value;
}
InstanceVersion = (Version32)rawInstanceVersion;
}
}
public static Result Create(Vk api, ref InstanceCreateInfo createInfo, out VulkanInstance instance)
{
instance = null;
Instance rawInstance = default;
Result result = api.CreateInstance(SpanHelpers.AsReadOnlySpan(ref createInfo), ReadOnlySpan<AllocationCallbacks>.Empty, SpanHelpers.AsSpan(ref rawInstance));
if (result == Result.Success)
{
instance = new VulkanInstance(api, rawInstance);
}
return result;
}
public Result EnumeratePhysicalDevices(out VulkanPhysicalDevice[] physicalDevices)
{
physicalDevices = null;
uint physicalDeviceCount = 0;
Result result = _api.EnumeratePhysicalDevices(Instance, SpanHelpers.AsSpan(ref physicalDeviceCount), Span<PhysicalDevice>.Empty);
if (result != Result.Success)
{
return result;
}
PhysicalDevice[] rawPhysicalDevices = new PhysicalDevice[physicalDeviceCount];
result = _api.EnumeratePhysicalDevices(Instance, SpanHelpers.AsSpan(ref physicalDeviceCount), rawPhysicalDevices);
if (result != Result.Success)
{
return result;
}
physicalDevices = rawPhysicalDevices.Select(x => new VulkanPhysicalDevice(_api, x)).ToArray();
return Result.Success;
}
public static IReadOnlySet<string> GetInstanceExtensions(Vk api)
{
uint propertiesCount = 0;
api.EnumerateInstanceExtensionProperties(ReadOnlySpan<byte>.Empty, SpanHelpers.AsSpan(ref propertiesCount), Span<ExtensionProperties>.Empty).ThrowOnError();
ExtensionProperties[] extensionProperties = new ExtensionProperties[propertiesCount];
api.EnumerateInstanceExtensionProperties(ReadOnlySpan<byte>.Empty, SpanHelpers.AsSpan(ref propertiesCount), extensionProperties).ThrowOnError();
unsafe
{
return extensionProperties.Select(x => Marshal.PtrToStringAnsi((IntPtr)x.ExtensionName)).ToImmutableHashSet();
}
}
public static IReadOnlySet<string> GetInstanceLayers(Vk api)
{
uint propertiesCount = 0;
api.EnumerateInstanceLayerProperties(SpanHelpers.AsSpan(ref propertiesCount), Span<LayerProperties>.Empty).ThrowOnError();
LayerProperties[] layerProperties = new LayerProperties[propertiesCount];
api.EnumerateInstanceLayerProperties(SpanHelpers.AsSpan(ref propertiesCount), layerProperties).ThrowOnError();
unsafe
{
return layerProperties.Select(x => Marshal.PtrToStringAnsi((IntPtr)x.LayerName)).ToImmutableHashSet();
}
}
public void Dispose()
{
if (!_disposed)
{
_api.DestroyInstance(Instance, ReadOnlySpan<AllocationCallbacks>.Empty);
_disposed = true;
}
}
}
}

View File

@ -0,0 +1,70 @@
using Ryujinx.Common.Utilities;
using Ryujinx.Graphics.GAL;
using Silk.NET.Vulkan;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Runtime.InteropServices;
namespace Ryujinx.Graphics.Vulkan
{
readonly struct VulkanPhysicalDevice
{
public readonly PhysicalDevice PhysicalDevice;
public readonly PhysicalDeviceFeatures PhysicalDeviceFeatures;
public readonly PhysicalDeviceProperties PhysicalDeviceProperties;
public readonly PhysicalDeviceMemoryProperties PhysicalDeviceMemoryProperties;
public readonly QueueFamilyProperties[] QueueFamilyProperties;
public readonly string DeviceName;
public readonly IReadOnlySet<string> DeviceExtensions;
public VulkanPhysicalDevice(Vk api, PhysicalDevice physicalDevice)
{
PhysicalDevice = physicalDevice;
PhysicalDeviceFeatures = api.GetPhysicalDeviceFeature(PhysicalDevice);
api.GetPhysicalDeviceProperties(PhysicalDevice, out var physicalDeviceProperties);
PhysicalDeviceProperties = physicalDeviceProperties;
api.GetPhysicalDeviceMemoryProperties(PhysicalDevice, out PhysicalDeviceMemoryProperties);
unsafe
{
DeviceName = Marshal.PtrToStringAnsi((IntPtr)physicalDeviceProperties.DeviceName);
}
uint propertiesCount = 0;
api.GetPhysicalDeviceQueueFamilyProperties(physicalDevice, SpanHelpers.AsSpan(ref propertiesCount), Span<QueueFamilyProperties>.Empty);
QueueFamilyProperties = new QueueFamilyProperties[propertiesCount];
api.GetPhysicalDeviceQueueFamilyProperties(physicalDevice, SpanHelpers.AsSpan(ref propertiesCount), QueueFamilyProperties);
api.EnumerateDeviceExtensionProperties(PhysicalDevice, Span<byte>.Empty, SpanHelpers.AsSpan(ref propertiesCount), Span<ExtensionProperties>.Empty).ThrowOnError();
ExtensionProperties[] extensionProperties = new ExtensionProperties[propertiesCount];
api.EnumerateDeviceExtensionProperties(PhysicalDevice, Span<byte>.Empty, SpanHelpers.AsSpan(ref propertiesCount), extensionProperties).ThrowOnError();
unsafe
{
DeviceExtensions = extensionProperties.Select(x => Marshal.PtrToStringAnsi((IntPtr)x.ExtensionName)).ToImmutableHashSet();
}
}
public string Id => $"0x{PhysicalDeviceProperties.VendorID:X}_0x{PhysicalDeviceProperties.DeviceID:X}";
public bool IsDeviceExtensionPresent(string extension) => DeviceExtensions.Contains(extension);
public DeviceInfo ToDeviceInfo()
{
return new DeviceInfo(
Id,
VendorUtils.GetNameFromId(PhysicalDeviceProperties.VendorID),
DeviceName,
PhysicalDeviceProperties.DeviceType == PhysicalDeviceType.DiscreteGpu);
}
}
}

View File

@ -17,9 +17,9 @@ namespace Ryujinx.Graphics.Vulkan
{ {
public sealed class VulkanRenderer : IRenderer public sealed class VulkanRenderer : IRenderer
{ {
private Instance _instance; private VulkanInstance _instance;
private SurfaceKHR _surface; private SurfaceKHR _surface;
private PhysicalDevice _physicalDevice; private VulkanPhysicalDevice _physicalDevice;
private Device _device; private Device _device;
private WindowBase _window; private WindowBase _window;
@ -49,6 +49,7 @@ namespace Ryujinx.Graphics.Vulkan
internal PipelineLayoutCache PipelineLayoutCache { get; private set; } internal PipelineLayoutCache PipelineLayoutCache { get; private set; }
internal BackgroundResources BackgroundResources { get; private set; } internal BackgroundResources BackgroundResources { get; private set; }
internal Action<Action> InterruptAction { get; private set; } internal Action<Action> InterruptAction { get; private set; }
internal SyncManager SyncManager { get; private set; }
internal BufferManager BufferManager { get; private set; } internal BufferManager BufferManager { get; private set; }
@ -58,7 +59,6 @@ namespace Ryujinx.Graphics.Vulkan
private VulkanDebugMessenger _debugMessenger; private VulkanDebugMessenger _debugMessenger;
private Counters _counters; private Counters _counters;
private SyncManager _syncManager;
private PipelineFull _pipeline; private PipelineFull _pipeline;
@ -106,33 +106,31 @@ namespace Ryujinx.Graphics.Vulkan
} }
} }
private unsafe void LoadFeatures(string[] supportedExtensions, uint maxQueueCount, uint queueFamilyIndex) private unsafe void LoadFeatures(uint maxQueueCount, uint queueFamilyIndex)
{ {
FormatCapabilities = new FormatCapabilities(Api, _physicalDevice); FormatCapabilities = new FormatCapabilities(Api, _physicalDevice.PhysicalDevice);
var supportedFeatures = Api.GetPhysicalDeviceFeature(_physicalDevice); if (Api.TryGetDeviceExtension(_instance.Instance, _device, out ExtConditionalRendering conditionalRenderingApi))
if (Api.TryGetDeviceExtension(_instance, _device, out ExtConditionalRendering conditionalRenderingApi))
{ {
ConditionalRenderingApi = conditionalRenderingApi; ConditionalRenderingApi = conditionalRenderingApi;
} }
if (Api.TryGetDeviceExtension(_instance, _device, out ExtExtendedDynamicState extendedDynamicStateApi)) if (Api.TryGetDeviceExtension(_instance.Instance, _device, out ExtExtendedDynamicState extendedDynamicStateApi))
{ {
ExtendedDynamicStateApi = extendedDynamicStateApi; ExtendedDynamicStateApi = extendedDynamicStateApi;
} }
if (Api.TryGetDeviceExtension(_instance, _device, out KhrPushDescriptor pushDescriptorApi)) if (Api.TryGetDeviceExtension(_instance.Instance, _device, out KhrPushDescriptor pushDescriptorApi))
{ {
PushDescriptorApi = pushDescriptorApi; PushDescriptorApi = pushDescriptorApi;
} }
if (Api.TryGetDeviceExtension(_instance, _device, out ExtTransformFeedback transformFeedbackApi)) if (Api.TryGetDeviceExtension(_instance.Instance, _device, out ExtTransformFeedback transformFeedbackApi))
{ {
TransformFeedbackApi = transformFeedbackApi; TransformFeedbackApi = transformFeedbackApi;
} }
if (Api.TryGetDeviceExtension(_instance, _device, out KhrDrawIndirectCount drawIndirectCountApi)) if (Api.TryGetDeviceExtension(_instance.Instance, _device, out KhrDrawIndirectCount drawIndirectCountApi))
{ {
DrawIndirectCountApi = drawIndirectCountApi; DrawIndirectCountApi = drawIndirectCountApi;
} }
@ -154,7 +152,7 @@ namespace Ryujinx.Graphics.Vulkan
SType = StructureType.PhysicalDeviceBlendOperationAdvancedPropertiesExt SType = StructureType.PhysicalDeviceBlendOperationAdvancedPropertiesExt
}; };
bool supportsBlendOperationAdvanced = supportedExtensions.Contains("VK_EXT_blend_operation_advanced"); bool supportsBlendOperationAdvanced = _physicalDevice.IsDeviceExtensionPresent("VK_EXT_blend_operation_advanced");
if (supportsBlendOperationAdvanced) if (supportsBlendOperationAdvanced)
{ {
@ -167,14 +165,14 @@ namespace Ryujinx.Graphics.Vulkan
SType = StructureType.PhysicalDeviceSubgroupSizeControlPropertiesExt SType = StructureType.PhysicalDeviceSubgroupSizeControlPropertiesExt
}; };
bool supportsSubgroupSizeControl = supportedExtensions.Contains("VK_EXT_subgroup_size_control"); bool supportsSubgroupSizeControl = _physicalDevice.IsDeviceExtensionPresent("VK_EXT_subgroup_size_control");
if (supportsSubgroupSizeControl) if (supportsSubgroupSizeControl)
{ {
properties2.PNext = &propertiesSubgroupSizeControl; properties2.PNext = &propertiesSubgroupSizeControl;
} }
bool supportsTransformFeedback = supportedExtensions.Contains(ExtTransformFeedback.ExtensionName); bool supportsTransformFeedback = _physicalDevice.IsDeviceExtensionPresent(ExtTransformFeedback.ExtensionName);
PhysicalDeviceTransformFeedbackPropertiesEXT propertiesTransformFeedback = new PhysicalDeviceTransformFeedbackPropertiesEXT() PhysicalDeviceTransformFeedbackPropertiesEXT propertiesTransformFeedback = new PhysicalDeviceTransformFeedbackPropertiesEXT()
{ {
@ -222,30 +220,30 @@ namespace Ryujinx.Graphics.Vulkan
SType = StructureType.PhysicalDevicePortabilitySubsetFeaturesKhr SType = StructureType.PhysicalDevicePortabilitySubsetFeaturesKhr
}; };
if (supportedExtensions.Contains("VK_EXT_primitive_topology_list_restart")) if (_physicalDevice.IsDeviceExtensionPresent("VK_EXT_primitive_topology_list_restart"))
{ {
features2.PNext = &featuresPrimitiveTopologyListRestart; features2.PNext = &featuresPrimitiveTopologyListRestart;
} }
if (supportedExtensions.Contains("VK_EXT_robustness2")) if (_physicalDevice.IsDeviceExtensionPresent("VK_EXT_robustness2"))
{ {
featuresRobustness2.PNext = features2.PNext; featuresRobustness2.PNext = features2.PNext;
features2.PNext = &featuresRobustness2; features2.PNext = &featuresRobustness2;
} }
if (supportedExtensions.Contains("VK_KHR_shader_float16_int8")) if (_physicalDevice.IsDeviceExtensionPresent("VK_KHR_shader_float16_int8"))
{ {
featuresShaderInt8.PNext = features2.PNext; featuresShaderInt8.PNext = features2.PNext;
features2.PNext = &featuresShaderInt8; features2.PNext = &featuresShaderInt8;
} }
if (supportedExtensions.Contains("VK_EXT_custom_border_color")) if (_physicalDevice.IsDeviceExtensionPresent("VK_EXT_custom_border_color"))
{ {
featuresCustomBorderColor.PNext = features2.PNext; featuresCustomBorderColor.PNext = features2.PNext;
features2.PNext = &featuresCustomBorderColor; features2.PNext = &featuresCustomBorderColor;
} }
bool usePortability = supportedExtensions.Contains("VK_KHR_portability_subset"); bool usePortability = _physicalDevice.IsDeviceExtensionPresent("VK_KHR_portability_subset");
if (usePortability) if (usePortability)
{ {
@ -256,8 +254,8 @@ namespace Ryujinx.Graphics.Vulkan
features2.PNext = &featuresPortabilitySubset; features2.PNext = &featuresPortabilitySubset;
} }
Api.GetPhysicalDeviceProperties2(_physicalDevice, &properties2); Api.GetPhysicalDeviceProperties2(_physicalDevice.PhysicalDevice, &properties2);
Api.GetPhysicalDeviceFeatures2(_physicalDevice, &features2); Api.GetPhysicalDeviceFeatures2(_physicalDevice.PhysicalDevice, &features2);
var portabilityFlags = PortabilitySubsetFlags.None; var portabilityFlags = PortabilitySubsetFlags.None;
uint vertexBufferAlignment = 1; uint vertexBufferAlignment = 1;
@ -272,7 +270,7 @@ namespace Ryujinx.Graphics.Vulkan
portabilityFlags |= featuresPortabilitySubset.SamplerMipLodBias ? 0 : PortabilitySubsetFlags.NoLodBias; portabilityFlags |= featuresPortabilitySubset.SamplerMipLodBias ? 0 : PortabilitySubsetFlags.NoLodBias;
} }
bool supportsCustomBorderColor = supportedExtensions.Contains("VK_EXT_custom_border_color") && bool supportsCustomBorderColor = _physicalDevice.IsDeviceExtensionPresent("VK_EXT_custom_border_color") &&
featuresCustomBorderColor.CustomBorderColors && featuresCustomBorderColor.CustomBorderColors &&
featuresCustomBorderColor.CustomBorderColorWithoutFormat; featuresCustomBorderColor.CustomBorderColorWithoutFormat;
@ -284,30 +282,30 @@ namespace Ryujinx.Graphics.Vulkan
properties.Limits.FramebufferStencilSampleCounts; properties.Limits.FramebufferStencilSampleCounts;
Capabilities = new HardwareCapabilities( Capabilities = new HardwareCapabilities(
supportedExtensions.Contains("VK_EXT_index_type_uint8"), _physicalDevice.IsDeviceExtensionPresent("VK_EXT_index_type_uint8"),
supportsCustomBorderColor, supportsCustomBorderColor,
supportsBlendOperationAdvanced, supportsBlendOperationAdvanced,
propertiesBlendOperationAdvanced.AdvancedBlendCorrelatedOverlap, propertiesBlendOperationAdvanced.AdvancedBlendCorrelatedOverlap,
propertiesBlendOperationAdvanced.AdvancedBlendNonPremultipliedSrcColor, propertiesBlendOperationAdvanced.AdvancedBlendNonPremultipliedSrcColor,
propertiesBlendOperationAdvanced.AdvancedBlendNonPremultipliedDstColor, propertiesBlendOperationAdvanced.AdvancedBlendNonPremultipliedDstColor,
supportedExtensions.Contains(KhrDrawIndirectCount.ExtensionName), _physicalDevice.IsDeviceExtensionPresent(KhrDrawIndirectCount.ExtensionName),
supportedExtensions.Contains("VK_EXT_fragment_shader_interlock"), _physicalDevice.IsDeviceExtensionPresent("VK_EXT_fragment_shader_interlock"),
supportedExtensions.Contains("VK_NV_geometry_shader_passthrough"), _physicalDevice.IsDeviceExtensionPresent("VK_NV_geometry_shader_passthrough"),
supportsSubgroupSizeControl, supportsSubgroupSizeControl,
featuresShaderInt8.ShaderInt8, featuresShaderInt8.ShaderInt8,
supportedExtensions.Contains("VK_EXT_shader_stencil_export"), _physicalDevice.IsDeviceExtensionPresent("VK_EXT_shader_stencil_export"),
supportedExtensions.Contains(ExtConditionalRendering.ExtensionName), _physicalDevice.IsDeviceExtensionPresent(ExtConditionalRendering.ExtensionName),
supportedExtensions.Contains(ExtExtendedDynamicState.ExtensionName), _physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState.ExtensionName),
features2.Features.MultiViewport, features2.Features.MultiViewport,
featuresRobustness2.NullDescriptor || IsMoltenVk, featuresRobustness2.NullDescriptor || IsMoltenVk,
supportedExtensions.Contains(KhrPushDescriptor.ExtensionName), _physicalDevice.IsDeviceExtensionPresent(KhrPushDescriptor.ExtensionName),
featuresPrimitiveTopologyListRestart.PrimitiveTopologyListRestart, featuresPrimitiveTopologyListRestart.PrimitiveTopologyListRestart,
featuresPrimitiveTopologyListRestart.PrimitiveTopologyPatchListRestart, featuresPrimitiveTopologyListRestart.PrimitiveTopologyPatchListRestart,
supportsTransformFeedback, supportsTransformFeedback,
propertiesTransformFeedback.TransformFeedbackQueries, propertiesTransformFeedback.TransformFeedbackQueries,
features2.Features.OcclusionQueryPrecise, features2.Features.OcclusionQueryPrecise,
supportedFeatures.PipelineStatisticsQuery, _physicalDevice.PhysicalDeviceFeatures.PipelineStatisticsQuery,
supportedFeatures.GeometryShader, _physicalDevice.PhysicalDeviceFeatures.GeometryShader,
propertiesSubgroupSizeControl.MinSubgroupSize, propertiesSubgroupSizeControl.MinSubgroupSize,
propertiesSubgroupSizeControl.MaxSubgroupSize, propertiesSubgroupSizeControl.MaxSubgroupSize,
propertiesSubgroupSizeControl.RequiredSubgroupSizeStages, propertiesSubgroupSizeControl.RequiredSubgroupSizeStages,
@ -315,9 +313,9 @@ namespace Ryujinx.Graphics.Vulkan
portabilityFlags, portabilityFlags,
vertexBufferAlignment); vertexBufferAlignment);
IsSharedMemory = MemoryAllocator.IsDeviceMemoryShared(Api, _physicalDevice); IsSharedMemory = MemoryAllocator.IsDeviceMemoryShared(_physicalDevice);
MemoryAllocator = new MemoryAllocator(Api, _physicalDevice, _device, properties.Limits.MaxMemoryAllocationCount); MemoryAllocator = new MemoryAllocator(Api, _physicalDevice, _device);
CommandBufferPool = new CommandBufferPool(Api, _device, Queue, QueueLock, queueFamilyIndex); CommandBufferPool = new CommandBufferPool(Api, _device, Queue, QueueLock, queueFamilyIndex);
@ -329,7 +327,7 @@ namespace Ryujinx.Graphics.Vulkan
BufferManager = new BufferManager(this, _device); BufferManager = new BufferManager(this, _device);
_syncManager = new SyncManager(this, _device); SyncManager = new SyncManager(this, _device);
_pipeline = new PipelineFull(this, _device); _pipeline = new PipelineFull(this, _device);
_pipeline.Initialize(); _pipeline.Initialize();
@ -345,22 +343,21 @@ namespace Ryujinx.Graphics.Vulkan
Api = api; Api = api;
_instance = VulkanInitialization.CreateInstance(api, logLevel, _getRequiredExtensions()); _instance = VulkanInitialization.CreateInstance(api, logLevel, _getRequiredExtensions());
_debugMessenger = new VulkanDebugMessenger(api, _instance, logLevel); _debugMessenger = new VulkanDebugMessenger(api, _instance.Instance, logLevel);
if (api.TryGetInstanceExtension(_instance, out KhrSurface surfaceApi)) if (api.TryGetInstanceExtension(_instance.Instance, out KhrSurface surfaceApi))
{ {
SurfaceApi = surfaceApi; SurfaceApi = surfaceApi;
} }
_surface = _getSurface(_instance, api); _surface = _getSurface(_instance.Instance, api);
_physicalDevice = VulkanInitialization.FindSuitablePhysicalDevice(api, _instance, _surface, _preferredGpuId); _physicalDevice = VulkanInitialization.FindSuitablePhysicalDevice(api, _instance, _surface, _preferredGpuId);
var queueFamilyIndex = VulkanInitialization.FindSuitableQueueFamily(api, _physicalDevice, _surface, out uint maxQueueCount); var queueFamilyIndex = VulkanInitialization.FindSuitableQueueFamily(api, _physicalDevice, _surface, out uint maxQueueCount);
var supportedExtensions = VulkanInitialization.GetSupportedExtensions(api, _physicalDevice);
_device = VulkanInitialization.CreateDevice(api, _physicalDevice, queueFamilyIndex, supportedExtensions, maxQueueCount); _device = VulkanInitialization.CreateDevice(api, _physicalDevice, queueFamilyIndex, maxQueueCount);
if (api.TryGetDeviceExtension(_instance, _device, out KhrSwapchain swapchainApi)) if (api.TryGetDeviceExtension(_instance.Instance, _device, out KhrSwapchain swapchainApi))
{ {
SwapchainApi = swapchainApi; SwapchainApi = swapchainApi;
} }
@ -369,9 +366,9 @@ namespace Ryujinx.Graphics.Vulkan
Queue = queue; Queue = queue;
QueueLock = new object(); QueueLock = new object();
LoadFeatures(supportedExtensions, maxQueueCount, queueFamilyIndex); LoadFeatures(maxQueueCount, queueFamilyIndex);
_window = new Window(this, _surface, _physicalDevice, _device); _window = new Window(this, _surface, _physicalDevice.PhysicalDevice, _device);
_initialized = true; _initialized = true;
} }
@ -439,7 +436,7 @@ namespace Ryujinx.Graphics.Vulkan
internal void RegisterFlush() internal void RegisterFlush()
{ {
_syncManager.RegisterFlush(); SyncManager.RegisterFlush();
} }
public PinnedSpan<byte> GetBufferData(BufferHandle buffer, int offset, int size) public PinnedSpan<byte> GetBufferData(BufferHandle buffer, int offset, int size)
@ -536,10 +533,9 @@ namespace Ryujinx.Graphics.Vulkan
PNext = &featuresVk12 PNext = &featuresVk12
}; };
Api.GetPhysicalDeviceFeatures2(_physicalDevice, &features2); Api.GetPhysicalDeviceFeatures2(_physicalDevice.PhysicalDevice, &features2);
Api.GetPhysicalDeviceProperties(_physicalDevice, out var properties);
var limits = properties.Limits; var limits = _physicalDevice.PhysicalDeviceProperties.Limits;
return new Capabilities( return new Capabilities(
api: TargetApi.Vulkan, api: TargetApi.Vulkan,
@ -623,7 +619,7 @@ namespace Ryujinx.Graphics.Vulkan
private unsafe void PrintGpuInformation() private unsafe void PrintGpuInformation()
{ {
Api.GetPhysicalDeviceProperties(_physicalDevice, out var properties); var properties = _physicalDevice.PhysicalDeviceProperties;
string vendorName = VendorUtils.GetNameFromId(properties.VendorID); string vendorName = VendorUtils.GetNameFromId(properties.VendorID);
@ -700,7 +696,7 @@ namespace Ryujinx.Graphics.Vulkan
public void PreFrame() public void PreFrame()
{ {
_syncManager.Cleanup(); SyncManager.Cleanup();
} }
public ICounterEvent ReportCounter(CounterType type, EventHandler<ulong> resultHandler, bool hostReserved) public ICounterEvent ReportCounter(CounterType type, EventHandler<ulong> resultHandler, bool hostReserved)
@ -740,7 +736,7 @@ namespace Ryujinx.Graphics.Vulkan
public void CreateSync(ulong id, bool strict) public void CreateSync(ulong id, bool strict)
{ {
_syncManager.Create(id, strict); SyncManager.Create(id, strict);
} }
public IProgram LoadProgramBinary(byte[] programBinary, bool isFragment, ShaderInfo info) public IProgram LoadProgramBinary(byte[] programBinary, bool isFragment, ShaderInfo info)
@ -750,12 +746,12 @@ namespace Ryujinx.Graphics.Vulkan
public void WaitSync(ulong id) public void WaitSync(ulong id)
{ {
_syncManager.Wait(id); SyncManager.Wait(id);
} }
public ulong GetCurrentSync() public ulong GetCurrentSync()
{ {
return _syncManager.GetCurrent(); return SyncManager.GetCurrent();
} }
public void SetInterruptAction(Action<Action> interruptAction) public void SetInterruptAction(Action<Action> interruptAction)
@ -807,14 +803,14 @@ namespace Ryujinx.Graphics.Vulkan
sampler.Dispose(); sampler.Dispose();
} }
SurfaceApi.DestroySurface(_instance, _surface, null); SurfaceApi.DestroySurface(_instance.Instance, _surface, null);
Api.DestroyDevice(_device, null); Api.DestroyDevice(_device, null);
_debugMessenger.Dispose(); _debugMessenger.Dispose();
// Last step destroy the instance // Last step destroy the instance
Api.DestroyInstance(_instance, null); _instance.Dispose();
} }
} }
} }

View File

@ -55,7 +55,7 @@ namespace Ryujinx.HLE.Exceptions
if (callingType != null && callingMethod != null) if (callingType != null && callingMethod != null)
{ {
// If the type is past 0xF, we are using TIPC // If the type is past 0xF, we are using TIPC
var ipcCommands = Request.Type > IpcMessageType.TipcCloseSession ? Service.TipcCommands : Service.HipcCommands; var ipcCommands = Request.Type > IpcMessageType.TipcCloseSession ? Service.TipcCommands : Service.CmifCommands;
// Find the handler for the method called // Find the handler for the method called
var ipcHandler = ipcCommands.FirstOrDefault(x => x.Value == callingMethod); var ipcHandler = ipcCommands.FirstOrDefault(x => x.Value == callingMethod);

View File

@ -88,7 +88,7 @@ namespace Ryujinx.HLE.HOS.Ipc
long recvListPos = reader.BaseStream.Position + rawDataSize; long recvListPos = reader.BaseStream.Position + rawDataSize;
// only HIPC have the padding requirements. // Only CMIF has the padding requirements.
if (Type < IpcMessageType.TipcCloseSession) if (Type < IpcMessageType.TipcCloseSession)
{ {
long pad0 = GetPadSize16(reader.BaseStream.Position + cmdPtr); long pad0 = GetPadSize16(reader.BaseStream.Position + cmdPtr);

View File

@ -2,12 +2,12 @@ namespace Ryujinx.HLE.HOS.Ipc
{ {
enum IpcMessageType enum IpcMessageType
{ {
HipcResponse = 0, CmifResponse = 0,
HipcCloseSession = 2, CmifCloseSession = 2,
HipcRequest = 4, CmifRequest = 4,
HipcControl = 5, CmifControl = 5,
HipcRequestWithContext = 6, CmifRequestWithContext = 6,
HipcControlWithContext = 7, CmifControlWithContext = 7,
TipcCloseSession = 0xF TipcCloseSession = 0xF
} }
} }

View File

@ -9,21 +9,21 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService
_managerServer = new ManagerServer(userId); _managerServer = new ManagerServer(userId);
} }
[CommandHipc(0)] [CommandCmif(0)]
// CheckAvailability() // CheckAvailability()
public ResultCode CheckAvailability(ServiceCtx context) public ResultCode CheckAvailability(ServiceCtx context)
{ {
return _managerServer.CheckAvailability(context); return _managerServer.CheckAvailability(context);
} }
[CommandHipc(1)] [CommandCmif(1)]
// GetAccountId() -> nn::account::NetworkServiceAccountId // GetAccountId() -> nn::account::NetworkServiceAccountId
public ResultCode GetAccountId(ServiceCtx context) public ResultCode GetAccountId(ServiceCtx context)
{ {
return _managerServer.GetAccountId(context); return _managerServer.GetAccountId(context);
} }
[CommandHipc(2)] [CommandCmif(2)]
// EnsureIdTokenCacheAsync() -> object<nn::account::detail::IAsyncContext> // EnsureIdTokenCacheAsync() -> object<nn::account::detail::IAsyncContext>
public ResultCode EnsureIdTokenCacheAsync(ServiceCtx context) public ResultCode EnsureIdTokenCacheAsync(ServiceCtx context)
{ {
@ -37,28 +37,28 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService
return resultCode; return resultCode;
} }
[CommandHipc(3)] [CommandCmif(3)]
// LoadIdTokenCache() -> (u32 id_token_cache_size, buffer<bytes, 6>) // LoadIdTokenCache() -> (u32 id_token_cache_size, buffer<bytes, 6>)
public ResultCode LoadIdTokenCache(ServiceCtx context) public ResultCode LoadIdTokenCache(ServiceCtx context)
{ {
return _managerServer.LoadIdTokenCache(context); return _managerServer.LoadIdTokenCache(context);
} }
[CommandHipc(130)] [CommandCmif(130)]
// GetNintendoAccountUserResourceCacheForApplication() -> (nn::account::NintendoAccountId, nn::account::nas::NasUserBaseForApplication, buffer<bytes, 6>) // GetNintendoAccountUserResourceCacheForApplication() -> (nn::account::NintendoAccountId, nn::account::nas::NasUserBaseForApplication, buffer<bytes, 6>)
public ResultCode GetNintendoAccountUserResourceCacheForApplication(ServiceCtx context) public ResultCode GetNintendoAccountUserResourceCacheForApplication(ServiceCtx context)
{ {
return _managerServer.GetNintendoAccountUserResourceCacheForApplication(context); return _managerServer.GetNintendoAccountUserResourceCacheForApplication(context);
} }
[CommandHipc(160)] // 5.0.0+ [CommandCmif(160)] // 5.0.0+
// StoreOpenContext() // StoreOpenContext()
public ResultCode StoreOpenContext(ServiceCtx context) public ResultCode StoreOpenContext(ServiceCtx context)
{ {
return _managerServer.StoreOpenContext(context); return _managerServer.StoreOpenContext(context);
} }
[CommandHipc(170)] // 6.0.0+ [CommandCmif(170)] // 6.0.0+
// LoadNetworkServiceLicenseKindAsync() -> object<nn::account::detail::IAsyncNetworkServiceLicenseKindContext> // LoadNetworkServiceLicenseKindAsync() -> object<nn::account::detail::IAsyncNetworkServiceLicenseKindContext>
public ResultCode LoadNetworkServiceLicenseKindAsync(ServiceCtx context) public ResultCode LoadNetworkServiceLicenseKindAsync(ServiceCtx context)
{ {

View File

@ -9,21 +9,21 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService
_managerServer = new ManagerServer(userId); _managerServer = new ManagerServer(userId);
} }
[CommandHipc(0)] [CommandCmif(0)]
// CheckAvailability() // CheckAvailability()
public ResultCode CheckAvailability(ServiceCtx context) public ResultCode CheckAvailability(ServiceCtx context)
{ {
return _managerServer.CheckAvailability(context); return _managerServer.CheckAvailability(context);
} }
[CommandHipc(1)] [CommandCmif(1)]
// GetAccountId() -> nn::account::NetworkServiceAccountId // GetAccountId() -> nn::account::NetworkServiceAccountId
public ResultCode GetAccountId(ServiceCtx context) public ResultCode GetAccountId(ServiceCtx context)
{ {
return _managerServer.GetAccountId(context); return _managerServer.GetAccountId(context);
} }
[CommandHipc(2)] [CommandCmif(2)]
// EnsureIdTokenCacheAsync() -> object<nn::account::detail::IAsyncContext> // EnsureIdTokenCacheAsync() -> object<nn::account::detail::IAsyncContext>
public ResultCode EnsureIdTokenCacheAsync(ServiceCtx context) public ResultCode EnsureIdTokenCacheAsync(ServiceCtx context)
{ {
@ -37,7 +37,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService
return resultCode; return resultCode;
} }
[CommandHipc(3)] [CommandCmif(3)]
// LoadIdTokenCache() -> (u32 id_token_cache_size, buffer<bytes, 6>) // LoadIdTokenCache() -> (u32 id_token_cache_size, buffer<bytes, 6>)
public ResultCode LoadIdTokenCache(ServiceCtx context) public ResultCode LoadIdTokenCache(ServiceCtx context)
{ {

View File

@ -9,28 +9,28 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService
_profileServer = new ProfileServer(profile); _profileServer = new ProfileServer(profile);
} }
[CommandHipc(0)] [CommandCmif(0)]
// Get() -> (nn::account::profile::ProfileBase, buffer<nn::account::profile::UserData, 0x1a>) // Get() -> (nn::account::profile::ProfileBase, buffer<nn::account::profile::UserData, 0x1a>)
public ResultCode Get(ServiceCtx context) public ResultCode Get(ServiceCtx context)
{ {
return _profileServer.Get(context); return _profileServer.Get(context);
} }
[CommandHipc(1)] [CommandCmif(1)]
// GetBase() -> nn::account::profile::ProfileBase // GetBase() -> nn::account::profile::ProfileBase
public ResultCode GetBase(ServiceCtx context) public ResultCode GetBase(ServiceCtx context)
{ {
return _profileServer.GetBase(context); return _profileServer.GetBase(context);
} }
[CommandHipc(10)] [CommandCmif(10)]
// GetImageSize() -> u32 // GetImageSize() -> u32
public ResultCode GetImageSize(ServiceCtx context) public ResultCode GetImageSize(ServiceCtx context)
{ {
return _profileServer.GetImageSize(context); return _profileServer.GetImageSize(context);
} }
[CommandHipc(11)] [CommandCmif(11)]
// LoadImage() -> (u32, buffer<bytes, 6>) // LoadImage() -> (u32, buffer<bytes, 6>)
public ResultCode LoadImage(ServiceCtx context) public ResultCode LoadImage(ServiceCtx context)
{ {

View File

@ -9,42 +9,42 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService
_profileServer = new ProfileServer(profile); _profileServer = new ProfileServer(profile);
} }
[CommandHipc(0)] [CommandCmif(0)]
// Get() -> (nn::account::profile::ProfileBase, buffer<nn::account::profile::UserData, 0x1a>) // Get() -> (nn::account::profile::ProfileBase, buffer<nn::account::profile::UserData, 0x1a>)
public ResultCode Get(ServiceCtx context) public ResultCode Get(ServiceCtx context)
{ {
return _profileServer.Get(context); return _profileServer.Get(context);
} }
[CommandHipc(1)] [CommandCmif(1)]
// GetBase() -> nn::account::profile::ProfileBase // GetBase() -> nn::account::profile::ProfileBase
public ResultCode GetBase(ServiceCtx context) public ResultCode GetBase(ServiceCtx context)
{ {
return _profileServer.GetBase(context); return _profileServer.GetBase(context);
} }
[CommandHipc(10)] [CommandCmif(10)]
// GetImageSize() -> u32 // GetImageSize() -> u32
public ResultCode GetImageSize(ServiceCtx context) public ResultCode GetImageSize(ServiceCtx context)
{ {
return _profileServer.GetImageSize(context); return _profileServer.GetImageSize(context);
} }
[CommandHipc(11)] [CommandCmif(11)]
// LoadImage() -> (u32, buffer<bytes, 6>) // LoadImage() -> (u32, buffer<bytes, 6>)
public ResultCode LoadImage(ServiceCtx context) public ResultCode LoadImage(ServiceCtx context)
{ {
return _profileServer.LoadImage(context); return _profileServer.LoadImage(context);
} }
[CommandHipc(100)] [CommandCmif(100)]
// Store(nn::account::profile::ProfileBase, buffer<nn::account::profile::UserData, 0x19>) // Store(nn::account::profile::ProfileBase, buffer<nn::account::profile::UserData, 0x19>)
public ResultCode Store(ServiceCtx context) public ResultCode Store(ServiceCtx context)
{ {
return _profileServer.Store(context); return _profileServer.Store(context);
} }
[CommandHipc(101)] [CommandCmif(101)]
// StoreWithImage(nn::account::profile::ProfileBase, buffer<nn::account::profile::UserData, 0x19>, buffer<bytes, 5>) // StoreWithImage(nn::account::profile::ProfileBase, buffer<nn::account::profile::UserData, 0x19>, buffer<bytes, 5>)
public ResultCode StoreWithImage(ServiceCtx context) public ResultCode StoreWithImage(ServiceCtx context)
{ {

View File

@ -14,42 +14,42 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
_applicationServiceServer = new ApplicationServiceServer(serviceFlag); _applicationServiceServer = new ApplicationServiceServer(serviceFlag);
} }
[CommandHipc(0)] [CommandCmif(0)]
// GetUserCount() -> i32 // GetUserCount() -> i32
public ResultCode GetUserCount(ServiceCtx context) public ResultCode GetUserCount(ServiceCtx context)
{ {
return _applicationServiceServer.GetUserCountImpl(context); return _applicationServiceServer.GetUserCountImpl(context);
} }
[CommandHipc(1)] [CommandCmif(1)]
// GetUserExistence(nn::account::Uid) -> bool // GetUserExistence(nn::account::Uid) -> bool
public ResultCode GetUserExistence(ServiceCtx context) public ResultCode GetUserExistence(ServiceCtx context)
{ {
return _applicationServiceServer.GetUserExistenceImpl(context); return _applicationServiceServer.GetUserExistenceImpl(context);
} }
[CommandHipc(2)] [CommandCmif(2)]
// ListAllUsers() -> array<nn::account::Uid, 0xa> // ListAllUsers() -> array<nn::account::Uid, 0xa>
public ResultCode ListAllUsers(ServiceCtx context) public ResultCode ListAllUsers(ServiceCtx context)
{ {
return _applicationServiceServer.ListAllUsers(context); return _applicationServiceServer.ListAllUsers(context);
} }
[CommandHipc(3)] [CommandCmif(3)]
// ListOpenUsers() -> array<nn::account::Uid, 0xa> // ListOpenUsers() -> array<nn::account::Uid, 0xa>
public ResultCode ListOpenUsers(ServiceCtx context) public ResultCode ListOpenUsers(ServiceCtx context)
{ {
return _applicationServiceServer.ListOpenUsers(context); return _applicationServiceServer.ListOpenUsers(context);
} }
[CommandHipc(4)] [CommandCmif(4)]
// GetLastOpenedUser() -> nn::account::Uid // GetLastOpenedUser() -> nn::account::Uid
public ResultCode GetLastOpenedUser(ServiceCtx context) public ResultCode GetLastOpenedUser(ServiceCtx context)
{ {
return _applicationServiceServer.GetLastOpenedUser(context); return _applicationServiceServer.GetLastOpenedUser(context);
} }
[CommandHipc(5)] [CommandCmif(5)]
// GetProfile(nn::account::Uid) -> object<nn::account::profile::IProfile> // GetProfile(nn::account::Uid) -> object<nn::account::profile::IProfile>
public ResultCode GetProfile(ServiceCtx context) public ResultCode GetProfile(ServiceCtx context)
{ {
@ -63,7 +63,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
return resultCode; return resultCode;
} }
[CommandHipc(50)] [CommandCmif(50)]
// IsUserRegistrationRequestPermitted(pid) -> bool // IsUserRegistrationRequestPermitted(pid) -> bool
public ResultCode IsUserRegistrationRequestPermitted(ServiceCtx context) public ResultCode IsUserRegistrationRequestPermitted(ServiceCtx context)
{ {
@ -72,14 +72,14 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
return _applicationServiceServer.IsUserRegistrationRequestPermitted(context); return _applicationServiceServer.IsUserRegistrationRequestPermitted(context);
} }
[CommandHipc(51)] [CommandCmif(51)]
// TrySelectUserWithoutInteraction(bool) -> nn::account::Uid // TrySelectUserWithoutInteraction(bool) -> nn::account::Uid
public ResultCode TrySelectUserWithoutInteraction(ServiceCtx context) public ResultCode TrySelectUserWithoutInteraction(ServiceCtx context)
{ {
return _applicationServiceServer.TrySelectUserWithoutInteraction(context); return _applicationServiceServer.TrySelectUserWithoutInteraction(context);
} }
[CommandHipc(102)] [CommandCmif(102)]
// GetBaasAccountManagerForSystemService(nn::account::Uid) -> object<nn::account::baas::IManagerForApplication> // GetBaasAccountManagerForSystemService(nn::account::Uid) -> object<nn::account::baas::IManagerForApplication>
public ResultCode GetBaasAccountManagerForSystemService(ServiceCtx context) public ResultCode GetBaasAccountManagerForSystemService(ServiceCtx context)
{ {
@ -98,14 +98,14 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(140)] // 6.0.0+ [CommandCmif(140)] // 6.0.0+
// ListQualifiedUsers() -> array<nn::account::Uid, 0xa> // ListQualifiedUsers() -> array<nn::account::Uid, 0xa>
public ResultCode ListQualifiedUsers(ServiceCtx context) public ResultCode ListQualifiedUsers(ServiceCtx context)
{ {
return _applicationServiceServer.ListQualifiedUsers(context); return _applicationServiceServer.ListQualifiedUsers(context);
} }
[CommandHipc(205)] [CommandCmif(205)]
// GetProfileEditor(nn::account::Uid) -> object<nn::account::profile::IProfileEditor> // GetProfileEditor(nn::account::Uid) -> object<nn::account::profile::IProfileEditor>
public ResultCode GetProfileEditor(ServiceCtx context) public ResultCode GetProfileEditor(ServiceCtx context)
{ {

View File

@ -14,42 +14,42 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
_applicationServiceServer = new ApplicationServiceServer(serviceFlag); _applicationServiceServer = new ApplicationServiceServer(serviceFlag);
} }
[CommandHipc(0)] [CommandCmif(0)]
// GetUserCount() -> i32 // GetUserCount() -> i32
public ResultCode GetUserCount(ServiceCtx context) public ResultCode GetUserCount(ServiceCtx context)
{ {
return _applicationServiceServer.GetUserCountImpl(context); return _applicationServiceServer.GetUserCountImpl(context);
} }
[CommandHipc(1)] [CommandCmif(1)]
// GetUserExistence(nn::account::Uid) -> bool // GetUserExistence(nn::account::Uid) -> bool
public ResultCode GetUserExistence(ServiceCtx context) public ResultCode GetUserExistence(ServiceCtx context)
{ {
return _applicationServiceServer.GetUserExistenceImpl(context); return _applicationServiceServer.GetUserExistenceImpl(context);
} }
[CommandHipc(2)] [CommandCmif(2)]
// ListAllUsers() -> array<nn::account::Uid, 0xa> // ListAllUsers() -> array<nn::account::Uid, 0xa>
public ResultCode ListAllUsers(ServiceCtx context) public ResultCode ListAllUsers(ServiceCtx context)
{ {
return _applicationServiceServer.ListAllUsers(context); return _applicationServiceServer.ListAllUsers(context);
} }
[CommandHipc(3)] [CommandCmif(3)]
// ListOpenUsers() -> array<nn::account::Uid, 0xa> // ListOpenUsers() -> array<nn::account::Uid, 0xa>
public ResultCode ListOpenUsers(ServiceCtx context) public ResultCode ListOpenUsers(ServiceCtx context)
{ {
return _applicationServiceServer.ListOpenUsers(context); return _applicationServiceServer.ListOpenUsers(context);
} }
[CommandHipc(4)] [CommandCmif(4)]
// GetLastOpenedUser() -> nn::account::Uid // GetLastOpenedUser() -> nn::account::Uid
public ResultCode GetLastOpenedUser(ServiceCtx context) public ResultCode GetLastOpenedUser(ServiceCtx context)
{ {
return _applicationServiceServer.GetLastOpenedUser(context); return _applicationServiceServer.GetLastOpenedUser(context);
} }
[CommandHipc(5)] [CommandCmif(5)]
// GetProfile(nn::account::Uid) -> object<nn::account::profile::IProfile> // GetProfile(nn::account::Uid) -> object<nn::account::profile::IProfile>
public ResultCode GetProfile(ServiceCtx context) public ResultCode GetProfile(ServiceCtx context)
{ {
@ -63,7 +63,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
return resultCode; return resultCode;
} }
[CommandHipc(50)] [CommandCmif(50)]
// IsUserRegistrationRequestPermitted(pid) -> bool // IsUserRegistrationRequestPermitted(pid) -> bool
public ResultCode IsUserRegistrationRequestPermitted(ServiceCtx context) public ResultCode IsUserRegistrationRequestPermitted(ServiceCtx context)
{ {
@ -71,16 +71,16 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
return _applicationServiceServer.IsUserRegistrationRequestPermitted(context); return _applicationServiceServer.IsUserRegistrationRequestPermitted(context);
} }
[CommandHipc(51)] [CommandCmif(51)]
// TrySelectUserWithoutInteraction(bool) -> nn::account::Uid // TrySelectUserWithoutInteraction(bool) -> nn::account::Uid
public ResultCode TrySelectUserWithoutInteraction(ServiceCtx context) public ResultCode TrySelectUserWithoutInteraction(ServiceCtx context)
{ {
return _applicationServiceServer.TrySelectUserWithoutInteraction(context); return _applicationServiceServer.TrySelectUserWithoutInteraction(context);
} }
[CommandHipc(100)] [CommandCmif(100)]
[CommandHipc(140)] // 6.0.0+ [CommandCmif(140)] // 6.0.0+
[CommandHipc(160)] // 13.0.0+ [CommandCmif(160)] // 13.0.0+
// InitializeApplicationInfo(u64 pid_placeholder, pid) // InitializeApplicationInfo(u64 pid_placeholder, pid)
public ResultCode InitializeApplicationInfo(ServiceCtx context) public ResultCode InitializeApplicationInfo(ServiceCtx context)
{ {
@ -105,7 +105,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(101)] [CommandCmif(101)]
// GetBaasAccountManagerForApplication(nn::account::Uid) -> object<nn::account::baas::IManagerForApplication> // GetBaasAccountManagerForApplication(nn::account::Uid) -> object<nn::account::baas::IManagerForApplication>
public ResultCode GetBaasAccountManagerForApplication(ServiceCtx context) public ResultCode GetBaasAccountManagerForApplication(ServiceCtx context)
{ {
@ -124,7 +124,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(103)] // 4.0.0+ [CommandCmif(103)] // 4.0.0+
// CheckNetworkServiceAvailabilityAsync() -> object<nn::account::detail::IAsyncContext> // CheckNetworkServiceAvailabilityAsync() -> object<nn::account::detail::IAsyncContext>
public ResultCode CheckNetworkServiceAvailabilityAsync(ServiceCtx context) public ResultCode CheckNetworkServiceAvailabilityAsync(ServiceCtx context)
{ {
@ -138,21 +138,21 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
return resultCode; return resultCode;
} }
[CommandHipc(110)] [CommandCmif(110)]
// StoreSaveDataThumbnail(nn::account::Uid, buffer<bytes, 5>) // StoreSaveDataThumbnail(nn::account::Uid, buffer<bytes, 5>)
public ResultCode StoreSaveDataThumbnail(ServiceCtx context) public ResultCode StoreSaveDataThumbnail(ServiceCtx context)
{ {
return _applicationServiceServer.StoreSaveDataThumbnail(context); return _applicationServiceServer.StoreSaveDataThumbnail(context);
} }
[CommandHipc(111)] [CommandCmif(111)]
// ClearSaveDataThumbnail(nn::account::Uid) // ClearSaveDataThumbnail(nn::account::Uid)
public ResultCode ClearSaveDataThumbnail(ServiceCtx context) public ResultCode ClearSaveDataThumbnail(ServiceCtx context)
{ {
return _applicationServiceServer.ClearSaveDataThumbnail(context); return _applicationServiceServer.ClearSaveDataThumbnail(context);
} }
[CommandHipc(130)] // 5.0.0+ [CommandCmif(130)] // 5.0.0+
// LoadOpenContext(nn::account::Uid) -> object<nn::account::baas::IManagerForApplication> // LoadOpenContext(nn::account::Uid) -> object<nn::account::baas::IManagerForApplication>
public ResultCode LoadOpenContext(ServiceCtx context) public ResultCode LoadOpenContext(ServiceCtx context)
{ {
@ -168,22 +168,22 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(60)] // 5.0.0-5.1.0 [CommandCmif(60)] // 5.0.0-5.1.0
[CommandHipc(131)] // 6.0.0+ [CommandCmif(131)] // 6.0.0+
// ListOpenContextStoredUsers() -> array<nn::account::Uid, 0xa> // ListOpenContextStoredUsers() -> array<nn::account::Uid, 0xa>
public ResultCode ListOpenContextStoredUsers(ServiceCtx context) public ResultCode ListOpenContextStoredUsers(ServiceCtx context)
{ {
return _applicationServiceServer.ListOpenContextStoredUsers(context); return _applicationServiceServer.ListOpenContextStoredUsers(context);
} }
[CommandHipc(141)] // 6.0.0+ [CommandCmif(141)] // 6.0.0+
// ListQualifiedUsers() -> array<nn::account::Uid, 0xa> // ListQualifiedUsers() -> array<nn::account::Uid, 0xa>
public ResultCode ListQualifiedUsers(ServiceCtx context) public ResultCode ListQualifiedUsers(ServiceCtx context)
{ {
return _applicationServiceServer.ListQualifiedUsers(context); return _applicationServiceServer.ListQualifiedUsers(context);
} }
[CommandHipc(150)] // 6.0.0+ [CommandCmif(150)] // 6.0.0+
// IsUserAccountSwitchLocked() -> bool // IsUserAccountSwitchLocked() -> bool
public ResultCode IsUserAccountSwitchLocked(ServiceCtx context) public ResultCode IsUserAccountSwitchLocked(ServiceCtx context)
{ {

View File

@ -13,42 +13,42 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
_applicationServiceServer = new ApplicationServiceServer(serviceFlag); _applicationServiceServer = new ApplicationServiceServer(serviceFlag);
} }
[CommandHipc(0)] [CommandCmif(0)]
// GetUserCount() -> i32 // GetUserCount() -> i32
public ResultCode GetUserCount(ServiceCtx context) public ResultCode GetUserCount(ServiceCtx context)
{ {
return _applicationServiceServer.GetUserCountImpl(context); return _applicationServiceServer.GetUserCountImpl(context);
} }
[CommandHipc(1)] [CommandCmif(1)]
// GetUserExistence(nn::account::Uid) -> bool // GetUserExistence(nn::account::Uid) -> bool
public ResultCode GetUserExistence(ServiceCtx context) public ResultCode GetUserExistence(ServiceCtx context)
{ {
return _applicationServiceServer.GetUserExistenceImpl(context); return _applicationServiceServer.GetUserExistenceImpl(context);
} }
[CommandHipc(2)] [CommandCmif(2)]
// ListAllUsers() -> array<nn::account::Uid, 0xa> // ListAllUsers() -> array<nn::account::Uid, 0xa>
public ResultCode ListAllUsers(ServiceCtx context) public ResultCode ListAllUsers(ServiceCtx context)
{ {
return _applicationServiceServer.ListAllUsers(context); return _applicationServiceServer.ListAllUsers(context);
} }
[CommandHipc(3)] [CommandCmif(3)]
// ListOpenUsers() -> array<nn::account::Uid, 0xa> // ListOpenUsers() -> array<nn::account::Uid, 0xa>
public ResultCode ListOpenUsers(ServiceCtx context) public ResultCode ListOpenUsers(ServiceCtx context)
{ {
return _applicationServiceServer.ListOpenUsers(context); return _applicationServiceServer.ListOpenUsers(context);
} }
[CommandHipc(4)] [CommandCmif(4)]
// GetLastOpenedUser() -> nn::account::Uid // GetLastOpenedUser() -> nn::account::Uid
public ResultCode GetLastOpenedUser(ServiceCtx context) public ResultCode GetLastOpenedUser(ServiceCtx context)
{ {
return _applicationServiceServer.GetLastOpenedUser(context); return _applicationServiceServer.GetLastOpenedUser(context);
} }
[CommandHipc(5)] [CommandCmif(5)]
// GetProfile(nn::account::Uid) -> object<nn::account::profile::IProfile> // GetProfile(nn::account::Uid) -> object<nn::account::profile::IProfile>
public ResultCode GetProfile(ServiceCtx context) public ResultCode GetProfile(ServiceCtx context)
{ {
@ -62,7 +62,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
return resultCode; return resultCode;
} }
[CommandHipc(50)] [CommandCmif(50)]
// IsUserRegistrationRequestPermitted(pid) -> bool // IsUserRegistrationRequestPermitted(pid) -> bool
public ResultCode IsUserRegistrationRequestPermitted(ServiceCtx context) public ResultCode IsUserRegistrationRequestPermitted(ServiceCtx context)
{ {
@ -71,14 +71,14 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
return _applicationServiceServer.IsUserRegistrationRequestPermitted(context); return _applicationServiceServer.IsUserRegistrationRequestPermitted(context);
} }
[CommandHipc(51)] [CommandCmif(51)]
// TrySelectUserWithoutInteraction(bool) -> nn::account::Uid // TrySelectUserWithoutInteraction(bool) -> nn::account::Uid
public ResultCode TrySelectUserWithoutInteraction(ServiceCtx context) public ResultCode TrySelectUserWithoutInteraction(ServiceCtx context)
{ {
return _applicationServiceServer.TrySelectUserWithoutInteraction(context); return _applicationServiceServer.TrySelectUserWithoutInteraction(context);
} }
[CommandHipc(102)] [CommandCmif(102)]
// GetBaasAccountManagerForSystemService(nn::account::Uid) -> object<nn::account::baas::IManagerForApplication> // GetBaasAccountManagerForSystemService(nn::account::Uid) -> object<nn::account::baas::IManagerForApplication>
public ResultCode GetBaasAccountManagerForSystemService(ServiceCtx context) public ResultCode GetBaasAccountManagerForSystemService(ServiceCtx context)
{ {
@ -97,7 +97,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(140)] // 6.0.0+ [CommandCmif(140)] // 6.0.0+
// ListQualifiedUsers() -> array<nn::account::Uid, 0xa> // ListQualifiedUsers() -> array<nn::account::Uid, 0xa>
public ResultCode ListQualifiedUsers(ServiceCtx context) public ResultCode ListQualifiedUsers(ServiceCtx context)
{ {

View File

@ -14,7 +14,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
AsyncExecution = asyncExecution; AsyncExecution = asyncExecution;
} }
[CommandHipc(0)] [CommandCmif(0)]
// GetSystemEvent() -> handle<copy> // GetSystemEvent() -> handle<copy>
public ResultCode GetSystemEvent(ServiceCtx context) public ResultCode GetSystemEvent(ServiceCtx context)
{ {
@ -28,7 +28,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(1)] [CommandCmif(1)]
// Cancel() // Cancel()
public ResultCode Cancel(ServiceCtx context) public ResultCode Cancel(ServiceCtx context)
{ {
@ -45,7 +45,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(2)] [CommandCmif(2)]
// HasDone() -> b8 // HasDone() -> b8
public ResultCode HasDone(ServiceCtx context) public ResultCode HasDone(ServiceCtx context)
{ {
@ -59,7 +59,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(3)] [CommandCmif(3)]
// GetResult() // GetResult()
public ResultCode GetResult(ServiceCtx context) public ResultCode GetResult(ServiceCtx context)
{ {

View File

@ -11,7 +11,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
_serviceLicenseKind = serviceLicenseKind; _serviceLicenseKind = serviceLicenseKind;
} }
[CommandHipc(100)] [CommandCmif(100)]
// GetNetworkServiceLicenseKind() -> nn::account::NetworkServiceLicenseKind // GetNetworkServiceLicenseKind() -> nn::account::NetworkServiceLicenseKind
public ResultCode GetNetworkServiceLicenseKind(ServiceCtx context) public ResultCode GetNetworkServiceLicenseKind(ServiceCtx context)
{ {

View File

@ -12,7 +12,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
_pid = pid; _pid = pid;
} }
[CommandHipc(0)] [CommandCmif(0)]
// GetCommonStateGetter() -> object<nn::am::service::ICommonStateGetter> // GetCommonStateGetter() -> object<nn::am::service::ICommonStateGetter>
public ResultCode GetCommonStateGetter(ServiceCtx context) public ResultCode GetCommonStateGetter(ServiceCtx context)
{ {
@ -21,7 +21,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(1)] [CommandCmif(1)]
// GetSelfController() -> object<nn::am::service::ISelfController> // GetSelfController() -> object<nn::am::service::ISelfController>
public ResultCode GetSelfController(ServiceCtx context) public ResultCode GetSelfController(ServiceCtx context)
{ {
@ -30,7 +30,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(2)] [CommandCmif(2)]
// GetWindowController() -> object<nn::am::service::IWindowController> // GetWindowController() -> object<nn::am::service::IWindowController>
public ResultCode GetWindowController(ServiceCtx context) public ResultCode GetWindowController(ServiceCtx context)
{ {
@ -39,7 +39,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(3)] [CommandCmif(3)]
// GetAudioController() -> object<nn::am::service::IAudioController> // GetAudioController() -> object<nn::am::service::IAudioController>
public ResultCode GetAudioController(ServiceCtx context) public ResultCode GetAudioController(ServiceCtx context)
{ {
@ -48,7 +48,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(4)] [CommandCmif(4)]
// GetDisplayController() -> object<nn::am::service::IDisplayController> // GetDisplayController() -> object<nn::am::service::IDisplayController>
public ResultCode GetDisplayController(ServiceCtx context) public ResultCode GetDisplayController(ServiceCtx context)
{ {
@ -57,7 +57,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(10)] [CommandCmif(10)]
// GetProcessWindingController() -> object<nn::am::service::IProcessWindingController> // GetProcessWindingController() -> object<nn::am::service::IProcessWindingController>
public ResultCode GetProcessWindingController(ServiceCtx context) public ResultCode GetProcessWindingController(ServiceCtx context)
{ {
@ -66,7 +66,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(11)] [CommandCmif(11)]
// GetLibraryAppletCreator() -> object<nn::am::service::ILibraryAppletCreator> // GetLibraryAppletCreator() -> object<nn::am::service::ILibraryAppletCreator>
public ResultCode GetLibraryAppletCreator(ServiceCtx context) public ResultCode GetLibraryAppletCreator(ServiceCtx context)
{ {
@ -75,7 +75,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(20)] [CommandCmif(20)]
// OpenLibraryAppletSelfAccessor() -> object<nn::am::service::ILibraryAppletSelfAccessor> // OpenLibraryAppletSelfAccessor() -> object<nn::am::service::ILibraryAppletSelfAccessor>
public ResultCode OpenLibraryAppletSelfAccessor(ServiceCtx context) public ResultCode OpenLibraryAppletSelfAccessor(ServiceCtx context)
{ {
@ -84,7 +84,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(21)] [CommandCmif(21)]
// GetAppletCommonFunctions() -> object<nn::am::service::IAppletCommonFunctions> // GetAppletCommonFunctions() -> object<nn::am::service::IAppletCommonFunctions>
public ResultCode GetAppletCommonFunctions(ServiceCtx context) public ResultCode GetAppletCommonFunctions(ServiceCtx context)
{ {
@ -93,7 +93,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(1000)] [CommandCmif(1000)]
// GetDebugFunctions() -> object<nn::am::service::IDebugFunctions> // GetDebugFunctions() -> object<nn::am::service::IDebugFunctions>
public ResultCode GetDebugFunctions(ServiceCtx context) public ResultCode GetDebugFunctions(ServiceCtx context)
{ {

View File

@ -11,7 +11,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
_pid = pid; _pid = pid;
} }
[CommandHipc(0)] [CommandCmif(0)]
// GetCommonStateGetter() -> object<nn::am::service::ICommonStateGetter> // GetCommonStateGetter() -> object<nn::am::service::ICommonStateGetter>
public ResultCode GetCommonStateGetter(ServiceCtx context) public ResultCode GetCommonStateGetter(ServiceCtx context)
{ {
@ -20,7 +20,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(1)] [CommandCmif(1)]
// GetSelfController() -> object<nn::am::service::ISelfController> // GetSelfController() -> object<nn::am::service::ISelfController>
public ResultCode GetSelfController(ServiceCtx context) public ResultCode GetSelfController(ServiceCtx context)
{ {
@ -29,7 +29,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(2)] [CommandCmif(2)]
// GetWindowController() -> object<nn::am::service::IWindowController> // GetWindowController() -> object<nn::am::service::IWindowController>
public ResultCode GetWindowController(ServiceCtx context) public ResultCode GetWindowController(ServiceCtx context)
{ {
@ -38,7 +38,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(3)] [CommandCmif(3)]
// GetAudioController() -> object<nn::am::service::IAudioController> // GetAudioController() -> object<nn::am::service::IAudioController>
public ResultCode GetAudioController(ServiceCtx context) public ResultCode GetAudioController(ServiceCtx context)
{ {
@ -47,7 +47,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(4)] [CommandCmif(4)]
// GetDisplayController() -> object<nn::am::service::IDisplayController> // GetDisplayController() -> object<nn::am::service::IDisplayController>
public ResultCode GetDisplayController(ServiceCtx context) public ResultCode GetDisplayController(ServiceCtx context)
{ {
@ -56,7 +56,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(11)] [CommandCmif(11)]
// GetLibraryAppletCreator() -> object<nn::am::service::ILibraryAppletCreator> // GetLibraryAppletCreator() -> object<nn::am::service::ILibraryAppletCreator>
public ResultCode GetLibraryAppletCreator(ServiceCtx context) public ResultCode GetLibraryAppletCreator(ServiceCtx context)
{ {
@ -65,7 +65,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(20)] [CommandCmif(20)]
// GetHomeMenuFunctions() -> object<nn::am::service::IHomeMenuFunctions> // GetHomeMenuFunctions() -> object<nn::am::service::IHomeMenuFunctions>
public ResultCode GetHomeMenuFunctions(ServiceCtx context) public ResultCode GetHomeMenuFunctions(ServiceCtx context)
{ {
@ -74,7 +74,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(21)] [CommandCmif(21)]
// GetGlobalStateController() -> object<nn::am::service::IGlobalStateController> // GetGlobalStateController() -> object<nn::am::service::IGlobalStateController>
public ResultCode GetGlobalStateController(ServiceCtx context) public ResultCode GetGlobalStateController(ServiceCtx context)
{ {
@ -83,7 +83,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(22)] [CommandCmif(22)]
// GetApplicationCreator() -> object<nn::am::service::IApplicationCreator> // GetApplicationCreator() -> object<nn::am::service::IApplicationCreator>
public ResultCode GetApplicationCreator(ServiceCtx context) public ResultCode GetApplicationCreator(ServiceCtx context)
{ {
@ -92,7 +92,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(1000)] [CommandCmif(1000)]
// GetDebugFunctions() -> object<nn::am::service::IDebugFunctions> // GetDebugFunctions() -> object<nn::am::service::IDebugFunctions>
public ResultCode GetDebugFunctions(ServiceCtx context) public ResultCode GetDebugFunctions(ServiceCtx context)
{ {

View File

@ -62,7 +62,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib
_interactiveOutDataEvent.WritableEvent.Signal(); _interactiveOutDataEvent.WritableEvent.Signal();
} }
[CommandHipc(0)] [CommandCmif(0)]
// GetAppletStateChangedEvent() -> handle<copy> // GetAppletStateChangedEvent() -> handle<copy>
public ResultCode GetAppletStateChangedEvent(ServiceCtx context) public ResultCode GetAppletStateChangedEvent(ServiceCtx context)
{ {
@ -79,14 +79,14 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(10)] [CommandCmif(10)]
// Start() // Start()
public ResultCode Start(ServiceCtx context) public ResultCode Start(ServiceCtx context)
{ {
return (ResultCode)_applet.Start(_normalSession.GetConsumer(), _interactiveSession.GetConsumer()); return (ResultCode)_applet.Start(_normalSession.GetConsumer(), _interactiveSession.GetConsumer());
} }
[CommandHipc(20)] [CommandCmif(20)]
// RequestExit() // RequestExit()
public ResultCode RequestExit(ServiceCtx context) public ResultCode RequestExit(ServiceCtx context)
{ {
@ -98,14 +98,14 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(30)] [CommandCmif(30)]
// GetResult() // GetResult()
public ResultCode GetResult(ServiceCtx context) public ResultCode GetResult(ServiceCtx context)
{ {
return (ResultCode)_applet.GetResult(); return (ResultCode)_applet.GetResult();
} }
[CommandHipc(60)] [CommandCmif(60)]
// PresetLibraryAppletGpuTimeSliceZero() // PresetLibraryAppletGpuTimeSliceZero()
public ResultCode PresetLibraryAppletGpuTimeSliceZero(ServiceCtx context) public ResultCode PresetLibraryAppletGpuTimeSliceZero(ServiceCtx context)
{ {
@ -118,7 +118,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(100)] [CommandCmif(100)]
// PushInData(object<nn::am::service::IStorage>) // PushInData(object<nn::am::service::IStorage>)
public ResultCode PushInData(ServiceCtx context) public ResultCode PushInData(ServiceCtx context)
{ {
@ -129,7 +129,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(101)] [CommandCmif(101)]
// PopOutData() -> object<nn::am::service::IStorage> // PopOutData() -> object<nn::am::service::IStorage>
public ResultCode PopOutData(ServiceCtx context) public ResultCode PopOutData(ServiceCtx context)
{ {
@ -145,7 +145,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib
return ResultCode.NotAvailable; return ResultCode.NotAvailable;
} }
[CommandHipc(103)] [CommandCmif(103)]
// PushInteractiveInData(object<nn::am::service::IStorage>) // PushInteractiveInData(object<nn::am::service::IStorage>)
public ResultCode PushInteractiveInData(ServiceCtx context) public ResultCode PushInteractiveInData(ServiceCtx context)
{ {
@ -156,7 +156,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(104)] [CommandCmif(104)]
// PopInteractiveOutData() -> object<nn::am::service::IStorage> // PopInteractiveOutData() -> object<nn::am::service::IStorage>
public ResultCode PopInteractiveOutData(ServiceCtx context) public ResultCode PopInteractiveOutData(ServiceCtx context)
{ {
@ -172,7 +172,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib
return ResultCode.NotAvailable; return ResultCode.NotAvailable;
} }
[CommandHipc(105)] [CommandCmif(105)]
// GetPopOutDataEvent() -> handle<copy> // GetPopOutDataEvent() -> handle<copy>
public ResultCode GetPopOutDataEvent(ServiceCtx context) public ResultCode GetPopOutDataEvent(ServiceCtx context)
{ {
@ -189,7 +189,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(106)] [CommandCmif(106)]
// GetPopInteractiveOutDataEvent() -> handle<copy> // GetPopInteractiveOutDataEvent() -> handle<copy>
public ResultCode GetPopInteractiveOutDataEvent(ServiceCtx context) public ResultCode GetPopInteractiveOutDataEvent(ServiceCtx context)
{ {
@ -206,21 +206,21 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(110)] [CommandCmif(110)]
// NeedsToExitProcess() // NeedsToExitProcess()
public ResultCode NeedsToExitProcess(ServiceCtx context) public ResultCode NeedsToExitProcess(ServiceCtx context)
{ {
return ResultCode.Stubbed; return ResultCode.Stubbed;
} }
[CommandHipc(150)] [CommandCmif(150)]
// RequestForAppletToGetForeground() // RequestForAppletToGetForeground()
public ResultCode RequestForAppletToGetForeground(ServiceCtx context) public ResultCode RequestForAppletToGetForeground(ServiceCtx context)
{ {
return ResultCode.Stubbed; return ResultCode.Stubbed;
} }
[CommandHipc(160)] // 2.0.0+ [CommandCmif(160)] // 2.0.0+
// GetIndirectLayerConsumerHandle() -> u64 indirect_layer_consumer_handle // GetIndirectLayerConsumerHandle() -> u64 indirect_layer_consumer_handle
public ResultCode GetIndirectLayerConsumerHandle(ServiceCtx context) public ResultCode GetIndirectLayerConsumerHandle(ServiceCtx context)
{ {

View File

@ -29,7 +29,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib
} }
} }
[CommandHipc(0)] [CommandCmif(0)]
// PopInData() -> object<nn::am::service::IStorage> // PopInData() -> object<nn::am::service::IStorage>
public ResultCode PopInData(ServiceCtx context) public ResultCode PopInData(ServiceCtx context)
{ {
@ -45,7 +45,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(11)] [CommandCmif(11)]
// GetLibraryAppletInfo() -> nn::am::service::LibraryAppletInfo // GetLibraryAppletInfo() -> nn::am::service::LibraryAppletInfo
public ResultCode GetLibraryAppletInfo(ServiceCtx context) public ResultCode GetLibraryAppletInfo(ServiceCtx context)
{ {
@ -60,7 +60,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(14)] [CommandCmif(14)]
// GetCallerAppletIdentityInfo() -> nn::am::service::AppletIdentityInfo // GetCallerAppletIdentityInfo() -> nn::am::service::AppletIdentityInfo
public ResultCode GetCallerAppletIdentityInfo(ServiceCtx context) public ResultCode GetCallerAppletIdentityInfo(ServiceCtx context)
{ {

View File

@ -6,7 +6,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib
{ {
public IProcessWindingController() { } public IProcessWindingController() { }
[CommandHipc(0)] [CommandCmif(0)]
// GetLaunchReason() -> nn::am::service::AppletProcessLaunchReason // GetLaunchReason() -> nn::am::service::AppletProcessLaunchReason
public ResultCode GetLaunchReason(ServiceCtx context) public ResultCode GetLaunchReason(ServiceCtx context)
{ {

View File

@ -6,7 +6,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
{ {
public IAudioController() { } public IAudioController() { }
[CommandHipc(0)] [CommandCmif(0)]
// SetExpectedMasterVolume(f32, f32) // SetExpectedMasterVolume(f32, f32)
public ResultCode SetExpectedMasterVolume(ServiceCtx context) public ResultCode SetExpectedMasterVolume(ServiceCtx context)
{ {
@ -18,7 +18,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(1)] [CommandCmif(1)]
// GetMainAppletExpectedMasterVolume() -> f32 // GetMainAppletExpectedMasterVolume() -> f32
public ResultCode GetMainAppletExpectedMasterVolume(ServiceCtx context) public ResultCode GetMainAppletExpectedMasterVolume(ServiceCtx context)
{ {
@ -29,7 +29,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(2)] [CommandCmif(2)]
// GetLibraryAppletExpectedMasterVolume() -> f32 // GetLibraryAppletExpectedMasterVolume() -> f32
public ResultCode GetLibraryAppletExpectedMasterVolume(ServiceCtx context) public ResultCode GetLibraryAppletExpectedMasterVolume(ServiceCtx context)
{ {
@ -40,7 +40,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(3)] [CommandCmif(3)]
// ChangeMainAppletMasterVolume(f32, u64) // ChangeMainAppletMasterVolume(f32, u64)
public ResultCode ChangeMainAppletMasterVolume(ServiceCtx context) public ResultCode ChangeMainAppletMasterVolume(ServiceCtx context)
{ {
@ -52,7 +52,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(4)] [CommandCmif(4)]
// SetTransparentVolumeRate(f32) // SetTransparentVolumeRate(f32)
public ResultCode SetTransparentVolumeRate(ServiceCtx context) public ResultCode SetTransparentVolumeRate(ServiceCtx context)
{ {

View File

@ -30,7 +30,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
_lblControllerServer = new Lbl.LblControllerServer(context); _lblControllerServer = new Lbl.LblControllerServer(context);
} }
[CommandHipc(0)] [CommandCmif(0)]
// GetEventHandle() -> handle<copy> // GetEventHandle() -> handle<copy>
public ResultCode GetEventHandle(ServiceCtx context) public ResultCode GetEventHandle(ServiceCtx context)
{ {
@ -49,7 +49,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(1)] [CommandCmif(1)]
// ReceiveMessage() -> nn::am::AppletMessage // ReceiveMessage() -> nn::am::AppletMessage
public ResultCode ReceiveMessage(ServiceCtx context) public ResultCode ReceiveMessage(ServiceCtx context)
{ {
@ -77,7 +77,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(5)] [CommandCmif(5)]
// GetOperationMode() -> u8 // GetOperationMode() -> u8
public ResultCode GetOperationMode(ServiceCtx context) public ResultCode GetOperationMode(ServiceCtx context)
{ {
@ -90,14 +90,14 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(6)] [CommandCmif(6)]
// GetPerformanceMode() -> nn::apm::PerformanceMode // GetPerformanceMode() -> nn::apm::PerformanceMode
public ResultCode GetPerformanceMode(ServiceCtx context) public ResultCode GetPerformanceMode(ServiceCtx context)
{ {
return (ResultCode)_apmManagerServer.GetPerformanceMode(context); return (ResultCode)_apmManagerServer.GetPerformanceMode(context);
} }
[CommandHipc(8)] [CommandCmif(8)]
// GetBootMode() -> u8 // GetBootMode() -> u8
public ResultCode GetBootMode(ServiceCtx context) public ResultCode GetBootMode(ServiceCtx context)
{ {
@ -108,7 +108,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(9)] [CommandCmif(9)]
// GetCurrentFocusState() -> u8 // GetCurrentFocusState() -> u8
public ResultCode GetCurrentFocusState(ServiceCtx context) public ResultCode GetCurrentFocusState(ServiceCtx context)
{ {
@ -117,7 +117,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(50)] // 3.0.0+ [CommandCmif(50)] // 3.0.0+
// IsVrModeEnabled() -> b8 // IsVrModeEnabled() -> b8
public ResultCode IsVrModeEnabled(ServiceCtx context) public ResultCode IsVrModeEnabled(ServiceCtx context)
{ {
@ -126,7 +126,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(51)] // 3.0.0+ [CommandCmif(51)] // 3.0.0+
// SetVrModeEnabled(b8) // SetVrModeEnabled(b8)
public ResultCode SetVrModeEnabled(ServiceCtx context) public ResultCode SetVrModeEnabled(ServiceCtx context)
{ {
@ -137,7 +137,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(52)] // 4.0.0+ [CommandCmif(52)] // 4.0.0+
// SetLcdBacklighOffEnabled(b8) // SetLcdBacklighOffEnabled(b8)
public ResultCode SetLcdBacklighOffEnabled(ServiceCtx context) public ResultCode SetLcdBacklighOffEnabled(ServiceCtx context)
{ {
@ -151,7 +151,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(53)] // 7.0.0+ [CommandCmif(53)] // 7.0.0+
// BeginVrModeEx() // BeginVrModeEx()
public ResultCode BeginVrModeEx(ServiceCtx context) public ResultCode BeginVrModeEx(ServiceCtx context)
{ {
@ -160,7 +160,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(54)] // 7.0.0+ [CommandCmif(54)] // 7.0.0+
// EndVrModeEx() // EndVrModeEx()
public ResultCode EndVrModeEx(ServiceCtx context) public ResultCode EndVrModeEx(ServiceCtx context)
{ {
@ -190,7 +190,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
// TODO: It signals an internal event of ICommonStateGetter. We have to determine where this event is used. // TODO: It signals an internal event of ICommonStateGetter. We have to determine where this event is used.
} }
[CommandHipc(60)] // 3.0.0+ [CommandCmif(60)] // 3.0.0+
// GetDefaultDisplayResolution() -> (u32, u32) // GetDefaultDisplayResolution() -> (u32, u32)
public ResultCode GetDefaultDisplayResolution(ServiceCtx context) public ResultCode GetDefaultDisplayResolution(ServiceCtx context)
{ {
@ -204,7 +204,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(61)] // 3.0.0+ [CommandCmif(61)] // 3.0.0+
// GetDefaultDisplayResolutionChangeEvent() -> handle<copy> // GetDefaultDisplayResolutionChangeEvent() -> handle<copy>
public ResultCode GetDefaultDisplayResolutionChangeEvent(ServiceCtx context) public ResultCode GetDefaultDisplayResolutionChangeEvent(ServiceCtx context)
{ {
@ -224,7 +224,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(62)] // 4.0.0+ [CommandCmif(62)] // 4.0.0+
// GetHdcpAuthenticationState() -> s32 state // GetHdcpAuthenticationState() -> s32 state
public ResultCode GetHdcpAuthenticationState(ServiceCtx context) public ResultCode GetHdcpAuthenticationState(ServiceCtx context)
{ {
@ -235,7 +235,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(66)] // 6.0.0+ [CommandCmif(66)] // 6.0.0+
// SetCpuBoostMode(u32 cpu_boost_mode) // SetCpuBoostMode(u32 cpu_boost_mode)
public ResultCode SetCpuBoostMode(ServiceCtx context) public ResultCode SetCpuBoostMode(ServiceCtx context)
{ {
@ -253,14 +253,14 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(91)] // 7.0.0+ [CommandCmif(91)] // 7.0.0+
// GetCurrentPerformanceConfiguration() -> nn::apm::PerformanceConfiguration // GetCurrentPerformanceConfiguration() -> nn::apm::PerformanceConfiguration
public ResultCode GetCurrentPerformanceConfiguration(ServiceCtx context) public ResultCode GetCurrentPerformanceConfiguration(ServiceCtx context)
{ {
return (ResultCode)_apmSystemManagerServer.GetCurrentPerformanceConfiguration(context); return (ResultCode)_apmSystemManagerServer.GetCurrentPerformanceConfiguration(context);
} }
[CommandHipc(300)] // 9.0.0+ [CommandCmif(300)] // 9.0.0+
// GetSettingsPlatformRegion() -> u8 // GetSettingsPlatformRegion() -> u8
public ResultCode GetSettingsPlatformRegion(ServiceCtx context) public ResultCode GetSettingsPlatformRegion(ServiceCtx context)
{ {
@ -272,7 +272,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(900)] // 11.0.0+ [CommandCmif(900)] // 11.0.0+
// SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled() // SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled()
public ResultCode SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled(ServiceCtx context) public ResultCode SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled(ServiceCtx context)
{ {

View File

@ -17,7 +17,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
_transferMem = context.Device.System.AppletCaptureBufferTransfer; _transferMem = context.Device.System.AppletCaptureBufferTransfer;
} }
[CommandHipc(8)] // 2.0.0+ [CommandCmif(8)] // 2.0.0+
// TakeScreenShotOfOwnLayer(b8, s32) // TakeScreenShotOfOwnLayer(b8, s32)
public ResultCode TakeScreenShotOfOwnLayer(ServiceCtx context) public ResultCode TakeScreenShotOfOwnLayer(ServiceCtx context)
{ {
@ -29,7 +29,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(11)] [CommandCmif(11)]
// ReleaseLastApplicationCaptureBuffer() // ReleaseLastApplicationCaptureBuffer()
public ResultCode ReleaseLastApplicationCaptureBuffer(ServiceCtx context) public ResultCode ReleaseLastApplicationCaptureBuffer(ServiceCtx context)
{ {
@ -43,7 +43,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(15)] [CommandCmif(15)]
// ReleaseCallerAppletCaptureBuffer() // ReleaseCallerAppletCaptureBuffer()
public ResultCode ReleaseCallerAppletCaptureBuffer(ServiceCtx context) public ResultCode ReleaseCallerAppletCaptureBuffer(ServiceCtx context)
{ {
@ -57,7 +57,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(16)] [CommandCmif(16)]
// AcquireLastApplicationCaptureBufferEx() -> (b8, handle<copy>) // AcquireLastApplicationCaptureBufferEx() -> (b8, handle<copy>)
public ResultCode AcquireLastApplicationCaptureBufferEx(ServiceCtx context) public ResultCode AcquireLastApplicationCaptureBufferEx(ServiceCtx context)
{ {
@ -80,7 +80,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(18)] [CommandCmif(18)]
// AcquireCallerAppletCaptureBufferEx() -> (b8, handle<copy>) // AcquireCallerAppletCaptureBufferEx() -> (b8, handle<copy>)
public ResultCode AcquireCallerAppletCaptureBufferEx(ServiceCtx context) public ResultCode AcquireCallerAppletCaptureBufferEx(ServiceCtx context)
{ {

View File

@ -17,7 +17,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
_channelEvent = new KEvent(system.KernelContext); _channelEvent = new KEvent(system.KernelContext);
} }
[CommandHipc(10)] [CommandCmif(10)]
// RequestToGetForeground() // RequestToGetForeground()
public ResultCode RequestToGetForeground(ServiceCtx context) public ResultCode RequestToGetForeground(ServiceCtx context)
{ {
@ -26,7 +26,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(21)] [CommandCmif(21)]
// GetPopFromGeneralChannelEvent() -> handle<copy> // GetPopFromGeneralChannelEvent() -> handle<copy>
public ResultCode GetPopFromGeneralChannelEvent(ServiceCtx context) public ResultCode GetPopFromGeneralChannelEvent(ServiceCtx context)
{ {

View File

@ -7,7 +7,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
{ {
public ILibraryAppletCreator() { } public ILibraryAppletCreator() { }
[CommandHipc(0)] [CommandCmif(0)]
// CreateLibraryApplet(u32, u32) -> object<nn::am::service::ILibraryAppletAccessor> // CreateLibraryApplet(u32, u32) -> object<nn::am::service::ILibraryAppletAccessor>
public ResultCode CreateLibraryApplet(ServiceCtx context) public ResultCode CreateLibraryApplet(ServiceCtx context)
{ {
@ -19,7 +19,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(10)] [CommandCmif(10)]
// CreateStorage(u64) -> object<nn::am::service::IStorage> // CreateStorage(u64) -> object<nn::am::service::IStorage>
public ResultCode CreateStorage(ServiceCtx context) public ResultCode CreateStorage(ServiceCtx context)
{ {
@ -37,7 +37,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(11)] [CommandCmif(11)]
// CreateTransferMemoryStorage(b8, u64, handle<copy>) -> object<nn::am::service::IStorage> // CreateTransferMemoryStorage(b8, u64, handle<copy>) -> object<nn::am::service::IStorage>
public ResultCode CreateTransferMemoryStorage(ServiceCtx context) public ResultCode CreateTransferMemoryStorage(ServiceCtx context)
{ {
@ -63,7 +63,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(12)] // 2.0.0+ [CommandCmif(12)] // 2.0.0+
// CreateHandleStorage(u64, handle<copy>) -> object<nn::am::service::IStorage> // CreateHandleStorage(u64, handle<copy>) -> object<nn::am::service::IStorage>
public ResultCode CreateHandleStorage(ServiceCtx context) public ResultCode CreateHandleStorage(ServiceCtx context)
{ {

View File

@ -43,7 +43,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
_pid = pid; _pid = pid;
} }
[CommandHipc(0)] [CommandCmif(0)]
// Exit() // Exit()
public ResultCode Exit(ServiceCtx context) public ResultCode Exit(ServiceCtx context)
{ {
@ -52,7 +52,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(1)] [CommandCmif(1)]
// LockExit() // LockExit()
public ResultCode LockExit(ServiceCtx context) public ResultCode LockExit(ServiceCtx context)
{ {
@ -61,7 +61,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(2)] [CommandCmif(2)]
// UnlockExit() // UnlockExit()
public ResultCode UnlockExit(ServiceCtx context) public ResultCode UnlockExit(ServiceCtx context)
{ {
@ -70,7 +70,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(3)] // 2.0.0+ [CommandCmif(3)] // 2.0.0+
// EnterFatalSection() // EnterFatalSection()
public ResultCode EnterFatalSection(ServiceCtx context) public ResultCode EnterFatalSection(ServiceCtx context)
{ {
@ -82,7 +82,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(4)] // 2.0.0+ [CommandCmif(4)] // 2.0.0+
// LeaveFatalSection() // LeaveFatalSection()
public ResultCode LeaveFatalSection(ServiceCtx context) public ResultCode LeaveFatalSection(ServiceCtx context)
{ {
@ -103,7 +103,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return result; return result;
} }
[CommandHipc(9)] [CommandCmif(9)]
// GetLibraryAppletLaunchableEvent() -> handle<copy> // GetLibraryAppletLaunchableEvent() -> handle<copy>
public ResultCode GetLibraryAppletLaunchableEvent(ServiceCtx context) public ResultCode GetLibraryAppletLaunchableEvent(ServiceCtx context)
{ {
@ -124,7 +124,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(10)] [CommandCmif(10)]
// SetScreenShotPermission(u32) // SetScreenShotPermission(u32)
public ResultCode SetScreenShotPermission(ServiceCtx context) public ResultCode SetScreenShotPermission(ServiceCtx context)
{ {
@ -137,7 +137,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(11)] [CommandCmif(11)]
// SetOperationModeChangedNotification(b8) // SetOperationModeChangedNotification(b8)
public ResultCode SetOperationModeChangedNotification(ServiceCtx context) public ResultCode SetOperationModeChangedNotification(ServiceCtx context)
{ {
@ -150,7 +150,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(12)] [CommandCmif(12)]
// SetPerformanceModeChangedNotification(b8) // SetPerformanceModeChangedNotification(b8)
public ResultCode SetPerformanceModeChangedNotification(ServiceCtx context) public ResultCode SetPerformanceModeChangedNotification(ServiceCtx context)
{ {
@ -163,7 +163,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(13)] [CommandCmif(13)]
// SetFocusHandlingMode(b8, b8, b8) // SetFocusHandlingMode(b8, b8, b8)
public ResultCode SetFocusHandlingMode(ServiceCtx context) public ResultCode SetFocusHandlingMode(ServiceCtx context)
{ {
@ -176,7 +176,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(14)] [CommandCmif(14)]
// SetRestartMessageEnabled(b8) // SetRestartMessageEnabled(b8)
public ResultCode SetRestartMessageEnabled(ServiceCtx context) public ResultCode SetRestartMessageEnabled(ServiceCtx context)
{ {
@ -189,7 +189,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(16)] // 2.0.0+ [CommandCmif(16)] // 2.0.0+
// SetOutOfFocusSuspendingEnabled(b8) // SetOutOfFocusSuspendingEnabled(b8)
public ResultCode SetOutOfFocusSuspendingEnabled(ServiceCtx context) public ResultCode SetOutOfFocusSuspendingEnabled(ServiceCtx context)
{ {
@ -202,7 +202,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(19)] // 3.0.0+ [CommandCmif(19)] // 3.0.0+
// SetScreenShotImageOrientation(u32) // SetScreenShotImageOrientation(u32)
public ResultCode SetScreenShotImageOrientation(ServiceCtx context) public ResultCode SetScreenShotImageOrientation(ServiceCtx context)
{ {
@ -215,7 +215,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(40)] [CommandCmif(40)]
// CreateManagedDisplayLayer() -> u64 // CreateManagedDisplayLayer() -> u64
public ResultCode CreateManagedDisplayLayer(ServiceCtx context) public ResultCode CreateManagedDisplayLayer(ServiceCtx context)
{ {
@ -227,7 +227,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(41)] // 4.0.0+ [CommandCmif(41)] // 4.0.0+
// IsSystemBufferSharingEnabled() // IsSystemBufferSharingEnabled()
public ResultCode IsSystemBufferSharingEnabled(ServiceCtx context) public ResultCode IsSystemBufferSharingEnabled(ServiceCtx context)
{ {
@ -236,7 +236,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.NotImplemented; return ResultCode.NotImplemented;
} }
[CommandHipc(44)] // 10.0.0+ [CommandCmif(44)] // 10.0.0+
// CreateManagedDisplaySeparableLayer() -> (u64, u64) // CreateManagedDisplaySeparableLayer() -> (u64, u64)
public ResultCode CreateManagedDisplaySeparableLayer(ServiceCtx context) public ResultCode CreateManagedDisplaySeparableLayer(ServiceCtx context)
{ {
@ -250,7 +250,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(50)] [CommandCmif(50)]
// SetHandlesRequestToDisplay(b8) // SetHandlesRequestToDisplay(b8)
public ResultCode SetHandlesRequestToDisplay(ServiceCtx context) public ResultCode SetHandlesRequestToDisplay(ServiceCtx context)
{ {
@ -263,7 +263,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(62)] [CommandCmif(62)]
// SetIdleTimeDetectionExtension(u32) // SetIdleTimeDetectionExtension(u32)
public ResultCode SetIdleTimeDetectionExtension(ServiceCtx context) public ResultCode SetIdleTimeDetectionExtension(ServiceCtx context)
{ {
@ -276,7 +276,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(63)] [CommandCmif(63)]
// GetIdleTimeDetectionExtension() -> u32 // GetIdleTimeDetectionExtension() -> u32
public ResultCode GetIdleTimeDetectionExtension(ServiceCtx context) public ResultCode GetIdleTimeDetectionExtension(ServiceCtx context)
{ {
@ -287,7 +287,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(65)] [CommandCmif(65)]
// ReportUserIsActive() // ReportUserIsActive()
public ResultCode ReportUserIsActive(ServiceCtx context) public ResultCode ReportUserIsActive(ServiceCtx context)
{ {
@ -298,19 +298,19 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(67)] //3.0.0+ [CommandCmif(67)] //3.0.0+
// IsIlluminanceAvailable() -> bool // IsIlluminanceAvailable() -> bool
public ResultCode IsIlluminanceAvailable(ServiceCtx context) public ResultCode IsIlluminanceAvailable(ServiceCtx context)
{ {
// NOTE: This should call IsAmbientLightSensorAvailable through to Lbl, but there's no situation where we'd want false. // NOTE: This should call IsAmbientLightSensorAvailable through to Lbl, but there's no situation where we'd want false.
context.ResponseData.Write(true); context.ResponseData.Write(true);
Logger.Stub?.PrintStub(LogClass.ServiceAm); Logger.Stub?.PrintStub(LogClass.ServiceAm);
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(68)] [CommandCmif(68)]
// SetAutoSleepDisabled(u8) // SetAutoSleepDisabled(u8)
public ResultCode SetAutoSleepDisabled(ServiceCtx context) public ResultCode SetAutoSleepDisabled(ServiceCtx context)
{ {
@ -321,7 +321,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(69)] [CommandCmif(69)]
// IsAutoSleepDisabled() -> u8 // IsAutoSleepDisabled() -> u8
public ResultCode IsAutoSleepDisabled(ServiceCtx context) public ResultCode IsAutoSleepDisabled(ServiceCtx context)
{ {
@ -330,7 +330,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(71)] //5.0.0+ [CommandCmif(71)] //5.0.0+
// GetCurrentIlluminanceEx() -> (bool, f32) // GetCurrentIlluminanceEx() -> (bool, f32)
public ResultCode GetCurrentIlluminanceEx(ServiceCtx context) public ResultCode GetCurrentIlluminanceEx(ServiceCtx context)
{ {
@ -343,7 +343,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(80)] // 4.0.0+ [CommandCmif(80)] // 4.0.0+
// SetWirelessPriorityMode(s32 wireless_priority_mode) // SetWirelessPriorityMode(s32 wireless_priority_mode)
public ResultCode SetWirelessPriorityMode(ServiceCtx context) public ResultCode SetWirelessPriorityMode(ServiceCtx context)
{ {
@ -359,7 +359,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(90)] // 6.0.0+ [CommandCmif(90)] // 6.0.0+
// GetAccumulatedSuspendedTickValue() -> u64 // GetAccumulatedSuspendedTickValue() -> u64
public ResultCode GetAccumulatedSuspendedTickValue(ServiceCtx context) public ResultCode GetAccumulatedSuspendedTickValue(ServiceCtx context)
{ {
@ -368,7 +368,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(91)] // 6.0.0+ [CommandCmif(91)] // 6.0.0+
// GetAccumulatedSuspendedTickChangedEvent() -> handle<copy> // GetAccumulatedSuspendedTickChangedEvent() -> handle<copy>
public ResultCode GetAccumulatedSuspendedTickChangedEvent(ServiceCtx context) public ResultCode GetAccumulatedSuspendedTickChangedEvent(ServiceCtx context)
{ {
@ -389,7 +389,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(100)] // 7.0.0+ [CommandCmif(100)] // 7.0.0+
// SetAlbumImageTakenNotificationEnabled(u8) // SetAlbumImageTakenNotificationEnabled(u8)
public ResultCode SetAlbumImageTakenNotificationEnabled(ServiceCtx context) public ResultCode SetAlbumImageTakenNotificationEnabled(ServiceCtx context)
{ {
@ -400,7 +400,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(120)] // 11.0.0+ [CommandCmif(120)] // 11.0.0+
// SaveCurrentScreenshot(s32 album_report_option) // SaveCurrentScreenshot(s32 album_report_option)
public ResultCode SaveCurrentScreenshot(ServiceCtx context) public ResultCode SaveCurrentScreenshot(ServiceCtx context)
{ {
@ -416,7 +416,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(130)] // 13.0.0+ [CommandCmif(130)] // 13.0.0+
// SetRecordVolumeMuted(b8) // SetRecordVolumeMuted(b8)
public ResultCode SetRecordVolumeMuted(ServiceCtx context) public ResultCode SetRecordVolumeMuted(ServiceCtx context)
{ {
@ -429,4 +429,4 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
} }
} }

View File

@ -11,7 +11,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
_pid = pid; _pid = pid;
} }
[CommandHipc(1)] [CommandCmif(1)]
// GetAppletResourceUserId() -> nn::applet::AppletResourceUserId // GetAppletResourceUserId() -> nn::applet::AppletResourceUserId
public ResultCode GetAppletResourceUserId(ServiceCtx context) public ResultCode GetAppletResourceUserId(ServiceCtx context)
{ {
@ -24,7 +24,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(10)] [CommandCmif(10)]
// AcquireForegroundRights() // AcquireForegroundRights()
public ResultCode AcquireForegroundRights(ServiceCtx context) public ResultCode AcquireForegroundRights(ServiceCtx context)
{ {

View File

@ -7,7 +7,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE
{ {
public IAllSystemAppletProxiesService(ServiceCtx context) { } public IAllSystemAppletProxiesService(ServiceCtx context) { }
[CommandHipc(100)] [CommandCmif(100)]
// OpenSystemAppletProxy(u64, pid, handle<copy>) -> object<nn::am::service::ISystemAppletProxy> // OpenSystemAppletProxy(u64, pid, handle<copy>) -> object<nn::am::service::ISystemAppletProxy>
public ResultCode OpenSystemAppletProxy(ServiceCtx context) public ResultCode OpenSystemAppletProxy(ServiceCtx context)
{ {
@ -16,8 +16,8 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(200)] [CommandCmif(200)]
[CommandHipc(201)] // 3.0.0+ [CommandCmif(201)] // 3.0.0+
// OpenLibraryAppletProxy(u64, pid, handle<copy>) -> object<nn::am::service::ILibraryAppletProxy> // OpenLibraryAppletProxy(u64, pid, handle<copy>) -> object<nn::am::service::ILibraryAppletProxy>
public ResultCode OpenLibraryAppletProxy(ServiceCtx context) public ResultCode OpenLibraryAppletProxy(ServiceCtx context)
{ {

View File

@ -11,7 +11,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE
Data = data; Data = data;
} }
[CommandHipc(0)] [CommandCmif(0)]
// Open() -> object<nn::am::service::IStorageAccessor> // Open() -> object<nn::am::service::IStorageAccessor>
public ResultCode Open(ServiceCtx context) public ResultCode Open(ServiceCtx context)
{ {

View File

@ -11,7 +11,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE
_storage = storage; _storage = storage;
} }
[CommandHipc(0)] [CommandCmif(0)]
// GetSize() -> u64 // GetSize() -> u64
public ResultCode GetSize(ServiceCtx context) public ResultCode GetSize(ServiceCtx context)
{ {
@ -20,7 +20,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(10)] [CommandCmif(10)]
// Write(u64, buffer<bytes, 0x21>) // Write(u64, buffer<bytes, 0x21>)
public ResultCode Write(ServiceCtx context) public ResultCode Write(ServiceCtx context)
{ {
@ -59,7 +59,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(11)] [CommandCmif(11)]
// Read(u64) -> buffer<bytes, 0x22> // Read(u64) -> buffer<bytes, 0x22>
public ResultCode Read(ServiceCtx context) public ResultCode Read(ServiceCtx context)
{ {

View File

@ -55,7 +55,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
_horizon = system.LibHacHorizonManager.AmClient; _horizon = system.LibHacHorizonManager.AmClient;
} }
[CommandHipc(1)] [CommandCmif(1)]
// PopLaunchParameter(LaunchParameterKind kind) -> object<nn::am::service::IStorage> // PopLaunchParameter(LaunchParameterKind kind) -> object<nn::am::service::IStorage>
public ResultCode PopLaunchParameter(ServiceCtx context) public ResultCode PopLaunchParameter(ServiceCtx context)
{ {
@ -88,7 +88,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(12)] // 4.0.0+ [CommandCmif(12)] // 4.0.0+
// CreateApplicationAndRequestToStart(u64 title_id) // CreateApplicationAndRequestToStart(u64 title_id)
public ResultCode CreateApplicationAndRequestToStart(ServiceCtx context) public ResultCode CreateApplicationAndRequestToStart(ServiceCtx context)
{ {
@ -108,7 +108,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(20)] [CommandCmif(20)]
// EnsureSaveData(nn::account::Uid) -> u64 // EnsureSaveData(nn::account::Uid) -> u64
public ResultCode EnsureSaveData(ServiceCtx context) public ResultCode EnsureSaveData(ServiceCtx context)
{ {
@ -127,7 +127,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return (ResultCode)result.Value; return (ResultCode)result.Value;
} }
[CommandHipc(21)] [CommandCmif(21)]
// GetDesiredLanguage() -> nn::settings::LanguageCode // GetDesiredLanguage() -> nn::settings::LanguageCode
public ResultCode GetDesiredLanguage(ServiceCtx context) public ResultCode GetDesiredLanguage(ServiceCtx context)
{ {
@ -164,7 +164,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(22)] [CommandCmif(22)]
// SetTerminateResult(u32) // SetTerminateResult(u32)
public ResultCode SetTerminateResult(ServiceCtx context) public ResultCode SetTerminateResult(ServiceCtx context)
{ {
@ -175,7 +175,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(23)] [CommandCmif(23)]
// GetDisplayVersion() -> nn::oe::DisplayVersion // GetDisplayVersion() -> nn::oe::DisplayVersion
public ResultCode GetDisplayVersion(ServiceCtx context) public ResultCode GetDisplayVersion(ServiceCtx context)
{ {
@ -185,7 +185,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(25)] // 3.0.0+ [CommandCmif(25)] // 3.0.0+
// ExtendSaveData(u8 save_data_type, nn::account::Uid, s64 save_size, s64 journal_size) -> u64 result_code // ExtendSaveData(u8 save_data_type, nn::account::Uid, s64 save_size, s64 journal_size) -> u64 result_code
public ResultCode ExtendSaveData(ServiceCtx context) public ResultCode ExtendSaveData(ServiceCtx context)
{ {
@ -207,7 +207,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(26)] // 3.0.0+ [CommandCmif(26)] // 3.0.0+
// GetSaveDataSize(u8 save_data_type, nn::account::Uid) -> (s64 save_size, s64 journal_size) // GetSaveDataSize(u8 save_data_type, nn::account::Uid) -> (s64 save_size, s64 journal_size)
public ResultCode GetSaveDataSize(ServiceCtx context) public ResultCode GetSaveDataSize(ServiceCtx context)
{ {
@ -226,7 +226,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(27)] // 5.0.0+ [CommandCmif(27)] // 5.0.0+
// CreateCacheStorage(u16 index, s64 save_size, s64 journal_size) -> (u32 storageTarget, u64 requiredSize) // CreateCacheStorage(u16 index, s64 save_size, s64 journal_size) -> (u32 storageTarget, u64 requiredSize)
public ResultCode CreateCacheStorage(ServiceCtx context) public ResultCode CreateCacheStorage(ServiceCtx context)
{ {
@ -250,7 +250,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(28)] // 11.0.0+ [CommandCmif(28)] // 11.0.0+
// GetSaveDataSizeMax() -> (s64 save_size_max, s64 journal_size_max) // GetSaveDataSizeMax() -> (s64 save_size_max, s64 journal_size_max)
public ResultCode GetSaveDataSizeMax(ServiceCtx context) public ResultCode GetSaveDataSizeMax(ServiceCtx context)
{ {
@ -267,7 +267,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(30)] [CommandCmif(30)]
// BeginBlockingHomeButtonShortAndLongPressed() // BeginBlockingHomeButtonShortAndLongPressed()
public ResultCode BeginBlockingHomeButtonShortAndLongPressed(ServiceCtx context) public ResultCode BeginBlockingHomeButtonShortAndLongPressed(ServiceCtx context)
{ {
@ -278,7 +278,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(31)] [CommandCmif(31)]
// EndBlockingHomeButtonShortAndLongPressed() // EndBlockingHomeButtonShortAndLongPressed()
public ResultCode EndBlockingHomeButtonShortAndLongPressed(ServiceCtx context) public ResultCode EndBlockingHomeButtonShortAndLongPressed(ServiceCtx context)
{ {
@ -289,7 +289,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(32)] // 2.0.0+ [CommandCmif(32)] // 2.0.0+
// BeginBlockingHomeButton(u64 nano_second) // BeginBlockingHomeButton(u64 nano_second)
public ResultCode BeginBlockingHomeButton(ServiceCtx context) public ResultCode BeginBlockingHomeButton(ServiceCtx context)
{ {
@ -302,7 +302,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(33)] // 2.0.0+ [CommandCmif(33)] // 2.0.0+
// EndBlockingHomeButton() // EndBlockingHomeButton()
public ResultCode EndBlockingHomeButton(ServiceCtx context) public ResultCode EndBlockingHomeButton(ServiceCtx context)
{ {
@ -313,7 +313,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(40)] [CommandCmif(40)]
// NotifyRunning() -> b8 // NotifyRunning() -> b8
public ResultCode NotifyRunning(ServiceCtx context) public ResultCode NotifyRunning(ServiceCtx context)
{ {
@ -322,7 +322,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(50)] // 2.0.0+ [CommandCmif(50)] // 2.0.0+
// GetPseudoDeviceId() -> nn::util::Uuid // GetPseudoDeviceId() -> nn::util::Uuid
public ResultCode GetPseudoDeviceId(ServiceCtx context) public ResultCode GetPseudoDeviceId(ServiceCtx context)
{ {
@ -334,7 +334,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(60)] // 2.0.0+ [CommandCmif(60)] // 2.0.0+
// SetMediaPlaybackStateForApplication(bool enabled) // SetMediaPlaybackStateForApplication(bool enabled)
public ResultCode SetMediaPlaybackStateForApplication(ServiceCtx context) public ResultCode SetMediaPlaybackStateForApplication(ServiceCtx context)
{ {
@ -347,7 +347,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(65)] // 3.0.0+ [CommandCmif(65)] // 3.0.0+
// IsGamePlayRecordingSupported() -> u8 // IsGamePlayRecordingSupported() -> u8
public ResultCode IsGamePlayRecordingSupported(ServiceCtx context) public ResultCode IsGamePlayRecordingSupported(ServiceCtx context)
{ {
@ -356,7 +356,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(66)] // 3.0.0+ [CommandCmif(66)] // 3.0.0+
// InitializeGamePlayRecording(u64, handle<copy>) // InitializeGamePlayRecording(u64, handle<copy>)
public ResultCode InitializeGamePlayRecording(ServiceCtx context) public ResultCode InitializeGamePlayRecording(ServiceCtx context)
{ {
@ -365,7 +365,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(67)] // 3.0.0+ [CommandCmif(67)] // 3.0.0+
// SetGamePlayRecordingState(u32) // SetGamePlayRecordingState(u32)
public ResultCode SetGamePlayRecordingState(ServiceCtx context) public ResultCode SetGamePlayRecordingState(ServiceCtx context)
{ {
@ -376,7 +376,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(90)] // 4.0.0+ [CommandCmif(90)] // 4.0.0+
// EnableApplicationCrashReport(u8) // EnableApplicationCrashReport(u8)
public ResultCode EnableApplicationCrashReport(ServiceCtx context) public ResultCode EnableApplicationCrashReport(ServiceCtx context)
{ {
@ -387,7 +387,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(100)] // 5.0.0+ [CommandCmif(100)] // 5.0.0+
// InitializeApplicationCopyrightFrameBuffer(s32 width, s32 height, handle<copy, transfer_memory> transfer_memory, u64 transfer_memory_size) // InitializeApplicationCopyrightFrameBuffer(s32 width, s32 height, handle<copy, transfer_memory> transfer_memory, u64 transfer_memory_size)
public ResultCode InitializeApplicationCopyrightFrameBuffer(ServiceCtx context) public ResultCode InitializeApplicationCopyrightFrameBuffer(ServiceCtx context)
{ {
@ -433,7 +433,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return resultCode; return resultCode;
} }
[CommandHipc(101)] // 5.0.0+ [CommandCmif(101)] // 5.0.0+
// SetApplicationCopyrightImage(buffer<bytes, 0x45> frame_buffer, s32 x, s32 y, s32 width, s32 height, s32 window_origin_mode) // SetApplicationCopyrightImage(buffer<bytes, 0x45> frame_buffer, s32 x, s32 y, s32 width, s32 height, s32 window_origin_mode)
public ResultCode SetApplicationCopyrightImage(ServiceCtx context) public ResultCode SetApplicationCopyrightImage(ServiceCtx context)
{ {
@ -480,7 +480,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(102)] // 5.0.0+ [CommandCmif(102)] // 5.0.0+
// SetApplicationCopyrightVisibility(bool visible) // SetApplicationCopyrightVisibility(bool visible)
public ResultCode SetApplicationCopyrightVisibility(ServiceCtx context) public ResultCode SetApplicationCopyrightVisibility(ServiceCtx context)
{ {
@ -493,7 +493,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(110)] // 5.0.0+ [CommandCmif(110)] // 5.0.0+
// QueryApplicationPlayStatistics(buffer<bytes, 5> title_id_list) -> (buffer<bytes, 6> entries, s32 entries_count) // QueryApplicationPlayStatistics(buffer<bytes, 5> title_id_list) -> (buffer<bytes, 6> entries, s32 entries_count)
public ResultCode QueryApplicationPlayStatistics(ServiceCtx context) public ResultCode QueryApplicationPlayStatistics(ServiceCtx context)
{ {
@ -501,7 +501,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return (ResultCode)QueryPlayStatisticsManager.GetPlayStatistics(context); return (ResultCode)QueryPlayStatisticsManager.GetPlayStatistics(context);
} }
[CommandHipc(111)] // 6.0.0+ [CommandCmif(111)] // 6.0.0+
// QueryApplicationPlayStatisticsByUid(nn::account::Uid, buffer<bytes, 5> title_id_list) -> (buffer<bytes, 6> entries, s32 entries_count) // QueryApplicationPlayStatisticsByUid(nn::account::Uid, buffer<bytes, 5> title_id_list) -> (buffer<bytes, 6> entries, s32 entries_count)
public ResultCode QueryApplicationPlayStatisticsByUid(ServiceCtx context) public ResultCode QueryApplicationPlayStatisticsByUid(ServiceCtx context)
{ {
@ -509,7 +509,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return (ResultCode)QueryPlayStatisticsManager.GetPlayStatistics(context, true); return (ResultCode)QueryPlayStatisticsManager.GetPlayStatistics(context, true);
} }
[CommandHipc(120)] // 5.0.0+ [CommandCmif(120)] // 5.0.0+
// ExecuteProgram(ProgramSpecifyKind kind, u64 value) // ExecuteProgram(ProgramSpecifyKind kind, u64 value)
public ResultCode ExecuteProgram(ServiceCtx context) public ResultCode ExecuteProgram(ServiceCtx context)
{ {
@ -527,7 +527,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(121)] // 5.0.0+ [CommandCmif(121)] // 5.0.0+
// ClearUserChannel() // ClearUserChannel()
public ResultCode ClearUserChannel(ServiceCtx context) public ResultCode ClearUserChannel(ServiceCtx context)
{ {
@ -536,7 +536,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(122)] // 5.0.0+ [CommandCmif(122)] // 5.0.0+
// UnpopToUserChannel(object<nn::am::service::IStorage> input_storage) // UnpopToUserChannel(object<nn::am::service::IStorage> input_storage)
public ResultCode UnpopToUserChannel(ServiceCtx context) public ResultCode UnpopToUserChannel(ServiceCtx context)
{ {
@ -547,7 +547,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(123)] // 5.0.0+ [CommandCmif(123)] // 5.0.0+
// GetPreviousProgramIndex() -> s32 program_index // GetPreviousProgramIndex() -> s32 program_index
public ResultCode GetPreviousProgramIndex(ServiceCtx context) public ResultCode GetPreviousProgramIndex(ServiceCtx context)
{ {
@ -560,7 +560,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(130)] // 8.0.0+ [CommandCmif(130)] // 8.0.0+
// GetGpuErrorDetectedSystemEvent() -> handle<copy> // GetGpuErrorDetectedSystemEvent() -> handle<copy>
public ResultCode GetGpuErrorDetectedSystemEvent(ServiceCtx context) public ResultCode GetGpuErrorDetectedSystemEvent(ServiceCtx context)
{ {
@ -581,7 +581,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(140)] // 9.0.0+ [CommandCmif(140)] // 9.0.0+
// GetFriendInvitationStorageChannelEvent() -> handle<copy> // GetFriendInvitationStorageChannelEvent() -> handle<copy>
public ResultCode GetFriendInvitationStorageChannelEvent(ServiceCtx context) public ResultCode GetFriendInvitationStorageChannelEvent(ServiceCtx context)
{ {
@ -598,7 +598,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(141)] // 9.0.0+ [CommandCmif(141)] // 9.0.0+
// TryPopFromFriendInvitationStorageChannel() -> object<nn::am::service::IStorage> // TryPopFromFriendInvitationStorageChannel() -> object<nn::am::service::IStorage>
public ResultCode TryPopFromFriendInvitationStorageChannel(ServiceCtx context) public ResultCode TryPopFromFriendInvitationStorageChannel(ServiceCtx context)
{ {
@ -612,7 +612,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.NotAvailable; return ResultCode.NotAvailable;
} }
[CommandHipc(150)] // 9.0.0+ [CommandCmif(150)] // 9.0.0+
// GetNotificationStorageChannelEvent() -> handle<copy> // GetNotificationStorageChannelEvent() -> handle<copy>
public ResultCode GetNotificationStorageChannelEvent(ServiceCtx context) public ResultCode GetNotificationStorageChannelEvent(ServiceCtx context)
{ {
@ -629,7 +629,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(160)] // 9.0.0+ [CommandCmif(160)] // 9.0.0+
// GetHealthWarningDisappearedSystemEvent() -> handle<copy> // GetHealthWarningDisappearedSystemEvent() -> handle<copy>
public ResultCode GetHealthWarningDisappearedSystemEvent(ServiceCtx context) public ResultCode GetHealthWarningDisappearedSystemEvent(ServiceCtx context)
{ {
@ -646,7 +646,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(1001)] // 10.0.0+ [CommandCmif(1001)] // 10.0.0+
// PrepareForJit() // PrepareForJit()
public ResultCode PrepareForJit(ServiceCtx context) public ResultCode PrepareForJit(ServiceCtx context)
{ {

View File

@ -12,7 +12,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService
_pid = pid; _pid = pid;
} }
[CommandHipc(0)] [CommandCmif(0)]
// GetCommonStateGetter() -> object<nn::am::service::ICommonStateGetter> // GetCommonStateGetter() -> object<nn::am::service::ICommonStateGetter>
public ResultCode GetCommonStateGetter(ServiceCtx context) public ResultCode GetCommonStateGetter(ServiceCtx context)
{ {
@ -21,7 +21,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(1)] [CommandCmif(1)]
// GetSelfController() -> object<nn::am::service::ISelfController> // GetSelfController() -> object<nn::am::service::ISelfController>
public ResultCode GetSelfController(ServiceCtx context) public ResultCode GetSelfController(ServiceCtx context)
{ {
@ -30,7 +30,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(2)] [CommandCmif(2)]
// GetWindowController() -> object<nn::am::service::IWindowController> // GetWindowController() -> object<nn::am::service::IWindowController>
public ResultCode GetWindowController(ServiceCtx context) public ResultCode GetWindowController(ServiceCtx context)
{ {
@ -39,7 +39,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(3)] [CommandCmif(3)]
// GetAudioController() -> object<nn::am::service::IAudioController> // GetAudioController() -> object<nn::am::service::IAudioController>
public ResultCode GetAudioController(ServiceCtx context) public ResultCode GetAudioController(ServiceCtx context)
{ {
@ -48,7 +48,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(4)] [CommandCmif(4)]
// GetDisplayController() -> object<nn::am::service::IDisplayController> // GetDisplayController() -> object<nn::am::service::IDisplayController>
public ResultCode GetDisplayController(ServiceCtx context) public ResultCode GetDisplayController(ServiceCtx context)
{ {
@ -57,7 +57,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(11)] [CommandCmif(11)]
// GetLibraryAppletCreator() -> object<nn::am::service::ILibraryAppletCreator> // GetLibraryAppletCreator() -> object<nn::am::service::ILibraryAppletCreator>
public ResultCode GetLibraryAppletCreator(ServiceCtx context) public ResultCode GetLibraryAppletCreator(ServiceCtx context)
{ {
@ -66,7 +66,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(20)] [CommandCmif(20)]
// GetApplicationFunctions() -> object<nn::am::service::IApplicationFunctions> // GetApplicationFunctions() -> object<nn::am::service::IApplicationFunctions>
public ResultCode GetApplicationFunctions(ServiceCtx context) public ResultCode GetApplicationFunctions(ServiceCtx context)
{ {
@ -75,7 +75,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(1000)] [CommandCmif(1000)]
// GetDebugFunctions() -> object<nn::am::service::IDebugFunctions> // GetDebugFunctions() -> object<nn::am::service::IDebugFunctions>
public ResultCode GetDebugFunctions(ServiceCtx context) public ResultCode GetDebugFunctions(ServiceCtx context)
{ {

View File

@ -7,7 +7,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
{ {
public IApplicationProxyService(ServiceCtx context) { } public IApplicationProxyService(ServiceCtx context) { }
[CommandHipc(0)] [CommandCmif(0)]
// OpenApplicationProxy(u64, pid, handle<copy>) -> object<nn::am::service::IApplicationProxy> // OpenApplicationProxy(u64, pid, handle<copy>) -> object<nn::am::service::IApplicationProxy>
public ResultCode OpenApplicationProxy(ServiceCtx context) public ResultCode OpenApplicationProxy(ServiceCtx context)
{ {

View File

@ -8,7 +8,7 @@ namespace Ryujinx.HLE.HOS.Services.Apm
protected abstract PerformanceMode GetPerformanceMode(); protected abstract PerformanceMode GetPerformanceMode();
protected abstract bool IsCpuOverclockEnabled(); protected abstract bool IsCpuOverclockEnabled();
[CommandHipc(0)] [CommandCmif(0)]
// OpenSession() -> object<nn::apm::ISession> // OpenSession() -> object<nn::apm::ISession>
public ResultCode OpenSession(ServiceCtx context) public ResultCode OpenSession(ServiceCtx context)
{ {
@ -22,7 +22,7 @@ namespace Ryujinx.HLE.HOS.Services.Apm
return resultCode; return resultCode;
} }
[CommandHipc(1)] [CommandCmif(1)]
// GetPerformanceMode() -> nn::apm::PerformanceMode // GetPerformanceMode() -> nn::apm::PerformanceMode
public ResultCode GetPerformanceMode(ServiceCtx context) public ResultCode GetPerformanceMode(ServiceCtx context)
{ {
@ -31,7 +31,7 @@ namespace Ryujinx.HLE.HOS.Services.Apm
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(6)] // 7.0.0+ [CommandCmif(6)] // 7.0.0+
// IsCpuOverclockEnabled() -> bool // IsCpuOverclockEnabled() -> bool
public ResultCode IsCpuOverclockEnabled(ServiceCtx context) public ResultCode IsCpuOverclockEnabled(ServiceCtx context)
{ {

View File

@ -7,7 +7,7 @@ namespace Ryujinx.HLE.HOS.Services.Apm
{ {
public IManagerPrivileged(ServiceCtx context) { } public IManagerPrivileged(ServiceCtx context) { }
[CommandHipc(0)] [CommandCmif(0)]
// OpenSession() -> object<nn::apm::ISession> // OpenSession() -> object<nn::apm::ISession>
public ResultCode OpenSession(ServiceCtx context) public ResultCode OpenSession(ServiceCtx context)
{ {

View File

@ -8,7 +8,7 @@ namespace Ryujinx.HLE.HOS.Services.Apm
protected abstract ResultCode GetPerformanceConfiguration(PerformanceMode performanceMode, out PerformanceConfiguration performanceConfiguration); protected abstract ResultCode GetPerformanceConfiguration(PerformanceMode performanceMode, out PerformanceConfiguration performanceConfiguration);
protected abstract void SetCpuOverclockEnabled(bool enabled); protected abstract void SetCpuOverclockEnabled(bool enabled);
[CommandHipc(0)] [CommandCmif(0)]
// SetPerformanceConfiguration(nn::apm::PerformanceMode, nn::apm::PerformanceConfiguration) // SetPerformanceConfiguration(nn::apm::PerformanceMode, nn::apm::PerformanceConfiguration)
public ResultCode SetPerformanceConfiguration(ServiceCtx context) public ResultCode SetPerformanceConfiguration(ServiceCtx context)
{ {
@ -18,7 +18,7 @@ namespace Ryujinx.HLE.HOS.Services.Apm
return SetPerformanceConfiguration(performanceMode, performanceConfiguration); return SetPerformanceConfiguration(performanceMode, performanceConfiguration);
} }
[CommandHipc(1)] [CommandCmif(1)]
// GetPerformanceConfiguration(nn::apm::PerformanceMode) -> nn::apm::PerformanceConfiguration // GetPerformanceConfiguration(nn::apm::PerformanceMode) -> nn::apm::PerformanceConfiguration
public ResultCode GetPerformanceConfiguration(ServiceCtx context) public ResultCode GetPerformanceConfiguration(ServiceCtx context)
{ {
@ -31,7 +31,7 @@ namespace Ryujinx.HLE.HOS.Services.Apm
return resultCode; return resultCode;
} }
[CommandHipc(2)] // 8.0.0+ [CommandCmif(2)] // 8.0.0+
// SetCpuOverclockEnabled(bool) // SetCpuOverclockEnabled(bool)
public ResultCode SetCpuOverclockEnabled(ServiceCtx context) public ResultCode SetCpuOverclockEnabled(ServiceCtx context)
{ {

View File

@ -8,7 +8,7 @@ namespace Ryujinx.HLE.HOS.Services.Apm
internal abstract void SetCpuBoostMode(CpuBoostMode cpuBoostMode); internal abstract void SetCpuBoostMode(CpuBoostMode cpuBoostMode);
protected abstract PerformanceConfiguration GetCurrentPerformanceConfiguration(); protected abstract PerformanceConfiguration GetCurrentPerformanceConfiguration();
[CommandHipc(0)] [CommandCmif(0)]
// RequestPerformanceMode(nn::apm::PerformanceMode) // RequestPerformanceMode(nn::apm::PerformanceMode)
public ResultCode RequestPerformanceMode(ServiceCtx context) public ResultCode RequestPerformanceMode(ServiceCtx context)
{ {
@ -19,7 +19,7 @@ namespace Ryujinx.HLE.HOS.Services.Apm
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(6)] // 7.0.0+ [CommandCmif(6)] // 7.0.0+
// SetCpuBoostMode(nn::apm::CpuBootMode) // SetCpuBoostMode(nn::apm::CpuBootMode)
public ResultCode SetCpuBoostMode(ServiceCtx context) public ResultCode SetCpuBoostMode(ServiceCtx context)
{ {
@ -30,7 +30,7 @@ namespace Ryujinx.HLE.HOS.Services.Apm
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(7)] // 7.0.0+ [CommandCmif(7)] // 7.0.0+
// GetCurrentPerformanceConfiguration() -> nn::apm::PerformanceConfiguration // GetCurrentPerformanceConfiguration() -> nn::apm::PerformanceConfiguration
public ResultCode GetCurrentPerformanceConfiguration(ServiceCtx context) public ResultCode GetCurrentPerformanceConfiguration(ServiceCtx context)
{ {

View File

@ -18,7 +18,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioIn
_impl = impl; _impl = impl;
} }
[CommandHipc(0)] [CommandCmif(0)]
// GetAudioInState() -> u32 state // GetAudioInState() -> u32 state
public ResultCode GetAudioInState(ServiceCtx context) public ResultCode GetAudioInState(ServiceCtx context)
{ {
@ -27,21 +27,21 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioIn
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(1)] [CommandCmif(1)]
// Start() // Start()
public ResultCode Start(ServiceCtx context) public ResultCode Start(ServiceCtx context)
{ {
return _impl.Start(); return _impl.Start();
} }
[CommandHipc(2)] [CommandCmif(2)]
// Stop() // Stop()
public ResultCode StopAudioIn(ServiceCtx context) public ResultCode StopAudioIn(ServiceCtx context)
{ {
return _impl.Stop(); return _impl.Stop();
} }
[CommandHipc(3)] [CommandCmif(3)]
// AppendAudioInBuffer(u64 tag, buffer<nn::audio::AudioInBuffer, 5>) // AppendAudioInBuffer(u64 tag, buffer<nn::audio::AudioInBuffer, 5>)
public ResultCode AppendAudioInBuffer(ServiceCtx context) public ResultCode AppendAudioInBuffer(ServiceCtx context)
{ {
@ -54,7 +54,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioIn
return _impl.AppendBuffer(bufferTag, ref data); return _impl.AppendBuffer(bufferTag, ref data);
} }
[CommandHipc(4)] [CommandCmif(4)]
// RegisterBufferEvent() -> handle<copy> // RegisterBufferEvent() -> handle<copy>
public ResultCode RegisterBufferEvent(ServiceCtx context) public ResultCode RegisterBufferEvent(ServiceCtx context)
{ {
@ -70,7 +70,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioIn
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(5)] [CommandCmif(5)]
// GetReleasedAudioInBuffers() -> (u32 count, buffer<u64, 6> tags) // GetReleasedAudioInBuffers() -> (u32 count, buffer<u64, 6> tags)
public ResultCode GetReleasedAudioInBuffers(ServiceCtx context) public ResultCode GetReleasedAudioInBuffers(ServiceCtx context)
{ {
@ -87,7 +87,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioIn
} }
} }
[CommandHipc(6)] [CommandCmif(6)]
// ContainsAudioInBuffer(u64 tag) -> b8 // ContainsAudioInBuffer(u64 tag) -> b8
public ResultCode ContainsAudioInBuffer(ServiceCtx context) public ResultCode ContainsAudioInBuffer(ServiceCtx context)
{ {
@ -98,7 +98,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioIn
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(7)] // 3.0.0+ [CommandCmif(7)] // 3.0.0+
// AppendUacInBuffer(u64 tag, handle<copy, unknown>, buffer<nn::audio::AudioInBuffer, 5>) // AppendUacInBuffer(u64 tag, handle<copy, unknown>, buffer<nn::audio::AudioInBuffer, 5>)
public ResultCode AppendUacInBuffer(ServiceCtx context) public ResultCode AppendUacInBuffer(ServiceCtx context)
{ {
@ -112,7 +112,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioIn
return _impl.AppendUacBuffer(bufferTag, ref data, handle); return _impl.AppendUacBuffer(bufferTag, ref data, handle);
} }
[CommandHipc(8)] // 3.0.0+ [CommandCmif(8)] // 3.0.0+
// AppendAudioInBufferAuto(u64 tag, buffer<nn::audio::AudioInBuffer, 0x21>) // AppendAudioInBufferAuto(u64 tag, buffer<nn::audio::AudioInBuffer, 0x21>)
public ResultCode AppendAudioInBufferAuto(ServiceCtx context) public ResultCode AppendAudioInBufferAuto(ServiceCtx context)
{ {
@ -125,7 +125,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioIn
return _impl.AppendBuffer(bufferTag, ref data); return _impl.AppendBuffer(bufferTag, ref data);
} }
[CommandHipc(9)] // 3.0.0+ [CommandCmif(9)] // 3.0.0+
// GetReleasedAudioInBuffersAuto() -> (u32 count, buffer<u64, 0x22> tags) // GetReleasedAudioInBuffersAuto() -> (u32 count, buffer<u64, 0x22> tags)
public ResultCode GetReleasedAudioInBuffersAuto(ServiceCtx context) public ResultCode GetReleasedAudioInBuffersAuto(ServiceCtx context)
{ {
@ -141,7 +141,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioIn
} }
} }
[CommandHipc(10)] // 3.0.0+ [CommandCmif(10)] // 3.0.0+
// AppendUacInBufferAuto(u64 tag, handle<copy, event>, buffer<nn::audio::AudioInBuffer, 0x21>) // AppendUacInBufferAuto(u64 tag, handle<copy, event>, buffer<nn::audio::AudioInBuffer, 0x21>)
public ResultCode AppendUacInBufferAuto(ServiceCtx context) public ResultCode AppendUacInBufferAuto(ServiceCtx context)
{ {
@ -155,7 +155,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioIn
return _impl.AppendUacBuffer(bufferTag, ref data, handle); return _impl.AppendUacBuffer(bufferTag, ref data, handle);
} }
[CommandHipc(11)] // 4.0.0+ [CommandCmif(11)] // 4.0.0+
// GetAudioInBufferCount() -> u32 // GetAudioInBufferCount() -> u32
public ResultCode GetAudioInBufferCount(ServiceCtx context) public ResultCode GetAudioInBufferCount(ServiceCtx context)
{ {
@ -164,7 +164,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioIn
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(12)] // 4.0.0+ [CommandCmif(12)] // 4.0.0+
// SetAudioInVolume(s32) // SetAudioInVolume(s32)
public ResultCode SetAudioInVolume(ServiceCtx context) public ResultCode SetAudioInVolume(ServiceCtx context)
{ {
@ -175,7 +175,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioIn
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(13)] // 4.0.0+ [CommandCmif(13)] // 4.0.0+
// GetAudioInVolume() -> s32 // GetAudioInVolume() -> s32
public ResultCode GetAudioInVolume(ServiceCtx context) public ResultCode GetAudioInVolume(ServiceCtx context)
{ {
@ -184,7 +184,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioIn
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(14)] // 6.0.0+ [CommandCmif(14)] // 6.0.0+
// FlushAudioInBuffers() -> b8 // FlushAudioInBuffers() -> b8
public ResultCode FlushAudioInBuffers(ServiceCtx context) public ResultCode FlushAudioInBuffers(ServiceCtx context)
{ {

View File

@ -21,7 +21,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
_impl = impl; _impl = impl;
} }
[CommandHipc(0)] [CommandCmif(0)]
// ListAudioIns() -> (u32, buffer<bytes, 6>) // ListAudioIns() -> (u32, buffer<bytes, 6>)
public ResultCode ListAudioIns(ServiceCtx context) public ResultCode ListAudioIns(ServiceCtx context)
{ {
@ -57,7 +57,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(1)] [CommandCmif(1)]
// OpenAudioIn(AudioInInputConfiguration input_config, nn::applet::AppletResourceUserId, pid, handle<copy, process>, buffer<bytes, 5> name) // OpenAudioIn(AudioInInputConfiguration input_config, nn::applet::AppletResourceUserId, pid, handle<copy, process>, buffer<bytes, 5> name)
// -> (u32 sample_rate, u32 channel_count, u32 pcm_format, u32, object<nn::audio::detail::IAudioIn>, buffer<bytes, 6> name) // -> (u32 sample_rate, u32 channel_count, u32 pcm_format, u32, object<nn::audio::detail::IAudioIn>, buffer<bytes, 6> name)
public ResultCode OpenAudioIn(ServiceCtx context) public ResultCode OpenAudioIn(ServiceCtx context)
@ -92,7 +92,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
return resultCode; return resultCode;
} }
[CommandHipc(2)] // 3.0.0+ [CommandCmif(2)] // 3.0.0+
// ListAudioInsAuto() -> (u32, buffer<bytes, 0x22>) // ListAudioInsAuto() -> (u32, buffer<bytes, 0x22>)
public ResultCode ListAudioInsAuto(ServiceCtx context) public ResultCode ListAudioInsAuto(ServiceCtx context)
{ {
@ -127,7 +127,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(3)] // 3.0.0+ [CommandCmif(3)] // 3.0.0+
// OpenAudioInAuto(AudioInInputConfiguration input_config, nn::applet::AppletResourceUserId, pid, handle<copy, process>, buffer<bytes, 0x21>) // OpenAudioInAuto(AudioInInputConfiguration input_config, nn::applet::AppletResourceUserId, pid, handle<copy, process>, buffer<bytes, 0x21>)
// -> (u32 sample_rate, u32 channel_count, u32 pcm_format, u32, object<nn::audio::detail::IAudioIn>, buffer<bytes, 0x22> name) // -> (u32 sample_rate, u32 channel_count, u32 pcm_format, u32, object<nn::audio::detail::IAudioIn>, buffer<bytes, 0x22> name)
public ResultCode OpenAudioInAuto(ServiceCtx context) public ResultCode OpenAudioInAuto(ServiceCtx context)
@ -159,7 +159,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
return resultCode; return resultCode;
} }
[CommandHipc(4)] // 3.0.0+ [CommandCmif(4)] // 3.0.0+
// ListAudioInsAutoFiltered() -> (u32, buffer<bytes, 0x22>) // ListAudioInsAutoFiltered() -> (u32, buffer<bytes, 0x22>)
public ResultCode ListAudioInsAutoFiltered(ServiceCtx context) public ResultCode ListAudioInsAutoFiltered(ServiceCtx context)
{ {
@ -194,7 +194,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(5)] // 5.0.0+ [CommandCmif(5)] // 5.0.0+
// OpenAudioInProtocolSpecified(b64 protocol_specified_related, AudioInInputConfiguration input_config, nn::applet::AppletResourceUserId, pid, handle<copy, process>, buffer<bytes, 5> name) // OpenAudioInProtocolSpecified(b64 protocol_specified_related, AudioInInputConfiguration input_config, nn::applet::AppletResourceUserId, pid, handle<copy, process>, buffer<bytes, 5> name)
// -> (u32 sample_rate, u32 channel_count, u32 pcm_format, u32, object<nn::audio::detail::IAudioIn>, buffer<bytes, 6> name) // -> (u32 sample_rate, u32 channel_count, u32 pcm_format, u32, object<nn::audio::detail::IAudioIn>, buffer<bytes, 6> name)
public ResultCode OpenAudioInProtocolSpecified(ServiceCtx context) public ResultCode OpenAudioInProtocolSpecified(ServiceCtx context)

View File

@ -18,7 +18,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioOut
_impl = impl; _impl = impl;
} }
[CommandHipc(0)] [CommandCmif(0)]
// GetAudioOutState() -> u32 state // GetAudioOutState() -> u32 state
public ResultCode GetAudioOutState(ServiceCtx context) public ResultCode GetAudioOutState(ServiceCtx context)
{ {
@ -27,21 +27,21 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioOut
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(1)] [CommandCmif(1)]
// Start() // Start()
public ResultCode Start(ServiceCtx context) public ResultCode Start(ServiceCtx context)
{ {
return _impl.Start(); return _impl.Start();
} }
[CommandHipc(2)] [CommandCmif(2)]
// Stop() // Stop()
public ResultCode Stop(ServiceCtx context) public ResultCode Stop(ServiceCtx context)
{ {
return _impl.Stop(); return _impl.Stop();
} }
[CommandHipc(3)] [CommandCmif(3)]
// AppendAudioOutBuffer(u64 bufferTag, buffer<nn::audio::AudioOutBuffer, 5> buffer) // AppendAudioOutBuffer(u64 bufferTag, buffer<nn::audio::AudioOutBuffer, 5> buffer)
public ResultCode AppendAudioOutBuffer(ServiceCtx context) public ResultCode AppendAudioOutBuffer(ServiceCtx context)
{ {
@ -54,7 +54,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioOut
return _impl.AppendBuffer(bufferTag, ref data); return _impl.AppendBuffer(bufferTag, ref data);
} }
[CommandHipc(4)] [CommandCmif(4)]
// RegisterBufferEvent() -> handle<copy> // RegisterBufferEvent() -> handle<copy>
public ResultCode RegisterBufferEvent(ServiceCtx context) public ResultCode RegisterBufferEvent(ServiceCtx context)
{ {
@ -70,7 +70,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioOut
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(5)] [CommandCmif(5)]
// GetReleasedAudioOutBuffers() -> (u32 count, buffer<u64, 6> tags) // GetReleasedAudioOutBuffers() -> (u32 count, buffer<u64, 6> tags)
public ResultCode GetReleasedAudioOutBuffers(ServiceCtx context) public ResultCode GetReleasedAudioOutBuffers(ServiceCtx context)
{ {
@ -87,7 +87,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioOut
} }
} }
[CommandHipc(6)] [CommandCmif(6)]
// ContainsAudioOutBuffer(u64 tag) -> b8 // ContainsAudioOutBuffer(u64 tag) -> b8
public ResultCode ContainsAudioOutBuffer(ServiceCtx context) public ResultCode ContainsAudioOutBuffer(ServiceCtx context)
{ {
@ -98,7 +98,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioOut
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(7)] // 3.0.0+ [CommandCmif(7)] // 3.0.0+
// AppendAudioOutBufferAuto(u64 tag, buffer<nn::audio::AudioOutBuffer, 0x21>) // AppendAudioOutBufferAuto(u64 tag, buffer<nn::audio::AudioOutBuffer, 0x21>)
public ResultCode AppendAudioOutBufferAuto(ServiceCtx context) public ResultCode AppendAudioOutBufferAuto(ServiceCtx context)
{ {
@ -111,7 +111,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioOut
return _impl.AppendBuffer(bufferTag, ref data); return _impl.AppendBuffer(bufferTag, ref data);
} }
[CommandHipc(8)] // 3.0.0+ [CommandCmif(8)] // 3.0.0+
// GetReleasedAudioOutBuffersAuto() -> (u32 count, buffer<u64, 0x22> tags) // GetReleasedAudioOutBuffersAuto() -> (u32 count, buffer<u64, 0x22> tags)
public ResultCode GetReleasedAudioOutBuffersAuto(ServiceCtx context) public ResultCode GetReleasedAudioOutBuffersAuto(ServiceCtx context)
{ {
@ -127,7 +127,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioOut
} }
} }
[CommandHipc(9)] // 4.0.0+ [CommandCmif(9)] // 4.0.0+
// GetAudioOutBufferCount() -> u32 // GetAudioOutBufferCount() -> u32
public ResultCode GetAudioOutBufferCount(ServiceCtx context) public ResultCode GetAudioOutBufferCount(ServiceCtx context)
{ {
@ -136,7 +136,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioOut
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(10)] // 4.0.0+ [CommandCmif(10)] // 4.0.0+
// GetAudioOutPlayedSampleCount() -> u64 // GetAudioOutPlayedSampleCount() -> u64
public ResultCode GetAudioOutPlayedSampleCount(ServiceCtx context) public ResultCode GetAudioOutPlayedSampleCount(ServiceCtx context)
{ {
@ -145,7 +145,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioOut
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(11)] // 4.0.0+ [CommandCmif(11)] // 4.0.0+
// FlushAudioOutBuffers() -> b8 // FlushAudioOutBuffers() -> b8
public ResultCode FlushAudioOutBuffers(ServiceCtx context) public ResultCode FlushAudioOutBuffers(ServiceCtx context)
{ {
@ -154,7 +154,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioOut
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(12)] // 6.0.0+ [CommandCmif(12)] // 6.0.0+
// SetAudioOutVolume(s32) // SetAudioOutVolume(s32)
public ResultCode SetAudioOutVolume(ServiceCtx context) public ResultCode SetAudioOutVolume(ServiceCtx context)
{ {
@ -165,7 +165,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioOut
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(13)] // 6.0.0+ [CommandCmif(13)] // 6.0.0+
// GetAudioOutVolume() -> s32 // GetAudioOutVolume() -> s32
public ResultCode GetAudioOutVolume(ServiceCtx context) public ResultCode GetAudioOutVolume(ServiceCtx context)
{ {

View File

@ -21,7 +21,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
_impl = impl; _impl = impl;
} }
[CommandHipc(0)] [CommandCmif(0)]
// ListAudioOuts() -> (u32, buffer<bytes, 6>) // ListAudioOuts() -> (u32, buffer<bytes, 6>)
public ResultCode ListAudioOuts(ServiceCtx context) public ResultCode ListAudioOuts(ServiceCtx context)
{ {
@ -57,7 +57,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(1)] [CommandCmif(1)]
// OpenAudioOut(AudioOutInputConfiguration input_config, nn::applet::AppletResourceUserId, pid, handle<copy, process> process_handle, buffer<bytes, 5> name_in) // OpenAudioOut(AudioOutInputConfiguration input_config, nn::applet::AppletResourceUserId, pid, handle<copy, process> process_handle, buffer<bytes, 5> name_in)
// -> (AudioOutInputConfiguration output_config, object<nn::audio::detail::IAudioOut>, buffer<bytes, 6> name_out) // -> (AudioOutInputConfiguration output_config, object<nn::audio::detail::IAudioOut>, buffer<bytes, 6> name_out)
public ResultCode OpenAudioOut(ServiceCtx context) public ResultCode OpenAudioOut(ServiceCtx context)
@ -92,7 +92,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
return resultCode; return resultCode;
} }
[CommandHipc(2)] // 3.0.0+ [CommandCmif(2)] // 3.0.0+
// ListAudioOutsAuto() -> (u32, buffer<bytes, 0x22>) // ListAudioOutsAuto() -> (u32, buffer<bytes, 0x22>)
public ResultCode ListAudioOutsAuto(ServiceCtx context) public ResultCode ListAudioOutsAuto(ServiceCtx context)
{ {
@ -127,7 +127,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(3)] // 3.0.0+ [CommandCmif(3)] // 3.0.0+
// OpenAudioOut(AudioOutInputConfiguration input_config, nn::applet::AppletResourceUserId, pid, handle<copy, process> process_handle, buffer<bytes, 0x21> name_in) // OpenAudioOut(AudioOutInputConfiguration input_config, nn::applet::AppletResourceUserId, pid, handle<copy, process> process_handle, buffer<bytes, 0x21> name_in)
// -> (AudioOutInputConfiguration output_config, object<nn::audio::detail::IAudioOut>, buffer<bytes, 0x22> name_out) // -> (AudioOutInputConfiguration output_config, object<nn::audio::detail::IAudioOut>, buffer<bytes, 0x22> name_out)
public ResultCode OpenAudioOutAuto(ServiceCtx context) public ResultCode OpenAudioOutAuto(ServiceCtx context)

View File

@ -19,7 +19,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
_impl = impl; _impl = impl;
} }
[CommandHipc(0)] [CommandCmif(0)]
// ListAudioDeviceName() -> (u32, buffer<bytes, 6>) // ListAudioDeviceName() -> (u32, buffer<bytes, 6>)
public ResultCode ListAudioDeviceName(ServiceCtx context) public ResultCode ListAudioDeviceName(ServiceCtx context)
{ {
@ -53,7 +53,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(1)] [CommandCmif(1)]
// SetAudioDeviceOutputVolume(f32 volume, buffer<bytes, 5> name) // SetAudioDeviceOutputVolume(f32 volume, buffer<bytes, 5> name)
public ResultCode SetAudioDeviceOutputVolume(ServiceCtx context) public ResultCode SetAudioDeviceOutputVolume(ServiceCtx context)
{ {
@ -67,7 +67,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return _impl.SetAudioDeviceOutputVolume(deviceName, volume); return _impl.SetAudioDeviceOutputVolume(deviceName, volume);
} }
[CommandHipc(2)] [CommandCmif(2)]
// GetAudioDeviceOutputVolume(buffer<bytes, 5> name) -> f32 volume // GetAudioDeviceOutputVolume(buffer<bytes, 5> name) -> f32 volume
public ResultCode GetAudioDeviceOutputVolume(ServiceCtx context) public ResultCode GetAudioDeviceOutputVolume(ServiceCtx context)
{ {
@ -86,7 +86,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return result; return result;
} }
[CommandHipc(3)] [CommandCmif(3)]
// GetActiveAudioDeviceName() -> buffer<bytes, 6> // GetActiveAudioDeviceName() -> buffer<bytes, 6>
public ResultCode GetActiveAudioDeviceName(ServiceCtx context) public ResultCode GetActiveAudioDeviceName(ServiceCtx context)
{ {
@ -109,7 +109,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(4)] [CommandCmif(4)]
// QueryAudioDeviceSystemEvent() -> handle<copy, event> // QueryAudioDeviceSystemEvent() -> handle<copy, event>
public ResultCode QueryAudioDeviceSystemEvent(ServiceCtx context) public ResultCode QueryAudioDeviceSystemEvent(ServiceCtx context)
{ {
@ -127,7 +127,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(5)] [CommandCmif(5)]
// GetActiveChannelCount() -> u32 // GetActiveChannelCount() -> u32
public ResultCode GetActiveChannelCount(ServiceCtx context) public ResultCode GetActiveChannelCount(ServiceCtx context)
{ {
@ -138,7 +138,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(6)] // 3.0.0+ [CommandCmif(6)] // 3.0.0+
// ListAudioDeviceNameAuto() -> (u32, buffer<bytes, 0x22>) // ListAudioDeviceNameAuto() -> (u32, buffer<bytes, 0x22>)
public ResultCode ListAudioDeviceNameAuto(ServiceCtx context) public ResultCode ListAudioDeviceNameAuto(ServiceCtx context)
{ {
@ -171,7 +171,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(7)] // 3.0.0+ [CommandCmif(7)] // 3.0.0+
// SetAudioDeviceOutputVolumeAuto(f32 volume, buffer<bytes, 0x21> name) // SetAudioDeviceOutputVolumeAuto(f32 volume, buffer<bytes, 0x21> name)
public ResultCode SetAudioDeviceOutputVolumeAuto(ServiceCtx context) public ResultCode SetAudioDeviceOutputVolumeAuto(ServiceCtx context)
{ {
@ -184,7 +184,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return _impl.SetAudioDeviceOutputVolume(deviceName, volume); return _impl.SetAudioDeviceOutputVolume(deviceName, volume);
} }
[CommandHipc(8)] // 3.0.0+ [CommandCmif(8)] // 3.0.0+
// GetAudioDeviceOutputVolumeAuto(buffer<bytes, 0x21> name) -> f32 // GetAudioDeviceOutputVolumeAuto(buffer<bytes, 0x21> name) -> f32
public ResultCode GetAudioDeviceOutputVolumeAuto(ServiceCtx context) public ResultCode GetAudioDeviceOutputVolumeAuto(ServiceCtx context)
{ {
@ -202,7 +202,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(10)] // 3.0.0+ [CommandCmif(10)] // 3.0.0+
// GetActiveAudioDeviceNameAuto() -> buffer<bytes, 0x22> // GetActiveAudioDeviceNameAuto() -> buffer<bytes, 0x22>
public ResultCode GetActiveAudioDeviceNameAuto(ServiceCtx context) public ResultCode GetActiveAudioDeviceNameAuto(ServiceCtx context)
{ {
@ -224,7 +224,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(11)] // 3.0.0+ [CommandCmif(11)] // 3.0.0+
// QueryAudioDeviceInputEvent() -> handle<copy, event> // QueryAudioDeviceInputEvent() -> handle<copy, event>
public ResultCode QueryAudioDeviceInputEvent(ServiceCtx context) public ResultCode QueryAudioDeviceInputEvent(ServiceCtx context)
{ {
@ -242,7 +242,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(12)] // 3.0.0+ [CommandCmif(12)] // 3.0.0+
// QueryAudioDeviceOutputEvent() -> handle<copy, event> // QueryAudioDeviceOutputEvent() -> handle<copy, event>
public ResultCode QueryAudioDeviceOutputEvent(ServiceCtx context) public ResultCode QueryAudioDeviceOutputEvent(ServiceCtx context)
{ {
@ -260,7 +260,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(13)] // 13.0.0+ [CommandCmif(13)] // 13.0.0+
// GetActiveAudioOutputDeviceName() -> buffer<bytes, 6> // GetActiveAudioOutputDeviceName() -> buffer<bytes, 6>
public ResultCode GetActiveAudioOutputDeviceName(ServiceCtx context) public ResultCode GetActiveAudioOutputDeviceName(ServiceCtx context)
{ {
@ -283,7 +283,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(14)] // 13.0.0+ [CommandCmif(14)] // 13.0.0+
// ListAudioOutputDeviceName() -> (u32, buffer<bytes, 6>) // ListAudioOutputDeviceName() -> (u32, buffer<bytes, 6>)
public ResultCode ListAudioOutputDeviceName(ServiceCtx context) public ResultCode ListAudioOutputDeviceName(ServiceCtx context)
{ {

View File

@ -16,7 +16,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
_impl = impl; _impl = impl;
} }
[CommandHipc(0)] [CommandCmif(0)]
// GetSampleRate() -> u32 // GetSampleRate() -> u32
public ResultCode GetSampleRate(ServiceCtx context) public ResultCode GetSampleRate(ServiceCtx context)
{ {
@ -25,7 +25,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(1)] [CommandCmif(1)]
// GetSampleCount() -> u32 // GetSampleCount() -> u32
public ResultCode GetSampleCount(ServiceCtx context) public ResultCode GetSampleCount(ServiceCtx context)
{ {
@ -34,7 +34,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(2)] [CommandCmif(2)]
// GetMixBufferCount() -> u32 // GetMixBufferCount() -> u32
public ResultCode GetMixBufferCount(ServiceCtx context) public ResultCode GetMixBufferCount(ServiceCtx context)
{ {
@ -43,7 +43,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(3)] [CommandCmif(3)]
// GetState() -> u32 // GetState() -> u32
public ResultCode GetState(ServiceCtx context) public ResultCode GetState(ServiceCtx context)
{ {
@ -52,7 +52,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(4)] [CommandCmif(4)]
// RequestUpdate(buffer<nn::audio::detail::AudioRendererUpdateDataHeader, 5> input) // RequestUpdate(buffer<nn::audio::detail::AudioRendererUpdateDataHeader, 5> input)
// -> (buffer<nn::audio::detail::AudioRendererUpdateDataHeader, 6> output, buffer<nn::audio::detail::AudioRendererUpdateDataHeader, 6> performanceOutput) // -> (buffer<nn::audio::detail::AudioRendererUpdateDataHeader, 6> output, buffer<nn::audio::detail::AudioRendererUpdateDataHeader, 6> performanceOutput)
public ResultCode RequestUpdate(ServiceCtx context) public ResultCode RequestUpdate(ServiceCtx context)
@ -89,21 +89,21 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return result; return result;
} }
[CommandHipc(5)] [CommandCmif(5)]
// Start() // Start()
public ResultCode Start(ServiceCtx context) public ResultCode Start(ServiceCtx context)
{ {
return _impl.Start(); return _impl.Start();
} }
[CommandHipc(6)] [CommandCmif(6)]
// Stop() // Stop()
public ResultCode Stop(ServiceCtx context) public ResultCode Stop(ServiceCtx context)
{ {
return _impl.Stop(); return _impl.Stop();
} }
[CommandHipc(7)] [CommandCmif(7)]
// QuerySystemEvent() -> handle<copy, event> // QuerySystemEvent() -> handle<copy, event>
public ResultCode QuerySystemEvent(ServiceCtx context) public ResultCode QuerySystemEvent(ServiceCtx context)
{ {
@ -122,7 +122,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return result; return result;
} }
[CommandHipc(8)] [CommandCmif(8)]
// SetAudioRendererRenderingTimeLimit(u32 limit) // SetAudioRendererRenderingTimeLimit(u32 limit)
public ResultCode SetAudioRendererRenderingTimeLimit(ServiceCtx context) public ResultCode SetAudioRendererRenderingTimeLimit(ServiceCtx context)
{ {
@ -133,7 +133,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(9)] [CommandCmif(9)]
// GetAudioRendererRenderingTimeLimit() -> u32 limit // GetAudioRendererRenderingTimeLimit() -> u32 limit
public ResultCode GetAudioRendererRenderingTimeLimit(ServiceCtx context) public ResultCode GetAudioRendererRenderingTimeLimit(ServiceCtx context)
{ {
@ -144,7 +144,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(10)] // 3.0.0+ [CommandCmif(10)] // 3.0.0+
// RequestUpdateAuto(buffer<nn::audio::detail::AudioRendererUpdateDataHeader, 0x21> input) // RequestUpdateAuto(buffer<nn::audio::detail::AudioRendererUpdateDataHeader, 0x21> input)
// -> (buffer<nn::audio::detail::AudioRendererUpdateDataHeader, 0x22> output, buffer<nn::audio::detail::AudioRendererUpdateDataHeader, 0x22> performanceOutput) // -> (buffer<nn::audio::detail::AudioRendererUpdateDataHeader, 0x22> output, buffer<nn::audio::detail::AudioRendererUpdateDataHeader, 0x22> performanceOutput)
public ResultCode RequestUpdateAuto(ServiceCtx context) public ResultCode RequestUpdateAuto(ServiceCtx context)
@ -172,14 +172,14 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return result; return result;
} }
[CommandHipc(11)] // 3.0.0+ [CommandCmif(11)] // 3.0.0+
// ExecuteAudioRendererRendering() // ExecuteAudioRendererRendering()
public ResultCode ExecuteAudioRendererRendering(ServiceCtx context) public ResultCode ExecuteAudioRendererRendering(ServiceCtx context)
{ {
return _impl.ExecuteAudioRendererRendering(); return _impl.ExecuteAudioRendererRendering();
} }
[CommandHipc(12)] // 15.0.0+ [CommandCmif(12)] // 15.0.0+
// SetVoiceDropParameter(f32 voiceDropParameter) // SetVoiceDropParameter(f32 voiceDropParameter)
public ResultCode SetVoiceDropParameter(ServiceCtx context) public ResultCode SetVoiceDropParameter(ServiceCtx context)
{ {
@ -190,7 +190,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
return ResultCode.Success; return ResultCode.Success;
} }
[CommandHipc(13)] // 15.0.0+ [CommandCmif(13)] // 15.0.0+
// GetVoiceDropParameter() -> f32 voiceDropParameter // GetVoiceDropParameter() -> f32 voiceDropParameter
public ResultCode GetVoiceDropParameter(ServiceCtx context) public ResultCode GetVoiceDropParameter(ServiceCtx context)
{ {
@ -209,4 +209,4 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRenderer
} }
} }
} }
} }

View File

@ -21,7 +21,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
_impl = impl; _impl = impl;
} }
[CommandHipc(0)] [CommandCmif(0)]
// OpenAudioRenderer(nn::audio::detail::AudioRendererParameterInternal parameter, u64 workBufferSize, nn::applet::AppletResourceUserId appletResourceId, pid, handle<copy> workBuffer, handle<copy> processHandle) // OpenAudioRenderer(nn::audio::detail::AudioRendererParameterInternal parameter, u64 workBufferSize, nn::applet::AppletResourceUserId appletResourceId, pid, handle<copy> workBuffer, handle<copy> processHandle)
// -> object<nn::audio::detail::IAudioRenderer> // -> object<nn::audio::detail::IAudioRenderer>
public ResultCode OpenAudioRenderer(ServiceCtx context) public ResultCode OpenAudioRenderer(ServiceCtx context)
@ -54,7 +54,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
return result; return result;
} }
[CommandHipc(1)] [CommandCmif(1)]
// GetWorkBufferSize(nn::audio::detail::AudioRendererParameterInternal parameter) -> u64 workBufferSize // GetWorkBufferSize(nn::audio::detail::AudioRendererParameterInternal parameter) -> u64 workBufferSize
public ResultCode GetAudioRendererWorkBufferSize(ServiceCtx context) public ResultCode GetAudioRendererWorkBufferSize(ServiceCtx context)
{ {
@ -80,7 +80,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
} }
} }
[CommandHipc(2)] [CommandCmif(2)]
// GetAudioDeviceService(nn::applet::AppletResourceUserId) -> object<nn::audio::detail::IAudioDevice> // GetAudioDeviceService(nn::applet::AppletResourceUserId) -> object<nn::audio::detail::IAudioDevice>
public ResultCode GetAudioDeviceService(ServiceCtx context) public ResultCode GetAudioDeviceService(ServiceCtx context)
{ {
@ -96,7 +96,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio
return result; return result;
} }
[CommandHipc(4)] // 4.0.0+ [CommandCmif(4)] // 4.0.0+
// GetAudioDeviceServiceWithRevisionInfo(s32 revision, nn::applet::AppletResourceUserId appletResourceId) -> object<nn::audio::detail::IAudioDevice> // GetAudioDeviceServiceWithRevisionInfo(s32 revision, nn::applet::AppletResourceUserId appletResourceId) -> object<nn::audio::detail::IAudioDevice>
public ResultCode GetAudioDeviceServiceWithRevisionInfo(ServiceCtx context) public ResultCode GetAudioDeviceServiceWithRevisionInfo(ServiceCtx context)
{ {

View File

@ -21,35 +21,35 @@ namespace Ryujinx.HLE.HOS.Services.Audio.HardwareOpusDecoderManager
_flags = flags; _flags = flags;
} }
[CommandHipc(0)] [CommandCmif(0)]
// DecodeInterleavedOld(buffer<unknown, 5>) -> (u32, u32, buffer<unknown, 6>) // DecodeInterleavedOld(buffer<unknown, 5>) -> (u32, u32, buffer<unknown, 6>)
public ResultCode DecodeInterleavedOld(ServiceCtx context) public ResultCode DecodeInterleavedOld(ServiceCtx context)
{ {
return DecodeInterleavedInternal(context, OpusDecoderFlags.None, reset: false, withPerf: false); return DecodeInterleavedInternal(context, OpusDecoderFlags.None, reset: false, withPerf: false);
} }
[CommandHipc(2)] [CommandCmif(2)]
// DecodeInterleavedForMultiStreamOld(buffer<unknown, 5>) -> (u32, u32, buffer<unknown, 6>) // DecodeInterleavedForMultiStreamOld(buffer<unknown, 5>) -> (u32, u32, buffer<unknown, 6>)
public ResultCode DecodeInterleavedForMultiStreamOld(ServiceCtx context) public ResultCode DecodeInterleavedForMultiStreamOld(ServiceCtx context)
{ {
return DecodeInterleavedInternal(context, OpusDecoderFlags.None, reset: false, withPerf: false); return DecodeInterleavedInternal(context, OpusDecoderFlags.None, reset: false, withPerf: false);
} }
[CommandHipc(4)] // 6.0.0+ [CommandCmif(4)] // 6.0.0+
// DecodeInterleavedWithPerfOld(buffer<unknown, 5>) -> (u32, u32, u64, buffer<unknown, 0x46>) // DecodeInterleavedWithPerfOld(buffer<unknown, 5>) -> (u32, u32, u64, buffer<unknown, 0x46>)
public ResultCode DecodeInterleavedWithPerfOld(ServiceCtx context) public ResultCode DecodeInterleavedWithPerfOld(ServiceCtx context)
{ {
return DecodeInterleavedInternal(context, OpusDecoderFlags.None, reset: false, withPerf: true); return DecodeInterleavedInternal(context, OpusDecoderFlags.None, reset: false, withPerf: true);
} }
[CommandHipc(5)] // 6.0.0+ [CommandCmif(5)] // 6.0.0+
// DecodeInterleavedForMultiStreamWithPerfOld(buffer<unknown, 5>) -> (u32, u32, u64, buffer<unknown, 0x46>) // DecodeInterleavedForMultiStreamWithPerfOld(buffer<unknown, 5>) -> (u32, u32, u64, buffer<unknown, 0x46>)
public ResultCode DecodeInterleavedForMultiStreamWithPerfOld(ServiceCtx context) public ResultCode DecodeInterleavedForMultiStreamWithPerfOld(ServiceCtx context)
{ {
return DecodeInterleavedInternal(context, OpusDecoderFlags.None, reset: false, withPerf: true); return DecodeInterleavedInternal(context, OpusDecoderFlags.None, reset: false, withPerf: true);
} }
[CommandHipc(6)] // 6.0.0+ [CommandCmif(6)] // 6.0.0+
// DecodeInterleavedWithPerfAndResetOld(bool reset, buffer<unknown, 5>) -> (u32, u32, u64, buffer<unknown, 0x46>) // DecodeInterleavedWithPerfAndResetOld(bool reset, buffer<unknown, 5>) -> (u32, u32, u64, buffer<unknown, 0x46>)
public ResultCode DecodeInterleavedWithPerfAndResetOld(ServiceCtx context) public ResultCode DecodeInterleavedWithPerfAndResetOld(ServiceCtx context)
{ {
@ -58,7 +58,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.HardwareOpusDecoderManager
return DecodeInterleavedInternal(context, OpusDecoderFlags.None, reset, withPerf: true); return DecodeInterleavedInternal(context, OpusDecoderFlags.None, reset, withPerf: true);
} }
[CommandHipc(7)] // 6.0.0+ [CommandCmif(7)] // 6.0.0+
// DecodeInterleavedForMultiStreamWithPerfAndResetOld(bool reset, buffer<unknown, 5>) -> (u32, u32, u64, buffer<unknown, 0x46>) // DecodeInterleavedForMultiStreamWithPerfAndResetOld(bool reset, buffer<unknown, 5>) -> (u32, u32, u64, buffer<unknown, 0x46>)
public ResultCode DecodeInterleavedForMultiStreamWithPerfAndResetOld(ServiceCtx context) public ResultCode DecodeInterleavedForMultiStreamWithPerfAndResetOld(ServiceCtx context)
{ {
@ -67,7 +67,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.HardwareOpusDecoderManager
return DecodeInterleavedInternal(context, OpusDecoderFlags.None, reset, withPerf: true); return DecodeInterleavedInternal(context, OpusDecoderFlags.None, reset, withPerf: true);
} }
[CommandHipc(8)] // 7.0.0+ [CommandCmif(8)] // 7.0.0+
// DecodeInterleaved(bool reset, buffer<unknown, 0x45>) -> (u32, u32, u64, buffer<unknown, 0x46>) // DecodeInterleaved(bool reset, buffer<unknown, 0x45>) -> (u32, u32, u64, buffer<unknown, 0x46>)
public ResultCode DecodeInterleaved(ServiceCtx context) public ResultCode DecodeInterleaved(ServiceCtx context)
{ {
@ -76,7 +76,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.HardwareOpusDecoderManager
return DecodeInterleavedInternal(context, _flags, reset, withPerf: true); return DecodeInterleavedInternal(context, _flags, reset, withPerf: true);
} }
[CommandHipc(9)] // 7.0.0+ [CommandCmif(9)] // 7.0.0+
// DecodeInterleavedForMultiStream(bool reset, buffer<unknown, 0x45>) -> (u32, u32, u64, buffer<unknown, 0x46>) // DecodeInterleavedForMultiStream(bool reset, buffer<unknown, 0x45>) -> (u32, u32, u64, buffer<unknown, 0x46>)
public ResultCode DecodeInterleavedForMultiStream(ServiceCtx context) public ResultCode DecodeInterleavedForMultiStream(ServiceCtx context)
{ {

Some files were not shown because too many files have changed in this diff Show More