feat(vm): IHost.Sleep seam + dispatch 0xc8 (headless hosts no-op; parity held)

- IHost.Sleep(long duration); VM case "sleep" forwards the raw operand.
- 8 non-Godot hosts no-op Sleep; RecordingHost records it.
- SleepDispatchTests (51 green); sweep unchanged 284 exit / 13 STEP-LIMIT.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-07-08 08:59:52 -04:00
parent 6044a0d412
commit 5f245d4cf4
16 changed files with 407 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ public sealed class CaptureHost : IHost
public List<(int Offset, string Text)> Emitted { get; } = new();
public void ShowText(int offset, string text) => Emitted.Add((offset, text));
public void WaitForInput() { }
public void Sleep(long duration) { }
public void CreateTexture(int slot, int width, int height) { }
public void SetTexture(long resourceId, int slot) { }
public void DrawTexture(int slot, int srcX, int srcY, int width, int height, int dstX, int dstY) { }

View File

@@ -3,6 +3,7 @@ public interface IHost
{
void ShowText(int offset, string text);
void WaitForInput();
void Sleep(long duration);
void CreateTexture(int slot, int width, int height);
void SetTexture(long resourceId, int slot);
void DrawTexture(int slot, int srcX, int srcY, int width, int height, int dstX, int dstY);

View File

@@ -208,6 +208,8 @@ public sealed class VirtualMachine
}
return pc + 1;
case "wait-for-input": _host.WaitForInput(); return pc + 1;
case "sleep": // 0xc8 (duration) — pause the host duration ms; headless hosts no-op (parity). Frame pacing.
_host.Sleep(Read(a[0])); return pc + 1;
case "end-text-line": case "set-font":
case "comment": case "display-furigana": case "dev_ukn":
return pc + 1;