Test on synthesized scenes with full handling, not crippled real scenes

- ScriptAssembler (Age.Engine/Sys4): assemble code+strings -> Script (inverse of
  Sys4Loader; also Phase-D modding-assembler groundwork).
- SyntheticSceneTests: deterministic show-text/wait/nested-call-script/shared-global
  scene run with call-script handling ON.
- WaitForInputTests: reworked onto a synthesized two-page scene (was: SC0000 stub=186).
- RecoverTests: full call-script handling via a no-op subroutine double (isolates
  RECOVER's ISA semantics from real subroutines' game-state deps).
- Retire TraceDiffTests: it matched the C# VM to vm0.py's stubbed-call-script trace;
  vm0.py is retired from oracle duty, and we no longer gate handling to keep it matching.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-07-07 13:45:42 -04:00
parent 9649cfab47
commit e29314c89c
6 changed files with 189 additions and 76 deletions

View File

@@ -1,3 +1,4 @@
using System.Collections.Generic;
using Age.Engine.Hosting;
using Age.Engine.Sys4;
using Age.Engine.Vm;
@@ -12,7 +13,13 @@ public class RecoverTests
{
var table = OpcodeTableJson.Load(Paths.OpcodesJson);
var script = Sys4Loader.Load(Path.Combine(Paths.Data1, "RECOVER.BIN"), table);
var vm = new VirtualMachine(script, table, new CaptureHost());
// Full call-script handling on, but the subroutines are doubled by a no-op `exit` script:
// this test isolates RECOVER's ISA semantics (pointer/lvalue, 2D-stride, loops) from the real
// subroutines' game-state dependencies. The real subroutines are covered elsewhere.
var noop = ScriptAssembler.Assemble(table, "NOOP",
new List<(int, Age.Engine.Model.Operand[])> { (0x2, System.Array.Empty<Age.Engine.Model.Operand>()) },
System.Array.Empty<string>());
var vm = new VirtualMachine(script, table, new CaptureHost(), null, new AnyProvider(noop));
int unit = 0;
vm.Globals[0x152616] = unit;