mirror of
https://github.com/par274/sharpemu.git
synced 2026-07-31 06:59:45 +08:00
fix(ajm): accept Gen5 codec types (#526)
This commit is contained in:
@@ -17,7 +17,7 @@ public static class AjmExports
|
|||||||
private const int OrbisAjmErrorCodecAlreadyRegistered = unchecked((int)0x80930009);
|
private const int OrbisAjmErrorCodecAlreadyRegistered = unchecked((int)0x80930009);
|
||||||
private const int OrbisAjmErrorCodecNotRegistered = unchecked((int)0x8093000A);
|
private const int OrbisAjmErrorCodecNotRegistered = unchecked((int)0x8093000A);
|
||||||
private const int OrbisAjmErrorWrongRevisionFlag = unchecked((int)0x8093000B);
|
private const int OrbisAjmErrorWrongRevisionFlag = unchecked((int)0x8093000B);
|
||||||
private const uint MaxCodecType = 23;
|
private const uint MaxCodecType = 25;
|
||||||
private const int MaxInstanceIndex = 0x2FFF;
|
private const int MaxInstanceIndex = 0x2FFF;
|
||||||
private static readonly ConcurrentDictionary<uint, AjmContextState> Contexts = new();
|
private static readonly ConcurrentDictionary<uint, AjmContextState> Contexts = new();
|
||||||
private static int _nextContextId;
|
private static int _nextContextId;
|
||||||
|
|||||||
@@ -80,6 +80,19 @@ public sealed class AjmExportsTests : IDisposable
|
|||||||
Assert.Equal(InvalidContext, RegisterCodec(contextId + 1, 1));
|
Assert.Equal(InvalidContext, RegisterCodec(contextId + 1, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[InlineData(23u)]
|
||||||
|
[InlineData(24u)]
|
||||||
|
public void Gen5CodecTypesCanRegisterAndCreateInstances(uint codecType)
|
||||||
|
{
|
||||||
|
var contextId = Initialize();
|
||||||
|
|
||||||
|
Assert.Equal(0, RegisterCodec(contextId, codecType));
|
||||||
|
Assert.Equal(
|
||||||
|
0,
|
||||||
|
CreateInstance(contextId, codecType, 0x401, InstanceAddress));
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void InstanceDestroy_RejectsUnknownContextAndSlot()
|
public void InstanceDestroy_RejectsUnknownContextAndSlot()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user