Skip to content

Replace FFP Template code with modified remix-comp-base#14

Merged
Kim2091 merged 33 commits into
Ekozmaster:masterfrom
Kim2091:remix-comp-integration
Apr 2, 2026
Merged

Replace FFP Template code with modified remix-comp-base#14
Kim2091 merged 33 commits into
Ekozmaster:masterfrom
Kim2091:remix-comp-integration

Conversation

@Kim2091
Copy link
Copy Markdown
Collaborator

@Kim2091 Kim2091 commented Apr 2, 2026

Changelog: remix-comp-integration

DX9 RE Scripts

11 new static analysis scripts under rtx_remix_tools/dx/scripts/, all built on a shared dx9_common.py module (776 lines) that handles D3D9 vtable offset resolution, constant decoding, and pattern matching:

  • classify_draws.py — Categorize draw calls as FFP, shader, or hybrid
  • decode_fvf.py — Decode FVF bitfields from SetFVF calls
  • find_ps_constants.py — Find SetPixelShaderConstantF/I/B call sites with register/count
  • find_render_states.py — Find SetRenderState calls with enum decoding
  • find_shader_bytecode.py — Extract embedded shader bytecode from the binary
  • find_stateblocks.py — Find state block create/record/apply patterns
  • find_surface_formats.py — Extract formats from CreateTexture/RT/DS calls
  • find_texture_ops.py — Map texture pipeline: stages, TSS ops, sampler states
  • find_transforms.py — Find SetTransform calls (World, View, Projection, Texture)
  • find_matrix_registers.py — Identify View/Proj/World matrix VS registers via CTAB + frequency analysis

remix-comp-proxy

The old dx9-ffp-proxy template code has been stripped out and replaced with a fork of xoxor4x's remix-comp-base.

These are the changes made to his code:

  • FFP Conversion Boilerplate — Implemented the core features/functions from my old dx9-ffp-proxy code. This includes skinning support.
    • Shared FFP state tracker — Centralized VS/PS constant tracking, vertex declarations, bone matrices, and draw routing state.
    • Skinning module — Skinned mesh handling via FFP indexed vertex blending with bone matrix support.
  • INI configurationremix-comp-proxy.ini replaces hardcoded settings, covering FFP, skinning, diagnostics,
    tracer, Remix, and chain-loading.
  • d3d9.dll proxy — Replaced the dinput8.dll ASI loader with direct d3d9 export forwarding. Supports DLL chain loading for mod coexistence.
  • Built-in DX9 tracer — Full frame capture from inside the proxy. Records D3D9 API calls to JSONL with ImGui controls: delayed capture, category filters, external trigger file support.
  • Diagnostics module — Per-category diagnostic logging for FFP conversion debugging with ImGui capture controls.
  • Simplified build — Replaced Premake with a single build.bat that handles MSVC discovery, compilation, and deployment with per-game variant support.
  • Simplified renderer — Reduced from ~378 to ~262 lines. Extracted drawcall context into its own file.

The proxy also has the tracer integrated:

  • External trigger support — The proxy watches for dxtrace_capture.trigger on every Present, so python -m graphics.directx.dx9.tracer trigger --game-dir <DIR> works without the standalone DLL.
  • D3D9 method table (d3d9_methods.py) — Structured method definitions for tracer analysis.

Prompt & Skill Infrastructure Changes

  • Reduced context usage — Moved tool-catalog from always-loaded rule to on-demand reference. Split tool-dispatch out of subagent-workflow. Added remix-comp-context as a reference doc.
  • Updated all Agent files.claude, .cursor, .github, .kiro synced for proxy conversion, new scripts, dataflow/indirect additions, and FFP troubleshooting tips.

Kim2091 and others added 26 commits March 29, 2026 18:57
- Overhaul patch workflow templates and prompt files
- Fix tracer re-enabling FFP unconditionally after capture (now saves/restores)
- Parse [FFP.Registers] INI section (was ignored due to static constexpr)
- Add on-demand diagnostic capture from ImGui with per-category log controls
- Wire diagnostics hooks into D3D9 proxy (Present, BeginScene, SetVS*, draw calls)
- Add Diagnostics tab to ImGui overlay with capture controls and category toggles
- Fix analyze.py format spec for non-float values

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rename the project from remix-comp to remix-comp-proxy across all
source files, build scripts, INI config, skill/prompt files, and
documentation. The directory, INI filename, and all internal references
are updated; upstream remix-comp-base references are preserved.

Tracer enhancements:
- External trigger file support: on_present() polls for
  dxtrace_capture.trigger so the Python CLI works with the proxy
- Delayed capture with configurable countdown (0-30s) via ImGui
- Category-based capture filtering (draw calls, state, shaders,
  textures, transforms, vertex setup, resources, scene, getters, misc)
- Updated About tab to reflect current contributors and features
Remove xoxor4d's berry.png branding — this is a separate project now
and we don't want users directing support requests to him for our work.
His contributions are still credited in the About tab and README.

The icon system still works: drop any icon.png into rtx_comp/textures/
and it shows in the About tab. Nothing loads by default.
@Kim2091 Kim2091 changed the title Remix comp integration Replace FFP Template code with modified remix-comp-base Apr 2, 2026
Merges Ekozmaster/master (bf5b013) into remix-comp-integration,
resolving 5 conflicts where upstream's dataflow/indirect/switch-table
additions overlapped with this branch's restructuring (tool-catalog
move to references/, condensed subagent-workflow, new tool-dispatch).

Upstream additions now integrated across all IDE mirrors:
- dataflow.py (constant propagation + backward slice) in allowlists,
  decision guides, tool tables, and workflow examples
- --indirect flag for callgraph/xrefs (vtable/fptr call discovery)
- cfg.py switch/jump table auto-resolution
- CI workflow, updated context.py with --no-dataflow option
- /dynamic-analysis skill reference

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Kim2091
Copy link
Copy Markdown
Collaborator Author

Kim2091 commented Apr 2, 2026

@Night1099 Could you please review this PR, then I'll merge it? It required modifying some of the agent files, which were conflicting before. I'd like to make sure that you're happy with the changes.

…ared tooling, gave real paths to run in examples, remove lines counts (self discoverable)
@Night1099
Copy link
Copy Markdown
Collaborator

Night1099 commented Apr 2, 2026

^ What commit says, and removed line counts, this can change and the ai can discover it itself, descriptions already convey "big boilerplate, skip it" vs "small focused file, read it."

Night1099 and others added 3 commits April 1, 2026 21:59
Critical fixes:
- D3DRS/D3DBLEND enum values in dx9_common.py aligned to SDK header
- CreateDevice HRESULT check before wrapping device pointer
- Missing CS_MODE_64 import in xrefs.py
- dataflow _get_mem returns Unknown when index register present
- asi_patcher validates addr >= base before computing RVA

Important fixes:
- Migrate 5 DX scripts off duplicated internals onto dx9_common
- Null p_this in module destructors (renderer, imgui, diagnostics, skinning)
- backward_slice_cfg: CFG-aware slice that follows predecessor edges
- Remove unused g_installed_signature_patches externs from comp.hpp
- Split find_matrix_registers main() into discrete phases
- cfg.py _resolve_switch accepts scale==8 for x64 tables
- init_log_file uses std::call_once for thread safety
- Two new dataflow tests: cross-block slice and branch-merge paths

Design notes: document delegation hub, threading model, FFP suppression,
x64 pointer truncation hazards.
@Kim2091
Copy link
Copy Markdown
Collaborator Author

Kim2091 commented Apr 2, 2026

^ These commits also change the imgui theme
image

@Night1099
Copy link
Copy Markdown
Collaborator

Night1099 commented Apr 2, 2026

LGTM might wanna squash and merge to keep things tidy

@Kim2091 Kim2091 merged commit 8109a5f into Ekozmaster:master Apr 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants