Implement diagnostic output opcodes

This commit is contained in:
gamer147
2026-07-29 11:54:09 -04:00
parent bab3c051d2
commit cbd1521872
16 changed files with 367 additions and 37 deletions

View File

@@ -32,6 +32,8 @@ public sealed class GameSession
public AudioMixerSettings AudioMixerSettings { get; }
/// <summary>The live retained ADV backlog shared by every VM run in this session.</summary>
public AdvTextHistory TextHistory { get; } = new();
/// <summary>The EngineCtx-lifetime diagnostic accumulator shared across script/scene VMs.</summary>
public DiagnosticOutputState DiagnosticOutput { get; } = new();
public GameSession(SharedProfile? sharedProfile = null, INativeDatStore? nativeDatStore = null,
AudioMixerSettings? audioMixerSettings = null)
@@ -51,7 +53,7 @@ public sealed class GameSession
{
var vm = new VirtualMachine(
script, table, host, options, provider, sink, TextHistory, SharedProfile, NativeDatStore,
AudioMixerSettings);
AudioMixerSettings, DiagnosticOutput);
foreach (var kv in Globals) vm.Globals[kv.Key] = kv.Value;
foreach (var kv in GlobalFloats) vm.GlobalFloats[kv.Key] = kv.Value;
foreach (var kv in GlobalStrings) vm.GlobalStrings[kv.Key] = kv.Value;