refact(iidxhook9): Use sdk-hook and support new config api

Summary:

Test Plan:
This commit is contained in:
icex2 2024-08-17 12:50:14 +02:00
parent d578feb4f9
commit 8b6cd4a58e
27 changed files with 681 additions and 709 deletions

View File

@ -475,10 +475,6 @@ $(zipdir)/iidx-27-to-30.zip: \
dist/iidx/gamestart-28.bat \
dist/iidx/gamestart-29.bat \
dist/iidx/gamestart-30.bat \
dist/iidx/iidxhook-27.conf \
dist/iidx/iidxhook-28.conf \
dist/iidx/iidxhook-29.conf \
dist/iidx/iidxhook-30.conf \
dist/iidx/launcher-27.xml \
dist/iidx/launcher-28.xml \
dist/iidx/launcher-29.xml \

View File

@ -48,5 +48,4 @@ cd /d %CONTENT_DIR%
%BEMANITOOLS_DIR%\launcher.exe^
%BEMANITOOLS_DIR%\launcher-27.xml^
--config %BEMANITOOLS_DIR%\iidxhook-27.conf^
%*

View File

@ -48,5 +48,4 @@ cd /d %CONTENT_DIR%
%BEMANITOOLS_DIR%\launcher.exe^
%BEMANITOOLS_DIR%\launcher-28.xml^
--config %BEMANITOOLS_DIR%\iidxhook-28.conf^
%*

View File

@ -48,5 +48,4 @@ cd /d %CONTENT_DIR%
%BEMANITOOLS_DIR%\launcher.exe^
%BEMANITOOLS_DIR%\launcher-29.xml^
--config %BEMANITOOLS_DIR%\iidxhook-29.conf^
%*

View File

@ -48,5 +48,4 @@ cd /d %CONTENT_DIR%
%BEMANITOOLS_DIR%\launcher.exe^
%BEMANITOOLS_DIR%\launcher-30.xml^
--config %BEMANITOOLS_DIR%\iidxhook-30.conf^
%*

View File

@ -1,87 +0,0 @@
# Disable card reader emulation and enable usage of real card reader hardware on COM1 (for games supporting slotted readers)
io.disable_card_reader_emu=false
# Disable BIO2 emulation and enable usage of real BIO2 hardware
io.disable_bio2_emu=false
# Disables the poll limiter, warning very high CPU usage may arise
io.disable_poll_limiter=false
# Lightning cab mode (requires additional IO emulation)
io.lightning_mode=false
# Disable camera connection
io.disable_cams=true
# Disables the built in file hooks, requiring manual file creation
io.disable_file_hooks=false
# Turntable sensitivity multiplier (1.0 is default)
io.tt_multiplier=1.0
# Disables the camera emulation
cam.disable_emu=true
# Camera port layout (0 = LDJ, 1 = CLDJ/TDJ-JA, 2 = TDJ-JB)
cam.port_layout=1
# Disable camera 1. Use, i.e., if you only have one camera and want it to be mapped to camera 2 ingame.
cam.disable_camera1=false
# Disable camera 2. Use, i.e., if you have more than one camera but only want to map camera 1 ingame.
cam.disable_camera2=false
# Override camera device ID detection (copy from device manager, do not escape)
cam.device_id1=
# Override camera device ID detection (copy from device manager, do not escape)
cam.device_id2=
# Run the game in a framed window (requires windowed option)
gfx.framed=true
# Run the game windowed
gfx.windowed=false
# Confine mouse cursor to window
gfx.confined=false
# Windowed width, -1 for default size
gfx.window_width=-1
# Windowed height, -1 for default size
gfx.window_height=-1
# Windowed X, -1 for default X position
gfx.window_x=-1
# Windowed Y, -1 for default Y position
gfx.window_y=-1
# Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors)
gfx.forced_refresh_rate=-1
# D3D9ex device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
gfx.device_adapter=-1
# Orientation to force monitor into, -1 to use default, 0, 1, 2, 3 to do 0, 90, 180, 270 degrees
gfx.force_orientation=-1
# Force a screen resolution (width), -1 to disable. Use this if the game does not auto detect your monitor's resolution properly, e.g. 1368x768 instead of 1280x720.
gfx.force_screen_res.width=-1
# Force a screen resolution (height), -1 to disable. Use this if the game does not auto detect your monitor's resolution properly, e.g. 1368x768 instead of 1280x720.
gfx.force_screen_res.height=-1
# IP of adapter to force override with
adapter.override_ip=
# Force ASIO audio mode/device (if applicable / TDJ default)
asio.force_asio=false
# Force WASAPI audio mode (if applicable / LDJ default)
asio.force_wasapi=true
# The ASIO device name to use
asio.device_name=XONAR SOUND CARD(64)

View File

@ -1,87 +0,0 @@
# Disable card reader emulation and enable usage of real card reader hardware on COM1 (for games supporting slotted readers)
io.disable_card_reader_emu=false
# Disable BIO2 emulation and enable usage of real BIO2 hardware
io.disable_bio2_emu=false
# Disables the poll limiter, warning very high CPU usage may arise
io.disable_poll_limiter=false
# Lightning cab mode (requires additional IO emulation)
io.lightning_mode=false
# Disable camera connection
io.disable_cams=true
# Disables the built in file hooks, requiring manual file creation
io.disable_file_hooks=false
# Turntable sensitivity multiplier (1.0 is default)
io.tt_multiplier=1.0
# Disables the camera emulation
cam.disable_emu=true
# Camera port layout (0 = LDJ, 1 = CLDJ/TDJ-JA, 2 = TDJ-JB)
cam.port_layout=1
# Disable camera 1. Use, i.e., if you only have one camera and want it to be mapped to camera 2 ingame.
cam.disable_camera1=false
# Disable camera 2. Use, i.e., if you have more than one camera but only want to map camera 1 ingame.
cam.disable_camera2=false
# Override camera device ID detection (copy from device manager, do not escape)
cam.device_id1=
# Override camera device ID detection (copy from device manager, do not escape)
cam.device_id2=
# Run the game in a framed window (requires windowed option)
gfx.framed=true
# Run the game windowed
gfx.windowed=false
# Confine mouse cursor to window
gfx.confined=false
# Windowed width, -1 for default size
gfx.window_width=-1
# Windowed height, -1 for default size
gfx.window_height=-1
# Windowed X, -1 for default X position
gfx.window_x=-1
# Windowed Y, -1 for default Y position
gfx.window_y=-1
# Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors)
gfx.forced_refresh_rate=-1
# D3D9ex device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
gfx.device_adapter=-1
# Orientation to force monitor into, -1 to use default, 0, 1, 2, 3 to do 0, 90, 180, 270 degrees
gfx.force_orientation=-1
# Force a screen resolution (width), -1 to disable. Use this if the game does not auto detect your monitor's resolution properly, e.g. 1368x768 instead of 1280x720.
gfx.force_screen_res.width=-1
# Force a screen resolution (height), -1 to disable. Use this if the game does not auto detect your monitor's resolution properly, e.g. 1368x768 instead of 1280x720.
gfx.force_screen_res.height=-1
# IP of adapter to force override with
adapter.override_ip=
# Force ASIO audio mode/device (if applicable / TDJ default)
asio.force_asio=false
# Force WASAPI audio mode (if applicable / LDJ default)
asio.force_wasapi=true
# The ASIO device name to use
asio.device_name=XONAR SOUND CARD(64)

View File

@ -1,87 +0,0 @@
# Disable card reader emulation and enable usage of real card reader hardware on COM1 (for games supporting slotted readers)
io.disable_card_reader_emu=false
# Disable BIO2 emulation and enable usage of real BIO2 hardware
io.disable_bio2_emu=false
# Disables the poll limiter, warning very high CPU usage may arise
io.disable_poll_limiter=false
# Lightning cab mode (requires additional IO emulation)
io.lightning_mode=false
# Disable camera connection
io.disable_cams=true
# Disables the built in file hooks, requiring manual file creation
io.disable_file_hooks=false
# Turntable sensitivity multiplier (1.0 is default)
io.tt_multiplier=1.0
# Disables the camera emulation
cam.disable_emu=true
# Camera port layout (0 = LDJ, 1 = CLDJ/TDJ-JA, 2 = TDJ-JB)
cam.port_layout=1
# Disable camera 1. Use, i.e., if you only have one camera and want it to be mapped to camera 2 ingame.
cam.disable_camera1=true
# Disable camera 2. Use, i.e., if you have more than one camera but only want to map camera 1 ingame.
cam.disable_camera2=false
# Override camera device ID detection (copy from device manager, do not escape)
cam.device_id1=
# Override camera device ID detection (copy from device manager, do not escape)
cam.device_id2=
# Run the game in a framed window (requires windowed option)
gfx.framed=true
# Run the game windowed
gfx.windowed=false
# Confine mouse cursor to window
gfx.confined=false
# Windowed width, -1 for default size
gfx.window_width=-1
# Windowed height, -1 for default size
gfx.window_height=-1
# Windowed X, -1 for default X position
gfx.window_x=-1
# Windowed Y, -1 for default Y position
gfx.window_y=-1
# Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors)
gfx.forced_refresh_rate=-1
# D3D9ex device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
gfx.device_adapter=-1
# Orientation to force monitor into, -1 to use default, 0, 1, 2, 3 to do 0, 90, 180, 270 degrees
gfx.force_orientation=-1
# Force a screen resolution (width), -1 to disable. Use this if the game does not auto detect your monitor's resolution properly, e.g. 1368x768 instead of 1280x720.
gfx.force_screen_res.width=-1
# Force a screen resolution (height), -1 to disable. Use this if the game does not auto detect your monitor's resolution properly, e.g. 1368x768 instead of 1280x720.
gfx.force_screen_res.height=-1
# IP of adapter to force override with
adapter.override_ip=
# Force ASIO audio mode/device (if applicable / TDJ default)
asio.force_asio=false
# Force WASAPI audio mode (if applicable / LDJ default)
asio.force_wasapi=true
# The ASIO device name to use
asio.device_name=XONAR SOUND CARD(64)

View File

@ -1,87 +0,0 @@
# Disable card reader emulation and enable usage of real card reader hardware on COM1 (for games supporting slotted readers)
io.disable_card_reader_emu=false
# Disable BIO2 emulation and enable usage of real BIO2 hardware
io.disable_bio2_emu=false
# Disables the poll limiter, warning very high CPU usage may arise
io.disable_poll_limiter=false
# Lightning cab mode (requires additional IO emulation)
io.lightning_mode=false
# Disable camera connection
io.disable_cams=true
# Disables the built in file hooks, requiring manual file creation
io.disable_file_hooks=false
# Turntable sensitivity multiplier (1.0 is default)
io.tt_multiplier=1.0
# Disables the camera emulation
cam.disable_emu=true
# Camera port layout (0 = LDJ, 1 = CLDJ/TDJ-JA, 2 = TDJ-JB)
cam.port_layout=1
# Disable camera 1. Use, i.e., if you only have one camera and want it to be mapped to camera 2 ingame.
cam.disable_camera1=true
# Disable camera 2. Use, i.e., if you have more than one camera but only want to map camera 1 ingame.
cam.disable_camera2=false
# Override camera device ID detection (copy from device manager, do not escape)
cam.device_id1=
# Override camera device ID detection (copy from device manager, do not escape)
cam.device_id2=
# Run the game in a framed window (requires windowed option)
gfx.framed=true
# Run the game windowed
gfx.windowed=false
# Confine mouse cursor to window
gfx.confined=false
# Windowed width, -1 for default size
gfx.window_width=-1
# Windowed height, -1 for default size
gfx.window_height=-1
# Windowed X, -1 for default X position
gfx.window_x=-1
# Windowed Y, -1 for default Y position
gfx.window_y=-1
# Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors)
gfx.forced_refresh_rate=-1
# D3D9ex device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
gfx.device_adapter=-1
# Orientation to force monitor into, -1 to use default, 0, 1, 2, 3 to do 0, 90, 180, 270 degrees
gfx.force_orientation=-1
# Force a screen resolution (width), -1 to disable. Use this if the game does not auto detect your monitor's resolution properly, e.g. 1368x768 instead of 1280x720.
gfx.force_screen_res.width=-1
# Force a screen resolution (height), -1 to disable. Use this if the game does not auto detect your monitor's resolution properly, e.g. 1368x768 instead of 1280x720.
gfx.force_screen_res.height=-1
# IP of adapter to force override with
adapter.override_ip=
# Force ASIO audio mode/device (if applicable / TDJ default)
asio.force_asio=false
# Force WASAPI audio mode (if applicable / LDJ default)
asio.force_wasapi=true
# The ASIO device name to use
asio.device_name=XONAR SOUND CARD(64)

View File

@ -1,44 +0,0 @@
<?xml version="1.0" encoding="Shift-JIS"?>
<hook>
<version __type="u32">1</version>
<io>
<disable_card_reader_emu __type="bool">0</disable_card_reader_emu>
<disable_bio2_emu __type="bool">0</disable_bio2_emu>
<disable_poll_limiter __type="bool">0</disable_poll_limiter>
<lightning_mode __type="bool">0</lighting_mode>
<disable_cams __type="bool">1</disable_cams>
<disable_file_hooks __type="bool">0</disable_file_hooks>
<tt_multiplier __type="float">1.0</tt_multiplier>
</io>
<cam>
<disable_emu __type="bool">1</disable_emu>
<disable_camera1 __type="bool">1</disable_camera1>
<disable_camera2 __type="bool">1</disable_camera2>
<device_id1 __type="str"></device_id1>
<device_id2 __type="str"></device_id2>
</cam>
<gfx>
<framed __type="bool">1</framed>
<windowed __type="bool">0</windowed>
<confined __type="bool">0</confined>
<window_width __type="s32">-1</window_width>
<window_height __type="s32">-1</window_height>
<window_x __type="s32">-1</window_x>
<window_y __type="s32">-1</window_y>
<forced_refresh_rate __type="s32">-1</forced_refresh_rate>
<device_adapter __type="s32">-1</device_adapter>
<force_orientation __type="s32">-1</force_orientation>
<force_screen_res>
<width __type="s32">-1</width>
<height __type="s32">-1</height>
</force_screen_res>
</gfx>
<adapter>
<override_ip __type="str"></override_ip>
</adapter>
<asio>
<force_asio __type="bool">0</force_asio>
<force_wasapi __type="bool">1</force_wasapi>
<device_name __type="str">XONAR SOUND CARD(64)</device_name>
</asio>
</hook>

View File

@ -60,6 +60,90 @@
<path __type="str">iidxhook9.dll</path>
<config kind="inline">
<hook>
<adapter>
<!-- IP of adapter to force override with -->
<override_ip __type="str"></override_ip>
</adapter>
<asio>
<!-- Force ASIO audio mode/device (if applicable / TDJ default) -->
<force_asio __type="bool">false</force_asio>
<!-- Force WASAPI audio mode (if applicable / LDJ default) -->
<force_asio __type="bool">true</force_asio>
<!-- The ASIO device name to use -->
<force_asio __type="bool">XONAR SOUND CARD(64)</force_asio>
</asio>
<gfx>
<device>
<!-- D3D9ex device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter -->
<adapter __type="s32">-1</adapter>
<!-- Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) -->
<forced_refresh_rate __type="s32">-1</forced_refresh_rate>
<!-- Orientation to force monitor into, -1 to use default, 0, 1, 2, 3 to do 0, 90, 180, 270 degrees -->
<force_orientation __type="s32">-1</force_orientation>
<!-- Force a screen resolution (width), -1 to disable. Use this if the game does not auto detect your monitor's resolution properly, e.g. 1368x768 instead of 1280x720. -->
<force_screen_res>
<width __type="s32">-1</width>
<height __type="s32">-1</height>
</force_screen_res>
</device>
<window>
<!-- Run the game windowed -->
<windowed __type="bool">1</windowed>
<!-- Run the game in a framed window (requires windowed option) -->
<framed __type="bool">1</framed>
<!-- Confine mouse cursor to window -->
<confined __type="bool">0</confined>
<!-- Windowed width, -1 for default size -->
<width __type="s32">-1</width>
<!-- Windowed height, -1 for default size -->
<height __type="s32">-1</height>
<!-- Windowed X, -1 for default X position -->
<x __type="s32">-1</x>
<!-- Windowed Y, -1 for default Y position -->
<y __type="s32">-1</y>
</window>
<back_buffer_scale>
<!-- Up-/downscale the back buffer's height. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding width parameter. -->
<width __type="s32">0</width>
<height __type="s32">0</height>
<!-- Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation). -->
<filter __type="str">none</filter>
</back_buffer_scale>
</gfx>
<camera>
<!-- Disables the camera emulation -->
<disable_emu __type="bool">0</disable_emu>
<!-- Camera port layout (0 = LDJ, 1 = CLDJ/TDJ-JA, 2 = TDJ-JB) -->
<port_layout __type="s16">1</port_layout>
<device_1>
<!-- Disable camera 1. Use, i.e., if you only have one camera and want it to be mapped to camera 2 ingame. -->
<disable __type="bool">0</disable>
<!-- Override camera device ID 1 detection (copy from device manager, do not escape) Leave blank to automatically detect -->
<id __type="str"></id>
</device_1>
<device_2>
<!-- Disable camera 2. Use, i.e., if you have more than one camera but only want to map camera 1 ingame. -->
<disable __type="bool">0</disable>
<!-- Override camera device ID 2 detection (copy from device manager, do not escape) Leave blank to automatically detect -->
<id __type="str"></id>
</device_2>
</camera>
<io>
<!-- Disable card reader emulation and enable usage of real card reader hardware on COM1 (for games supporting slotted readers) -->
<disable_card_reader_emu __type="bool">0</disable_card_reader_emu>
<!-- Disable BIO2 emulation and enable usage of real BIO2 hardware -->
<disable_bio2_emu __type="bool">0</disable_bio2_emu>
<!-- Disables the poll limiter, warning very high CPU usage may arise -->
<disable_poll_limiter __type="bool">0</disable_poll_limiter>
<!-- Lightning cab mode (requires additional IO emulation) -->
<lightning_mode __type="bool">0</lightning_mode>
<!-- Disable camera connection -->
<disable_cams __type="bool">1</disable_cams>
<!-- Disables the built in file hooks, requiring manual file creation -->
<disable_file_hooks __type="bool">0</disable_file_hooks>
<!-- Turntable sensitivity multiplier (1.0 is default) -->
<tt_multiplier __type="float">1.0</tt_multiplier>
</io>
</hook>
</config>
</pre_avs>

View File

@ -60,6 +60,90 @@
<path __type="str">iidxhook9.dll</path>
<config kind="inline">
<hook>
<adapter>
<!-- IP of adapter to force override with -->
<override_ip __type="str"></override_ip>
</adapter>
<asio>
<!-- Force ASIO audio mode/device (if applicable / TDJ default) -->
<force_asio __type="bool">false</force_asio>
<!-- Force WASAPI audio mode (if applicable / LDJ default) -->
<force_asio __type="bool">true</force_asio>
<!-- The ASIO device name to use -->
<force_asio __type="bool">XONAR SOUND CARD(64)</force_asio>
</asio>
<gfx>
<device>
<!-- D3D9ex device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter -->
<adapter __type="s32">-1</adapter>
<!-- Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) -->
<forced_refresh_rate __type="s32">-1</forced_refresh_rate>
<!-- Orientation to force monitor into, -1 to use default, 0, 1, 2, 3 to do 0, 90, 180, 270 degrees -->
<force_orientation __type="s32">-1</force_orientation>
<!-- Force a screen resolution (width), -1 to disable. Use this if the game does not auto detect your monitor's resolution properly, e.g. 1368x768 instead of 1280x720. -->
<force_screen_res>
<width __type="s32">-1</width>
<height __type="s32">-1</height>
</force_screen_res>
</device>
<window>
<!-- Run the game windowed -->
<windowed __type="bool">1</windowed>
<!-- Run the game in a framed window (requires windowed option) -->
<framed __type="bool">1</framed>
<!-- Confine mouse cursor to window -->
<confined __type="bool">0</confined>
<!-- Windowed width, -1 for default size -->
<width __type="s32">-1</width>
<!-- Windowed height, -1 for default size -->
<height __type="s32">-1</height>
<!-- Windowed X, -1 for default X position -->
<x __type="s32">-1</x>
<!-- Windowed Y, -1 for default Y position -->
<y __type="s32">-1</y>
</window>
<back_buffer_scale>
<!-- Up-/downscale the back buffer's height. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding width parameter. -->
<width __type="s32">0</width>
<height __type="s32">0</height>
<!-- Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation). -->
<filter __type="str">none</filter>
</back_buffer_scale>
</gfx>
<camera>
<!-- Disables the camera emulation -->
<disable_emu __type="bool">0</disable_emu>
<!-- Camera port layout (0 = LDJ, 1 = CLDJ/TDJ-JA, 2 = TDJ-JB) -->
<port_layout __type="s16">1</port_layout>
<device_1>
<!-- Disable camera 1. Use, i.e., if you only have one camera and want it to be mapped to camera 2 ingame. -->
<disable __type="bool">0</disable>
<!-- Override camera device ID 1 detection (copy from device manager, do not escape) Leave blank to automatically detect -->
<id __type="str"></id>
</device_1>
<device_2>
<!-- Disable camera 2. Use, i.e., if you have more than one camera but only want to map camera 1 ingame. -->
<disable __type="bool">0</disable>
<!-- Override camera device ID 2 detection (copy from device manager, do not escape) Leave blank to automatically detect -->
<id __type="str"></id>
</device_2>
</camera>
<io>
<!-- Disable card reader emulation and enable usage of real card reader hardware on COM1 (for games supporting slotted readers) -->
<disable_card_reader_emu __type="bool">0</disable_card_reader_emu>
<!-- Disable BIO2 emulation and enable usage of real BIO2 hardware -->
<disable_bio2_emu __type="bool">0</disable_bio2_emu>
<!-- Disables the poll limiter, warning very high CPU usage may arise -->
<disable_poll_limiter __type="bool">0</disable_poll_limiter>
<!-- Lightning cab mode (requires additional IO emulation) -->
<lightning_mode __type="bool">0</lightning_mode>
<!-- Disable camera connection -->
<disable_cams __type="bool">1</disable_cams>
<!-- Disables the built in file hooks, requiring manual file creation -->
<disable_file_hooks __type="bool">0</disable_file_hooks>
<!-- Turntable sensitivity multiplier (1.0 is default) -->
<tt_multiplier __type="float">1.0</tt_multiplier>
</io>
</hook>
</config>
</pre_avs>

View File

@ -60,6 +60,90 @@
<path __type="str">iidxhook9.dll</path>
<config kind="inline">
<hook>
<adapter>
<!-- IP of adapter to force override with -->
<override_ip __type="str"></override_ip>
</adapter>
<asio>
<!-- Force ASIO audio mode/device (if applicable / TDJ default) -->
<force_asio __type="bool">false</force_asio>
<!-- Force WASAPI audio mode (if applicable / LDJ default) -->
<force_asio __type="bool">true</force_asio>
<!-- The ASIO device name to use -->
<force_asio __type="bool">XONAR SOUND CARD(64)</force_asio>
</asio>
<gfx>
<device>
<!-- D3D9ex device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter -->
<adapter __type="s32">-1</adapter>
<!-- Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) -->
<forced_refresh_rate __type="s32">-1</forced_refresh_rate>
<!-- Orientation to force monitor into, -1 to use default, 0, 1, 2, 3 to do 0, 90, 180, 270 degrees -->
<force_orientation __type="s32">-1</force_orientation>
<!-- Force a screen resolution (width), -1 to disable. Use this if the game does not auto detect your monitor's resolution properly, e.g. 1368x768 instead of 1280x720. -->
<force_screen_res>
<width __type="s32">-1</width>
<height __type="s32">-1</height>
</force_screen_res>
</device>
<window>
<!-- Run the game windowed -->
<windowed __type="bool">1</windowed>
<!-- Run the game in a framed window (requires windowed option) -->
<framed __type="bool">1</framed>
<!-- Confine mouse cursor to window -->
<confined __type="bool">0</confined>
<!-- Windowed width, -1 for default size -->
<width __type="s32">-1</width>
<!-- Windowed height, -1 for default size -->
<height __type="s32">-1</height>
<!-- Windowed X, -1 for default X position -->
<x __type="s32">-1</x>
<!-- Windowed Y, -1 for default Y position -->
<y __type="s32">-1</y>
</window>
<back_buffer_scale>
<!-- Up-/downscale the back buffer's height. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding width parameter. -->
<width __type="s32">0</width>
<height __type="s32">0</height>
<!-- Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation). -->
<filter __type="str">none</filter>
</back_buffer_scale>
</gfx>
<camera>
<!-- Disables the camera emulation -->
<disable_emu __type="bool">0</disable_emu>
<!-- Camera port layout (0 = LDJ, 1 = CLDJ/TDJ-JA, 2 = TDJ-JB) -->
<port_layout __type="s16">1</port_layout>
<device_1>
<!-- Disable camera 1. Use, i.e., if you only have one camera and want it to be mapped to camera 2 ingame. -->
<disable __type="bool">1</disable>
<!-- Override camera device ID 1 detection (copy from device manager, do not escape) Leave blank to automatically detect -->
<id __type="str"></id>
</device_1>
<device_2>
<!-- Disable camera 2. Use, i.e., if you have more than one camera but only want to map camera 1 ingame. -->
<disable __type="bool">0</disable>
<!-- Override camera device ID 2 detection (copy from device manager, do not escape) Leave blank to automatically detect -->
<id __type="str"></id>
</device_2>
</camera>
<io>
<!-- Disable card reader emulation and enable usage of real card reader hardware on COM1 (for games supporting slotted readers) -->
<disable_card_reader_emu __type="bool">0</disable_card_reader_emu>
<!-- Disable BIO2 emulation and enable usage of real BIO2 hardware -->
<disable_bio2_emu __type="bool">0</disable_bio2_emu>
<!-- Disables the poll limiter, warning very high CPU usage may arise -->
<disable_poll_limiter __type="bool">0</disable_poll_limiter>
<!-- Lightning cab mode (requires additional IO emulation) -->
<lightning_mode __type="bool">0</lightning_mode>
<!-- Disable camera connection -->
<disable_cams __type="bool">1</disable_cams>
<!-- Disables the built in file hooks, requiring manual file creation -->
<disable_file_hooks __type="bool">0</disable_file_hooks>
<!-- Turntable sensitivity multiplier (1.0 is default) -->
<tt_multiplier __type="float">1.0</tt_multiplier>
</io>
</hook>
</config>
</pre_avs>

View File

@ -60,6 +60,90 @@
<path __type="str">iidxhook9.dll</path>
<config kind="inline">
<hook>
<adapter>
<!-- IP of adapter to force override with -->
<override_ip __type="str"></override_ip>
</adapter>
<asio>
<!-- Force ASIO audio mode/device (if applicable / TDJ default) -->
<force_asio __type="bool">false</force_asio>
<!-- Force WASAPI audio mode (if applicable / LDJ default) -->
<force_asio __type="bool">true</force_asio>
<!-- The ASIO device name to use -->
<force_asio __type="bool">XONAR SOUND CARD(64)</force_asio>
</asio>
<gfx>
<device>
<!-- D3D9ex device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter -->
<adapter __type="s32">-1</adapter>
<!-- Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) -->
<forced_refresh_rate __type="s32">-1</forced_refresh_rate>
<!-- Orientation to force monitor into, -1 to use default, 0, 1, 2, 3 to do 0, 90, 180, 270 degrees -->
<force_orientation __type="s32">-1</force_orientation>
<!-- Force a screen resolution (width), -1 to disable. Use this if the game does not auto detect your monitor's resolution properly, e.g. 1368x768 instead of 1280x720. -->
<force_screen_res>
<width __type="s32">-1</width>
<height __type="s32">-1</height>
</force_screen_res>
</device>
<window>
<!-- Run the game windowed -->
<windowed __type="bool">1</windowed>
<!-- Run the game in a framed window (requires windowed option) -->
<framed __type="bool">1</framed>
<!-- Confine mouse cursor to window -->
<confined __type="bool">0</confined>
<!-- Windowed width, -1 for default size -->
<width __type="s32">-1</width>
<!-- Windowed height, -1 for default size -->
<height __type="s32">-1</height>
<!-- Windowed X, -1 for default X position -->
<x __type="s32">-1</x>
<!-- Windowed Y, -1 for default Y position -->
<y __type="s32">-1</y>
</window>
<back_buffer_scale>
<!-- Up-/downscale the back buffer's height. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding width parameter. -->
<width __type="s32">0</width>
<height __type="s32">0</height>
<!-- Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation). -->
<filter __type="str">none</filter>
</back_buffer_scale>
</gfx>
<camera>
<!-- Disables the camera emulation -->
<disable_emu __type="bool">0</disable_emu>
<!-- Camera port layout (0 = LDJ, 1 = CLDJ/TDJ-JA, 2 = TDJ-JB) -->
<port_layout __type="s16">1</port_layout>
<device_1>
<!-- Disable camera 1. Use, i.e., if you only have one camera and want it to be mapped to camera 2 ingame. -->
<disable __type="bool">1</disable>
<!-- Override camera device ID 1 detection (copy from device manager, do not escape) Leave blank to automatically detect -->
<id __type="str"></id>
</device_1>
<device_2>
<!-- Disable camera 2. Use, i.e., if you have more than one camera but only want to map camera 1 ingame. -->
<disable __type="bool">0</disable>
<!-- Override camera device ID 2 detection (copy from device manager, do not escape) Leave blank to automatically detect -->
<id __type="str"></id>
</device_2>
</camera>
<io>
<!-- Disable card reader emulation and enable usage of real card reader hardware on COM1 (for games supporting slotted readers) -->
<disable_card_reader_emu __type="bool">0</disable_card_reader_emu>
<!-- Disable BIO2 emulation and enable usage of real BIO2 hardware -->
<disable_bio2_emu __type="bool">0</disable_bio2_emu>
<!-- Disables the poll limiter, warning very high CPU usage may arise -->
<disable_poll_limiter __type="bool">0</disable_poll_limiter>
<!-- Lightning cab mode (requires additional IO emulation) -->
<lightning_mode __type="bool">0</lightning_mode>
<!-- Disable camera connection -->
<disable_cams __type="bool">1</disable_cams>
<!-- Disables the built in file hooks, requiring manual file creation -->
<disable_file_hooks __type="bool">0</disable_file_hooks>
<!-- Turntable sensitivity multiplier (1.0 is default) -->
<tt_multiplier __type="float">1.0</tt_multiplier>
</io>
</hook>
</config>
</pre_avs>

View File

@ -72,3 +72,12 @@ void asiohook_config_asio_get(
ASIOHOOK_CONFIG_IO_DEFAULT_ASIO_DEVICE_NAME_VALUE);
}
}
void asiohook_config_asio_get2(
const bt_core_config_t *config,
struct asiohook_config_asio *config_asio)
{
bt_core_config_bool_get(config, "asio/force_asio", &config_asio->force_asio);
bt_core_config_bool_get(config, "asio/force_wasapi", &config_asio->force_wasapi);
bt_core_config_str_get(config, "asio/device_name", config_asio->replacement_name, sizeof(config_asio->replacement_name));
}

View File

@ -5,6 +5,8 @@
#include "cconfig/cconfig.h"
#include "iface-core/config.h"
struct asiohook_config_asio {
bool force_asio;
bool force_wasapi;
@ -16,4 +18,8 @@ void asiohook_config_init(struct cconfig *config);
void asiohook_config_asio_get(
struct asiohook_config_asio *config_asio, struct cconfig *config);
void asiohook_config_asio_get2(
const bt_core_config_t *config,
struct asiohook_config_asio *config_asio);
#endif

View File

@ -267,3 +267,22 @@ void d3d9exhook_config_gfx_get(
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_SCREEN_RES_HEIGHT_VALUE);
}
}
void d3d9exhook_config_gfx_get2(
const bt_core_config_t *config,
struct d3d9exhook_config_gfx *config_gfx)
{
bt_core_config_s32_get(config, "gfx/device/adapter", &config_gfx->device_adapter);
bt_core_config_s32_get(config, "gfx/device/forced_refresh_rate", &config_gfx->forced_refresh_rate);
bt_core_config_s32_get(config, "gfx/device/force_orientation", &config_gfx->force_orientation);
bt_core_config_s32_get(config, "gfx/device/force_screen_res/width", &config_gfx->force_screen_res.width);
bt_core_config_s32_get(config, "gfx/device/force_screen_res/height", &config_gfx->force_screen_res.height);
bt_core_config_bool_get(config, "gfx/window/windowed", &config_gfx->windowed);
bt_core_config_bool_get(config, "gfx/window/framed", &config_gfx->framed);
bt_core_config_bool_get(config, "gfx/window/confined", &config_gfx->confined);
bt_core_config_s32_get(config, "gfx/window/width", &config_gfx->window_width);
bt_core_config_s32_get(config, "gfx/window/height", &config_gfx->window_height);
bt_core_config_s32_get(config, "gfx/window/x", &config_gfx->window_x);
bt_core_config_s32_get(config, "gfx/window/y", &config_gfx->window_y);
}

View File

@ -3,6 +3,8 @@
#include "cconfig/cconfig.h"
#include "iface-core/config.h"
/**
* Config struct for d3d9exhook
*
@ -38,4 +40,8 @@ void d3d9exhook_config_gfx_init(struct cconfig *config);
void d3d9exhook_config_gfx_get(
struct d3d9exhook_config_gfx *config_gfx, struct cconfig *config);
void d3d9exhook_config_gfx_get2(
const bt_core_config_t *config,
struct d3d9exhook_config_gfx *config_gfx);
#endif

View File

@ -33,3 +33,9 @@ void hooklib_config_adapter_get(
HOOKLIB_CONFIG_ADAPTER_DEFAULT_OVERRIDE_IP_VALUE);
}
}
void hooklib_config_adapter_get2(
const bt_core_config_t *config, struct hooklib_config_adapter *config_adapter)
{
bt_core_config_str_get(config, "adapter/override_ip", config_adapter->override_ip, sizeof(config_adapter->override_ip));
}

View File

@ -5,6 +5,8 @@
#include "cconfig/cconfig.h"
#include "iface-core/config.h"
struct hooklib_config_adapter {
// this is larger on purpose, in case ppl enter the wrong stuff here
char override_ip[32];
@ -15,4 +17,7 @@ void hooklib_config_adapter_init(struct cconfig *config);
void hooklib_config_adapter_get(
struct hooklib_config_adapter *config_adapter, struct cconfig *config);
void hooklib_config_adapter_get2(
const bt_core_config_t *config, struct hooklib_config_adapter *config_adapter);
#endif

View File

@ -36,5 +36,6 @@ libs_iidxhook9 := \
src_iidxhook9 := \
config-io.c \
fs-hook.c \
dllmain.c \
fs-hook.c \
iidxhook9.c \

View File

@ -1,5 +1,7 @@
#include "cconfig/cconfig-util.h"
#include "core/config-ext.h"
#include "iface-core/log.h"
#include "iidxhook9/config-io.h"
@ -154,3 +156,15 @@ void iidxhook9_config_io_get(
IIDXHOOK9_CONFIG_IO_DEFAULT_TT_MULTIPLIER_VALUE);
}
}
void iidxhook9_config_io_get2(
const bt_core_config_t *config,
struct iidxhook9_config_io *config_io)
{
bt_core_config_ext_bool_get(config, "io/disable_card_reader_emu", &config_io->disable_card_reader_emu);
bt_core_config_ext_bool_get(config, "io/disable_bio2_emu", &config_io->disable_bio2_emu);
bt_core_config_ext_bool_get(config, "io/disable_poll_limiter", &config_io->disable_poll_limiter);
bt_core_config_ext_bool_get(config, "io/disable_cams", &config_io->disable_cams);
bt_core_config_ext_bool_get(config, "io/disable_file_hooks", &config_io->disable_file_hooks);
bt_core_config_ext_float_get(config, "io/tt_multiplier", &config_io->tt_multiplier);
}

View File

@ -20,4 +20,8 @@ void iidxhook9_config_io_init(struct cconfig *config);
void iidxhook9_config_io_get(
struct iidxhook9_config_io *config_io, struct cconfig *config);
void iidxhook9_config_io_get2(
const bt_core_config_t *config,
struct iidxhook9_config_io *config_io);
#endif

View File

@ -1,313 +1,6 @@
#include <windows.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "cconfig/cconfig-hook.h"
#include "hooklib/acp.h"
#include "hooklib/adapter.h"
#include "hooklib/config-adapter.h"
#include "hooklib/memfile.h"
#include "hooklib/rs232.h"
#include "hooklib/setupapi.h"
#include "iface-core/log.h"
#include "iface-core/thread.h"
#include "iface-io/eam.h"
#include "iface-io/iidx.h"
#include "iidxhook-util/acio.h"
#include "bio2emu/emu.h"
#include "bio2emu-iidx/bi2a.h"
#include "iidxhook9/config-io.h"
#include "iidxhook9/fs-hook.h"
#include "camhook/cam.h"
#include "camhook/config-cam.h"
#include "asio/asio-reghook.h"
#include "asio/config-asio.h"
#include "d3d9exhook/d3d9ex.h"
#include "dinput/dinput.h"
#include "module/io-ext.h"
#include "module/io.h"
#include "sdk/module/core/log.h"
#include "sdk/module/core/thread.h"
#include "sdk/module/hook.h"
#include "util/cmdline.h"
#include "util/str.h"
#define IIDXHOOK9_INFO_HEADER \
"iidxhook for Heroic Verse" \
", build " __DATE__ " " __TIME__ ", gitrev " STRINGIFY(GITREV) "\n"
#define IIDXHOOK9_CMD_USAGE \
"Usage: launcher.exe -B iidxhook9-prehook.dll -K iidxhook9.dll " \
"<bm2dx.dll> [options...]"
static struct iidxhook9_config_io iidxhook9_config_io;
static struct camhook_config_cam config_cam;
static struct asiohook_config_asio config_asio;
static struct hooklib_config_adapter config_adapter;
static struct d3d9exhook_config_gfx config_gfx;
static struct bio2emu_port bio2_emu = {
.port = "COM4",
.wport = L"COM4",
.dispatcher = bio2_emu_bi2a_dispatch_request,
};
static module_io_t *iidxhook_module_io_iidx;
static module_io_t *iidxhook_module_io_eam;
static void _iidxhook9_io_iidx_init(module_io_t **module)
{
bt_io_iidx_api_t api;
module_io_ext_load_and_init(
"iidxio.dll", "bt_module_io_iidx_api_get", module);
module_io_api_get(*module, &api);
bt_io_iidx_api_set(&api);
}
static void _iidxhook9_io_eam_init(module_io_t **module)
{
bt_io_eam_api_t api;
module_io_ext_load_and_init(
"eamio.dll", "bt_module_io_eam_api_get", module);
module_io_api_get(*module, &api);
bt_io_eam_api_set(&api);
}
static bool load_configs()
{
struct cconfig *config;
config = cconfig_init();
iidxhook9_config_io_init(config);
camhook_config_cam_init(config, 2, true);
d3d9exhook_config_gfx_init(config);
hooklib_config_adapter_init(config);
asiohook_config_init(config);
if (!cconfig_hook_config_init(
config,
IIDXHOOK9_INFO_HEADER "\n" IIDXHOOK9_CMD_USAGE,
CCONFIG_CMD_USAGE_OUT_DBG)) {
cconfig_finit(config);
return false;
}
iidxhook9_config_io_get(&iidxhook9_config_io, config);
camhook_config_cam_get(&config_cam, config, 2, true);
d3d9exhook_config_gfx_get(&config_gfx, config);
hooklib_config_adapter_get(&config_adapter, config);
asiohook_config_asio_get(&config_asio, config);
cconfig_finit(config);
return true;
}
static bool _iidxhook9_pre_avs_init(const bt_core_config_t *config)
{
log_info("-------------------------------------------------------------");
log_info("------------------ Begin iidxhook pre_hook ------------------");
log_info("-------------------------------------------------------------");
if (!load_configs()) {
exit(EXIT_FAILURE);
}
// asio hooks
if (config_asio.force_asio) {
SetEnvironmentVariable("SOUND_OUTPUT_DEVICE", "asio");
} else if (config_asio.force_wasapi) {
SetEnvironmentVariable("SOUND_OUTPUT_DEVICE", "wasapi");
}
if (iidxhook9_config_io.disable_cams) {
// this disables the entire camera subsystem
// useful for skipping the camera error entierly
SetEnvironmentVariable("CONNECT_CAMERA", "0");
}
log_info("-------------------------------------------------------------");
log_info("------------------- End iidxhook pre_hook -------------------");
log_info("-------------------------------------------------------------");
return true;
}
static bool
_iidxhook9_main_init(HMODULE game_module, const bt_core_config_t *config_)
{
log_info("-------------------------------------------------------------");
log_info("--------------- Begin iidxhook dll_entry_init ---------------");
log_info("-------------------------------------------------------------");
log_info(IIDXHOOK9_INFO_HEADER);
log_info("Initializing iidxhook...");
// reload configs again so they get logged through avs as well
// (so we get a copy of them in the -Y logfile)
if (!load_configs()) {
exit(EXIT_FAILURE);
}
d3d9ex_configure(&config_gfx);
d3d9ex_hook_init();
acp_hook_init();
adapter_hook_init();
dinput_init();
/* Start up IIDXIO.DLL */
if (!iidxhook9_config_io.disable_bio2_emu) {
log_info("Starting IIDX IO backend");
_iidxhook9_io_iidx_init(&iidxhook_module_io_iidx);
if (!bt_io_iidx_init()) {
log_fatal("Initializing IIDX IO backend failed");
}
}
/* Start up EAMIO.DLL */
if (!iidxhook9_config_io.disable_card_reader_emu) {
log_misc("Initializing card reader backend");
_iidxhook9_io_eam_init(&iidxhook_module_io_eam);
if (!bt_io_eam_init()) {
log_fatal("Initializing card reader backend failed");
}
}
iohook_push_handler(iidxhook_util_acio_dispatch_irp);
iohook_push_handler(bio2emu_port_dispatch_irp);
if (!iidxhook9_config_io.disable_file_hooks) {
memfile_hook_init();
iohook_push_handler(memfile_hook_dispatch_irp);
// game uses this file to determine what mode to put the cab in
// the default depends on a value embedded in the dll
if (iidxhook9_config_io.lightning_mode) {
memfile_hook_add_fd("d:\\\\001rom.txt", ABSOLUTE_MATCH, "TDJ", 3);
} else {
memfile_hook_add_fd("d:\\\\001rom.txt", ABSOLUTE_MATCH, "LDJ", 3);
}
// redirect F:\ drive to vfs (used for video recording)
iidxhook9_fs_hooks_init();
}
rs232_hook_init();
rs232_hook_limit_hooks();
if (!iidxhook9_config_io.disable_bio2_emu) {
if (!iidxhook9_config_io.lightning_mode) {
bio2emu_init();
bio2_emu_bi2a_set_tt_multiplier(iidxhook9_config_io.tt_multiplier);
bio2_emu_bi2a_init(
&bio2_emu, iidxhook9_config_io.disable_poll_limiter);
}
}
if (!iidxhook9_config_io.disable_card_reader_emu) {
if (iidxhook9_config_io.lightning_mode) {
// TDJ mode expects 1.7.0 readers
iidxhook_util_acio_override_version(v170);
}
iidxhook_util_acio_init(false);
}
// camera hooks
if (!config_cam.disable_emu) {
camhook_set_version(CAMHOOK_VERSION_NEW);
camhook_init(&config_cam);
}
adapter_hook_override(config_adapter.override_ip);
// asio hooks
if (config_asio.force_asio) {
asio_reghook_init("XONAR SOUND CARD(64)", config_asio.replacement_name);
}
log_info("-------------------------------------------------------------");
log_info("---------------- End iidxhook dll_entry_init ----------------");
log_info("-------------------------------------------------------------");
return true;
}
static void _iidxhook9_main_fini()
{
if (!config_cam.disable_emu) {
camhook_fini();
}
if (!iidxhook9_config_io.disable_card_reader_emu) {
log_misc("Shutting down card reader backend");
bt_io_eam_fini();
bt_io_eam_api_clear();
module_io_free(&iidxhook_module_io_eam);
}
if (!iidxhook9_config_io.disable_bio2_emu) {
log_misc("Shutting down IIDX IO backend");
bt_io_iidx_fini();
bt_io_iidx_api_clear();
module_io_free(&iidxhook_module_io_iidx);
}
if (!iidxhook9_config_io.disable_file_hooks) {
memfile_hook_fini();
}
}
void bt_module_core_log_api_set(const bt_core_log_api_t *api)
{
bt_core_log_api_set(api);
}
void bt_module_core_thread_api_set(const bt_core_thread_api_t *api)
{
bt_core_thread_api_set(api);
}
void bt_module_hook_api_get(bt_hook_api_t *api)
{
api->version = 1;
api->v1.pre_avs_init = _iidxhook9_pre_avs_init;
api->v1.main_init = _iidxhook9_main_init;
api->v1.main_fini = _iidxhook9_main_fini;
}
/**
* Hook library HV+
*/
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
{
return TRUE;
}
}

View File

@ -0,0 +1,263 @@
#define LOG_MODULE "iidxhook9"
#include <windows.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "hooklib/acp.h"
#include "hooklib/adapter.h"
#include "hooklib/config-adapter.h"
#include "hooklib/memfile.h"
#include "hooklib/rs232.h"
#include "hooklib/setupapi.h"
#include "iface-core/config.h"
#include "iface-core/log.h"
#include "iface-core/thread.h"
#include "iface-io/eam.h"
#include "iface-io/iidx.h"
#include "iidxhook-util/acio.h"
#include "bio2emu/emu.h"
#include "bio2emu-iidx/bi2a.h"
#include "iidxhook9/config-io.h"
#include "iidxhook9/fs-hook.h"
#include "camhook/cam.h"
#include "camhook/config-cam.h"
#include "asio/asio-reghook.h"
#include "asio/config-asio.h"
#include "d3d9exhook/d3d9ex.h"
#include "dinput/dinput.h"
#include "module/io-ext.h"
#include "module/io.h"
#include "sdk/module/core/config.h"
#include "sdk/module/core/log.h"
#include "sdk/module/core/thread.h"
#include "sdk/module/hook.h"
#include "util/cmdline.h"
#include "util/str.h"
static struct iidxhook9_config_io iidxhook9_config_io;
static struct camhook_config_cam config_cam;
static struct asiohook_config_asio config_asio;
static struct hooklib_config_adapter config_adapter;
static struct d3d9exhook_config_gfx config_gfx;
static struct bio2emu_port bio2_emu = {
.port = "COM4",
.wport = L"COM4",
.dispatcher = bio2_emu_bi2a_dispatch_request,
};
static module_io_t *iidxhook_module_io_iidx;
static module_io_t *iidxhook_module_io_eam;
static void _iidxhook9_io_iidx_init(module_io_t **module)
{
bt_io_iidx_api_t api;
module_io_ext_load_and_init(
"iidxio.dll", "bt_module_io_iidx_api_get", module);
module_io_api_get(*module, &api);
bt_io_iidx_api_set(&api);
}
static void _iidxhook9_io_eam_init(module_io_t **module)
{
bt_io_eam_api_t api;
module_io_ext_load_and_init(
"eamio.dll", "bt_module_io_eam_api_get", module);
module_io_api_get(*module, &api);
bt_io_eam_api_set(&api);
}
static void load_configs(const bt_core_config_t *config)
{
iidxhook9_config_io_get2(config, &iidxhook9_config_io);
camhook_config_cam_get2(config, &config_cam, 2, true);
d3d9exhook_config_gfx_get2(config, &config_gfx);
hooklib_config_adapter_get2(config, &config_adapter);
asiohook_config_asio_get2(config, &config_asio);
}
static bool _iidxhook9_pre_avs_init(const bt_core_config_t *config)
{
load_configs(config);
// asio hooks
if (config_asio.force_asio) {
SetEnvironmentVariable("SOUND_OUTPUT_DEVICE", "asio");
} else if (config_asio.force_wasapi) {
SetEnvironmentVariable("SOUND_OUTPUT_DEVICE", "wasapi");
}
if (iidxhook9_config_io.disable_cams) {
// this disables the entire camera subsystem
// useful for skipping the camera error entierly
SetEnvironmentVariable("CONNECT_CAMERA", "0");
}
return true;
}
static bool
_iidxhook9_main_init(HMODULE game_module, const bt_core_config_t *config)
{
log_info("iidxhook for Heroic Verse, Bistrover, Cast Hour and Resident");
log_info("build " __DATE__ " " __TIME__ ", gitrev " STRINGIFY(GITREV));
// reload configs again so they get logged through avs as well
// (so we get a copy of them in the -Y logfile)
load_configs(config);
d3d9ex_configure(&config_gfx);
d3d9ex_hook_init();
acp_hook_init();
adapter_hook_init();
dinput_init();
/* Start up IIDXIO.DLL */
if (!iidxhook9_config_io.disable_bio2_emu) {
log_info("Starting IIDX IO backend");
_iidxhook9_io_iidx_init(&iidxhook_module_io_iidx);
if (!bt_io_iidx_init()) {
log_fatal("Initializing IIDX IO backend failed");
}
}
/* Start up EAMIO.DLL */
if (!iidxhook9_config_io.disable_card_reader_emu) {
log_misc("Initializing card reader backend");
_iidxhook9_io_eam_init(&iidxhook_module_io_eam);
if (!bt_io_eam_init()) {
log_fatal("Initializing card reader backend failed");
}
}
iohook_push_handler(iidxhook_util_acio_dispatch_irp);
iohook_push_handler(bio2emu_port_dispatch_irp);
if (!iidxhook9_config_io.disable_file_hooks) {
memfile_hook_init();
iohook_push_handler(memfile_hook_dispatch_irp);
// game uses this file to determine what mode to put the cab in
// the default depends on a value embedded in the dll
if (iidxhook9_config_io.lightning_mode) {
memfile_hook_add_fd("d:\\\\001rom.txt", ABSOLUTE_MATCH, "TDJ", 3);
} else {
memfile_hook_add_fd("d:\\\\001rom.txt", ABSOLUTE_MATCH, "LDJ", 3);
}
// redirect F:\ drive to vfs (used for video recording)
iidxhook9_fs_hooks_init();
}
rs232_hook_init();
rs232_hook_limit_hooks();
if (!iidxhook9_config_io.disable_bio2_emu) {
if (!iidxhook9_config_io.lightning_mode) {
bio2emu_init();
bio2_emu_bi2a_set_tt_multiplier(iidxhook9_config_io.tt_multiplier);
bio2_emu_bi2a_init(
&bio2_emu, iidxhook9_config_io.disable_poll_limiter);
}
}
if (!iidxhook9_config_io.disable_card_reader_emu) {
if (iidxhook9_config_io.lightning_mode) {
// TDJ mode expects 1.7.0 readers
iidxhook_util_acio_override_version(v170);
}
iidxhook_util_acio_init(false);
}
// camera hooks
if (!config_cam.disable_emu) {
camhook_set_version(CAMHOOK_VERSION_NEW);
camhook_init(&config_cam);
}
adapter_hook_override(config_adapter.override_ip);
// asio hooks
if (config_asio.force_asio) {
asio_reghook_init("XONAR SOUND CARD(64)", config_asio.replacement_name);
}
return true;
}
static void _iidxhook9_main_fini()
{
if (!config_cam.disable_emu) {
camhook_fini();
}
if (!iidxhook9_config_io.disable_card_reader_emu) {
log_misc("Shutting down card reader backend");
bt_io_eam_fini();
bt_io_eam_api_clear();
module_io_free(&iidxhook_module_io_eam);
}
if (!iidxhook9_config_io.disable_bio2_emu) {
log_misc("Shutting down IIDX IO backend");
bt_io_iidx_fini();
bt_io_iidx_api_clear();
module_io_free(&iidxhook_module_io_iidx);
}
if (!iidxhook9_config_io.disable_file_hooks) {
memfile_hook_fini();
}
}
void bt_module_core_config_api_set(const bt_core_config_api_t *api)
{
bt_core_config_api_set(api);
}
void bt_module_core_log_api_set(const bt_core_log_api_t *api)
{
bt_core_log_api_set(api);
}
void bt_module_core_thread_api_set(const bt_core_thread_api_t *api)
{
bt_core_thread_api_set(api);
}
void bt_module_hook_api_get(bt_hook_api_t *api)
{
api->version = 1;
api->v1.pre_avs_init = _iidxhook9_pre_avs_init;
api->v1.main_init = _iidxhook9_main_init;
api->v1.main_fini = _iidxhook9_main_fini;
}

View File

@ -4,6 +4,7 @@ EXPORTS
DllMain@12 @1 NONAME
; Bemanitools 6 API
bt_module_core_config_api_set
bt_module_core_log_api_set
bt_module_core_thread_api_set
bt_module_hook_api_get

View File

@ -0,0 +1,9 @@
#ifndef IIDXHOOK9_H
#define IIDXHOOK9_H
#include "sdk/module/core/config.h"
#include "sdk/module/core/log.h"
#include "sdk/module/core/thread.h"
#include "sdk/module/hook.h"
#endif