fix: allow SubtitleSynchAC1 and other ASI mods to hook D3D9 Present#3
Open
drkm9743 wants to merge 1 commit into
Open
fix: allow SubtitleSynchAC1 and other ASI mods to hook D3D9 Present#3drkm9743 wants to merge 1 commit into
drkm9743 wants to merge 1 commit into
Conversation
- 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.
Author
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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:
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
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.