Implement looping SFX and immediate rotation opcodes

This commit is contained in:
gamer147
2026-07-28 23:45:48 -04:00
parent d2ec834fc3
commit dad3ed4a4b
13 changed files with 112 additions and 28 deletions

View File

@@ -384,6 +384,25 @@ public class GfxAnimationTests
Assert.Equal((12L, 34L, 5L), o.V16c);
}
[Fact]
public void CurrentRotationSetter_ReplacesTheLiveAxisAngleImmediately()
{
var t = T();
var scene = ScriptAssembler.Assemble(t, "CURRENTROTATION", new List<(int, Operand[])>
{
MovGI(1, 0xcb20), MovGI(2, 0), MovGI(3, 1), MovGI(4, 0), MovGI(5, 180),
(0x1fe, new[] { G(1), G(2), G(3), G(4), G(5) }),
Exit(),
}, System.Array.Empty<string>());
var vm = new VirtualMachine(scene, t, new RecordingHost());
vm.Run();
var o = vm.Gfx.TryGet(0xcb20)!;
Assert.Equal((0.0, 1.0, 0.0, 180.0), o.RotationCurrent);
Assert.False(o.RotationChannelEnabled);
}
[Fact]
public void ResetAnimClock_DispatchClearsGlobalServiceClock()
{