mirror of
https://github.com/djhackersdev/bemanitools.git
synced 2026-09-08 16:35:10 -05:00
chore: Cleanup cconfig remains from iidxhooks
Summary: Test Plan:
This commit is contained in:
@@ -1,79 +1,6 @@
|
||||
#include "asio/config-asio.h"
|
||||
|
||||
#include "cconfig/cconfig-util.h"
|
||||
|
||||
#include "iface-core/log.h"
|
||||
|
||||
#define ASIOHOOK_CONFIG_IO_FORCE_ASIO_KEY "asio.force_asio"
|
||||
#define ASIOHOOK_CONFIG_IO_FORCE_WASAPI_KEY "asio.force_wasapi"
|
||||
#define ASIOHOOK_CONFIG_IO_ASIO_DEVICE_NAME_KEY "asio.device_name"
|
||||
|
||||
#define ASIOHOOK_CONFIG_IO_DEFAULT_FORCE_ASIO_VALUE false
|
||||
#define ASIOHOOK_CONFIG_IO_DEFAULT_FORCE_WASAPI_VALUE false
|
||||
#define ASIOHOOK_CONFIG_IO_DEFAULT_ASIO_DEVICE_NAME_VALUE "XONAR SOUND CARD(64)"
|
||||
|
||||
void asiohook_config_init(struct cconfig *config)
|
||||
{
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
ASIOHOOK_CONFIG_IO_FORCE_ASIO_KEY,
|
||||
ASIOHOOK_CONFIG_IO_DEFAULT_FORCE_ASIO_VALUE,
|
||||
"Force ASIO audio mode/device (if applicable)");
|
||||
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
ASIOHOOK_CONFIG_IO_FORCE_WASAPI_KEY,
|
||||
ASIOHOOK_CONFIG_IO_DEFAULT_FORCE_WASAPI_VALUE,
|
||||
"Force WASAPI audio mode (if applicable)");
|
||||
|
||||
cconfig_util_set_str(
|
||||
config,
|
||||
ASIOHOOK_CONFIG_IO_ASIO_DEVICE_NAME_KEY,
|
||||
ASIOHOOK_CONFIG_IO_DEFAULT_ASIO_DEVICE_NAME_VALUE,
|
||||
"The ASIO device name to use");
|
||||
}
|
||||
|
||||
void asiohook_config_asio_get(
|
||||
struct asiohook_config_asio *config_asio, struct cconfig *config)
|
||||
{
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
ASIOHOOK_CONFIG_IO_FORCE_ASIO_KEY,
|
||||
&config_asio->force_asio,
|
||||
ASIOHOOK_CONFIG_IO_DEFAULT_FORCE_ASIO_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
ASIOHOOK_CONFIG_IO_FORCE_ASIO_KEY,
|
||||
ASIOHOOK_CONFIG_IO_DEFAULT_FORCE_ASIO_VALUE);
|
||||
}
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
ASIOHOOK_CONFIG_IO_FORCE_WASAPI_KEY,
|
||||
&config_asio->force_wasapi,
|
||||
ASIOHOOK_CONFIG_IO_DEFAULT_FORCE_WASAPI_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
ASIOHOOK_CONFIG_IO_FORCE_WASAPI_KEY,
|
||||
ASIOHOOK_CONFIG_IO_DEFAULT_FORCE_WASAPI_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_str(
|
||||
config,
|
||||
ASIOHOOK_CONFIG_IO_ASIO_DEVICE_NAME_KEY,
|
||||
config_asio->replacement_name,
|
||||
sizeof(config_asio->replacement_name) - 1,
|
||||
ASIOHOOK_CONFIG_IO_DEFAULT_ASIO_DEVICE_NAME_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%s'",
|
||||
ASIOHOOK_CONFIG_IO_ASIO_DEVICE_NAME_KEY,
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#ifndef ASIOHOOK_CONFIG_IO_H
|
||||
#define ASIOHOOK_CONFIG_IO_H
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "cconfig/cconfig.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "iface-core/config.h"
|
||||
|
||||
@@ -13,12 +11,7 @@ struct asiohook_config_asio {
|
||||
char replacement_name[128];
|
||||
};
|
||||
|
||||
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);
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ libs_camhook := \
|
||||
iface-core \
|
||||
hook \
|
||||
hooklib \
|
||||
cconfig \
|
||||
util \
|
||||
|
||||
src_camhook := \
|
||||
|
||||
@@ -1,135 +1,12 @@
|
||||
#include "cconfig/cconfig-util.h"
|
||||
#include "camhook/config-cam.h"
|
||||
|
||||
#include "core/config-ext.h"
|
||||
|
||||
#include "camhook/config-cam.h"
|
||||
|
||||
#include "iface-core/log.h"
|
||||
|
||||
#include "util/str.h"
|
||||
|
||||
#define CAMHOOK_CONFIG_CAM_DISABLE_EMU_KEY "cam.disable_emu"
|
||||
#define CAMHOOK_CONFIG_CAM_DEFAULT_DISABLE_EMU_VALUE false
|
||||
|
||||
#define CAMHOOK_CONFIG_CAM_PORT_LAYOUT_KEY "cam.port_layout"
|
||||
#define CAMHOOK_CONFIG_CAM_DEFAULT_PORT_LAYOUT_VALUE 0
|
||||
|
||||
// the following four arrays are based on CAMHOOK_CONFIG_CAM_MAX
|
||||
// please insert more elements if more cams are added
|
||||
const char *camhook_config_disable_camera[CAMHOOK_CONFIG_CAM_MAX] = {
|
||||
"cam.disable_camera1",
|
||||
"cam.disable_camera2",
|
||||
};
|
||||
|
||||
const int camhook_config_disable_camera_default_values[CAMHOOK_CONFIG_CAM_MAX] =
|
||||
{
|
||||
false,
|
||||
false,
|
||||
};
|
||||
|
||||
const char *camhook_config_device_id_keys[CAMHOOK_CONFIG_CAM_MAX] = {
|
||||
"cam.device_id1",
|
||||
"cam.device_id2",
|
||||
};
|
||||
|
||||
const char *camhook_config_device_default_values[CAMHOOK_CONFIG_CAM_MAX] = {
|
||||
"",
|
||||
"",
|
||||
};
|
||||
|
||||
void camhook_config_cam_init(struct cconfig *config, size_t num_cams, bool use_port_layout)
|
||||
{
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
CAMHOOK_CONFIG_CAM_DISABLE_EMU_KEY,
|
||||
CAMHOOK_CONFIG_CAM_DEFAULT_DISABLE_EMU_VALUE,
|
||||
"Disables the camera emulation");
|
||||
|
||||
if (use_port_layout) {
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
CAMHOOK_CONFIG_CAM_PORT_LAYOUT_KEY,
|
||||
CAMHOOK_CONFIG_CAM_DEFAULT_PORT_LAYOUT_VALUE,
|
||||
"Camera port layout (0 = LDJ, 1 = CLDJ/TDJ-JA, 2 = TDJ-JB)");
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < num_cams; ++i) {
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
camhook_config_disable_camera[i],
|
||||
camhook_config_disable_camera_default_values[i],
|
||||
"Disable camera");
|
||||
cconfig_util_set_str(
|
||||
config,
|
||||
camhook_config_device_id_keys[i],
|
||||
camhook_config_device_default_values[i],
|
||||
"Override camera device ID detection (copy from device manager, do "
|
||||
"not escape)");
|
||||
}
|
||||
}
|
||||
|
||||
void camhook_config_cam_get(
|
||||
struct camhook_config_cam *config_cam,
|
||||
struct cconfig *config,
|
||||
size_t num_cams,
|
||||
bool use_port_layout)
|
||||
{
|
||||
config_cam->num_devices = num_cams;
|
||||
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
CAMHOOK_CONFIG_CAM_DISABLE_EMU_KEY,
|
||||
&config_cam->disable_emu,
|
||||
CAMHOOK_CONFIG_CAM_DEFAULT_DISABLE_EMU_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
CAMHOOK_CONFIG_CAM_DISABLE_EMU_KEY,
|
||||
CAMHOOK_CONFIG_CAM_DEFAULT_DISABLE_EMU_VALUE);
|
||||
}
|
||||
|
||||
if (use_port_layout) {
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
CAMHOOK_CONFIG_CAM_PORT_LAYOUT_KEY,
|
||||
&config_cam->port_layout,
|
||||
CAMHOOK_CONFIG_CAM_DEFAULT_PORT_LAYOUT_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
CAMHOOK_CONFIG_CAM_PORT_LAYOUT_KEY,
|
||||
CAMHOOK_CONFIG_CAM_DEFAULT_PORT_LAYOUT_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < num_cams; ++i) {
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
camhook_config_disable_camera[i],
|
||||
&config_cam->disable_camera[i],
|
||||
camhook_config_disable_camera_default_values[i])) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
camhook_config_disable_camera[i],
|
||||
camhook_config_disable_camera_default_values[i]);
|
||||
}
|
||||
if (!cconfig_util_get_str(
|
||||
config,
|
||||
camhook_config_device_id_keys[i],
|
||||
config_cam->device_id[i],
|
||||
sizeof(config_cam->device_id[i]) - 1,
|
||||
camhook_config_device_default_values[i])) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%s'",
|
||||
camhook_config_device_id_keys[i],
|
||||
camhook_config_device_default_values[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void camhook_config_cam_get2(
|
||||
const bt_core_config_t *config,
|
||||
struct camhook_config_cam *config_cam,
|
||||
size_t num_cams,
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "cconfig/cconfig.h"
|
||||
|
||||
#include "iface-core/config.h"
|
||||
|
||||
#define CAMHOOK_CONFIG_CAM_MAX 2
|
||||
@@ -17,18 +15,7 @@ struct camhook_config_cam {
|
||||
bool disable_camera[CAMHOOK_CONFIG_CAM_MAX];
|
||||
};
|
||||
|
||||
void camhook_config_cam_init(
|
||||
struct cconfig *config,
|
||||
size_t num_cams,
|
||||
bool use_port_layout);
|
||||
|
||||
void camhook_config_cam_get(
|
||||
struct camhook_config_cam *config_cam,
|
||||
struct cconfig *config,
|
||||
size_t num_cams,
|
||||
bool use_port_layout);
|
||||
|
||||
void camhook_config_cam_get2(
|
||||
const bt_core_config_t *config,
|
||||
struct camhook_config_cam *config_cam,
|
||||
size_t num_cams,
|
||||
|
||||
@@ -2,273 +2,11 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "cconfig/cconfig-util.h"
|
||||
|
||||
#include "d3d9exhook/config-gfx.h"
|
||||
|
||||
#include "iface-core/log.h"
|
||||
|
||||
#define D3D9EXHOOK_CONFIG_GFX_FRAMED_KEY "gfx.framed"
|
||||
#define D3D9EXHOOK_CONFIG_GFX_WINDOWED_KEY "gfx.windowed"
|
||||
#define D3D9EXHOOK_CONFIG_GFX_CONFINED_KEY "gfx.confined"
|
||||
#define D3D9EXHOOK_CONFIG_GFX_WINDOW_WIDTH_KEY "gfx.window_width"
|
||||
#define D3D9EXHOOK_CONFIG_GFX_WINDOW_HEIGHT_KEY "gfx.window_height"
|
||||
#define D3D9EXHOOK_CONFIG_GFX_WINDOW_X_KEY "gfx.window_x"
|
||||
#define D3D9EXHOOK_CONFIG_GFX_WINDOW_Y_KEY "gfx.window_y"
|
||||
#define D3D9EXHOOK_CONFIG_GFX_FORCED_REFRESHRATE_KEY "gfx.forced_refresh_rate"
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEVICE_ADAPTER_KEY "gfx.device_adapter"
|
||||
#define D3D9EXHOOK_CONFIG_GFX_FORCE_ORIENTATION_KEY "gfx.force_orientation"
|
||||
#define D3D9EXHOOK_CONFIG_GFX_FORCE_SCREEN_RES_WIDTH_KEY \
|
||||
"gfx.force_screen_res.width"
|
||||
#define D3D9EXHOOK_CONFIG_GFX_FORCE_SCREEN_RES_HEIGHT_KEY \
|
||||
"gfx.force_screen_res.height"
|
||||
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_FRAMED_VALUE false
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOWED_VALUE false
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_CONFINED_VALUE false
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOW_WIDTH_VALUE -1
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOW_HEIGHT_VALUE -1
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOW_X_VALUE -1
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOW_Y_VALUE -1
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCED_RR_VALUE -1
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE -1
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_ORIENTATION_VALUE -1
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_SCREEN_RES_WIDTH_VALUE -1
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_SCREEN_RES_HEIGHT_VALUE -1
|
||||
|
||||
void d3d9exhook_config_gfx_init(struct cconfig *config)
|
||||
{
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_FRAMED_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FRAMED_VALUE,
|
||||
"Run the game in a framed window (requires windowed option)");
|
||||
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_WINDOWED_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOWED_VALUE,
|
||||
"Run the game windowed");
|
||||
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_CONFINED_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_CONFINED_VALUE,
|
||||
"Confine mouse cursor to window");
|
||||
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_WINDOW_WIDTH_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOW_WIDTH_VALUE,
|
||||
"Windowed width, -1 for default size");
|
||||
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_WINDOW_HEIGHT_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOW_HEIGHT_VALUE,
|
||||
"Windowed height, -1 for default size");
|
||||
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_WINDOW_X_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOW_X_VALUE,
|
||||
"Windowed X, -1 for default X position");
|
||||
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_WINDOW_Y_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOW_Y_VALUE,
|
||||
"Windowed Y, -1 for default Y position");
|
||||
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_FORCED_REFRESHRATE_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCED_RR_VALUE,
|
||||
"Forced refresh rate, -1 to not force any (try 59 or 60 if monitor "
|
||||
"check fails to lock on high refresh rate monitors)");
|
||||
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEVICE_ADAPTER_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE,
|
||||
"D3D9ex device adapter (monitor), -1 to use default, "
|
||||
"0, 1, 2 etc. to use specified adapter");
|
||||
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_FORCE_ORIENTATION_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_ORIENTATION_VALUE,
|
||||
"Orientation to force monitor into, -1 to use default, "
|
||||
"0, 1, 2, 3 to do 0, 90, 180, 270 degrees");
|
||||
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_FORCE_SCREEN_RES_WIDTH_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_SCREEN_RES_WIDTH_VALUE,
|
||||
"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.");
|
||||
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_FORCE_SCREEN_RES_HEIGHT_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_SCREEN_RES_HEIGHT_VALUE,
|
||||
"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.");
|
||||
}
|
||||
|
||||
void d3d9exhook_config_gfx_get(
|
||||
struct d3d9exhook_config_gfx *config_gfx, struct cconfig *config)
|
||||
{
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_FRAMED_KEY,
|
||||
&config_gfx->framed,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FRAMED_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
D3D9EXHOOK_CONFIG_GFX_FRAMED_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FRAMED_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_WINDOWED_KEY,
|
||||
&config_gfx->windowed,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOWED_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
D3D9EXHOOK_CONFIG_GFX_WINDOWED_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOWED_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_CONFINED_KEY,
|
||||
&config_gfx->confined,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_CONFINED_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
D3D9EXHOOK_CONFIG_GFX_CONFINED_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_CONFINED_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_WINDOW_WIDTH_KEY,
|
||||
&config_gfx->window_width,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOW_WIDTH_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
D3D9EXHOOK_CONFIG_GFX_WINDOW_WIDTH_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOW_WIDTH_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_WINDOW_HEIGHT_KEY,
|
||||
&config_gfx->window_height,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOW_HEIGHT_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
D3D9EXHOOK_CONFIG_GFX_WINDOW_HEIGHT_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOW_HEIGHT_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_WINDOW_X_KEY,
|
||||
&config_gfx->window_x,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOW_X_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
D3D9EXHOOK_CONFIG_GFX_WINDOW_X_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOW_X_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_WINDOW_Y_KEY,
|
||||
&config_gfx->window_y,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOW_Y_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
D3D9EXHOOK_CONFIG_GFX_WINDOW_Y_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOW_Y_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_FORCED_REFRESHRATE_KEY,
|
||||
&config_gfx->forced_refresh_rate,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCED_RR_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
D3D9EXHOOK_CONFIG_GFX_FORCED_REFRESHRATE_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCED_RR_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEVICE_ADAPTER_KEY,
|
||||
&config_gfx->device_adapter,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
D3D9EXHOOK_CONFIG_GFX_DEVICE_ADAPTER_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_FORCE_ORIENTATION_KEY,
|
||||
&config_gfx->force_orientation,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_ORIENTATION_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
D3D9EXHOOK_CONFIG_GFX_FORCE_ORIENTATION_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_ORIENTATION_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_FORCE_SCREEN_RES_WIDTH_KEY,
|
||||
&config_gfx->force_screen_res.width,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_SCREEN_RES_WIDTH_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
D3D9EXHOOK_CONFIG_GFX_FORCE_SCREEN_RES_WIDTH_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_SCREEN_RES_WIDTH_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_FORCE_SCREEN_RES_HEIGHT_KEY,
|
||||
&config_gfx->force_screen_res.height,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_SCREEN_RES_HEIGHT_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
D3D9EXHOOK_CONFIG_GFX_FORCE_SCREEN_RES_HEIGHT_KEY,
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef D3D9EXHOOK_CONFIG_GFX_H
|
||||
#define D3D9EXHOOK_CONFIG_GFX_H
|
||||
|
||||
#include "cconfig/cconfig.h"
|
||||
|
||||
#include "iface-core/config.h"
|
||||
|
||||
/**
|
||||
@@ -29,18 +27,7 @@ struct d3d9exhook_config_gfx {
|
||||
} force_screen_res;
|
||||
};
|
||||
|
||||
/**
|
||||
* Add the gfx config set to the cconfig object
|
||||
*/
|
||||
void d3d9exhook_config_gfx_init(struct cconfig *config);
|
||||
|
||||
/**
|
||||
* Fill the actual config_gfx from the given 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);
|
||||
|
||||
|
||||
@@ -1,40 +1,6 @@
|
||||
#include "cconfig/cconfig-util.h"
|
||||
|
||||
#include "iface-core/log.h"
|
||||
|
||||
#include "hooklib/config-adapter.h"
|
||||
|
||||
#define HOOKLIB_CONFIG_ADAPTER_OVERRIDE_IP_KEY "adapter.override_ip"
|
||||
|
||||
#define HOOKLIB_CONFIG_ADAPTER_DEFAULT_OVERRIDE_IP_VALUE ""
|
||||
|
||||
void hooklib_config_adapter_init(struct cconfig *config)
|
||||
{
|
||||
cconfig_util_set_str(
|
||||
config,
|
||||
HOOKLIB_CONFIG_ADAPTER_OVERRIDE_IP_KEY,
|
||||
HOOKLIB_CONFIG_ADAPTER_DEFAULT_OVERRIDE_IP_VALUE,
|
||||
"IP of adapter to force override with");
|
||||
}
|
||||
|
||||
void hooklib_config_adapter_get(
|
||||
struct hooklib_config_adapter *config_adapter, struct cconfig *config)
|
||||
{
|
||||
if (!cconfig_util_get_str(
|
||||
config,
|
||||
HOOKLIB_CONFIG_ADAPTER_OVERRIDE_IP_KEY,
|
||||
config_adapter->override_ip,
|
||||
sizeof(config_adapter->override_ip),
|
||||
HOOKLIB_CONFIG_ADAPTER_DEFAULT_OVERRIDE_IP_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%s'",
|
||||
HOOKLIB_CONFIG_ADAPTER_OVERRIDE_IP_KEY,
|
||||
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));
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#ifndef HOOKLIB_CONFIG_ADAPTER_H
|
||||
#define HOOKLIB_CONFIG_ADAPTER_H
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "cconfig/cconfig.h"
|
||||
|
||||
#include "iface-core/config.h"
|
||||
|
||||
struct hooklib_config_adapter {
|
||||
@@ -12,12 +8,7 @@ struct hooklib_config_adapter {
|
||||
char override_ip[32];
|
||||
};
|
||||
|
||||
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
|
||||
@@ -1,7 +1,5 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "cconfig/cconfig-util.h"
|
||||
|
||||
#include "core/config-ext.h"
|
||||
|
||||
#include "iidxhook-util/config-eamuse.h"
|
||||
@@ -12,166 +10,6 @@
|
||||
|
||||
#include "util/str.h"
|
||||
|
||||
#define IIDXHOOK_CONFIG_EAMUSE_CARD_TYPE_KEY "eamuse.card_type"
|
||||
#define IIDXHOOK_CONFIG_EAMUSE_SERVER_KEY "eamuse.server"
|
||||
#define IIDXHOOK_CONFIG_EAMUSE_PCBID_KEY "eamuse.pcbid"
|
||||
#define IIDXHOOK_CONFIG_EAMUSE_EAMID_KEY "eamuse.eamid"
|
||||
|
||||
#define IIDXHOOK_CONFIG_EAMUSE_DEFAULT_CARD_TYPE_VALUE \
|
||||
SECURITY_MCODE_GAME_IIDX_9
|
||||
#define IIDXHOOK_CONFIG_EAMUSE_DEFAULT_SERVER_VALUE "localhost:80"
|
||||
#define IIDXHOOK_CONFIG_EAMUSE_DEFAULT_PCBID_VALUE security_id_default
|
||||
#define IIDXHOOK_CONFIG_EAMUSE_DEFAULT_PCBID_VALUE_LEN \
|
||||
sizeof(security_id_default)
|
||||
#define IIDXHOOK_CONFIG_EAMUSE_DEFAULT_EAMID_VALUE security_id_default
|
||||
#define IIDXHOOK_CONFIG_EAMUSE_DEFAULT_EAMID_VALUE_LEN \
|
||||
sizeof(security_id_default)
|
||||
|
||||
const struct net_addr iidxhook_eamuse_default_server = {
|
||||
.type = NET_ADDR_TYPE_HOSTNAME,
|
||||
.hostname.host = "localhost",
|
||||
.hostname.port = 80,
|
||||
};
|
||||
|
||||
void iidxhook_util_config_eamuse_init(struct cconfig *config)
|
||||
{
|
||||
cconfig_util_set_str(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_EAMUSE_CARD_TYPE_KEY,
|
||||
IIDXHOOK_CONFIG_EAMUSE_DEFAULT_CARD_TYPE_VALUE,
|
||||
"Magnetic card type, format XXX, 3 digit string (supports: C02, "
|
||||
"D01, "
|
||||
"E11, ECO)");
|
||||
|
||||
cconfig_util_set_str(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_EAMUSE_SERVER_KEY,
|
||||
IIDXHOOK_CONFIG_EAMUSE_DEFAULT_SERVER_VALUE,
|
||||
"URL (e.g. http://my.eamuse.server:80/whatever) or IPV4 "
|
||||
"(e.g. 127.0.0.1:80) of the target eamuse server. The port is "
|
||||
"optional "
|
||||
"but defaults to 80.");
|
||||
|
||||
cconfig_util_set_data(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_EAMUSE_PCBID_KEY,
|
||||
(uint8_t *) &IIDXHOOK_CONFIG_EAMUSE_DEFAULT_PCBID_VALUE,
|
||||
IIDXHOOK_CONFIG_EAMUSE_DEFAULT_PCBID_VALUE_LEN,
|
||||
"PCBID");
|
||||
|
||||
cconfig_util_set_data(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_EAMUSE_EAMID_KEY,
|
||||
(uint8_t *) &IIDXHOOK_CONFIG_EAMUSE_DEFAULT_EAMID_VALUE,
|
||||
IIDXHOOK_CONFIG_EAMUSE_DEFAULT_EAMID_VALUE_LEN,
|
||||
"EAMID");
|
||||
}
|
||||
|
||||
void iidxhook_util_config_eamuse_get(
|
||||
struct iidxhook_util_config_eamuse *config_eamuse, struct cconfig *config)
|
||||
{
|
||||
char server_url[1024];
|
||||
char *tmp;
|
||||
char *tmp2;
|
||||
|
||||
memset(config_eamuse, 0, sizeof(struct iidxhook_util_config_eamuse));
|
||||
|
||||
if (!cconfig_util_get_str(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_EAMUSE_CARD_TYPE_KEY,
|
||||
config_eamuse->card_type,
|
||||
sizeof(config_eamuse->card_type) - 1,
|
||||
IIDXHOOK_CONFIG_EAMUSE_DEFAULT_CARD_TYPE_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%s'",
|
||||
IIDXHOOK_CONFIG_EAMUSE_CARD_TYPE_KEY,
|
||||
IIDXHOOK_CONFIG_EAMUSE_DEFAULT_CARD_TYPE_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_str(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_EAMUSE_SERVER_KEY,
|
||||
server_url,
|
||||
sizeof(server_url),
|
||||
IIDXHOOK_CONFIG_EAMUSE_DEFAULT_SERVER_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%s'",
|
||||
IIDXHOOK_CONFIG_EAMUSE_SERVER_KEY,
|
||||
IIDXHOOK_CONFIG_EAMUSE_DEFAULT_SERVER_VALUE);
|
||||
}
|
||||
|
||||
if (!net_str_parse(server_url, &config_eamuse->server)) {
|
||||
memcpy(
|
||||
&config_eamuse->server,
|
||||
&iidxhook_eamuse_default_server,
|
||||
sizeof(config_eamuse->server));
|
||||
tmp = net_addr_to_str(&config_eamuse->server);
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default",
|
||||
tmp);
|
||||
free(tmp);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_data(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_EAMUSE_PCBID_KEY,
|
||||
(uint8_t *) &config_eamuse->pcbid,
|
||||
IIDXHOOK_CONFIG_EAMUSE_DEFAULT_PCBID_VALUE_LEN,
|
||||
(uint8_t *) &IIDXHOOK_CONFIG_EAMUSE_DEFAULT_PCBID_VALUE)) {
|
||||
tmp = security_id_to_str(
|
||||
&IIDXHOOK_CONFIG_EAMUSE_DEFAULT_PCBID_VALUE, false);
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default",
|
||||
tmp);
|
||||
free(tmp);
|
||||
}
|
||||
|
||||
if (!security_id_verify(&config_eamuse->pcbid)) {
|
||||
tmp = security_id_to_str(
|
||||
&IIDXHOOK_CONFIG_EAMUSE_DEFAULT_PCBID_VALUE, false);
|
||||
tmp2 = security_id_to_str(&config_eamuse->pcbid, false);
|
||||
log_warning(
|
||||
"PCBID verification of '%s' failed, fallback to default "
|
||||
"PCBID '%s'",
|
||||
tmp2,
|
||||
tmp);
|
||||
free(tmp);
|
||||
free(tmp2);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_data(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_EAMUSE_EAMID_KEY,
|
||||
(uint8_t *) &config_eamuse->eamid,
|
||||
IIDXHOOK_CONFIG_EAMUSE_DEFAULT_EAMID_VALUE_LEN,
|
||||
(uint8_t *) &IIDXHOOK_CONFIG_EAMUSE_DEFAULT_EAMID_VALUE)) {
|
||||
tmp = security_id_to_str(
|
||||
&IIDXHOOK_CONFIG_EAMUSE_DEFAULT_EAMID_VALUE, false);
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default",
|
||||
tmp);
|
||||
free(tmp);
|
||||
}
|
||||
|
||||
if (!security_id_verify(&config_eamuse->eamid)) {
|
||||
tmp = security_id_to_str(
|
||||
&IIDXHOOK_CONFIG_EAMUSE_DEFAULT_EAMID_VALUE, false);
|
||||
tmp2 = security_id_to_str(&config_eamuse->eamid, false);
|
||||
log_warning(
|
||||
"EAMID verification of '%s' failed, fallback to default "
|
||||
"EAMID '%s'",
|
||||
tmp2,
|
||||
tmp);
|
||||
free(tmp);
|
||||
free(tmp2);
|
||||
}
|
||||
}
|
||||
|
||||
static void _iidxhook_util_config_eamuse_verify(
|
||||
const iidxhook_util_config_eamuse_t *config)
|
||||
{
|
||||
@@ -197,7 +35,7 @@ static void _iidxhook_util_config_eamuse_verify(
|
||||
}
|
||||
}
|
||||
|
||||
void iidxhook_util_config_eamuse_get2(
|
||||
void iidxhook_util_config_eamuse_get(
|
||||
const bt_core_config_t *config,
|
||||
iidxhook_util_config_eamuse_t *config_eamuse)
|
||||
{
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef IIDXHOOK_UTIL_CONFIG_EAMUSE_H
|
||||
#define IIDXHOOK_UTIL_CONFIG_EAMUSE_H
|
||||
|
||||
#include "cconfig/cconfig.h"
|
||||
|
||||
#include "iface-core/config.h"
|
||||
|
||||
#include "security/id.h"
|
||||
@@ -16,12 +14,7 @@ typedef struct iidxhook_util_config_eamuse {
|
||||
struct security_id eamid;
|
||||
} iidxhook_util_config_eamuse_t;
|
||||
|
||||
void iidxhook_util_config_eamuse_init(struct cconfig *config);
|
||||
|
||||
void iidxhook_util_config_eamuse_get(
|
||||
iidxhook_util_config_eamuse_t *config_eamuse, struct cconfig *config);
|
||||
|
||||
void iidxhook_util_config_eamuse_get2(
|
||||
const bt_core_config_t *config,
|
||||
iidxhook_util_config_eamuse_t *config_eamuse);
|
||||
|
||||
|
||||
@@ -1,24 +1,14 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "cconfig/cconfig-util.h"
|
||||
|
||||
#include "core/config-ext.h"
|
||||
|
||||
#include "iidxhook-util/config-ezusb.h"
|
||||
|
||||
#include "iface-core/log.h"
|
||||
|
||||
#include "util/mem.h"
|
||||
#include "util/str.h"
|
||||
|
||||
#define IIDXHOOK_UTIL_CONFIG_EZUSB_API_CALL_MONITORING_KEY \
|
||||
"ezusb.api_call_monitoring"
|
||||
#define IIDXHOOK_UTIL_CONFIG_EZUSB_IO_BOARD_TYPE_KEY "ezusb.io_board_type"
|
||||
|
||||
#define IIDXHOOK_UTIL_CONFIG_EZUSB_DEFAULT_API_CALL_MONITORING_VALUE false
|
||||
#define IIDXHOOK_UTIL_CONFIG_EZUSB_DEFAULT_IO_BOARD_TYPE_VALUE 0
|
||||
|
||||
static void _iidxhook_util_config_ezusb_board_type_get(const bt_core_config_t *config, int32_t *board_type)
|
||||
{
|
||||
char tmp[8];
|
||||
@@ -34,61 +24,7 @@ static void _iidxhook_util_config_ezusb_board_type_get(const bt_core_config_t *c
|
||||
}
|
||||
}
|
||||
|
||||
void iidxhook_util_config_ezusb_init(struct cconfig *config)
|
||||
{
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK_UTIL_CONFIG_EZUSB_API_CALL_MONITORING_KEY,
|
||||
IIDXHOOK_UTIL_CONFIG_EZUSB_DEFAULT_API_CALL_MONITORING_VALUE,
|
||||
"Enable monitoring of ezusb.dll calls by logging call traces. "
|
||||
"Only works on 9th and 10th style!");
|
||||
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
IIDXHOOK_UTIL_CONFIG_EZUSB_IO_BOARD_TYPE_KEY,
|
||||
IIDXHOOK_UTIL_CONFIG_EZUSB_DEFAULT_IO_BOARD_TYPE_VALUE,
|
||||
"Set the type of ezusb IO board. 0 = C02, 1 = D01. "
|
||||
"Note: Impacts security settings!");
|
||||
}
|
||||
|
||||
void iidxhook_util_config_ezusb_get(
|
||||
struct iidxhook_util_config_ezusb *config_ezusb, struct cconfig *config)
|
||||
{
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
IIDXHOOK_UTIL_CONFIG_EZUSB_API_CALL_MONITORING_KEY,
|
||||
&config_ezusb->api_call_monitoring,
|
||||
IIDXHOOK_UTIL_CONFIG_EZUSB_DEFAULT_API_CALL_MONITORING_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK_UTIL_CONFIG_EZUSB_API_CALL_MONITORING_KEY,
|
||||
IIDXHOOK_UTIL_CONFIG_EZUSB_DEFAULT_API_CALL_MONITORING_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
IIDXHOOK_UTIL_CONFIG_EZUSB_IO_BOARD_TYPE_KEY,
|
||||
&config_ezusb->io_board_type,
|
||||
IIDXHOOK_UTIL_CONFIG_EZUSB_DEFAULT_IO_BOARD_TYPE_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK_UTIL_CONFIG_EZUSB_IO_BOARD_TYPE_KEY,
|
||||
IIDXHOOK_UTIL_CONFIG_EZUSB_DEFAULT_IO_BOARD_TYPE_VALUE);
|
||||
}
|
||||
|
||||
if (config_ezusb->io_board_type != 0 && config_ezusb->io_board_type != 1) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK_UTIL_CONFIG_EZUSB_IO_BOARD_TYPE_KEY,
|
||||
IIDXHOOK_UTIL_CONFIG_EZUSB_DEFAULT_IO_BOARD_TYPE_VALUE);
|
||||
config_ezusb->io_board_type = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void iidxhook_util_config_ezusb_get2(
|
||||
const bt_core_config_t *config,
|
||||
iidxhook_util_config_ezusb_t *config_ezusb)
|
||||
{
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef IIDXHOOK_UTIL_CONFIG_EZUSB_H
|
||||
#define IIDXHOOK_UTIL_CONFIG_EZUSB_H
|
||||
|
||||
#include "cconfig/cconfig.h"
|
||||
|
||||
#include "iface-core/config.h"
|
||||
|
||||
typedef struct iidxhook_util_config_ezusb {
|
||||
@@ -10,12 +8,7 @@ typedef struct iidxhook_util_config_ezusb {
|
||||
int32_t io_board_type;
|
||||
} iidxhook_util_config_ezusb_t;
|
||||
|
||||
void iidxhook_util_config_ezusb_init(struct cconfig *config);
|
||||
|
||||
void iidxhook_util_config_ezusb_get(
|
||||
struct iidxhook_util_config_ezusb *config_ezusb, struct cconfig *config);
|
||||
|
||||
void iidxhook_util_config_ezusb_get2(
|
||||
const bt_core_config_t *config,
|
||||
iidxhook_util_config_ezusb_t *config_ezusb);
|
||||
|
||||
|
||||
@@ -1,421 +1,12 @@
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "cconfig/cconfig-util.h"
|
||||
|
||||
#include "iface-core/log.h"
|
||||
|
||||
#include "iidxhook-util/config-gfx.h"
|
||||
|
||||
#include "util/str.h"
|
||||
|
||||
#define IIDXHOOK_CONFIG_GFX_BGVIDEO_UV_FIX_KEY "gfx.bgvideo_uv_fix"
|
||||
#define IIDXHOOK_CONFIG_GFX_FRAMED_KEY "gfx.framed"
|
||||
#define IIDXHOOK_CONFIG_GFX_FRAME_RATE_LIMIT_KEY "gfx.frame_rate_limit"
|
||||
#define IIDXHOOK_CONFIG_GFX_MONITOR_CHECK_KEY "gfx.monitor_check"
|
||||
#define IIDXHOOK_CONFIG_GFX_PCI_ID_KEY "gfx.pci_id"
|
||||
#define IIDXHOOK_CONFIG_GFX_WINDOWED_KEY "gfx.windowed"
|
||||
#define IIDXHOOK_CONFIG_GFX_WINDOW_WIDTH_KEY "gfx.window_width"
|
||||
#define IIDXHOOK_CONFIG_GFX_WINDOW_HEIGHT_KEY "gfx.window_height"
|
||||
#define IIDXHOOK_CONFIG_GFX_SCALE_BACK_BUFFER_WIDTH_KEY \
|
||||
"gfx.scale_back_buffer_width"
|
||||
#define IIDXHOOK_CONFIG_GFX_SCALE_BACK_BUFFER_HEIGHT_KEY \
|
||||
"gfx.scale_back_buffer_height"
|
||||
#define IIDXHOOK_CONFIG_GFX_SCALE_BACK_BUFFER_FILTER_KEY \
|
||||
"gfx.scale_back_buffer_filter"
|
||||
#define IIDXHOOK_CONFIG_GFX_FORCED_REFRESHRATE_KEY "gfx.forced_refresh_rate"
|
||||
#define IIDXHOOK_CONFIG_GFX_DEVICE_ADAPTER_KEY "gfx.device_adapter"
|
||||
#define IIDXHOOK_CONFIG_GFX_DIAGONAL_TEARING_FIX_KEY "gfx.diagonal_tearing_fix"
|
||||
#define IIDXHOOK_CONFIG_MISC_DISTORTED_MS_BG_FIX_KEY "gfx.distorted_ms_bg_fix"
|
||||
|
||||
#define IIDXHOOK_CONFIG_GFX_DEFAULT_BGVIDEO_UV_FIX_VALUE false
|
||||
#define IIDXHOOK_CONFIG_GFX_DEFAULT_FRAMED_VALUE false
|
||||
#define IIDXHOOK_CONFIG_GFX_DEFAULT_FRAME_RATE_LIMIT_VALUE 0.0
|
||||
#define IIDXHOOK_CONFIG_GFX_DEFAULT_MONITOR_CHECK_VALUE -1.0
|
||||
#define IIDXHOOK_CONFIG_GFX_DEFAULT_PCI_ID_VALUE "1002:7146"
|
||||
#define IIDXHOOK_CONFIG_GFX_DEFAULT_WINDOWED_VALUE false
|
||||
#define IIDXHOOK_CONFIG_GFX_DEFAULT_WINDOW_WIDTH_VALUE -1
|
||||
#define IIDXHOOK_CONFIG_GFX_DEFAULT_WINDOW_HEIGHT_VALUE -1
|
||||
#define IIDXHOOK_CONFIG_GFX_DEFAULT_SCALE_BACK_BUFFER_WIDTH_VALUE 0
|
||||
#define IIDXHOOK_CONFIG_GFX_DEFAULT_SCALE_BACK_BUFFER_HEIGHT_VALUE 0
|
||||
#define IIDXHOOK_CONFIG_GFX_DEFAULT_SCALE_BACK_BUFFER_FILTER_VALUE "none"
|
||||
#define IIDXHOOK_CONFIG_GFX_DEFAULT_FORCED_RR_VALUE -1
|
||||
#define IIDXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE -1
|
||||
#define IIDXHOOK_CONFIG_GFX_DEFAULT_DIAGONAL_TEARING_FIX_VALUE false
|
||||
#define IIDXHOOK_CONFIG_MISC_DEFAULT_DISTORTED_MS_BG_FIX_VALUE false
|
||||
|
||||
void iidxhook_config_gfx_init(struct cconfig *config)
|
||||
{
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_BGVIDEO_UV_FIX_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_BGVIDEO_UV_FIX_VALUE,
|
||||
"Fix stretched BG videos on newer GPUs. Might appear on SIRIUS "
|
||||
"and older. On 9th and 10th style this issue may only affect "
|
||||
"older BGAs (from 1st-3rd style)");
|
||||
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_FRAMED_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_FRAMED_VALUE,
|
||||
"Run the game in a framed window (requires windowed option)");
|
||||
|
||||
cconfig_util_set_float(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_FRAME_RATE_LIMIT_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_FRAME_RATE_LIMIT_VALUE,
|
||||
"Software limit the frame rate of the rendering loop in hz, e.g. "
|
||||
"60 or 59.95 (0.0 = no software limit)");
|
||||
|
||||
cconfig_util_set_float(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_MONITOR_CHECK_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_MONITOR_CHECK_VALUE,
|
||||
"Enable/disable software monitor check/auto timebase or set "
|
||||
"a pre-determined refresh value. -1 disables this feature. 0 "
|
||||
"enables "
|
||||
"auto detecting the current refresh rate on startup. Setting any "
|
||||
"positive value > 0 allows you to set a pre-determined refresh "
|
||||
"rate "
|
||||
"(e.g. retrieved from the monitor check on newer IIDX games). "
|
||||
"Either "
|
||||
"the auto detected value or pre-determined value is used to patch "
|
||||
"any "
|
||||
"chart files in-memory to fix song synchronization issues. "
|
||||
"Requires "
|
||||
"constant refresh rate!!!");
|
||||
|
||||
cconfig_util_set_str(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_PCI_ID_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_PCI_ID_VALUE,
|
||||
"Patch the GPU device ID detection (leave empty to"
|
||||
" disable), format XXXX:YYYY, two 4 digit hex numbers (vid:pid)."
|
||||
" Examples: 1002:7146 (RV515, Radeon X1300), 1002:95C5 (RV620 LE,"
|
||||
" Radeon HD3450)");
|
||||
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_WINDOWED_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_WINDOWED_VALUE,
|
||||
"Run the game windowed");
|
||||
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_WINDOW_WIDTH_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_WINDOW_WIDTH_VALUE,
|
||||
"Windowed width, -1 for default size");
|
||||
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_WINDOW_HEIGHT_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_WINDOW_HEIGHT_VALUE,
|
||||
"Windowed height, -1 for default size");
|
||||
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_SCALE_BACK_BUFFER_WIDTH_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_SCALE_BACK_BUFFER_WIDTH_VALUE,
|
||||
"Up-/downscale the back buffer's width. 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 height parameter.");
|
||||
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_SCALE_BACK_BUFFER_HEIGHT_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_SCALE_BACK_BUFFER_HEIGHT_VALUE,
|
||||
"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.");
|
||||
|
||||
cconfig_util_set_str(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_SCALE_BACK_BUFFER_FILTER_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_SCALE_BACK_BUFFER_FILTER_VALUE,
|
||||
"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).");
|
||||
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_FORCED_REFRESHRATE_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_FORCED_RR_VALUE,
|
||||
"Forced refresh rate, -1 to not force any (try 59 or 60 if monitor "
|
||||
"check fails to lock on high refresh rate monitors)");
|
||||
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_DEVICE_ADAPTER_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE,
|
||||
"D3D9 device adapter (monitor), -1 to use default, "
|
||||
"0, 1, 2 etc. to use specified adapter");
|
||||
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_DIAGONAL_TEARING_FIX_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_DIAGONAL_TEARING_FIX_VALUE,
|
||||
"Fix diagonal tearing with video cards "
|
||||
"other than Radeon X1300 and HD3450");
|
||||
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_MISC_DISTORTED_MS_BG_FIX_KEY,
|
||||
IIDXHOOK_CONFIG_MISC_DEFAULT_DISTORTED_MS_BG_FIX_VALUE,
|
||||
"Fix broken 3D background on DistorteD's music select (if "
|
||||
"appearing "
|
||||
"completely black)");
|
||||
}
|
||||
|
||||
void iidxhook_config_gfx_get(
|
||||
struct iidxhook_config_gfx *config_gfx, struct cconfig *config)
|
||||
{
|
||||
char tmp[10];
|
||||
char *vid;
|
||||
char *pid;
|
||||
int32_t tmp_int;
|
||||
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_BGVIDEO_UV_FIX_KEY,
|
||||
&config_gfx->bgvideo_uv_fix,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_BGVIDEO_UV_FIX_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK_CONFIG_GFX_BGVIDEO_UV_FIX_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_BGVIDEO_UV_FIX_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_FRAMED_KEY,
|
||||
&config_gfx->framed,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_FRAMED_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK_CONFIG_GFX_FRAMED_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_FRAMED_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_float(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_FRAME_RATE_LIMIT_KEY,
|
||||
&config_gfx->frame_rate_limit,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_FRAME_RATE_LIMIT_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%f'",
|
||||
IIDXHOOK_CONFIG_GFX_FRAME_RATE_LIMIT_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_FRAME_RATE_LIMIT_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_float(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_MONITOR_CHECK_KEY,
|
||||
&config_gfx->monitor_check,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_MONITOR_CHECK_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%f'",
|
||||
IIDXHOOK_CONFIG_GFX_MONITOR_CHECK_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_MONITOR_CHECK_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_str(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_PCI_ID_KEY,
|
||||
tmp,
|
||||
sizeof(tmp) - 1,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_PCI_ID_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%s'",
|
||||
IIDXHOOK_CONFIG_GFX_PCI_ID_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_PCI_ID_VALUE);
|
||||
}
|
||||
|
||||
if (tmp[4] != ':') {
|
||||
log_warning(
|
||||
"Invalid format for value for key '%s' specified, fallback "
|
||||
"to default '%s'",
|
||||
IIDXHOOK_CONFIG_GFX_PCI_ID_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_PCI_ID_VALUE);
|
||||
strcpy(tmp, IIDXHOOK_CONFIG_GFX_DEFAULT_PCI_ID_VALUE);
|
||||
}
|
||||
|
||||
tmp[4] = '\0';
|
||||
vid = tmp;
|
||||
pid = &tmp[5];
|
||||
config_gfx->pci_id_vid = strtol(vid, NULL, 16);
|
||||
config_gfx->pci_id_pid = strtol(pid, NULL, 16);
|
||||
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_WINDOWED_KEY,
|
||||
&config_gfx->windowed,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_WINDOWED_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK_CONFIG_GFX_WINDOWED_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_WINDOWED_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_WINDOW_WIDTH_KEY,
|
||||
(int32_t*) &config_gfx->window_width,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_WINDOW_WIDTH_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK_CONFIG_GFX_WINDOW_WIDTH_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_WINDOW_WIDTH_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_WINDOW_HEIGHT_KEY,
|
||||
(int32_t*) &config_gfx->window_height,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_WINDOW_HEIGHT_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK_CONFIG_GFX_WINDOW_HEIGHT_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_WINDOW_HEIGHT_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_SCALE_BACK_BUFFER_WIDTH_KEY,
|
||||
&tmp_int,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_SCALE_BACK_BUFFER_WIDTH_VALUE) ||
|
||||
tmp_int < 0 || tmp_int > 0xFFFF) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK_CONFIG_GFX_SCALE_BACK_BUFFER_WIDTH_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_SCALE_BACK_BUFFER_WIDTH_VALUE);
|
||||
}
|
||||
|
||||
config_gfx->scale_back_buffer_width = (uint16_t) tmp_int;
|
||||
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_SCALE_BACK_BUFFER_HEIGHT_KEY,
|
||||
&tmp_int,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_SCALE_BACK_BUFFER_HEIGHT_VALUE) ||
|
||||
tmp_int < 0 || tmp_int > 0xFFFF) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK_CONFIG_GFX_SCALE_BACK_BUFFER_HEIGHT_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_SCALE_BACK_BUFFER_HEIGHT_VALUE);
|
||||
}
|
||||
|
||||
config_gfx->scale_back_buffer_height = (uint16_t) tmp_int;
|
||||
|
||||
if (!cconfig_util_get_str(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_SCALE_BACK_BUFFER_FILTER_KEY,
|
||||
tmp,
|
||||
sizeof(tmp) - 1,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_SCALE_BACK_BUFFER_FILTER_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%s'",
|
||||
IIDXHOOK_CONFIG_GFX_SCALE_BACK_BUFFER_FILTER_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_SCALE_BACK_BUFFER_FILTER_VALUE);
|
||||
}
|
||||
|
||||
if (!strcmp(tmp, "none")) {
|
||||
config_gfx->scale_back_buffer_filter =
|
||||
IIDXHOOK_UTIL_D3D9_BACK_BUFFER_SCALE_FILTER_NONE;
|
||||
} else if (!strcmp(tmp, "linear")) {
|
||||
config_gfx->scale_back_buffer_filter =
|
||||
IIDXHOOK_UTIL_D3D9_BACK_BUFFER_SCALE_FILTER_LINEAR;
|
||||
} else if (!strcmp(tmp, "point")) {
|
||||
config_gfx->scale_back_buffer_filter =
|
||||
IIDXHOOK_UTIL_D3D9_BACK_BUFFER_SCALE_FILTER_POINT;
|
||||
} else {
|
||||
config_gfx->scale_back_buffer_filter =
|
||||
IIDXHOOK_UTIL_D3D9_BACK_BUFFER_SCALE_FILTER_NONE;
|
||||
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%s'",
|
||||
IIDXHOOK_CONFIG_GFX_SCALE_BACK_BUFFER_FILTER_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_SCALE_BACK_BUFFER_FILTER_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_FORCED_REFRESHRATE_KEY,
|
||||
(int32_t*) &config_gfx->forced_refresh_rate,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_FORCED_RR_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK_CONFIG_GFX_FORCED_REFRESHRATE_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_FORCED_RR_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_DEVICE_ADAPTER_KEY,
|
||||
(int32_t*) &config_gfx->device_adapter,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK_CONFIG_GFX_DEVICE_ADAPTER_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_DIAGONAL_TEARING_FIX_KEY,
|
||||
&config_gfx->diagonal_tearing_fix,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_DIAGONAL_TEARING_FIX_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK_CONFIG_GFX_DIAGONAL_TEARING_FIX_KEY,
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_DIAGONAL_TEARING_FIX_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_MISC_DISTORTED_MS_BG_FIX_KEY,
|
||||
&config_gfx->distorted_ms_bg_fix,
|
||||
IIDXHOOK_CONFIG_MISC_DEFAULT_DISTORTED_MS_BG_FIX_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK_CONFIG_MISC_DISTORTED_MS_BG_FIX_KEY,
|
||||
IIDXHOOK_CONFIG_MISC_DEFAULT_DISTORTED_MS_BG_FIX_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
static void _iidxhook_util_config_gfx_verify(const iidxhook_config_gfx_t *config)
|
||||
{
|
||||
if (config->frame_rate_limit < 0.0 || config->frame_rate_limit > 500.0) {
|
||||
@@ -472,7 +63,7 @@ static void _iidxhook_util_config_gfx_back_buffer_scale_filter_get(
|
||||
}
|
||||
}
|
||||
|
||||
void iidxhook_util_config_gfx_get2(
|
||||
void iidxhook_util_config_gfx_get(
|
||||
const bt_core_config_t *config,
|
||||
iidxhook_config_gfx_t *config_gfx)
|
||||
{
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef IIDXHOOK_CONFIG_GFX_H
|
||||
#define IIDXHOOK_CONFIG_GFX_H
|
||||
|
||||
#include "cconfig/cconfig.h"
|
||||
|
||||
#include "iface-core/config.h"
|
||||
|
||||
#include "iidxhook-util/d3d9.h"
|
||||
@@ -28,12 +26,7 @@ typedef struct iidxhook_config_gfx {
|
||||
bool distorted_ms_bg_fix;
|
||||
} iidxhook_config_gfx_t;
|
||||
|
||||
void iidxhook_config_gfx_init(struct cconfig *config);
|
||||
|
||||
void iidxhook_config_gfx_get(
|
||||
struct iidxhook_config_gfx *config_gfx, struct cconfig *config);
|
||||
|
||||
void iidxhook_util_config_gfx_get2(
|
||||
void iidxhook_util_config_gfx_get(
|
||||
const bt_core_config_t *config,
|
||||
iidxhook_config_gfx_t *config_gfx);
|
||||
|
||||
|
||||
@@ -1,64 +1,10 @@
|
||||
#include "cconfig/cconfig-util.h"
|
||||
|
||||
#include "core/config-ext.h"
|
||||
|
||||
#include "iface-core/log.h"
|
||||
|
||||
#include "iidxhook-util/config-io.h"
|
||||
|
||||
#define IIDXHOOK_UTIL_CONFIG_IO_DISABLE_CARD_READER_EMU_KEY \
|
||||
"io.disable_card_reader_emu"
|
||||
#define IIDXHOOK_UTIL_CONFIG_IO_DISABLE_IO_EMU_KEY "io.disable_io_emu"
|
||||
|
||||
#define IIDXHOOK_UTIL_CONFIG_IO_DEFAULT_DISABLE_CARD_READER_EMU_VALUE false
|
||||
#define IIDXHOOK_UTIL_CONFIG_IO_DEFAULT_DISABLE_IO_EMU_VALUE false
|
||||
|
||||
void iidxhook_config_io_init(struct cconfig *config)
|
||||
{
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK_UTIL_CONFIG_IO_DISABLE_CARD_READER_EMU_KEY,
|
||||
IIDXHOOK_UTIL_CONFIG_IO_DEFAULT_DISABLE_CARD_READER_EMU_VALUE,
|
||||
"Disable card reader emulation and enable usage of real card reader "
|
||||
"hardware on COM1 (for games supporting slotted/wavepass readers)");
|
||||
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK_UTIL_CONFIG_IO_DISABLE_IO_EMU_KEY,
|
||||
IIDXHOOK_UTIL_CONFIG_IO_DEFAULT_DISABLE_IO_EMU_VALUE,
|
||||
"Disable ezusb IO emulation and enable usage of real ezusb1/2 IO "
|
||||
"hardware");
|
||||
}
|
||||
|
||||
void iidxhook_config_io_get(
|
||||
struct iidxhook_config_io *config_io, struct cconfig *config)
|
||||
{
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
IIDXHOOK_UTIL_CONFIG_IO_DISABLE_CARD_READER_EMU_KEY,
|
||||
&config_io->disable_card_reader_emu,
|
||||
IIDXHOOK_UTIL_CONFIG_IO_DEFAULT_DISABLE_CARD_READER_EMU_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK_UTIL_CONFIG_IO_DISABLE_CARD_READER_EMU_KEY,
|
||||
IIDXHOOK_UTIL_CONFIG_IO_DEFAULT_DISABLE_CARD_READER_EMU_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
IIDXHOOK_UTIL_CONFIG_IO_DISABLE_IO_EMU_KEY,
|
||||
&config_io->disable_io_emu,
|
||||
IIDXHOOK_UTIL_CONFIG_IO_DEFAULT_DISABLE_IO_EMU_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK_UTIL_CONFIG_IO_DISABLE_IO_EMU_KEY,
|
||||
IIDXHOOK_UTIL_CONFIG_IO_DEFAULT_DISABLE_IO_EMU_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
void iidxhook_util_config_io_get2(
|
||||
void iidxhook_util_config_io_get(
|
||||
const bt_core_config_t *config,
|
||||
iidxhook_config_io_t *config_io)
|
||||
{
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "cconfig/cconfig.h"
|
||||
|
||||
#include "iface-core/config.h"
|
||||
|
||||
typedef struct iidxhook_config_io {
|
||||
@@ -12,12 +10,7 @@ typedef struct iidxhook_config_io {
|
||||
bool disable_io_emu;
|
||||
} iidxhook_config_io_t;
|
||||
|
||||
void iidxhook_config_io_init(struct cconfig *config);
|
||||
|
||||
void iidxhook_config_io_get(
|
||||
struct iidxhook_config_io *config_io, struct cconfig *config);
|
||||
|
||||
void iidxhook_util_config_io_get2(
|
||||
void iidxhook_util_config_io_get(
|
||||
const bt_core_config_t *config,
|
||||
iidxhook_config_io_t *config_io);
|
||||
|
||||
|
||||
@@ -1,83 +1,8 @@
|
||||
#include "cconfig/cconfig-util.h"
|
||||
|
||||
#include "core/config-ext.h"
|
||||
|
||||
#include "iface-core/log.h"
|
||||
|
||||
#include "iidxhook-util/config-misc.h"
|
||||
|
||||
#define IIDXHOOK_CONFIG_MISC_DISABLE_CLOCK_SET_KEY "misc.disable_clock_set"
|
||||
#define IIDXHOOK_CONFIG_MISC_RTEFFECT_STUB_KEY "misc.rteffect_stub"
|
||||
#define IIDXHOOK_CONFIG_MISC_SETTINGS_PATH_STUB_KEY "misc.settings_path"
|
||||
|
||||
#define IIDXHOOK_CONFIG_MISC_DEFAULT_DISABLE_CLOCK_SET_VALUE false
|
||||
#define IIDXHOOK_CONFIG_MISC_DEFAULT_RTEFFECT_STUB_VALUE false
|
||||
#define IIDXHOOK_CONFIG_MISC_DEFAULT_SETTINGS_PATH_STUB_VALUE ".\\"
|
||||
|
||||
void iidxhook_config_misc_init(struct cconfig *config)
|
||||
{
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_MISC_DISABLE_CLOCK_SET_KEY,
|
||||
IIDXHOOK_CONFIG_MISC_DEFAULT_DISABLE_CLOCK_SET_VALUE,
|
||||
"Disable operator clock setting system clock time");
|
||||
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_MISC_RTEFFECT_STUB_KEY,
|
||||
IIDXHOOK_CONFIG_MISC_DEFAULT_RTEFFECT_STUB_VALUE,
|
||||
"Stub calls to rteffect.dll (10th to DistorteD)");
|
||||
|
||||
cconfig_util_set_str(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_MISC_SETTINGS_PATH_STUB_KEY,
|
||||
IIDXHOOK_CONFIG_MISC_DEFAULT_SETTINGS_PATH_STUB_VALUE,
|
||||
"Path to store the settings, e.g. bookkeeping, operator settings. d:, "
|
||||
"e: and f: drive configuration/settings data");
|
||||
}
|
||||
|
||||
void iidxhook_config_misc_get(
|
||||
struct iidxhook_config_misc *config_misc, struct cconfig *config)
|
||||
{
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_MISC_DISABLE_CLOCK_SET_KEY,
|
||||
&config_misc->disable_clock_set,
|
||||
IIDXHOOK_CONFIG_MISC_DEFAULT_DISABLE_CLOCK_SET_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK_CONFIG_MISC_DISABLE_CLOCK_SET_KEY,
|
||||
IIDXHOOK_CONFIG_MISC_DEFAULT_DISABLE_CLOCK_SET_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_MISC_RTEFFECT_STUB_KEY,
|
||||
&config_misc->rteffect_stub,
|
||||
IIDXHOOK_CONFIG_MISC_DEFAULT_RTEFFECT_STUB_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK_CONFIG_MISC_RTEFFECT_STUB_KEY,
|
||||
IIDXHOOK_CONFIG_MISC_DEFAULT_RTEFFECT_STUB_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_str(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_MISC_SETTINGS_PATH_STUB_KEY,
|
||||
config_misc->settings_path,
|
||||
sizeof(config_misc->settings_path),
|
||||
IIDXHOOK_CONFIG_MISC_DEFAULT_SETTINGS_PATH_STUB_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%s'",
|
||||
IIDXHOOK_CONFIG_MISC_SETTINGS_PATH_STUB_KEY,
|
||||
IIDXHOOK_CONFIG_MISC_DEFAULT_SETTINGS_PATH_STUB_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
void iidxhook_util_config_misc_get2(
|
||||
void iidxhook_util_config_misc_get(
|
||||
const bt_core_config_t *config,
|
||||
iidxhook_config_misc_t *config_misc)
|
||||
{
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "cconfig/cconfig.h"
|
||||
|
||||
#include "iface-core/config.h"
|
||||
|
||||
typedef struct iidxhook_config_misc {
|
||||
@@ -13,12 +11,7 @@ typedef struct iidxhook_config_misc {
|
||||
char settings_path[MAX_PATH];
|
||||
} iidxhook_config_misc_t;
|
||||
|
||||
void iidxhook_config_misc_init(struct cconfig *config);
|
||||
|
||||
void iidxhook_config_misc_get(
|
||||
struct iidxhook_config_misc *config_misc, struct cconfig *config);
|
||||
|
||||
void iidxhook_util_config_misc_get2(
|
||||
void iidxhook_util_config_misc_get(
|
||||
const bt_core_config_t *config,
|
||||
iidxhook_config_misc_t *config_misc);
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "cconfig/cconfig-util.h"
|
||||
|
||||
#include "core/config-ext.h"
|
||||
|
||||
#include "iface-core/log.h"
|
||||
@@ -14,54 +12,6 @@
|
||||
|
||||
#include "util/mem.h"
|
||||
|
||||
#define IIDXHOOK_CONFIG_SEC_BOOT_VERSION_KEY "sec.boot_version"
|
||||
#define IIDXHOOK_CONFIG_SEC_BOOT_SEEDS_KEY "sec.boot_seeds"
|
||||
#define IIDXHOOK_CONFIG_SEC_BLACK_PLUG_MCODE_KEY "sec.black_plug_mcode"
|
||||
|
||||
/* Use C02 defaults */
|
||||
#define IIDXHOOK_CONFIG_SEC_DEFAULT_BOOT_VERSION_VALUE \
|
||||
iidxhook_security_default_boot_version
|
||||
#define IIDXHOOK_CONFIG_SEC_DEFAULT_BOOT_SEEDS_VALUE \
|
||||
iidxhook_security_default_boot_seeds
|
||||
#define IIDXHOOK_CONFIG_SEC_DEFAULT_BLACK_PLUG_MCODE_VALUE \
|
||||
iidxhook_security_default_black_plug_mcode
|
||||
|
||||
/* IIDX 09 default */
|
||||
static const struct security_mcode iidxhook_security_default_boot_version = {
|
||||
.header = SECURITY_MCODE_HEADER,
|
||||
.unkn = SECURITY_MCODE_UNKN_E,
|
||||
.game = SECURITY_MCODE_GAME_IIDX_9,
|
||||
.region = SECURITY_MCODE_FIELD_BLANK,
|
||||
.cabinet = SECURITY_MCODE_FIELD_BLANK,
|
||||
.revision = SECURITY_MCODE_FIELD_BLANK,
|
||||
};
|
||||
|
||||
/* IIDX 09 default */
|
||||
static const uint32_t iidxhook_security_default_boot_seeds[3] = {0, 0, 0};
|
||||
|
||||
/* IIDX 09 default */
|
||||
static const struct security_mcode iidxhook_security_default_black_plug_mcode =
|
||||
{
|
||||
.header = SECURITY_MCODE_HEADER,
|
||||
.unkn = SECURITY_MCODE_UNKN_Q,
|
||||
.game = SECURITY_MCODE_GAME_IIDX_9,
|
||||
.region = SECURITY_MCODE_REGION_JAPAN,
|
||||
.cabinet = SECURITY_MCODE_CABINET_A,
|
||||
.revision = SECURITY_MCODE_REVISION_A,
|
||||
};
|
||||
|
||||
static char *iidxhook_config_boot_seeds_to_str(const uint32_t *seeds)
|
||||
{
|
||||
char *res;
|
||||
size_t len;
|
||||
|
||||
len = snprintf(NULL, 0, "%d:%d:%d", seeds[0], seeds[1], seeds[2]);
|
||||
res = xmalloc(len + 1);
|
||||
sprintf(res, "%d:%d:%d", seeds[0], seeds[1], seeds[2]);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static bool iidxhook_config_boot_seeds_parse(const char *str, uint32_t *seeds)
|
||||
{
|
||||
if (strlen(str) < 5) {
|
||||
@@ -78,144 +28,6 @@ static bool iidxhook_config_boot_seeds_parse(const char *str, uint32_t *seeds)
|
||||
}
|
||||
}
|
||||
|
||||
void iidxhook_config_sec_init(struct cconfig *config)
|
||||
{
|
||||
char *tmp;
|
||||
|
||||
tmp =
|
||||
security_mcode_to_str(&IIDXHOOK_CONFIG_SEC_DEFAULT_BOOT_VERSION_VALUE);
|
||||
|
||||
cconfig_util_set_str(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_SEC_BOOT_VERSION_KEY,
|
||||
tmp,
|
||||
"Security boot version (e.g. GEC02).");
|
||||
|
||||
free(tmp);
|
||||
|
||||
tmp = iidxhook_config_boot_seeds_to_str(
|
||||
IIDXHOOK_CONFIG_SEC_DEFAULT_BOOT_SEEDS_VALUE);
|
||||
|
||||
cconfig_util_set_str(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_SEC_BOOT_SEEDS_KEY,
|
||||
tmp,
|
||||
"Security boot seeds for ezusb, format: X:X:X where X is a number "
|
||||
"of "
|
||||
"0-9 (e.g. 0:0:0).");
|
||||
|
||||
free(tmp);
|
||||
|
||||
tmp = security_mcode_to_str(
|
||||
&IIDXHOOK_CONFIG_SEC_DEFAULT_BLACK_PLUG_MCODE_VALUE);
|
||||
|
||||
cconfig_util_set_str(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_SEC_BLACK_PLUG_MCODE_KEY,
|
||||
tmp,
|
||||
"Security black plug mcode id string (e.g. GQC02JAA).");
|
||||
|
||||
free(tmp);
|
||||
}
|
||||
|
||||
void iidxhook_config_sec_get(
|
||||
struct iidxhook_config_sec *config_sec, struct cconfig *config)
|
||||
{
|
||||
char tmp_seeds[6];
|
||||
char tmp_mcode[sizeof(struct security_mcode) + 1];
|
||||
char *tmp_str;
|
||||
|
||||
tmp_str =
|
||||
security_mcode_to_str(&IIDXHOOK_CONFIG_SEC_DEFAULT_BOOT_VERSION_VALUE);
|
||||
|
||||
if (!cconfig_util_get_str(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_SEC_BOOT_VERSION_KEY,
|
||||
tmp_mcode,
|
||||
sizeof(tmp_mcode) - 1,
|
||||
tmp_str)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%s'",
|
||||
IIDXHOOK_CONFIG_SEC_BOOT_VERSION_KEY,
|
||||
tmp_str);
|
||||
}
|
||||
|
||||
if (!security_mcode_parse(tmp_mcode, &config_sec->boot_version)) {
|
||||
log_warning(
|
||||
"Invalid format for value of key '%s' specified, fallback "
|
||||
"to default '%s'",
|
||||
IIDXHOOK_CONFIG_SEC_BOOT_VERSION_KEY,
|
||||
tmp_str);
|
||||
memcpy(
|
||||
&config_sec->boot_version,
|
||||
&IIDXHOOK_CONFIG_SEC_DEFAULT_BOOT_VERSION_VALUE,
|
||||
sizeof(IIDXHOOK_CONFIG_SEC_DEFAULT_BOOT_VERSION_VALUE));
|
||||
}
|
||||
|
||||
free(tmp_str);
|
||||
|
||||
tmp_str = iidxhook_config_boot_seeds_to_str(
|
||||
IIDXHOOK_CONFIG_SEC_DEFAULT_BOOT_SEEDS_VALUE);
|
||||
|
||||
if (!cconfig_util_get_str(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_SEC_BOOT_SEEDS_KEY,
|
||||
tmp_seeds,
|
||||
sizeof(tmp_seeds) - 1,
|
||||
tmp_str)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%s'",
|
||||
IIDXHOOK_CONFIG_SEC_BOOT_SEEDS_KEY,
|
||||
tmp_str);
|
||||
}
|
||||
|
||||
if (!iidxhook_config_boot_seeds_parse(tmp_seeds, config_sec->boot_seeds)) {
|
||||
log_warning(
|
||||
"Invalid format for value of key '%s' specified, fallback "
|
||||
"to default '%s'",
|
||||
IIDXHOOK_CONFIG_SEC_BOOT_SEEDS_KEY,
|
||||
tmp_str);
|
||||
memcpy(
|
||||
config_sec->boot_seeds,
|
||||
IIDXHOOK_CONFIG_SEC_DEFAULT_BOOT_SEEDS_VALUE,
|
||||
sizeof(IIDXHOOK_CONFIG_SEC_DEFAULT_BOOT_SEEDS_VALUE));
|
||||
}
|
||||
|
||||
free(tmp_str);
|
||||
|
||||
tmp_str = security_mcode_to_str(
|
||||
&IIDXHOOK_CONFIG_SEC_DEFAULT_BLACK_PLUG_MCODE_VALUE);
|
||||
|
||||
if (!cconfig_util_get_str(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_SEC_BLACK_PLUG_MCODE_KEY,
|
||||
tmp_mcode,
|
||||
sizeof(tmp_mcode) - 1,
|
||||
tmp_str)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%s'",
|
||||
IIDXHOOK_CONFIG_SEC_BLACK_PLUG_MCODE_KEY,
|
||||
tmp_str);
|
||||
}
|
||||
|
||||
if (!security_mcode_parse(tmp_mcode, &config_sec->black_plug_mcode)) {
|
||||
log_warning(
|
||||
"Invalid format for value of key '%s' specified, fallback "
|
||||
"to default '%s'",
|
||||
IIDXHOOK_CONFIG_SEC_BLACK_PLUG_MCODE_KEY,
|
||||
tmp_str);
|
||||
memcpy(
|
||||
&config_sec->black_plug_mcode,
|
||||
&IIDXHOOK_CONFIG_SEC_DEFAULT_BLACK_PLUG_MCODE_VALUE,
|
||||
sizeof(IIDXHOOK_CONFIG_SEC_DEFAULT_BLACK_PLUG_MCODE_VALUE));
|
||||
}
|
||||
|
||||
free(tmp_str);
|
||||
}
|
||||
|
||||
static void _iidxhook_util_config_sec_security_mcode_get(const bt_core_config_t *config, const char *path, struct security_mcode *mcode)
|
||||
{
|
||||
char tmp[sizeof(struct security_mcode) + 1];
|
||||
@@ -238,7 +50,7 @@ static void _iidxhook_util_config_sec_boot_seeds_get(const bt_core_config_t *con
|
||||
}
|
||||
}
|
||||
|
||||
void iidxhook_util_config_sec_get2(
|
||||
void iidxhook_util_config_sec_get(
|
||||
const bt_core_config_t *config,
|
||||
iidxhook_config_sec_t *config_sec)
|
||||
{
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef IIDXHOOK_CONFIG_SEC_H
|
||||
#define IIDXHOOK_CONFIG_SEC_H
|
||||
|
||||
#include "cconfig/cconfig.h"
|
||||
|
||||
#include "iface-core/config.h"
|
||||
|
||||
#include "security/mcode.h"
|
||||
@@ -13,12 +11,7 @@ typedef struct iidxhook_config_sec {
|
||||
struct security_mcode black_plug_mcode;
|
||||
} iidxhook_config_sec_t;
|
||||
|
||||
void iidxhook_config_sec_init(struct cconfig *config);
|
||||
|
||||
void iidxhook_config_sec_get(
|
||||
struct iidxhook_config_sec *config_sec, struct cconfig *config);
|
||||
|
||||
void iidxhook_util_config_sec_get2(
|
||||
void iidxhook_util_config_sec_get(
|
||||
const bt_core_config_t *config,
|
||||
iidxhook_config_sec_t *config_sec);
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ libs_iidxhook1 := \
|
||||
acioemu \
|
||||
hook \
|
||||
hooklib \
|
||||
cconfig \
|
||||
module \
|
||||
ezusb \
|
||||
iface \
|
||||
|
||||
@@ -153,11 +153,11 @@ _iidxhook1_main_init(HMODULE game_module, const bt_core_config_t *config)
|
||||
log_info("iidxhook for 9th Style, 10th Style, RED and HAPPY SKY");
|
||||
log_info("build " __DATE__ " " __TIME__ ", gitrev " STRINGIFY(GITREV));
|
||||
|
||||
iidxhook_util_config_ezusb_get2(config, &config_ezusb);
|
||||
iidxhook_util_config_eamuse_get2(config, &config_eamuse);
|
||||
iidxhook_util_config_gfx_get2(config, &config_gfx);
|
||||
iidxhook_util_config_misc_get2(config, &config_misc);
|
||||
iidxhook_util_config_sec_get2(config, &config_sec);
|
||||
iidxhook_util_config_ezusb_get(config, &config_ezusb);
|
||||
iidxhook_util_config_eamuse_get(config, &config_eamuse);
|
||||
iidxhook_util_config_gfx_get(config, &config_gfx);
|
||||
iidxhook_util_config_misc_get(config, &config_misc);
|
||||
iidxhook_util_config_sec_get(config, &config_sec);
|
||||
|
||||
acp_hook_init();
|
||||
adapter_hook_init();
|
||||
|
||||
@@ -16,7 +16,6 @@ libs_iidxhook2 := \
|
||||
acioemu \
|
||||
hook \
|
||||
hooklib \
|
||||
cconfig \
|
||||
ezusb \
|
||||
iface \
|
||||
iface-io \
|
||||
|
||||
@@ -139,11 +139,11 @@ _iidxhook2_main_init(HMODULE game_module, const bt_core_config_t *config)
|
||||
log_info("iidxhook for DistorteD");
|
||||
log_info("build " __DATE__ " " __TIME__ ", gitrev " STRINGIFY(GITREV));
|
||||
|
||||
iidxhook_util_config_ezusb_get2(config, &config_ezusb);
|
||||
iidxhook_util_config_eamuse_get2(config, &config_eamuse);
|
||||
iidxhook_util_config_gfx_get2(config, &config_gfx);
|
||||
iidxhook_util_config_misc_get2(config, &config_misc);
|
||||
iidxhook_util_config_sec_get2(config, &config_sec);
|
||||
iidxhook_util_config_ezusb_get(config, &config_ezusb);
|
||||
iidxhook_util_config_eamuse_get(config, &config_eamuse);
|
||||
iidxhook_util_config_gfx_get(config, &config_gfx);
|
||||
iidxhook_util_config_misc_get(config, &config_misc);
|
||||
iidxhook_util_config_sec_get(config, &config_sec);
|
||||
|
||||
acp_hook_init();
|
||||
adapter_hook_init();
|
||||
|
||||
@@ -20,7 +20,6 @@ libs_iidxhook3 := \
|
||||
acioemu \
|
||||
hook \
|
||||
hooklib \
|
||||
cconfig \
|
||||
ezusb \
|
||||
iface \
|
||||
iface-io \
|
||||
|
||||
@@ -138,10 +138,10 @@ _iidxhook3_main_init(HMODULE game_module, const bt_core_config_t *config)
|
||||
log_info("iidxhook for Gold, DJTroopers, Empress and Sirius");
|
||||
log_info("build " __DATE__ " " __TIME__ ", gitrev " STRINGIFY(GITREV));
|
||||
|
||||
iidxhook_util_config_eamuse_get2(config, &config_eamuse);
|
||||
iidxhook_util_config_gfx_get2(config, &config_gfx);
|
||||
iidxhook_util_config_misc_get2(config, &config_misc);
|
||||
iidxhook_util_config_sec_get2(config, &config_sec);
|
||||
iidxhook_util_config_eamuse_get(config, &config_eamuse);
|
||||
iidxhook_util_config_gfx_get(config, &config_gfx);
|
||||
iidxhook_util_config_misc_get(config, &config_misc);
|
||||
iidxhook_util_config_sec_get(config, &config_sec);
|
||||
|
||||
acp_hook_init();
|
||||
adapter_hook_init();
|
||||
|
||||
@@ -21,7 +21,6 @@ libs_iidxhook4-cn := \
|
||||
security \
|
||||
hook \
|
||||
hooklib \
|
||||
cconfig \
|
||||
util \
|
||||
ezusb \
|
||||
iface \
|
||||
|
||||
@@ -122,11 +122,11 @@ _iidxhook4_cn_main_init(HMODULE game_module, const bt_core_config_t *config)
|
||||
log_info("iidxhook for Resort Anthem CN");
|
||||
log_info("build " __DATE__ " " __TIME__ ", gitrev " STRINGIFY(GITREV));
|
||||
|
||||
iidxhook_util_config_eamuse_get2(config, &config_eamuse);
|
||||
iidxhook_util_config_gfx_get2(config, &config_gfx);
|
||||
iidxhook_util_config_sec_get2(config, &config_sec);
|
||||
iidxhook_util_config_misc_get2(config, &config_misc);
|
||||
iidxhook_util_config_io_get2(config, &config_io);
|
||||
iidxhook_util_config_eamuse_get(config, &config_eamuse);
|
||||
iidxhook_util_config_gfx_get(config, &config_gfx);
|
||||
iidxhook_util_config_sec_get(config, &config_sec);
|
||||
iidxhook_util_config_misc_get(config, &config_misc);
|
||||
iidxhook_util_config_io_get(config, &config_io);
|
||||
|
||||
iidxhook4_cn_path_init();
|
||||
iidxhook4_cn_avs_boot_init();
|
||||
|
||||
@@ -21,7 +21,6 @@ libs_iidxhook4 := \
|
||||
acioemu \
|
||||
hook \
|
||||
hooklib \
|
||||
cconfig \
|
||||
ezusb \
|
||||
iface \
|
||||
iface-io \
|
||||
|
||||
@@ -128,9 +128,9 @@ _iidxhook4_main_init(HMODULE game_module, const bt_core_config_t *config)
|
||||
log_info("iidxhook for Resort Anthem");
|
||||
log_info("build " __DATE__ " " __TIME__ ", gitrev " STRINGIFY(GITREV));
|
||||
|
||||
iidxhook_util_config_gfx_get2(config, &config_gfx);
|
||||
iidxhook_util_config_misc_get2(config, &config_misc);
|
||||
iidxhook_util_config_io_get2(config, &config_io);
|
||||
iidxhook_util_config_gfx_get(config, &config_gfx);
|
||||
iidxhook_util_config_misc_get(config, &config_misc);
|
||||
iidxhook_util_config_io_get(config, &config_io);
|
||||
|
||||
acp_hook_init();
|
||||
adapter_hook_init();
|
||||
|
||||
@@ -21,7 +21,6 @@ libs_iidxhook5-cn := \
|
||||
security \
|
||||
hook \
|
||||
hooklib \
|
||||
cconfig \
|
||||
ezusb \
|
||||
iface \
|
||||
iface-io \
|
||||
|
||||
@@ -101,11 +101,11 @@ _iidxhook5_cn_main_init(HMODULE game_module, const bt_core_config_t *config)
|
||||
log_info("iidxhook for tricoro CN");
|
||||
log_info("build " __DATE__ " " __TIME__ ", gitrev " STRINGIFY(GITREV));
|
||||
|
||||
iidxhook_util_config_eamuse_get2(config, &config_eamuse);
|
||||
iidxhook_util_config_gfx_get2(config, &config_gfx);
|
||||
iidxhook_util_config_sec_get2(config, &config_sec);
|
||||
iidxhook_util_config_misc_get2(config, &config_misc);
|
||||
iidxhook_util_config_io_get2(config, &config_io);
|
||||
iidxhook_util_config_eamuse_get(config, &config_eamuse);
|
||||
iidxhook_util_config_gfx_get(config, &config_gfx);
|
||||
iidxhook_util_config_sec_get(config, &config_sec);
|
||||
iidxhook_util_config_misc_get(config, &config_misc);
|
||||
iidxhook_util_config_io_get(config, &config_io);
|
||||
|
||||
iidxhook5_cn_path_init();
|
||||
iidxhook5_cn_avs_boot_init();
|
||||
|
||||
@@ -21,7 +21,6 @@ libs_iidxhook5 := \
|
||||
acioemu \
|
||||
hook \
|
||||
hooklib \
|
||||
cconfig \
|
||||
ezusb \
|
||||
iface \
|
||||
iface-io \
|
||||
|
||||
@@ -130,9 +130,9 @@ _iidxhook5_main_init(HMODULE game_module, const bt_core_config_t *config)
|
||||
log_info("iidxhook for Lincle");
|
||||
log_info("build " __DATE__ " " __TIME__ ", gitrev " STRINGIFY(GITREV));
|
||||
|
||||
iidxhook_util_config_gfx_get2(config, &config_gfx);
|
||||
iidxhook_util_config_misc_get2(config, &config_misc);
|
||||
iidxhook_util_config_io_get2(config, &config_io);
|
||||
iidxhook_util_config_gfx_get(config, &config_gfx);
|
||||
iidxhook_util_config_misc_get(config, &config_misc);
|
||||
iidxhook_util_config_io_get(config, &config_io);
|
||||
|
||||
acp_hook_init();
|
||||
adapter_hook_init();
|
||||
|
||||
@@ -22,7 +22,6 @@ libs_iidxhook6 := \
|
||||
acioemu \
|
||||
hook \
|
||||
hooklib \
|
||||
cconfig \
|
||||
ezusb \
|
||||
iface \
|
||||
iface-io \
|
||||
|
||||
@@ -113,8 +113,8 @@ _iidxhook6_main_init(HMODULE game_module, const bt_core_config_t *config)
|
||||
log_info("iidxhook for Tricoro");
|
||||
log_info("build " __DATE__ " " __TIME__ ", gitrev " STRINGIFY(GITREV));
|
||||
|
||||
iidxhook_util_config_gfx_get2(config, &config_gfx);
|
||||
iidxhook_util_config_io_get2(config, &config_io);
|
||||
iidxhook_util_config_gfx_get(config, &config_gfx);
|
||||
iidxhook_util_config_io_get(config, &config_io);
|
||||
|
||||
acp_hook_init();
|
||||
adapter_hook_init();
|
||||
|
||||
@@ -14,7 +14,6 @@ libs_iidxhook7 := \
|
||||
core \
|
||||
iidxhook-d3d9 \
|
||||
iidxhook-util \
|
||||
cconfig \
|
||||
ezusb-emu \
|
||||
ezusb-iidx-16seg-emu \
|
||||
ezusb2-emu \
|
||||
|
||||
@@ -113,8 +113,8 @@ _iidxhook7_main_init(HMODULE game_module, const bt_core_config_t *config)
|
||||
log_info("iidxhook for SPADA, PENDUAL, copula and SINOBUZ");
|
||||
log_info("build " __DATE__ " " __TIME__ ", gitrev " STRINGIFY(GITREV));
|
||||
|
||||
iidxhook_util_config_gfx_get2(config, &config_gfx);
|
||||
iidxhook_util_config_io_get2(config, &config_io);
|
||||
iidxhook_util_config_gfx_get(config, &config_gfx);
|
||||
iidxhook_util_config_io_get(config, &config_io);
|
||||
|
||||
acp_hook_init();
|
||||
adapter_hook_init();
|
||||
|
||||
@@ -25,7 +25,6 @@ libs_iidxhook8 := \
|
||||
camhook \
|
||||
hook \
|
||||
hooklib \
|
||||
cconfig \
|
||||
iface \
|
||||
iface-io \
|
||||
iface-core \
|
||||
|
||||
@@ -1,84 +1,8 @@
|
||||
#include "cconfig/cconfig-util.h"
|
||||
|
||||
#include "core/config-ext.h"
|
||||
|
||||
#include "iface-core/log.h"
|
||||
|
||||
#include "iidxhook8/config-io.h"
|
||||
|
||||
#define IIDXHOOK8_CONFIG_IO_DISABLE_CARD_READER_EMU_KEY \
|
||||
"io.disable_card_reader_emu"
|
||||
#define IIDXHOOK8_CONFIG_IO_DISABLE_BIO2_EMU_KEY "io.disable_bio2_emu"
|
||||
#define IIDXHOOK8_CONFIG_IO_DISABLE_POLL_LIMITER_KEY "io.disable_poll_limiter"
|
||||
|
||||
#define IIDXHOOK8_CONFIG_IO_DEFAULT_DISABLE_CARD_READER_EMU_VALUE false
|
||||
#define IIDXHOOK8_CONFIG_IO_DEFAULT_DISABLE_BIO2_EMU_VALUE false
|
||||
#define IIDXHOOK8_CONFIG_IO_DEFAULT_DISABLE_POLL_LIMITER_VALUE false
|
||||
|
||||
void iidxhook8_config_io_init(struct cconfig *config)
|
||||
{
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK8_CONFIG_IO_DISABLE_CARD_READER_EMU_KEY,
|
||||
IIDXHOOK8_CONFIG_IO_DEFAULT_DISABLE_CARD_READER_EMU_VALUE,
|
||||
"Disable card reader emulation and enable usage of real card "
|
||||
"reader "
|
||||
"hardware on COM1 (for games supporting slotted readers)");
|
||||
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK8_CONFIG_IO_DISABLE_BIO2_EMU_KEY,
|
||||
IIDXHOOK8_CONFIG_IO_DEFAULT_DISABLE_BIO2_EMU_VALUE,
|
||||
"Disable BIO2 emulation and enable usage of real BIO2 hardware");
|
||||
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK8_CONFIG_IO_DISABLE_POLL_LIMITER_KEY,
|
||||
IIDXHOOK8_CONFIG_IO_DEFAULT_DISABLE_POLL_LIMITER_VALUE,
|
||||
"Disables the poll limiter, warning very high CPU usage may arise");
|
||||
}
|
||||
|
||||
void iidxhook8_config_io_get(
|
||||
struct iidxhook8_config_io *config_io, struct cconfig *config)
|
||||
{
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
IIDXHOOK8_CONFIG_IO_DISABLE_CARD_READER_EMU_KEY,
|
||||
&config_io->disable_card_reader_emu,
|
||||
IIDXHOOK8_CONFIG_IO_DEFAULT_DISABLE_CARD_READER_EMU_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK8_CONFIG_IO_DISABLE_CARD_READER_EMU_KEY,
|
||||
IIDXHOOK8_CONFIG_IO_DEFAULT_DISABLE_CARD_READER_EMU_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
IIDXHOOK8_CONFIG_IO_DISABLE_BIO2_EMU_KEY,
|
||||
&config_io->disable_bio2_emu,
|
||||
IIDXHOOK8_CONFIG_IO_DEFAULT_DISABLE_BIO2_EMU_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK8_CONFIG_IO_DISABLE_BIO2_EMU_KEY,
|
||||
IIDXHOOK8_CONFIG_IO_DEFAULT_DISABLE_BIO2_EMU_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
IIDXHOOK8_CONFIG_IO_DISABLE_POLL_LIMITER_KEY,
|
||||
&config_io->disable_poll_limiter,
|
||||
IIDXHOOK8_CONFIG_IO_DEFAULT_DISABLE_POLL_LIMITER_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK8_CONFIG_IO_DISABLE_POLL_LIMITER_KEY,
|
||||
IIDXHOOK8_CONFIG_IO_DEFAULT_DISABLE_POLL_LIMITER_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
void iidxhook8_config_io_get2(
|
||||
const bt_core_config_t *config,
|
||||
struct iidxhook8_config_io *config_io)
|
||||
{
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#ifndef IIDXHOOK8_CONFIG_IO_H
|
||||
#define IIDXHOOK8_CONFIG_IO_H
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "cconfig/cconfig.h"
|
||||
|
||||
#include "iface-core/config.h"
|
||||
|
||||
struct iidxhook8_config_io {
|
||||
@@ -13,12 +9,7 @@ struct iidxhook8_config_io {
|
||||
bool disable_poll_limiter;
|
||||
};
|
||||
|
||||
void iidxhook8_config_io_init(struct cconfig *config);
|
||||
|
||||
void iidxhook8_config_io_get(
|
||||
struct iidxhook8_config_io *config_io, struct cconfig *config);
|
||||
|
||||
void iidxhook8_config_io_get2(
|
||||
const bt_core_config_t *config,
|
||||
struct iidxhook8_config_io *config_io);
|
||||
|
||||
|
||||
@@ -120,9 +120,9 @@ _iidxhook8_main_init(HMODULE game_module, const bt_core_config_t *config)
|
||||
log_info("iidxhook for Cannon Ballers and Rootage");
|
||||
log_info("build " __DATE__ " " __TIME__ ", gitrev " STRINGIFY(GITREV));
|
||||
|
||||
iidxhook_util_config_gfx_get2(config, &config_gfx);
|
||||
iidxhook8_config_io_get2(config, &iidxhook8_config_io);
|
||||
camhook_config_cam_get2(config, &config_cam, 2, false);
|
||||
iidxhook_util_config_gfx_get(config, &config_gfx);
|
||||
iidxhook8_config_io_get(config, &iidxhook8_config_io);
|
||||
camhook_config_cam_get(config, &config_cam, 2, false);
|
||||
|
||||
acp_hook_init();
|
||||
adapter_hook_init();
|
||||
|
||||
@@ -27,7 +27,6 @@ libs_iidxhook9 := \
|
||||
dinput \
|
||||
hook \
|
||||
hooklib \
|
||||
cconfig \
|
||||
iface \
|
||||
iface-io \
|
||||
iface-core \
|
||||
|
||||
@@ -1,163 +1,10 @@
|
||||
#include "cconfig/cconfig-util.h"
|
||||
|
||||
#include "core/config-ext.h"
|
||||
|
||||
#include "iface-core/log.h"
|
||||
|
||||
#include "iidxhook9/config-io.h"
|
||||
|
||||
#define IIDXHOOK9_CONFIG_IO_DISABLE_CARD_READER_EMU_KEY \
|
||||
"io.disable_card_reader_emu"
|
||||
#define IIDXHOOK9_CONFIG_IO_DISABLE_BIO2_EMU_KEY "io.disable_bio2_emu"
|
||||
#define IIDXHOOK9_CONFIG_IO_DISABLE_POLL_LIMITER_KEY "io.disable_poll_limiter"
|
||||
#define IIDXHOOK9_CONFIG_IO_LIGHTNING_MODE_KEY "io.lightning_mode"
|
||||
#define IIDXHOOK9_CONFIG_IO_DISABLE_CAMS_KEY "io.disable_cams"
|
||||
#define IIDXHOOK9_CONFIG_IO_DISABLE_FILE_HOOKS_KEY "io.disable_file_hooks"
|
||||
#define IIDXHOOK9_CONFIG_IO_TT_MULTIPLIER_KEY "io.tt_multiplier"
|
||||
|
||||
#define IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_CARD_READER_EMU_VALUE false
|
||||
#define IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_BIO2_EMU_VALUE false
|
||||
#define IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_POLL_LIMITER_VALUE false
|
||||
#define IIDXHOOK9_CONFIG_IO_DEFAULT_LIGHTNING_MODE_VALUE false
|
||||
#define IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_CAMS_VALUE false
|
||||
#define IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_FILE_HOOKS_VALUE false
|
||||
#define IIDXHOOK9_CONFIG_IO_DEFAULT_TT_MULTIPLIER_VALUE 1.0
|
||||
|
||||
void iidxhook9_config_io_init(struct cconfig *config)
|
||||
{
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK9_CONFIG_IO_DISABLE_CARD_READER_EMU_KEY,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_CARD_READER_EMU_VALUE,
|
||||
"Disable card reader emulation and enable usage of real card reader "
|
||||
"hardware on COM1 (for games supporting slotted readers)");
|
||||
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK9_CONFIG_IO_DISABLE_BIO2_EMU_KEY,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_BIO2_EMU_VALUE,
|
||||
"Disable BIO2 emulation and enable usage of real BIO2 hardware");
|
||||
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK9_CONFIG_IO_DISABLE_POLL_LIMITER_KEY,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_POLL_LIMITER_VALUE,
|
||||
"Disables the poll limiter, warning very high CPU usage may arise");
|
||||
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK9_CONFIG_IO_LIGHTNING_MODE_KEY,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_LIGHTNING_MODE_VALUE,
|
||||
"Lightning cab mode (requires additional IO emulation)");
|
||||
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK9_CONFIG_IO_DISABLE_CAMS_KEY,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_CAMS_VALUE,
|
||||
"Disable camera connection");
|
||||
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK9_CONFIG_IO_DISABLE_FILE_HOOKS_KEY,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_FILE_HOOKS_VALUE,
|
||||
"Disables the built in file hooks, requiring manual file creation");
|
||||
|
||||
cconfig_util_set_float(
|
||||
config,
|
||||
IIDXHOOK9_CONFIG_IO_TT_MULTIPLIER_KEY,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_TT_MULTIPLIER_VALUE,
|
||||
"Turntable sensitivity multiplier (1.0 is default)");
|
||||
}
|
||||
|
||||
void iidxhook9_config_io_get(
|
||||
struct iidxhook9_config_io *config_io, struct cconfig *config)
|
||||
{
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
IIDXHOOK9_CONFIG_IO_DISABLE_CARD_READER_EMU_KEY,
|
||||
&config_io->disable_card_reader_emu,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_CARD_READER_EMU_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK9_CONFIG_IO_DISABLE_CARD_READER_EMU_KEY,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_CARD_READER_EMU_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
IIDXHOOK9_CONFIG_IO_DISABLE_BIO2_EMU_KEY,
|
||||
&config_io->disable_bio2_emu,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_BIO2_EMU_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK9_CONFIG_IO_DISABLE_BIO2_EMU_KEY,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_BIO2_EMU_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
IIDXHOOK9_CONFIG_IO_DISABLE_POLL_LIMITER_KEY,
|
||||
&config_io->disable_poll_limiter,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_POLL_LIMITER_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK9_CONFIG_IO_DISABLE_POLL_LIMITER_KEY,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_POLL_LIMITER_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
IIDXHOOK9_CONFIG_IO_LIGHTNING_MODE_KEY,
|
||||
&config_io->lightning_mode,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_LIGHTNING_MODE_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK9_CONFIG_IO_LIGHTNING_MODE_KEY,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_LIGHTNING_MODE_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
IIDXHOOK9_CONFIG_IO_DISABLE_CAMS_KEY,
|
||||
&config_io->disable_cams,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_CAMS_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK9_CONFIG_IO_DISABLE_CAMS_KEY,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_CAMS_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
IIDXHOOK9_CONFIG_IO_DISABLE_FILE_HOOKS_KEY,
|
||||
&config_io->disable_file_hooks,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_FILE_HOOKS_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
IIDXHOOK9_CONFIG_IO_DISABLE_FILE_HOOKS_KEY,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_DISABLE_FILE_HOOKS_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_float(
|
||||
config,
|
||||
IIDXHOOK9_CONFIG_IO_TT_MULTIPLIER_KEY,
|
||||
&config_io->tt_multiplier,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_TT_MULTIPLIER_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%f'",
|
||||
IIDXHOOK9_CONFIG_IO_TT_MULTIPLIER_KEY,
|
||||
IIDXHOOK9_CONFIG_IO_DEFAULT_TT_MULTIPLIER_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
void iidxhook9_config_io_get2(
|
||||
const bt_core_config_t *config,
|
||||
struct iidxhook9_config_io *config_io)
|
||||
{
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#ifndef IIDXHOOK9_CONFIG_IO_H
|
||||
#define IIDXHOOK9_CONFIG_IO_H
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "cconfig/cconfig.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
struct iidxhook9_config_io {
|
||||
bool disable_card_reader_emu;
|
||||
@@ -15,12 +13,7 @@ struct iidxhook9_config_io {
|
||||
float tt_multiplier;
|
||||
};
|
||||
|
||||
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);
|
||||
|
||||
|
||||
@@ -86,14 +86,14 @@ static void _iidxhook9_io_eam_init(module_io_t **module)
|
||||
|
||||
static void load_configs(const bt_core_config_t *config)
|
||||
{
|
||||
iidxhook9_config_io_get2(config, &iidxhook9_config_io);
|
||||
iidxhook9_config_io_get(config, &iidxhook9_config_io);
|
||||
|
||||
camhook_config_cam_get2(config, &config_cam, 2, true);
|
||||
camhook_config_cam_get(config, &config_cam, 2, true);
|
||||
|
||||
d3d9exhook_config_gfx_get2(config, &config_gfx);
|
||||
d3d9exhook_config_gfx_get(config, &config_gfx);
|
||||
|
||||
hooklib_config_adapter_get2(config, &config_adapter);
|
||||
asiohook_config_asio_get2(config, &config_asio);
|
||||
hooklib_config_adapter_get(config, &config_adapter);
|
||||
asiohook_config_asio_get(config, &config_asio);
|
||||
}
|
||||
|
||||
static bool _iidxhook9_pre_avs_init(const bt_core_config_t *config)
|
||||
|
||||
Reference in New Issue
Block a user