Skip to content

fix: allow SubtitleSynchAC1 and other ASI mods to hook D3D9 Present#3

Open
drkm9743 wants to merge 1 commit into
animus-reforged:mainfrom
drkm9743:fix/subtitlesynch-compatibility
Open

fix: allow SubtitleSynchAC1 and other ASI mods to hook D3D9 Present#3
drkm9743 wants to merge 1 commit into
animus-reforged:mainfrom
drkm9743:fix/subtitlesynch-compatibility

Conversation

@drkm9743

Copy link
Copy Markdown

Problem

When AltairFix is active alongside SubtitleSynchAC1 (Nexus mod #153) or any other ASI mod that hooks IDirect3DDevice9::Present, two issues prevented the mod from working:

1. DX9 Present hook conflict

AltairFix installed a MinHook vtable hook on slot 17 (Present) via \HookedPresent, which was a pure pass-through with no logic whatsoever. Despite doing nothing useful, it occupied the vtable slot and broke SubtitleSynchAC1's ability to install its own Present hook.

Fix: Removed the DX9 Present hook entirely. \HookedPresent, \s_TruePresent\ and related declarations have been removed. AltairFix's borderless/windowed functionality only needs the \CreateDevice\ and \Reset\ hooks.

2. Vtable probe device blocked by AdjustPresentParameters

SubtitleSynchAC1 (and similar mods) create a temporary D3D9 device with \Windowed=TRUE, \BackBufferWidth=0, \BackBufferHeight=0\ at startup purely to obtain the device vtable for hooking Present. AltairFix was intercepting this call and applying \AdjustPresentParameters\ + \SetupWindow, which caused the probe to either:

  • Take 15+ seconds to complete (blocking the mod's DllMain), or
  • Fail entirely (D3D9 rejects \D3DFMT_UNKNOWN\ with forced explicit dimensions)

Result: SubtitleSynchAC1 never got its vtable, F1 debug menu did nothing, no subtitles appeared.

Fix: \HookedCreateDevice\ now detects probe calls (\Windowed=TRUE\ + \Width==0\ + \Height==0) and passes them through with an 8×8 minimum size (required by D3D9 for windowed devices). The game's own fullscreen call (\Windowed=FALSE) is handled normally.

Changes

  • \source/WindowedMode.cpp: removed Present hook registration, removed \HookedPresent\ function, added probe detection in \HookedCreateDevice\
  • \source/WindowedMode.h: removed \s_TruePresent\ and \HookedPresent\ declarations

Testing

Tested with AltairFix v0.2.1 + SubtitleSynchAC1 + ReShade + EaglePatchAC1 all active simultaneously. Game launches correctly, borderless mode works, subtitles render, ReShade post-processing works.

- Remove the DX9 Present hook (HookedPresent was a pure pass-through with
  no logic, slot 17 is now left free for other ASI mods to use)
- Detect vtable-probe CreateDevice calls (Windowed=TRUE, Width=0, Height=0)
  and pass them through with an 8x8 minimum size instead of applying
  AdjustPresentParameters/SetupWindow, which was causing the probe to take
  15+ seconds or fail entirely (blocking the calling mod's DllMain)

This fixes compatibility with SubtitleSynchAC1 (Nexus mod #153) and any
other ASI mod that creates a temporary D3D9 device to steal the vtable
for hooking Present. With ReShade active, load SubtitleSynchAC1 first
(rename to 0SubtitleSynchAC1.asi) so ReShade wraps it and subtitles
render on top of the post-processing output.
@drkm9743

Copy link
Copy Markdown
Author
image

@shazzaam7

shazzaam7 commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Weird, I just downloaded SubtitleSynchAC1 (1.1.0 released on March 4th) and it randomly worked. Before I tried to use this mod and it wasn't working no matter if other ASI mods were loaded or not. Either way, AltairFix will be rewritten using CLion/CMake instead of VS so I'll need to think of a better way of doing this. I'll leave this open for now (merge it probably).

AssassinsCreed_Dx10_l2M9guAOUY AssassinsCreed_Dx10_HthVly3Lpd

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