Compare commits

...

8 Commits

Author SHA1 Message Date
863c581190 fix headless sdl2 option string (#3093) 2022-02-07 11:50:51 +01:00
5c3112aaeb Convert the bool to a lowercase string (#3080)
mesa_glthread doesn't accept PascalCase input
2022-02-06 12:52:39 -03:00
88d3ffb97c ARMeilleure: A32: Implement SHADD8 (#3086) 2022-02-06 12:25:45 -03:00
222b1ad7da ARMeilleure: OpCodeTable: Add CMN (RsReg) (#3087) 2022-02-06 02:01:05 +01:00
d317cfd639 Try to ensure save data always has a valid owner ID (#3057)
- Run the extra data fix in FixExtraData on non-system saves that have no owner ID.
- Set the owner ID in the dummy application control property if an application doesn't have a proper one available.
2022-02-02 14:49:49 -07:00
76b9041adf Fix the pronunciation of Ryujinx (#3059) 2022-01-31 18:34:21 +01:00
b944941733 Fix bug that could cause depth buffer to be missing after clear (#3067) 2022-01-31 00:11:43 -03:00
0dddcd012c Remove Appveyor from Readme and SLN (#3026)
* Replace Appveyor with Github badge.

* Delete appveyor.yml

* Remove Appveyor from SLN
2022-01-30 16:41:22 +01:00
13 changed files with 79 additions and 67 deletions

View File

@ -654,6 +654,7 @@ namespace ARMeilleure.Decoders
SetA32("<<<<000101101111xxxx11110001xxxx", InstName.Clz, InstEmit32.Clz, OpCode32AluReg.Create); SetA32("<<<<000101101111xxxx11110001xxxx", InstName.Clz, InstEmit32.Clz, OpCode32AluReg.Create);
SetA32("<<<<00110111xxxx0000xxxxxxxxxxxx", InstName.Cmn, InstEmit32.Cmn, OpCode32AluImm.Create); SetA32("<<<<00110111xxxx0000xxxxxxxxxxxx", InstName.Cmn, InstEmit32.Cmn, OpCode32AluImm.Create);
SetA32("<<<<00010111xxxx0000xxxxxxx0xxxx", InstName.Cmn, InstEmit32.Cmn, OpCode32AluRsImm.Create); SetA32("<<<<00010111xxxx0000xxxxxxx0xxxx", InstName.Cmn, InstEmit32.Cmn, OpCode32AluRsImm.Create);
SetA32("<<<<00010111xxxx0000xxxx0xx1xxxx", InstName.Cmn, InstEmit32.Cmn, OpCode32AluRsReg.Create);
SetA32("<<<<00110101xxxx0000xxxxxxxxxxxx", InstName.Cmp, InstEmit32.Cmp, OpCode32AluImm.Create); SetA32("<<<<00110101xxxx0000xxxxxxxxxxxx", InstName.Cmp, InstEmit32.Cmp, OpCode32AluImm.Create);
SetA32("<<<<00010101xxxx0000xxxxxxx0xxxx", InstName.Cmp, InstEmit32.Cmp, OpCode32AluRsImm.Create); SetA32("<<<<00010101xxxx0000xxxxxxx0xxxx", InstName.Cmp, InstEmit32.Cmp, OpCode32AluRsImm.Create);
SetA32("<<<<00010101xxxx0000xxxx0xx1xxxx", InstName.Cmp, InstEmit32.Cmp, OpCode32AluRsReg.Create); SetA32("<<<<00010101xxxx0000xxxx0xx1xxxx", InstName.Cmp, InstEmit32.Cmp, OpCode32AluRsReg.Create);
@ -732,6 +733,7 @@ namespace ARMeilleure.Decoders
SetA32("<<<<0000110xxxxxxxxxxxxx0xx1xxxx", InstName.Sbc, InstEmit32.Sbc, OpCode32AluRsReg.Create); SetA32("<<<<0000110xxxxxxxxxxxxx0xx1xxxx", InstName.Sbc, InstEmit32.Sbc, OpCode32AluRsReg.Create);
SetA32("<<<<0111101xxxxxxxxxxxxxx101xxxx", InstName.Sbfx, InstEmit32.Sbfx, OpCode32AluBf.Create); SetA32("<<<<0111101xxxxxxxxxxxxxx101xxxx", InstName.Sbfx, InstEmit32.Sbfx, OpCode32AluBf.Create);
SetA32("<<<<01110001xxxx1111xxxx0001xxxx", InstName.Sdiv, InstEmit32.Sdiv, OpCode32AluMla.Create); SetA32("<<<<01110001xxxx1111xxxx0001xxxx", InstName.Sdiv, InstEmit32.Sdiv, OpCode32AluMla.Create);
SetA32("<<<<01100011xxxxxxxx11111001xxxx", InstName.Shadd8, InstEmit32.Shadd8, OpCode32AluReg.Create);
SetA32("<<<<00010000xxxxxxxxxxxx1xx0xxxx", InstName.Smla__, InstEmit32.Smla__, OpCode32AluMla.Create); SetA32("<<<<00010000xxxxxxxxxxxx1xx0xxxx", InstName.Smla__, InstEmit32.Smla__, OpCode32AluMla.Create);
SetA32("<<<<0000111xxxxxxxxxxxxx1001xxxx", InstName.Smlal, InstEmit32.Smlal, OpCode32AluUmull.Create); SetA32("<<<<0000111xxxxxxxxxxxxx1001xxxx", InstName.Smlal, InstEmit32.Smlal, OpCode32AluUmull.Create);
SetA32("<<<<00010100xxxxxxxxxxxx1xx0xxxx", InstName.Smlal__, InstEmit32.Smlal__, OpCode32AluUmull.Create); SetA32("<<<<00010100xxxxxxxxxxxx1xx0xxxx", InstName.Smlal__, InstEmit32.Smlal__, OpCode32AluUmull.Create);

View File

@ -387,6 +387,11 @@ namespace ARMeilleure.Instructions
EmitDiv(context, false); EmitDiv(context, false);
} }
public static void Shadd8(ArmEmitterContext context)
{
EmitHadd8(context, false);
}
public static void Ssat(ArmEmitterContext context) public static void Ssat(ArmEmitterContext context)
{ {
OpCode32Sat op = (OpCode32Sat)context.CurrOp; OpCode32Sat op = (OpCode32Sat)context.CurrOp;
@ -474,20 +479,7 @@ namespace ARMeilleure.Instructions
public static void Uhadd8(ArmEmitterContext context) public static void Uhadd8(ArmEmitterContext context)
{ {
OpCode32AluReg op = (OpCode32AluReg)context.CurrOp; EmitHadd8(context, true);
Operand m = GetIntA32(context, op.Rm);
Operand n = GetIntA32(context, op.Rn);
Operand xor, res;
res = context.BitwiseAnd(m, n);
xor = context.BitwiseExclusiveOr(m, n);
xor = context.ShiftRightUI(xor, Const(1));
xor = context.BitwiseAnd(xor, Const(0x7F7F7F7Fu));
res = context.Add(res, xor);
SetIntA32(context, op.Rd, res);
} }
public static void Usat(ArmEmitterContext context) public static void Usat(ArmEmitterContext context)
@ -659,6 +651,36 @@ namespace ARMeilleure.Instructions
context.MarkLabel(lblEnd); context.MarkLabel(lblEnd);
} }
private static void EmitHadd8(ArmEmitterContext context, bool unsigned)
{
OpCode32AluReg op = (OpCode32AluReg)context.CurrOp;
Operand m = GetIntA32(context, op.Rm);
Operand n = GetIntA32(context, op.Rn);
Operand xor, res, carry;
// This relies on the equality x+y == ((x&y) << 1) + (x^y).
// Note that x^y always contains the LSB of the result.
// Since we want to calculate (x+y)/2, we can instead calculate (x&y) + ((x^y)>>1).
// We mask by 0x7F to remove the LSB so that it doesn't leak into the field below.
res = context.BitwiseAnd(m, n);
carry = context.BitwiseExclusiveOr(m, n);
xor = context.ShiftRightUI(carry, Const(1));
xor = context.BitwiseAnd(xor, Const(0x7F7F7F7Fu));
res = context.Add(res, xor);
if (!unsigned)
{
// Propagates the sign bit from (x^y)>>1 upwards by one.
carry = context.BitwiseAnd(carry, Const(0x80808080u));
res = context.BitwiseExclusiveOr(res, carry);
}
SetIntA32(context, op.Rd, res);
}
private static void EmitSat(ArmEmitterContext context, int intMin, int intMax) private static void EmitSat(ArmEmitterContext context, int intMin, int intMax)
{ {
OpCode32Sat op = (OpCode32Sat)context.CurrOp; OpCode32Sat op = (OpCode32Sat)context.CurrOp;
@ -772,4 +794,4 @@ namespace ARMeilleure.Instructions
EmitGenericAluStoreA32(context, op.Rd, op.SetFlags, value); EmitGenericAluStoreA32(context, op.Rd, op.SetFlags, value);
} }
} }
} }

View File

@ -516,6 +516,7 @@ namespace ARMeilleure.Instructions
Rsb, Rsb,
Rsc, Rsc,
Sbfx, Sbfx,
Shadd8,
Smla__, Smla__,
Smlal, Smlal,
Smlal__, Smlal__,

View File

@ -5,7 +5,7 @@
<br> <br>
<b>Ryujinx</b> <b>Ryujinx</b>
<br> <br>
<sub><sup><b>(REE-YOU-JI-NX)</b></sup></sub> <sub><sup><b>(REE-YOU-JINX)</b></sup></sub>
<br> <br>
</h1> </h1>
@ -17,8 +17,8 @@
</p> </p>
<p align="center"> <p align="center">
<a href="https://ci.appveyor.com/project/gdkchan/ryujinx?branch=master"> <a href="https://github.com/Ryujinx/Ryujinx/actions/workflows/release.yml">
<img src="https://ci.appveyor.com/api/projects/status/ssg4jwu6ve3k594s/branch/master?svg=true" <img src="https://github.com/Ryujinx/Ryujinx/actions/workflows/release.yml/badge.svg"
alt=""> alt="">
</a> </a>
<a href="https://discord.com/invite/VkQYXAZ"> <a href="https://discord.com/invite/VkQYXAZ">

View File

@ -6,7 +6,7 @@ namespace Ryujinx.Common.GraphicsDriver
{ {
public static void ToggleOGLThreading(bool enabled) public static void ToggleOGLThreading(bool enabled)
{ {
Environment.SetEnvironmentVariable("mesa_glthread", enabled.ToString()); Environment.SetEnvironmentVariable("mesa_glthread", enabled.ToString().ToLower());
Environment.SetEnvironmentVariable("__GL_THREADED_OPTIMIZATIONS", enabled ? "1" : "0"); Environment.SetEnvironmentVariable("__GL_THREADED_OPTIMIZATIONS", enabled ? "1" : "0");
try try

View File

@ -369,14 +369,14 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
if (color != null) if (color != null)
{ {
if (clipRegionWidth > color.Width) if (clipRegionWidth > color.Width / samplesInX)
{ {
clipRegionWidth = color.Width; clipRegionWidth = color.Width / samplesInX;
} }
if (clipRegionHeight > color.Height) if (clipRegionHeight > color.Height / samplesInY)
{ {
clipRegionHeight = color.Height; clipRegionHeight = color.Height / samplesInY;
} }
} }
} }
@ -400,14 +400,14 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
if (depthStencil != null) if (depthStencil != null)
{ {
if (clipRegionWidth > depthStencil.Width) if (clipRegionWidth > depthStencil.Width / samplesInX)
{ {
clipRegionWidth = depthStencil.Width; clipRegionWidth = depthStencil.Width / samplesInX;
} }
if (clipRegionHeight > depthStencil.Height) if (clipRegionHeight > depthStencil.Height / samplesInY)
{ {
clipRegionHeight = depthStencil.Height; clipRegionHeight = depthStencil.Height / samplesInY;
} }
} }
} }

View File

@ -434,6 +434,7 @@ namespace Ryujinx.Graphics.Gpu.Image
{ {
new Span<ITexture>(_rtHostColors).Fill(null); new Span<ITexture>(_rtHostColors).Fill(null);
_rtHostColors[index] = _rtColors[index]?.HostTexture; _rtHostColors[index] = _rtColors[index]?.HostTexture;
_rtHostDs = null;
_context.Renderer.Pipeline.SetRenderTargets(_rtHostColors, null); _context.Renderer.Pipeline.SetRenderTargets(_rtHostColors, null);
} }

View File

@ -505,7 +505,9 @@ namespace Ryujinx.HLE.FileSystem
bool canFixBySaveDataId = extraData.Attribute.StaticSaveDataId == 0 && info.StaticSaveDataId != 0; bool canFixBySaveDataId = extraData.Attribute.StaticSaveDataId == 0 && info.StaticSaveDataId != 0;
if (!canFixByProgramId && !canFixBySaveDataId) bool hasEmptyOwnerId = extraData.OwnerId == 0 && info.Type != LibHac.Fs.SaveDataType.System;
if (!canFixByProgramId && !canFixBySaveDataId && !hasEmptyOwnerId)
{ {
wasFixNeeded = false; wasFixNeeded = false;
return Result.Success; return Result.Success;

View File

@ -776,6 +776,7 @@ namespace Ryujinx.HLE.HOS
// The set sizes don't actually matter as long as they're non-zero because we use directory savedata. // The set sizes don't actually matter as long as they're non-zero because we use directory savedata.
control.UserAccountSaveDataSize = 0x4000; control.UserAccountSaveDataSize = 0x4000;
control.UserAccountSaveDataJournalSize = 0x4000; control.UserAccountSaveDataJournalSize = 0x4000;
control.SaveDataOwnerId = applicationId;
Logger.Warning?.Print(LogClass.Application, Logger.Warning?.Print(LogClass.Application,
"No control file was found for this game. Using a dummy one instead. This may cause inaccuracies in some games."); "No control file was found for this game. Using a dummy one instead. This may cause inaccuracies in some games.");

View File

@ -100,7 +100,7 @@ namespace Ryujinx.Headless.SDL2
[Option("system-language", Required = false, Default = SystemLanguage.AmericanEnglish, HelpText = "Change System Language.")] [Option("system-language", Required = false, Default = SystemLanguage.AmericanEnglish, HelpText = "Change System Language.")]
public SystemLanguage SystemLanguage { get; set; } public SystemLanguage SystemLanguage { get; set; }
[Option("system-language", Required = false, Default = RegionCode.USA, HelpText = "Change System Region.")] [Option("system-region", Required = false, Default = RegionCode.USA, HelpText = "Change System Region.")]
public RegionCode SystemRegion { get; set; } public RegionCode SystemRegion { get; set; }
[Option("system-timezone", Required = false, Default = "UTC", HelpText = "Change System TimeZone.")] [Option("system-timezone", Required = false, Default = "UTC", HelpText = "Change System TimeZone.")]
@ -132,7 +132,7 @@ namespace Ryujinx.Headless.SDL2
[Option("enable-warning-logs", Required = false, Default = true, HelpText = "Enables printing warning log messages.")] [Option("enable-warning-logs", Required = false, Default = true, HelpText = "Enables printing warning log messages.")]
public bool? LoggingEnableWarning { get; set; } public bool? LoggingEnableWarning { get; set; }
[Option("enable-warning-logs", Required = false, Default = true, HelpText = "Enables printing error log messages.")] [Option("enable-error-logs", Required = false, Default = true, HelpText = "Enables printing error log messages.")]
public bool? LoggingEnableError { get; set; } public bool? LoggingEnableError { get; set; }
[Option("enable-guest-logs", Required = false, Default = true, HelpText = "Enables printing guest log messages.")] [Option("enable-guest-logs", Required = false, Default = true, HelpText = "Enables printing guest log messages.")]

View File

@ -77,6 +77,25 @@ namespace Ryujinx.Tests.Cpu
CompareAgainstUnicorn(); CompareAgainstUnicorn();
} }
[Test, Pairwise]
public void Shadd8([Values(0u, 0xdu)] uint rd,
[Values(1u)] uint rm,
[Values(2u)] uint rn,
[Random(RndCnt)] uint w0,
[Random(RndCnt)] uint w1,
[Random(RndCnt)] uint w2)
{
uint opcode = 0xE6300F90u; // SHADD8 R0, R0, R0
opcode |= ((rm & 15) << 0) | ((rd & 15) << 12) | ((rn & 15) << 16);
uint sp = TestContext.CurrentContext.Random.NextUInt();
SingleOpcode(opcode, r0: w0, r1: w1, r2: w2, sp: sp);
CompareAgainstUnicorn();
}
[Test, Pairwise] [Test, Pairwise]
public void Ssat_Usat([ValueSource("_Ssat_Usat_")] uint opcode, public void Ssat_Usat([ValueSource("_Ssat_Usat_")] uint opcode,
[Values(0u, 0xdu)] uint rd, [Values(0u, 0xdu)] uint rd,
@ -120,7 +139,7 @@ namespace Ryujinx.Tests.Cpu
[Random(RndCnt)] uint w1, [Random(RndCnt)] uint w1,
[Random(RndCnt)] uint w2) [Random(RndCnt)] uint w2)
{ {
uint opcode = 0xE6700F90u; //UHADD8 R0, R0, R0 uint opcode = 0xE6700F90u; // UHADD8 R0, R0, R0
opcode |= ((rm & 15) << 0) | ((rd & 15) << 12) | ((rn & 15) << 16); opcode |= ((rm & 15) << 0) | ((rd & 15) << 12) | ((rn & 15) << 16);

View File

@ -34,7 +34,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{36F870C1-3E5F-485F-B426-F0645AF78751}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{36F870C1-3E5F-485F-B426-F0645AF78751}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig .editorconfig = .editorconfig
appveyor.yml = appveyor.yml
EndProjectSection EndProjectSection
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Memory", "Ryujinx.Memory\Ryujinx.Memory.csproj", "{A5E6C691-9E22-4263-8F40-42F002CE66BE}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Memory", "Ryujinx.Memory\Ryujinx.Memory.csproj", "{A5E6C691-9E22-4263-8F40-42F002CE66BE}"

View File

@ -1,35 +0,0 @@
version: 1.0.{build}
branches:
only:
- master
image: Visual Studio 2022
environment:
appveyor_dotnet_runtime: net6.0
matrix:
- config: Release
config_name: '-'
build_script:
- ps: >-
dotnet --version
dotnet publish -c $env:config -r win-x64 /p:Version=$env:APPVEYOR_BUILD_VERSION /p:DebugType=embedded --self-contained
dotnet publish -c $env:config -r linux-x64 /p:Version=$env:APPVEYOR_BUILD_VERSION /p:DebugType=embedded --self-contained
7z a ryujinx$env:config_name$env:APPVEYOR_BUILD_VERSION-win_x64.zip $env:APPVEYOR_BUILD_FOLDER\Ryujinx\bin\$env:config\$env:appveyor_dotnet_runtime\win-x64\publish\
7z a ryujinx$env:config_name$env:APPVEYOR_BUILD_VERSION-linux_x64.tar $env:APPVEYOR_BUILD_FOLDER\Ryujinx\bin\$env:config\$env:appveyor_dotnet_runtime\linux-x64\publish\
7z a ryujinx$env:config_name$env:APPVEYOR_BUILD_VERSION-linux_x64.tar.gz ryujinx$env:config_name$env:APPVEYOR_BUILD_VERSION-linux_x64.tar
7z a ryujinx-headless-sdl2$env:config_name$env:APPVEYOR_BUILD_VERSION-win_x64.zip $env:APPVEYOR_BUILD_FOLDER\Ryujinx.Headless.SDL2\bin\$env:config\$env:appveyor_dotnet_runtime\win-x64\publish\
7z a ryujinx-headless-sdl2$env:config_name$env:APPVEYOR_BUILD_VERSION-linux_x64.tar $env:APPVEYOR_BUILD_FOLDER\Ryujinx.Headless.SDL2\bin\$env:config\$env:appveyor_dotnet_runtime\linux-x64\publish\
7z a ryujinx-headless-sdl2$env:config_name$env:APPVEYOR_BUILD_VERSION-linux_x64.tar.gz ryujinx-headless-sdl2$env:config_name$env:APPVEYOR_BUILD_VERSION-linux_x64.tar
artifacts:
- path: ryujinx%config_name%%APPVEYOR_BUILD_VERSION%-win_x64.zip
- path: ryujinx%config_name%%APPVEYOR_BUILD_VERSION%-linux_x64.tar.gz
- path: ryujinx-headless-sdl2%config_name%%APPVEYOR_BUILD_VERSION%-win_x64.zip
- path: ryujinx-headless-sdl2%config_name%%APPVEYOR_BUILD_VERSION%-linux_x64.tar.gz