Fix AE001H cyclic color blending

This commit is contained in:
gamer147
2026-07-11 22:21:10 -04:00
parent f195934324
commit b41ae36168
8 changed files with 140 additions and 36 deletions

View File

@@ -105,6 +105,25 @@ public class AnimChannelTests
Assert.Equal(GfxState.PackColor(0x80, 0xFF0000), o.ColorTarget);
}
[Fact]
public void Op0x232_NegativeRgbPreservesNativeDefaultStaticColor()
{
var t = T();
var scene = ScriptAssembler.Assemble(t, "AE001H_COLOR", new List<(int, Operand[])>
{
(0x55, new[]{G(1), I(0xcb8e)}), (0x55, new[]{G(2), I(1200)}),
(0x55, new[]{G(3), I(224)}), (0x55, new[]{G(4), I(1)}),
(0x51, new[]{G(4), I(0), G(4)}),
(0x232, new[]{G(1), G(2), G(3), G(4)}), Exit(),
}, System.Array.Empty<string>());
var vm = new VirtualMachine(scene, t, new RecordingHost());
vm.Run();
var o = vm.Gfx.TryGet(0xcb8e)!;
Assert.Equal(0xffffffff, o.Color);
Assert.Equal(0xe0ffffff, o.ColorTarget);
Assert.Equal(0, o.StaticColorMode);
}
[Fact]
public void Op0x239_SetsSpritesheetGridCell()
{