Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
c120336
feat: Add ADG OPL3 runtime reverse engineering agent and related scripts
maximilien-noal May 1, 2026
065a21c
Enhance DNADG (AdLib Gold / OPL3) C# Overrides
maximilien-noal May 1, 2026
b6d3325
feat: Implement AdLib Gold driver functionality and initialization ro…
maximilien-noal May 1, 2026
bb21fc6
feat: Add detailed remarks and code examples for AdLib Gold driver fu…
maximilien-noal May 1, 2026
4a35396
feat: Enhance AdLib Gold driver with additional enums and improved co…
maximilien-noal May 1, 2026
63f2f8c
feat: Add detailed enums and constants for AdLib Gold driver function…
maximilien-noal May 1, 2026
68d5bd7
fix: Disable Adp C# function replacement for stability
maximilien-noal May 1, 2026
e97a457
feat: Enhance AdgDriverCode with additional functionality for song ha…
maximilien-noal May 1, 2026
1c364a9
feat: Update documentation for ADG388 driver reverse engineering prog…
maximilien-noal May 1, 2026
ea0ce03
feat: cover all the ADG code with overrides
maximilien-noal May 1, 2026
8daa543
chore: Update ADG plan
maximilien-noal May 1, 2026
d3689da
feat: Add independant ADG player
maximilien-noal May 1, 2026
fad7a11
feat: Implement ComputeAdgVolume method and update volume handling in…
maximilien-noal May 1, 2026
9c0b5cc
feat: Enhance ADG player functionality with improved operator handlin…
maximilien-noal May 1, 2026
5516315
feat: Enhance OPL synthesizer with Adlib Gold integration and improve…
maximilien-noal May 1, 2026
bf53289
fix: Tempo accumulator and ticks in AdgPlayer
maximilien-noal May 1, 2026
d5889da
feat: Implement AdLib Gold post-processing control and enhance routin…
maximilien-noal May 1, 2026
a2889ad
feat: Add support for ADG patch-type 4 routing and volume modulation …
maximilien-noal May 1, 2026
51faf72
feat: Implement complex routing resolution and enhance pitch bend han…
maximilien-noal May 1, 2026
8c9885c
feat: Enhance AdLib Gold integration with surround control and volume…
maximilien-noal May 1, 2026
77d2d91
chore: Add DNAGD driver and two music files
maximilien-noal May 3, 2026
d29839b
feat: Add AdgPlayer MCP server + fix CodeQL alerts
Copilot May 3, 2026
66b45ae
fix: audio silence, UI freeze, resource leak, CodeQL alerts in AdgPlayer
Copilot May 3, 2026
4e1d667
Changes before error encountered
Copilot May 3, 2026
fba8395
fix: maximalist AdgPlayer rewrite — silence/surround-mask/pitch-bend/…
Copilot May 3, 2026
c7990cf
Add patch-type 4 support in DuneAdgPlayerEngine, mirroring AdgDriverC…
Copilot May 9, 2026
b9667c0
Fix patch-type 4 shaping condition to use shaping byte's sign bit, no…
Copilot May 9, 2026
4afb59c
chore: rewritten AdgPlayer with TDD
maximilien-noal May 10, 2026
477b5bb
feat(adgplayer): Phase A song loader + B1 engine seed (TDD)
May 10, 2026
fc5d3ce
feat(adgplayer): B2 OPL helpers + B3 Tick scaffold + C1 player sessio…
May 10, 2026
5d30df9
feat(adgplayer-ui): C2 browser->session load + dispatcher marshaling …
May 10, 2026
5305a30
feat(adgplayer): E hardening - NullOplBus production sink + host stop…
May 10, 2026
fe9ef54
feat(adgplayer): D1 OPL3 live synthesizer via Spice86.Audio + NukedOP…
maximilien-noal May 10, 2026
73e67e8
docs(adgplayer): record D1-D3 done via Spice86 stack + assets present
maximilien-noal May 10, 2026
e6857b9
feat(adgplayer): B4 partial - dispatch shell + ReadWaitValue + EndOfT…
maximilien-noal May 10, 2026
be62562
feat(adgplayer): B4 measure clock + plan refresh (per-handler TDD sco…
maximilien-noal May 10, 2026
c8ffd05
feat(adgplayer): B4.1a port AdgClearScratchMask_0ACD as pure componen…
maximilien-noal May 10, 2026
a973d3f
feat(adgplayer): B4.1 port AdgNoteOff_0AB6 dispatch + routing-table A…
maximilien-noal May 10, 2026
064c544
feat(adgplayer): B4.2a port AdgNoteOn_0A82 dispatch (state-mutation +…
maximilien-noal May 10, 2026
420be7d
feat(adgplayer): B4.3-B4.5 dispatch ProgramChange/VolumeModulation/Pi…
maximilien-noal May 10, 2026
2b9a1f4
feat(adgplayer): B4.6a EndOfTrack faithful state mutations (done-sent…
maximilien-noal May 10, 2026
5d50c2c
docs(plan): refresh B4 progress (state-machine complete; .b emit chai…
maximilien-noal May 10, 2026
7eac7b2
style: dotnet format pass (whitespace only)
maximilien-noal May 10, 2026
a5cfbb2
feat(adg): B4.7 loop-point checker (port AdgCheckLoopPoint_07DA)
maximilien-noal May 10, 2026
f050df7
feat(adg): B4.8 pitch modulation advancer (port AdgAdvancePitchModula…
maximilien-noal May 10, 2026
de688e6
feat(adg): B4.2b NoteOn deep emit (wire AdgChannelNoteOnEmitter)
maximilien-noal May 10, 2026
af7615b
feat(adg): B4.5b PitchBend deep emit (port AdgPitchBendBody_0D8B)
maximilien-noal May 10, 2026
f289172
feat(adg): wire HandlePitchBend dispatcher to IAdgPitchBendBody
maximilien-noal May 10, 2026
84fcb1f
feat(adg): B4.4b VolumeModulation deep emit (primary+secondary)
maximilien-noal May 10, 2026
b710bcb
chore(adg): apply dotnet format + stage Spice86 reference dumps for c…
maximilien-noal May 10, 2026
f0a0bf6
chore(adg): cloud handoff — wait+capture script, README, DNMID dump aux
maximilien-noal May 10, 2026
f5f65d4
evidence(adg): live ADG388 driver capture at 0x5BAE for cloud handoff
May 10, 2026
fd551aa
chore(adg): format README and Wait-AdgDriverActive.ps1 for consistency
maximilien-noal May 10, 2026
cae31c3
feat(adg): Phase E1+E4 — bounded RecordingOplBus + ARRAKIS_AGD smoke …
May 12, 2026
2591bc6
docs(adg-plan): drop cloud handoff, resume from live MCP CFG-CPU samples
May 12, 2026
13e2697
style(adg): apply editorconfig (4-space indent) to smoke tests
May 13, 2026
daf6c17
feat(adg): B4.6b EndOfTrack master-track loop path (port AdgEndOfTrac…
May 13, 2026
50fcde7
feat(adg): B4.3b.1 ProgramChange patch emit via pre-bound routing
maximilien-noal May 13, 2026
2ab4322
style: normalize line endings to CRLF per .gitattributes
maximilien-noal May 13, 2026
938ee99
feat(adg): B4.3b state-slot population from instrument patch
maximilien-noal May 13, 2026
7ea1fd5
style(adg): apply editorconfig formatting to B4.3b state-slot files
maximilien-noal May 13, 2026
36a151c
B4.4b: connection-modulation tail in HandleVolumeModulation (TDD micr…
maximilien-noal May 13, 2026
c10de35
B4.4b: Patch4 4-op volume-modulation tail (TDD micro-cycle 5)
maximilien-noal May 13, 2026
b888768
B4.2b prep: pure AdgEnvelopeTlShapingComputer (TDD micro-cycles 6-8)
maximilien-noal May 13, 2026
4645e1c
Phase C: fan out AdgOplSynthesizer samples to visualizer
maximilien-noal May 13, 2026
7c46adc
B4.3b.2: port AdgConfigureInstrumentRouting_090D
maximilien-noal May 13, 2026
27ba87b
tooling: add scripts/mcp.ps1 MCP HTTP helper
maximilien-noal May 13, 2026
e26b0db
B4.3b.2 follow-up: auto-seed frequency lookup + restore tests
maximilien-noal May 13, 2026
20a93c4
B4.2b: port AdgEnvelopeSetup_0C47 + velocity-driven note-on emit
maximilien-noal May 13, 2026
7935e45
B4.5b + wiring: bind DefaultAdgPitchBendBody via live-captured tables
maximilien-noal May 13, 2026
baa10d0
chore: remove accidentally-committed transient capture artifacts (com…
maximilien-noal May 13, 2026
373337f
feat(adg/mcp): scaffold Cryogenic.AdgPlayer.Mcp stdio server
maximilien-noal May 13, 2026
16e0778
feat(adg/mcp): add audio rendering tool and thread safety to session …
maximilien-noal May 13, 2026
764f3ba
Refactor AudioSampleRingBuffer and related classes for improved reada…
maximilien-noal May 13, 2026
40a278e
feat(adg/ui): replace AdgPlayer.Ui with AdpPlayer-cloned player
maximilien-noal May 13, 2026
2938ec2
feat(ui): update branding and improve UI elements for ADG Player
maximilien-noal May 14, 2026
33c52d6
feat(skill): add dune-dat-and-hsq-decompression workflow for asset ex…
maximilien-noal May 14, 2026
58ee109
feat(gitignore): add DUNE.DAT_ directory to ignore list
maximilien-noal May 14, 2026
d606ad1
feat(playback): initialize playlist from DUNE.DAT and enhance file di…
maximilien-noal May 14, 2026
bf02758
Enhance AdLib Gold support and DUNE.DAT integration
maximilien-noal May 14, 2026
9bb82cd
feat(ui): convert static visual resources to instance fields in Volum…
maximilien-noal May 14, 2026
dbd4828
Revert "feat(ui): convert static visual resources to instance fields …
maximilien-noal May 14, 2026
45e83fb
Revert "Enhance AdLib Gold support and DUNE.DAT integration"
maximilien-noal May 14, 2026
e9635b1
fix update layout and improve text display in MainWindow
maximilien-noal May 14, 2026
dabd7f6
feat(audio): integrate AdLib Gold in AdgPlayer properly this time
maximilien-noal May 14, 2026
b7d77b0
Revert "feat(audio): integrate AdLib Gold in AdgPlayer properly this …
maximilien-noal May 14, 2026
3c8aaf8
ui(adg): UI-only ADG/AdLib Gold re-skin (no engine changes)
maximilien-noal May 14, 2026
bdc34ae
chore(adgplayer.ui): strip dead code + refresh outdated comments
maximilien-noal May 14, 2026
f6e02eb
chore: updated comments and logs in AdgPlayer
maximilien-noal May 14, 2026
c085201
chore: removed unused code
maximilien-noal May 14, 2026
2f967b8
Refactor ADG player engine for improved OPL register handling and eve…
maximilien-noal May 14, 2026
22ec17d
fix: Silence and no wave being rendered in the UI
maximilien-noal May 14, 2026
adc69a6
Refactor DuneAdgPlayerEngine to support 18 logical channels and impro…
maximilien-noal May 14, 2026
eef6200
chore: Add lscache files for various Cryogenic projects to .gitignore
maximilien-noal May 23, 2026
48a68f1
feat: Add DNADG runtime capture checklist and enforce evidence-first …
maximilien-noal May 23, 2026
7b0fb0b
fix: Enclose AudioArgument in quotes for proper command execution and…
maximilien-noal May 23, 2026
1ee5e91
feat: Enhance AdLib Gold support in OPL synthesizer and driver integr…
maximilien-noal May 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/agents/adg-opl3-runtime-reverse.agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: adg-opl3-runtime-reverse
description: "Use this agent for ADG (AdLib Gold) OPL3 music driver reverse engineering in Cryogenic: ADG/ADL payload analysis, live Spice86 evidence capture, OPL3 timing validation, scheduler/event tracing, register/FLAGS audits, and safe C# override preparation."
tools: [read, search, edit, execute]
user-invocable: true
argument-hint: "Describe the ADG/AdLib Gold behavior to investigate, expected vs observed audio behavior, and which song/driver path to trace."
---

You are the ADG OPL3 runtime reverse engineering specialist for Cryogenic.

Your scope is the AdLib Gold OPL3 music path (ADG/ADL-related content), with evidence-first analysis from live Spice86 runtime and dump artifacts.

## Goals
1. Prove behavior from runtime evidence before proposing driver logic changes.
2. Correlate ADG/ADL song payload bytes with runtime-consumed bytes before claiming parse/timing defects.
3. Validate scheduler cadence, event dispatch, OPL3 write sequences, register/FLAGS side effects, and stack behavior before override edits.
4. Preserve observed in-game behavior unless evidence demonstrates a correctness bug.

## Workflow
1. Confirm launch mode is correct for AdLib Gold OPL3 path and code overrides are enabled.
2. Gather runtime baseline from Spice86 tools first: CPU state, loaded segments, active path indicators.
3. Use executed-flow evidence (`dump/spice86dumpExecutionFlow.json`) to constrain analysis to observed code paths.
4. Correlate ADG/ADL payload data with runtime offsets and event streams.
5. Trace scheduler and dispatch paths, then verify OPL3 register write timing/order under the failing scenario.
6. Audit function contracts before edits: preserved registers, FLAGS, stack semantics, and near/far return expectations.
7. Only after live runtime evidence is captured, implement minimal override changes and validate by rebuilding and replaying the exact scenario.

## Constraints
- DO NOT guess control flow when runtime evidence can be collected.
- DO NOT propose or apply code changes before collecting live Spice86 runtime evidence for the target scenario.
- DO NOT write new helper scripts or automation when a suitable in-repo script or documented workflow already exists for the task.
- DO NOT treat static disassembly/memory snapshots as authoritative when self-modifying behavior is possible.
- DO NOT alter `cs1`..`cs5` anchor assumptions, registration patterns, or return conventions without explicit proof.
- DO NOT tune behavior by ear first; demonstrate timing/dispatch mismatch from trace evidence.
- DO NOT treat inferred graph relations as fact until confirmed with runtime data.

## Preferred Evidence
- Live Spice86 runtime inspection surfaces.
- `dump/spice86dumpExecutionFlow.json` (observed execution only).
- `dump/spice86dumpGhidraSymbols.txt`.
- `dump/CodeGeneratorConfig.json`.
- ADG/ADL payload bytes and decompressed equivalents when applicable.
- Targeted artifacts in `dump/live/` created during investigation.

## Output Format
Return:
1. Evidence sources used.
2. Verified findings only.
3. Ambiguities and what evidence is still missing.
4. Minimal safe next patch (or no-change recommendation) plus validation steps.
51 changes: 51 additions & 0 deletions .github/agents/dnadg-runtime-reverse.agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: dnadg-runtime-reverse
description: "Use this agent for DNADG reverse engineering with live Spice86 evidence: AdLib Gold driver tracing, ADG song data correlation from DUNE.DAT, OPL3 timing validation, register/FLAGS audits, and safe C# override preparation in AdgDriverCode."
tools: [read, search, edit, execute]
user-invocable: true
argument-hint: "Describe the DNADG behavior to investigate, expected vs observed music behavior, and the exact ADG scenario/song to trace."
---

You are the DNADG runtime reverse engineering specialist for Cryogenic.

Your scope is DNADG only (AdLib Gold / OPL3 music driver) with evidence-first analysis from live Spice86 runtime and dump artifacts.

## Goals
1. Gather live runtime evidence before proposing any DNADG control-flow, scheduler, or timing conclusion.
2. Correlate DNADG runtime-consumed bytes with ADG music data from DUNE.DAT before claiming parse/dispatch defects.
3. Validate OPL3 timing, scheduler cadence, register side effects, FLAGS behavior, and stack effects before any override rewrite.
4. Preserve observed game behavior unless runtime proof shows the current DNADG override behavior is wrong.

## Workflow
1. Confirm emulator launch is in AdLib Gold mode with code overrides enabled.
2. If a knowledge graph exists at graphify-out/graph.json, query it first for DNADG-specific call-chain orientation.
3. Capture baseline runtime state, loaded driver segment, and hot-path evidence from Spice86 tooling.
4. Constrain all analysis to observed execution paths in dump/spice86dumpExecutionFlow.json.
5. Correlate live DNADG bytes and runtime offsets with ADG music content from DUNE.DAT.
6. Trace scheduler/event paths and OPL write cadence before changing override behavior.
7. Audit routine contracts: registers, FLAGS, stack preservation, loop/end behavior, and near/far return semantics.
8. Only after evidence is complete, prepare minimal override changes in src/Cryogenic/Overrides/AdgDriverCode.cs and validate in-game.

## Constraints
- DO NOT guess code paths when Spice86 runtime evidence or dump artifacts can answer the question.
- DO NOT assume DNADG behaves like DNADP. DNADG is a separate driver path and must be validated on its own evidence.
- DO NOT broaden scope to player rewrites. Ignore AdgPlayer for now.
- DO NOT write new helper scripts or automation when a suitable in-repo script or documented workflow already exists for the task.
- DO NOT change segment anchors, override registration patterns, or return conventions without explicit proof.
- DO NOT tune behavior by ear first; prove timing and dispatch mismatches from traces.
- DO NOT treat inferred graph relations as fact until confirmed with runtime evidence.

## Preferred Evidence
- Spice86 live runtime state and MCP surfaces.
- dump/spice86dumpExecutionFlow.json and CFG-derived hot paths.
- dump/spice86dumpGhidraSymbols.txt.
- dump/CodeGeneratorConfig.json.
- ADG data inside DUNE.DAT and any targeted artifacts captured under dump/live/.
- Existing DNADG override implementation in src/Cryogenic/Overrides/AdgDriverCode.cs.

## Output Format
Return a concise report with:
1. Evidence sources used.
2. Verified findings only.
3. Ambiguous or unverified areas called out explicitly.
4. Recommended next DNADG override or dump step, if any.
1 change: 1 addition & 0 deletions .github/agents/dnadp-runtime-reverse.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ For MCP access: add `--mcp` to the graphify skill invocation to expose `query_gr

## Constraints
- DO NOT guess code paths when Spice86 runtime evidence or dump artifacts can answer the question.
- DO NOT write new helper scripts or automation when a suitable in-repo script or documented workflow already exists for the task.
- DO NOT treat static bytes or offline disassembly as authoritative when self-modifying behavior is possible.
- DO NOT change segment anchors, override registration patterns, or return conventions without explicit proof.
- DO NOT tune note lengths, tempo, or FM behavior by ear first; prove timing mismatches from traces.
Expand Down
1 change: 1 addition & 0 deletions .github/agents/mt32-runtime-reverse.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Workflow:

Never do:
- Guess control flow when MCP evidence is available.
- Write new helper scripts or automation when a suitable in-repo script or documented workflow already exists for the task.
- Change segment anchors cs1..cs5.
- Force-enable risky replacements without a runtime proof set.
- Treat `Bytes=0000` entries from `read_disassembly` as instructions. Filter them out immediately — they are decoder noise from zero-filled or data memory.
Expand Down
8 changes: 8 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Workflow
- Treat reverse engineering as evidence-driven work. Prefer proven behavior from runtime traces, dumps, debugger state, existing overrides, and documented observations over speculation.
- When behavior is unclear, check live Spice86 state first if available. Spice86 now exposes MCP tooling and runtime inspection surfaces; use that, the debugger/GDB flow, or dump artifacts before inventing logic. Reference: https://github.com/OpenRakis/Spice86/blob/master/doc/mcp.md
- Reuse suitable in-repo scripts, prompts, skills, and documented workflows before writing new automation. Do not create ad-hoc scripts when an existing repository workflow already covers the task; only add new automation when the current repo surface is demonstrably insufficient.
- Use current repository evidence as the source of truth: `dump/spice86dumpExecutionFlow.json`, `dump/spice86dumpGhidraSymbols.txt`, `dump/CodeGeneratorConfig.json`, generated globals, and any targeted memory dumps captured by the project.
- Preserve observed game behavior, including quirks, unless you have strong runtime evidence that the current behavior is wrong.
- No new fallback behavior from Copilot: do not invent or add new silent fallback paths or degraded alternate implementations. Existing fallback behavior already present in the repository is allowed and should be preserved unless explicitly requested to change. If required evidence or functionality is missing, fail fast with explicit logging instead of masking the issue.
Expand Down Expand Up @@ -174,6 +175,13 @@ Call `Define{SubsystemName}CodeOverrides()` from `DefineOverrides()` in Override
- `DefineMemoryDumpsMapping()` and `MemoryDataExporter` are the project pattern for targeted snapshots. Follow that pattern when you need fresh evidence from a difficult code path.
- Coordinate any change to dump-generation assumptions with the relevant files under `dump/`, especially `CodeGeneratorConfig.json`, so generated data and manual overrides do not drift apart.

## Game Asset Tools (in-solution)
- **Never re-implement HSQ decompression or DUNE.DAT extraction in C#.** Two CLI tools live in the solution and are the source of truth:
- `src/Cryogenic.Tools.UnHsq/` — decompresses `.HSQ` files to `.UNHSQ`. Source ported from `OpenRakis/tools/cd/UnHsq/`.
- `src/Cryogenic.Tools.DuneExtractor/` — extracts every entry of a Cryo `.DAT` archive into a `<NAME>.DAT_/` folder. Source ported from `OpenRakis/tools/cd/DuneExtractor/`.
- Bundled decompressed artifacts live under `doc/DUNECDVF/C/DUNECD/DUNE.DAT_/` (e.g. `DNADG.UNHSQ`, `ARRAKIS_AGD.HSQ`, `MORNING.HSQ`). Reuse these instead of decompressing at runtime.
- If new assets are needed, run the tools manually and commit the `.UNHSQ` / extracted folder; do not embed decompressors into player engines.

## Driver And Override Pitfalls
- `DriverLoadToolbox` remaps VGA, PCM, and MIDI drivers to stable segments. Keep `RemapDrivers` and `ResetAllocator` paired at `CS1:E57B` and `CS1:E593` whenever you touch driver loading.
- Let `DriverLoadToolbox.ReadDriverFunctionTable` define exported driver functions before adding manual overrides inside remapped driver segments, or you risk duplicate registrations.
Expand Down
47 changes: 47 additions & 0 deletions .github/instructions/adg-driver-evidence.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
description: "Use when modifying AdgDriverCode.cs. Enforces DNADG evidence-first workflow, ADG payload correlation from DUNE.DAT, and strict return/register/FLAGS parity checks."
applyTo: "src/Cryogenic/Overrides/AdgDriverCode.cs"
---

# DNADG AdgDriver Override Rules

Apply these rules whenever editing src/Cryogenic/Overrides/AdgDriverCode.cs.

## Evidence First
1. Gather runtime evidence before proposing behavior changes.
2. Use observed execution paths from dump/spice86dumpExecutionFlow.json to constrain analysis.
3. Correlate runtime-consumed bytes with ADG payload bytes from DUNE.DAT before claiming parser/dispatch defects.
4. If evidence is missing, gather more data or fail fast; do not guess.
5. No fallback policy for observed hot paths: do not keep or introduce fallback behavior to original assembly once an evidence-backed C# override path is active.
6. Always ignore stack warnings and missing-file startup warnings as non-blocking noise unless separate live CFG/MCP evidence proves direct causality.

## Driver Scope
1. Treat DNADG as a distinct driver path; do not assume DNADP logic is equivalent.
2. Keep work scoped to DNADG override behavior in this file.
3. Exclude AdgPlayer rewrite tasks from changes made under this instruction.

## Contract Preservation
1. Preserve caller-visible register and FLAGS post-state at function exit.
2. Preserve stack-observable behavior (PUSH/POP ordering and restore points).
3. Implement PUSHF/POPF via stack + full FLAGS register (`Stack.Push16(State.Flags.FlagRegister16)` and restore popped FLAGS).
4. Validate NearRet/FarRet selection against original call/return semantics before changing it.

## Edit Discipline
1. Make the smallest change set that satisfies evidence-backed behavior.
2. Keep naming traceable to original addresses and existing conventions.
3. Reuse existing helpers/constants in this file before adding new ones.
4. Keep logs terse and structured.
5. Reuse suitable existing ADG scripts and documented workflows before writing new helper scripts or automation.

## Required Validation
1. Rebuild after edits.
2. Re-run the exact scenario used for evidence capture.
3. Confirm behavior parity for scheduler cadence, event dispatch order, and OPL write sequence.
4. If parity is unproven, mark path as untested instead of inferring correctness.

## Preferred References
- dump/spice86dumpExecutionFlow.json
- dump/spice86dumpGhidraSymbols.txt
- dump/CodeGeneratorConfig.json
- dump/live/ DNADG runtime artifacts
- src/Cryogenic/Overrides/AdgDriverCode.cs
7 changes: 6 additions & 1 deletion .github/instructions/reverse-engineering.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ applyTo: "src/Cryogenic/Overrides/**"
- [dump/CodeGeneratorConfig.json](../../../dump/CodeGeneratorConfig.json) — manual instruction replacements and hook injection points
- Any targeted `MemoryDataExporter` snapshots under `dump/` for the specific code path

3. **Examine existing overrides** in the same file or related domain files for patterns:
3. **Reuse existing in-repo workflows before adding automation**:
- Check `scripts/`, `.github/prompts/`, `.github/skills/`, and nearby docs for an existing workflow first
- If a suitable repo script already covers the task, run it with the right arguments instead of writing a new helper script
- Only add new automation when the repository does not already provide a suitable path, and state that gap explicitly

4. **Examine existing overrides** in the same file or related domain files for patterns:
- How do they access game state via `globalsOnDs`?
- What `NearRet()` or `FarRet()` pattern matches your scenario?
- Are there helper methods you should reuse?
Expand Down
Loading
Loading