Rebased, change code region base address for 39-bits address space, print stack trace on break and undefined instructions too
This commit is contained in:
parent
d6fa0e1771
commit
c38f4df521
3 changed files with 20 additions and 4 deletions
|
@ -91,7 +91,7 @@ namespace Ryujinx.HLE.HOS.Kernel
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AddressSpaceType.Addr39Bits:
|
case AddressSpaceType.Addr39Bits:
|
||||||
CodeRegionStart = 0;
|
CodeRegionStart = 0x8000000;
|
||||||
CodeRegionSize = 0x80000000;
|
CodeRegionSize = 0x80000000;
|
||||||
MapRegionSize = 0x1000000000;
|
MapRegionSize = 0x1000000000;
|
||||||
HeapRegionSize = 0x180000000;
|
HeapRegionSize = 0x180000000;
|
||||||
|
|
|
@ -98,7 +98,7 @@ namespace Ryujinx.HLE.HOS
|
||||||
|
|
||||||
Executables = new List<Executable>();
|
Executables = new List<Executable>();
|
||||||
|
|
||||||
ImageBase = 0x8000000;
|
ImageBase = MemoryManager.CodeRegionStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadProgram(IExecutable Program)
|
public void LoadProgram(IExecutable Program)
|
||||||
|
@ -285,11 +285,15 @@ namespace Ryujinx.HLE.HOS
|
||||||
|
|
||||||
private void BreakHandler(object sender, AInstExceptionEventArgs e)
|
private void BreakHandler(object sender, AInstExceptionEventArgs e)
|
||||||
{
|
{
|
||||||
|
PrintStackTraceForCurrentThread();
|
||||||
|
|
||||||
throw new GuestBrokeExecutionException();
|
throw new GuestBrokeExecutionException();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UndefinedHandler(object sender, AInstUndefinedEventArgs e)
|
private void UndefinedHandler(object sender, AInstUndefinedEventArgs e)
|
||||||
{
|
{
|
||||||
|
PrintStackTraceForCurrentThread();
|
||||||
|
|
||||||
throw new UndefinedInstructionException(e.Position, e.RawOpCode);
|
throw new UndefinedInstructionException(e.Position, e.RawOpCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,12 +341,17 @@ namespace Ryujinx.HLE.HOS
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CpuInvalidAccessHandler(object sender, AInvalidAccessEventArgs e)
|
private void CpuInvalidAccessHandler(object sender, AInvalidAccessEventArgs e)
|
||||||
|
{
|
||||||
|
PrintStackTraceForCurrentThread();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PrintStackTraceForCurrentThread()
|
||||||
{
|
{
|
||||||
foreach (KThread Thread in Threads.Values)
|
foreach (KThread Thread in Threads.Values)
|
||||||
{
|
{
|
||||||
if (Thread.Thread.IsCurrentThread())
|
if (Thread.Context.IsCurrentThread())
|
||||||
{
|
{
|
||||||
PrintStackTrace(Thread.Thread.ThreadState);
|
PrintStackTrace(Thread.Context.ThreadState);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,6 +125,13 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer
|
||||||
//As of now, it assumes that HostChannelsCount == 2.
|
//As of now, it assumes that HostChannelsCount == 2.
|
||||||
WaveBuffer Wb = WaveBuffers[BufferIndex];
|
WaveBuffer Wb = WaveBuffers[BufferIndex];
|
||||||
|
|
||||||
|
if (Wb.Position == 0)
|
||||||
|
{
|
||||||
|
Samples = new int[0];
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (SampleFormat == SampleFormat.PcmInt16)
|
if (SampleFormat == SampleFormat.PcmInt16)
|
||||||
{
|
{
|
||||||
int SamplesCount = (int)(Wb.Size / (sizeof(short) * ChannelsCount));
|
int SamplesCount = (int)(Wb.Size / (sizeof(short) * ChannelsCount));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue