mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2024-11-18 07:17:08 +01:00
eeb626947e
* Implement Shared Fonts This fully implements shared fonts. This commit is provided without fonts. This commit also add Size to HSharedMem.Positions to be able to add fonts to shared zones when RequestLoad is called. * Require the user to provide fonts in RyuFS/system * Use File.Exits instead of relying ona try/catch and change system resource exception format a bit * Make sure that font sum doesn't exceed 17MB Also rename font data dictionary for coherence.
44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
using ChocolArm64.Memory;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Ryujinx.HLE.OsHle.Handles
|
|
{
|
|
class HSharedMem
|
|
{
|
|
private List<(AMemory, long, long)> Positions;
|
|
|
|
public EventHandler<EventArgs> MemoryMapped;
|
|
public EventHandler<EventArgs> MemoryUnmapped;
|
|
|
|
public HSharedMem()
|
|
{
|
|
Positions = new List<(AMemory, long, long)>();
|
|
}
|
|
|
|
public void AddVirtualPosition(AMemory Memory, long Position, long Size)
|
|
{
|
|
lock (Positions)
|
|
{
|
|
Positions.Add((Memory, Position, Size));
|
|
|
|
MemoryMapped?.Invoke(this, EventArgs.Empty);
|
|
}
|
|
}
|
|
|
|
public void RemoveVirtualPosition(AMemory Memory, long Position, long Size)
|
|
{
|
|
lock (Positions)
|
|
{
|
|
Positions.Remove((Memory, Position, Size));
|
|
|
|
MemoryUnmapped?.Invoke(this, EventArgs.Empty);
|
|
}
|
|
}
|
|
|
|
public (AMemory, long, long)[] GetVirtualPositions()
|
|
{
|
|
return Positions.ToArray();
|
|
}
|
|
}
|
|
} |