Commit Graph

78 Commits

Author SHA1 Message Date
gamer147
8aa58c4c3d Document BUNKI menu opcode contracts 2026-07-21 16:26:39 -04:00
gamer147
fe1531097a Document numeric HUD opcode contracts 2026-07-21 15:40:46 -04:00
gamer147
274744e9b6 Implement movie surface stop-time queries 2026-07-21 14:43:24 -04:00
gamer147
f0e31343a0 Document ADV system menu input path 2026-07-21 11:01:50 -04:00
gamer147
be586ca988 Implement script-configured input bindings 2026-07-21 10:32:37 -04:00
gamer147
490243705b Document SYS4 logical input bindings 2026-07-21 10:07:21 -04:00
gamer147
cffc75c64d Implement ROOM fades and character voices 2026-07-21 00:47:29 -04:00
gamer147
7a9fe52a9d Document packed raw SFX addressing 2026-07-20 18:32:56 -04:00
gamer147
9b35fc9e61 Document B0 natural boot control spine 2026-07-20 17:29:38 -04:00
gamer147
b7e92bdb2f Document opcode 0x1fe current rotation 2026-07-20 16:51:30 -04:00
gamer147
bc5763e65e Implement ADV skip lifecycle 2026-07-20 16:41:44 -04:00
gamer147
f5663ec595 Reverse shared SAVE.DAT integer opcodes 2026-07-20 13:33:27 -04:00
gamer147
c8303babf5 Reverse opcode 0x1ad save resume boundary 2026-07-20 12:06:02 -04:00
gamer147
3fa07c0ae5 Implement ADV text publication service 2026-07-20 10:18:10 -04:00
gamer147
96e4448796 Implement AGE text line spacing 2026-07-19 23:32:38 -04:00
gamer147
7c110d762b Implement History mouse wheel navigation 2026-07-19 21:38:34 -04:00
gamer147
81155c5e1c Implement History timed callback scrolling 2026-07-19 21:15:15 -04:00
gamer147
d3698a0612 Implement ADV History voice replay 2026-07-19 14:11:49 -04:00
gamer147
2c6bf9a4cd Correct ADV History layout addressing 2026-07-19 10:43:52 -04:00
gamer147
7dec791876 Implement ADV History data navigation 2026-07-18 23:41:23 -04:00
gamer147
bd6c92519c Document ADV History retained-record model 2026-07-18 23:16:50 -04:00
gamer147
66b13315f2 Correct ADV Hide Window restore behavior 2026-07-18 22:23:06 -04:00
gamer147
ad022ace51 Implement native ADV Hide Window path 2026-07-18 21:14:06 -04:00
gamer147
b76f175333 Document ADV history and remaining button paths 2026-07-18 20:28:36 -04:00
gamer147
dc50acaa9b Implement native ADV message skip 2026-07-18 17:32:12 -04:00
gamer147
4bf98cc7af Implement ADV controls and native Auto timing 2026-07-18 17:16:06 -04:00
gamer147
8c7c7158a7 Fix retained background lifecycle 2026-07-12 00:00:45 -04:00
gamer147
3aca514497 feat: add runtime ADV page locator 2026-07-11 22:52:26 -04:00
gamer147
2a49a0697c fix(gfx): restore third CG glow 2026-07-11 20:05:51 -04:00
gamer147
2232216832 Implement native-backed SC0000 SFX lifecycle 2026-07-11 02:15:17 -04:00
gamer147
921c91474f Implement native ADV retained text 2026-07-10 22:46:27 -04:00
gamer147
f94bca4ba5 Refresh retained presentation references 2026-07-10 21:56:57 -04:00
gamer147
85a66afe20 Fix native retained presentation batching 2026-07-10 21:37:42 -04:00
gamer147
768863b48e feat: add affine rotation rendering and timeline diagnostics 2026-07-10 17:54:33 -04:00
gamer147
4d225618f9 fix: align animation pacing and transforms with native 2026-07-10 15:41:17 -04:00
gamer147
f2797d5ab7 feat: model ADV coroutines and retained effect teardown 2026-07-10 09:45:43 -04:00
gamer147
f3fc25debf feat: scene-entry state capture -> auto-seed for single-scene runs
capture_global_writes.py hooks vm_operand_write@0x425fb0 (plaintext values,
before the obfuscated store — sidesteps the shelved flat-scan problem) and folds
the engine's global-int writes into a GameSession snapshot. --spawn captures from
boot (packer-aware: polls until the code unpacks, then attaches — AGE.EXE unpacks
in-place so a spawn-time hook hits packed bytes; also kills the spawned pid if
setup fails so no suspended orphan). Age.Cli 'trace ... --state <snap>' runs a
scene from the captured state.

Validated: a real boot->new-game->SC0000 capture (34008 globals incl. G[0x6c1]=1)
seeds the VM to match the engine's ENTIRE opening (542 ops, no non-realignable
fork) with zero manual seeding. Residual: a 2-op color detour (0x202/0x203)
unfixed by state = a real branch diff to chase. Engine 81/81, diff 5/5.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 13:30:14 -04:00
gamer147
029b77c67c re: diff_optrace resync-tolerant alignment (blind spots vs real forks)
Strict lockstep over-reported: the operand hook misses any op whose operands
aren't fetched via vm_operand_fetch (comment 0x1a7, set-string 0x192, the
0x1c7/0x1cc/0x131/... string-op cluster) — the engine executes them (they sit
after non-branching ops) but they're absent from its trace. New align() resyncs
over such one-sided insertions and reports only NON-realignable forks; it
separates VM-only blind spots (artifacts) from engine-only detours (real,
reconverging branch/state gaps, surfaced honestly). +2 tests (7/7).

Result: with G[0x6c1] seeded the SC0000 opening has NO non-realignable fork
across all 539 VM ops (was: false 'diverge at 0x8d'); residual = a 2-op
engine-only color detour (0x202/0x203 @ 0x122d0). Cold's first real fork is a
later G[0x6c1] gate. Validates the pre-scene-state theory end-to-end.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 12:55:21 -04:00
gamer147
0ab709141d re: diff_optrace operand-mode VM filtering (argc>=1 subsequence)
Operand-hook captures skip zero-operand ops (stmt markers, script-entry 0x259),
so the VM offset trace is filtered to argc>=1 instructions before diffing — same
subsequence both sides. +1 unit test. Default on; --full for a tick-mode capture.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 11:57:55 -04:00
gamer147
1d33e8694f re(frida): engine op-path tracer (tick/operand hook, per-script offsets)
Reads cur_ctx_index/frame_pc/frame_codebase from the engine ctx per executed op
and emits (codebase, offset=(pc-codebase)/4) to build/engine-optrace.jsonl.
Recon result: the tick hook (0x410fb0) does NOT expose ctx via ecx (0 entries);
the operand hook (0x41b940) is the working capture (100% of offsets land on valid
SC0000 instruction starts). Writes a tracer-live.flag so the capture can be gated
on hooks-installed before the scene loads (else the entry burst is missed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 11:57:55 -04:00
gamer147
878935db03 re: diff_optrace.py — engine-vs-VM offset-path divergence oracle
Pure first_divergence + pick_scene_codebase (longest-common-prefix codebase
identification), unit-tested (test_diff_optrace.py, 4/4). CLI loads the engine
jsonl + VM json, isolates the scene's codebase, and reports the first divergence
with the mis-modeled instruction and +/-3 ops of context on each side (opcode
+ rendered line via sys4load).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 11:25:20 -04:00
gamer147
c3729170dc re: EngineCtx field registry (engine-ctx.toml) + builder
Canonical source vm-map/engine-ctx.toml (35 documented ctx fields) +
engine_ctx_build.py (--build/--lint, unit-tested) -> build/engine-ctx.json
+ docs/engine-ctx-reference.md. Applied to Ghidra in the next task.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 10:01:54 -04:00
gamer147
96d63f01d3 re(frida): write import-map.json (in-table matches; singletons set aside)
248 module-resident core imports at the RVA 0x16f000 rebuilt IAT
(kernel32/user32/gdi32/winmm/advapi32/ole/oleaut/version/ntdll);
29 singletons set aside. Anchors confirmed: ReadFile/CreateFileA/
SetFilePointer + timeGetTime@0x16f3d4 (=DAT_0056f3d4). d3d9/shell32
etc. are heap-resolved (out of dump) — expected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 09:23:25 -04:00
gamer147
94a4763961 re(frida): import-map recon — export scan + clustering gate
GATE-PASS: 23342 exports mapped, 277 in-range pointer matches clustering
into a module-resident import table at RVA 0x16f000 (VA 0x56f000);
23 singletons. ~254 real imports vs pe-sieve's 17-in-noise.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 09:21:16 -04:00
gamer147
b3b59ae591 re: auto-label all opcode dispatch handlers from FUN_00413860
Extract op->real-handler map (handler(op)=ctx[0x26c93+op]) from the
registration routine's override stores; ghidra_handler_map.py +
build/op-handler-map.json (420 overrides). Cross-check vs opcodes.toml
found 0 real drift. One-shot Ghidra pass then labeled the /v2 image:
281 raw FUN_/LAB_ handlers -> op_0xNN_handler, 107 bare VAs -> functions,
31 hand-named preserved, opcode plate comment on every handler.

Includes the Task A spec + plan and the two-program (/v2 vs SMM) gotcha.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 08:32:01 -04:00
gamer147
4dbe718155 docs: frame-stepped-vm spec+plan + frame-cadence Frida probes
Design artifacts for the merged frame-stepped VM work (throttle the Godot VM
to a per-frame op budget). Probes measured the native ~1788 ops/sec cadence
and uncapped D3D9 Present that motivated the wall-clock-op-rate approach.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 17:34:52 -04:00
gamer147
b94a20b9ec feat(tools): per-scene opcode completeness tracker + 0x259 marker fix
Add tools/scene_opcode_coverage.py: histograms a scene's static opcodes and
classifies each vs the C# VM as impl / safe-noop / GAP (effectful op the VM
silently stubs). Implemented set is parsed live from VirtualMachine.cs case arms
(no drift); metadata from build/opcodes.json. Makes a half-rendered scene legible
("N ops still stubbed") instead of implying everything runs.

SC0000 baseline: 129 distinct ops, ~94.8% instruction-weighted handled, 68 GAP.
The tracker cross-checks opcodes.toml vs VM behavior and surfaced 0x259
(script-entry marker) missing its noop_headless flag -> reconciled in opcodes.toml
and rebuilt (regen: age_opcodes_himegari.py, opcode-reference.md).

Docs: tools-reference.md (tool row), phase-a-slice-plan.md (completeness gauge).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 22:57:25 -04:00
gamer147
5c21074454 chore(gfx): set dispatch labels for the gfx command-buffer ops
VM dispatches on the opcodes.toml label field (OpcodeTableJson), so the 14 gfx
ops' labels are set to their dispatch strings. Ops still stubbed until the VM
cases land (Task 3.3+); full suite green (34), lint clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 17:44:32 -04:00
gamer147
2a2377badb docs(gfx): reverse the full gfx command-buffer op contract (Phase 1)
Ghidra-read all 13 still-stubbed gfx-family handlers via the dispatch table
(0x1a2/0x1f7/0x1fa/0x1ff/0x202/0x203/0x212/0x213/0x216/0x217/0x218/0x219/0x21a);
recovered 0x219 (was unanalyzed). Every op writes a cmd-type into the current
object record then SETs fields (native worker) or QUERYs fields (returns to
operands). Recorded the op-contract table in engine-re.md, set opcodes.toml
semantics (source=investigation, confidence=high), renamed handlers in Ghidra.

Key finding: the drift has TWO stubbed drivers, not one — 0x215 (slot-select)
AND 0x218/0x21a (per-object geometry vectors feeding the anchor-preserve math).
The subsystem is a per-object record model (slot + position/anchor 3-vectors +
color) queried by the ops; native DirectDraw workers need not be modelled. This
is the spec for Phase 2 (host-side model design).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 17:01:14 -04:00
gamer147
5b07f4ac2b docs(gfx): settle render drift as native cmd-buffer op 0x215 (Ghidra), align docs
Read op 0x215's real handler FUN_0042a0b0 (resolved via the dispatch table
ctx[0x26c93+op]; Kelebek's 0x421160 is VA-drift). It writes cmd-type 5 into the
current gfx-object record and returns a std::map::find over an engine-internal
registry populated by sibling gfx ops (0x1a2 hash insert). The return is native
command-buffer state, not the VM global bank -> seeding story-state cannot fix
the drift. Verdict: (b) a genuine native op, NOT (a) state-divergence.

Reconcile the previously contradictory drift accounts onto one canonical home
(engine-re.md op 0x215), with opcodes.toml carrying the opcode-level semantics
and phase-a-slice-plan / tools-reference / frida README corrected to point at it
instead of repeating the disproven state-divergence conclusion.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 16:40:59 -04:00