Change ReadAsciiString to use long for the Size, avoids some casting
This commit is contained in:
parent
7092ad7cc9
commit
3d37a88180
7 changed files with 9 additions and 9 deletions
|
@ -70,11 +70,11 @@ namespace ChocolArm64.Memory
|
|||
Marshal.StructureToPtr<T>(Value, Ptr, false);
|
||||
}
|
||||
|
||||
public static string ReadAsciiString(AMemory Memory, long Position, int MaxSize = -1)
|
||||
public static string ReadAsciiString(AMemory Memory, long Position, long MaxSize = -1)
|
||||
{
|
||||
using (MemoryStream MS = new MemoryStream())
|
||||
{
|
||||
for (int Offs = 0; Offs < MaxSize || MaxSize == -1; Offs++)
|
||||
for (long Offs = 0; Offs < MaxSize || MaxSize == -1; Offs++)
|
||||
{
|
||||
byte Value = (byte)Memory.ReadByte(Position + Offs);
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@ namespace Ryujinx.Audio.OpenAL
|
|||
case AudioFormat.PcmInt16: return ALFormat.Stereo16;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
throw new ArgumentException(nameof(Format));
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace Ryujinx.Core.OsHle
|
|||
long Value0 = Memory.ReadInt64(Position + 0x08);
|
||||
long Value1 = Memory.ReadInt64(Position + 0x10);
|
||||
|
||||
FileName = AMemoryHelper.ReadAsciiString(Memory, Value0, (int)(Value1 - Value0));
|
||||
FileName = AMemoryHelper.ReadAsciiString(Memory, Value0, Value1 - Value0);
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace Ryujinx.Core.OsHle.IpcServices.Aud
|
|||
long Position = Context.Request.SendBuff[0].Position;
|
||||
long Size = Context.Request.SendBuff[0].Size;
|
||||
|
||||
string Name = AMemoryHelper.ReadAsciiString(Context.Memory, Position, (int)Size);
|
||||
string Name = AMemoryHelper.ReadAsciiString(Context.Memory, Position, Size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -89,11 +89,11 @@ namespace Ryujinx.Core.OsHle.IpcServices.Aud
|
|||
long Position = Context.Request.ReceiveBuff[0].Position;
|
||||
long Size = Context.Request.ReceiveBuff[0].Size;
|
||||
|
||||
int Count = (int)(Size >> 3);
|
||||
uint Count = (uint)((ulong)Size >> 3);
|
||||
|
||||
long[] ReleasedBuffers = AudioOut.GetReleasedBuffers(Track);
|
||||
|
||||
for (int Index = 0; Index < Count; Index++)
|
||||
for (uint Index = 0; Index < Count; Index++)
|
||||
{
|
||||
long Tag = 0;
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace Ryujinx.Core.OsHle.IpcServices.Aud
|
|||
string DeviceName = AMemoryHelper.ReadAsciiString(
|
||||
Context.Memory,
|
||||
Context.Request.SendBuff[0].Position,
|
||||
(int)Context.Request.SendBuff[0].Size);
|
||||
Context.Request.SendBuff[0].Size);
|
||||
|
||||
if (DeviceName == string.Empty)
|
||||
{
|
||||
|
|
|
@ -164,7 +164,7 @@ namespace Ryujinx.Core.OsHle.Svc
|
|||
long Position = (long)ThreadState.X0;
|
||||
long Size = (long)ThreadState.X1;
|
||||
|
||||
string Str = AMemoryHelper.ReadAsciiString(Memory, Position, (int)Size);
|
||||
string Str = AMemoryHelper.ReadAsciiString(Memory, Position, Size);
|
||||
|
||||
Logging.Info($"SvcOutputDebugString: {Str}");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue