unstub: preserve notice screen skip flag (#559)

* fix(system-service): preserve notice screen skip flag

* test(bink): avoid frame timing flake on CI
This commit is contained in:
Kurt Himebauch
2026-07-23 05:32:49 -04:00
committed by GitHub
parent 8e5a0bfb19
commit eb252af7b3
3 changed files with 42 additions and 5 deletions
@@ -83,7 +83,9 @@ public sealed class BinkFramePlaybackTests
public uint Height => 1;
public uint FramesPerSecondNumerator => 20;
// Keep frame boundaries far enough apart that a loaded CI runner cannot
// skip an expected frame between polling iterations.
public uint FramesPerSecondNumerator => 2;
public uint FramesPerSecondDenominator => 1;
@@ -11,6 +11,11 @@ public sealed class SystemServiceExportsTests
{
private const ulong MemoryBase = 0x1_0000_0000;
public SystemServiceExportsTests()
{
SystemServiceExports.ResetForTests();
}
[Fact]
public void GetNoticeScreenSkipFlagWritesOneByteAtMemoryBoundary()
{
@@ -26,4 +31,23 @@ public sealed class SystemServiceExportsTests
Assert.True(memory.TryRead(MemoryBase, flag));
Assert.Equal(0, flag[0]);
}
[Fact]
public void SetNoticeScreenSkipFlagRoundTripsThroughGetter()
{
var memory = new FakeCpuMemory(MemoryBase, 2);
var context = new CpuContext(memory, Generation.Gen5)
{
[CpuRegister.Rdi] = 1,
};
Assert.Equal(0, SystemServiceExports.SystemServiceSetNoticeScreenSkipFlag(context));
context[CpuRegister.Rdi] = MemoryBase;
Assert.Equal(0, SystemServiceExports.SystemServiceGetNoticeScreenSkipFlag(context));
Span<byte> flag = stackalloc byte[1];
Assert.True(memory.TryRead(MemoryBase, flag));
Assert.Equal(1, flag[0]);
}
}