From e16f151b7c6ba3cc1028295b206b4de4101a9583 Mon Sep 17 00:00:00 2001 From: Jeffrey Paine Date: Sat, 8 Apr 2023 22:13:10 -0400 Subject: [PATCH 01/15] Update cam.c The user can now set a custom camera device override of "SKIP" to leave that camera unassigned --- src/main/camhook/cam.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/camhook/cam.c b/src/main/camhook/cam.c index 19978e8..c8ea928 100644 --- a/src/main/camhook/cam.c +++ b/src/main/camhook/cam.c @@ -706,6 +706,11 @@ void fill_cam_struct(struct CameraData *data, const char *devid) // Device instance path strcpy(data->deviceInstancePath, devid); // continue + } else if (check_four(devid, "SKIP")) { + // User wants to leave this camera unassigned + num_addressed_cams++; + num_located_cams++; + return; } else { // UNKNOWN ENTRY log_info("UNK: %s", devid); -- 2.54.0 From 175f3962cbd0cdf872c68d88d0c504a97e25e6ef Mon Sep 17 00:00:00 2001 From: Jeffrey Paine Date: Sat, 8 Apr 2023 22:15:16 -0400 Subject: [PATCH 02/15] Update iidxhook-25.conf Added instructions on the new SKIP feature for cameras --- dist/iidx/iidxhook-25.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/iidx/iidxhook-25.conf b/dist/iidx/iidxhook-25.conf index 61a05c9..500c3a5 100644 --- a/dist/iidx/iidxhook-25.conf +++ b/dist/iidx/iidxhook-25.conf @@ -37,10 +37,10 @@ gfx.device_adapter=-1 # Disables the camera emulation cam.disable_emu=false -# Override camera device ID 1 detection (copy from device manager, do not escape) +# Override camera device ID 1 detection (copy from device manager, do not escape) Leave blank to automatically detect, or set to SKIP (case sensitive) to leave this camera unassigned cam.device_id1= -# Override camera device ID 2 detection (copy from device manager, do not escape) +# Override camera device ID 2 detection (copy from device manager, do not escape) Leave blank to automatically detect, or set to SKIP (case sensitive) to leave this camera unassigned cam.device_id2= # Disable card reader emulation and enable usage of real card reader hardware on COM1 (for games supporting slotted readers) @@ -50,4 +50,4 @@ io.disable_card_reader_emu=false io.disable_bio2_emu=false # Disables the poll limiter, warning very high CPU usage may arise -io.disable_poll_limiter=false \ No newline at end of file +io.disable_poll_limiter=false -- 2.54.0 From 72fde55159f9cf51da01ff859b950c36f6703b4b Mon Sep 17 00:00:00 2001 From: Jeffrey Paine Date: Sat, 8 Apr 2023 22:16:10 -0400 Subject: [PATCH 03/15] Update iidxhook-26.conf Add info on new SKIP feature for cameras --- dist/iidx/iidxhook-26.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/iidx/iidxhook-26.conf b/dist/iidx/iidxhook-26.conf index 61a05c9..500c3a5 100644 --- a/dist/iidx/iidxhook-26.conf +++ b/dist/iidx/iidxhook-26.conf @@ -37,10 +37,10 @@ gfx.device_adapter=-1 # Disables the camera emulation cam.disable_emu=false -# Override camera device ID 1 detection (copy from device manager, do not escape) +# Override camera device ID 1 detection (copy from device manager, do not escape) Leave blank to automatically detect, or set to SKIP (case sensitive) to leave this camera unassigned cam.device_id1= -# Override camera device ID 2 detection (copy from device manager, do not escape) +# Override camera device ID 2 detection (copy from device manager, do not escape) Leave blank to automatically detect, or set to SKIP (case sensitive) to leave this camera unassigned cam.device_id2= # Disable card reader emulation and enable usage of real card reader hardware on COM1 (for games supporting slotted readers) @@ -50,4 +50,4 @@ io.disable_card_reader_emu=false io.disable_bio2_emu=false # Disables the poll limiter, warning very high CPU usage may arise -io.disable_poll_limiter=false \ No newline at end of file +io.disable_poll_limiter=false -- 2.54.0 From e49f55dfdae8d4be5ad64e6a3da3babdedc45369 Mon Sep 17 00:00:00 2001 From: Jeffrey Paine Date: Mon, 10 Apr 2023 15:02:58 -0400 Subject: [PATCH 04/15] camhook: Add disable_camera options Allow users to manually disable specific cameras --- src/main/camhook/config-cam.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/camhook/config-cam.h b/src/main/camhook/config-cam.h index f329108..893a20b 100644 --- a/src/main/camhook/config-cam.h +++ b/src/main/camhook/config-cam.h @@ -11,6 +11,7 @@ struct camhook_config_cam { bool disable_emu; size_t num_devices; char device_id[CAMHOOK_CONFIG_CAM_MAX][MAX_PATH]; + bool disable_camera[CAMHOOK_CONFIG_CAM_MAX]; }; void camhook_config_cam_init(struct cconfig *config, size_t num_cams); -- 2.54.0 From 1d1a9a3bfe19e419dd894bc2ed1d57f147e62213 Mon Sep 17 00:00:00 2001 From: Jeffrey Paine Date: Mon, 10 Apr 2023 15:03:51 -0400 Subject: [PATCH 05/15] camhook: Add disable_camera options Allow users to manually disable specific cameras --- src/main/camhook/cam.c | 16 ++++++++----- src/main/camhook/config-cam.c | 44 ++++++++++++++++++++++++++++------- 2 files changed, 45 insertions(+), 15 deletions(-) diff --git a/src/main/camhook/cam.c b/src/main/camhook/cam.c index c8ea928..f368721 100644 --- a/src/main/camhook/cam.c +++ b/src/main/camhook/cam.c @@ -706,11 +706,6 @@ void fill_cam_struct(struct CameraData *data, const char *devid) // Device instance path strcpy(data->deviceInstancePath, devid); // continue - } else if (check_four(devid, "SKIP")) { - // User wants to leave this camera unassigned - num_addressed_cams++; - num_located_cams++; - return; } else { // UNKNOWN ENTRY log_info("UNK: %s", devid); @@ -813,6 +808,14 @@ void camhook_init(struct camhook_config_cam *config_cam) // fill before applying hooks for (size_t i = 0; i < config_cam->num_devices; ++i) { + // Check if this camera is disabled first + if (config_cam->disable_camera[i]) { + // If so, pretend this camera is already assigned and move on + num_addressed_cams++; + num_located_cams++; + continue; + } + // If not, try to hook the camera fill_cam_struct(&camData[i], config_cam->device_id[i]); } @@ -834,7 +837,8 @@ void camhook_init(struct camhook_config_cam *config_cam) NULL, "Mf.dll", camhook_mf_syms, lengthof(camhook_mf_syms)); log_info("Inserted cam hooks for %d cams", (int) num_setup); - } else { + // If the user has manually disabled all cams, don't print this in the log + } else if (num_addressed_cams != config_cam->num_devices) { log_info("No cams detected, not hooking"); } } diff --git a/src/main/camhook/config-cam.c b/src/main/camhook/config-cam.c index e905f0b..05ed8de 100644 --- a/src/main/camhook/config-cam.c +++ b/src/main/camhook/config-cam.c @@ -7,8 +7,18 @@ #define CAMHOOK_CONFIG_CAM_DISABLE_EMU_KEY "cam.disable_emu" #define CAMHOOK_CONFIG_CAM_DEFAULT_DISABLE_EMU_VALUE false -// the following two arrays are based on CAMHOOK_CONFIG_CAM_MAX +// 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", @@ -28,6 +38,11 @@ void camhook_config_cam_init(struct cconfig *config, size_t num_cams) "Disables the camera emulation"); 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], @@ -56,17 +71,28 @@ void camhook_config_cam_get( CAMHOOK_CONFIG_CAM_DEFAULT_DISABLE_EMU_VALUE); } for (size_t i = 0; i < num_cams; ++i) { - if (!cconfig_util_get_str( + if (!cconfig_util_get_bool( 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])) { + 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 '%s'", - camhook_config_device_id_keys[i], - camhook_config_device_default_values[i]); + "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]); } } } -- 2.54.0 From aaef197a0b0114029e7f566048ae51dff80bf26d Mon Sep 17 00:00:00 2001 From: Jeffrey Paine Date: Mon, 10 Apr 2023 15:07:49 -0400 Subject: [PATCH 06/15] iidx25/26 - Add cam.disable_camera options to config files --- dist/iidx/iidxhook-25.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dist/iidx/iidxhook-25.conf b/dist/iidx/iidxhook-25.conf index 500c3a5..08343f1 100644 --- a/dist/iidx/iidxhook-25.conf +++ b/dist/iidx/iidxhook-25.conf @@ -37,6 +37,12 @@ gfx.device_adapter=-1 # Disables the camera emulation cam.disable_emu=false +# 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 1 detection (copy from device manager, do not escape) Leave blank to automatically detect, or set to SKIP (case sensitive) to leave this camera unassigned cam.device_id1= -- 2.54.0 From 3385e0697534789bec14d5f07cf1cd3c0aa17562 Mon Sep 17 00:00:00 2001 From: Jeffrey Paine Date: Mon, 10 Apr 2023 15:08:24 -0400 Subject: [PATCH 07/15] iidx25/26 - Add cam.disable_camera options to config files --- dist/iidx/iidxhook-26.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dist/iidx/iidxhook-26.conf b/dist/iidx/iidxhook-26.conf index 500c3a5..985f346 100644 --- a/dist/iidx/iidxhook-26.conf +++ b/dist/iidx/iidxhook-26.conf @@ -37,6 +37,12 @@ gfx.device_adapter=-1 # Disables the camera emulation cam.disable_emu=false +# 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 1 detection (copy from device manager, do not escape) Leave blank to automatically detect, or set to SKIP (case sensitive) to leave this camera unassigned cam.device_id1= -- 2.54.0 From e1b35ac031eeb44e3bc47fed9dbdbea3b8c4b232 Mon Sep 17 00:00:00 2001 From: Jeffrey Paine Date: Mon, 10 Apr 2023 15:10:37 -0400 Subject: [PATCH 08/15] iidx27 - Add cam.disable_cam options and align cam.disable_emu with 28/29 --- dist/iidx/iidxhook-27.conf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dist/iidx/iidxhook-27.conf b/dist/iidx/iidxhook-27.conf index b977db9..62e879c 100644 --- a/dist/iidx/iidxhook-27.conf +++ b/dist/iidx/iidxhook-27.conf @@ -20,7 +20,13 @@ io.disable_file_hooks=false io.tt_multiplier=1.0 # Disables the camera emulation -cam.disable_emu=false +cam.disable_emu=true + +# 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= -- 2.54.0 From dee6056b67a92e7a96c94a268806535bade6a92e Mon Sep 17 00:00:00 2001 From: Jeffrey Paine Date: Mon, 10 Apr 2023 15:11:35 -0400 Subject: [PATCH 09/15] iidx26 - Fix cam.disable_camera1 default --- dist/iidx/iidxhook-26.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/iidx/iidxhook-26.conf b/dist/iidx/iidxhook-26.conf index 985f346..08343f1 100644 --- a/dist/iidx/iidxhook-26.conf +++ b/dist/iidx/iidxhook-26.conf @@ -38,7 +38,7 @@ gfx.device_adapter=-1 cam.disable_emu=false # 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 +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 -- 2.54.0 From a035e45c3ac39d774aa86f495c3e466b93c9cedc Mon Sep 17 00:00:00 2001 From: Jeffrey Paine Date: Mon, 10 Apr 2023 15:12:19 -0400 Subject: [PATCH 10/15] iidx28/29 - Add cam.disable_camera options to config files --- dist/iidx/iidxhook-28.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dist/iidx/iidxhook-28.conf b/dist/iidx/iidxhook-28.conf index 3154052..62e879c 100644 --- a/dist/iidx/iidxhook-28.conf +++ b/dist/iidx/iidxhook-28.conf @@ -22,6 +22,12 @@ io.tt_multiplier=1.0 # Disables the camera emulation cam.disable_emu=true +# 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= -- 2.54.0 From 4e3037a51c400839becadb6043a83efdc4de1e65 Mon Sep 17 00:00:00 2001 From: Jeffrey Paine Date: Mon, 10 Apr 2023 15:13:11 -0400 Subject: [PATCH 11/15] iidx28/29 - Add cam.disable_camera options to config files --- dist/iidx/iidxhook-29.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dist/iidx/iidxhook-29.conf b/dist/iidx/iidxhook-29.conf index 3154052..eb7e6bc 100644 --- a/dist/iidx/iidxhook-29.conf +++ b/dist/iidx/iidxhook-29.conf @@ -22,6 +22,12 @@ io.tt_multiplier=1.0 # Disables the camera emulation cam.disable_emu=true +# 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= -- 2.54.0 From a296a09dec13f13cf89c1ac344a0de12ec160ee1 Mon Sep 17 00:00:00 2001 From: Jeffrey Paine Date: Mon, 10 Apr 2023 15:42:05 -0400 Subject: [PATCH 12/15] iidx25-29 - Fix settings description in config files Co-authored-by: icex2 --- dist/iidx/iidxhook-25.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/iidx/iidxhook-25.conf b/dist/iidx/iidxhook-25.conf index 08343f1..1cb5f95 100644 --- a/dist/iidx/iidxhook-25.conf +++ b/dist/iidx/iidxhook-25.conf @@ -43,7 +43,7 @@ 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 1 detection (copy from device manager, do not escape) Leave blank to automatically detect, or set to SKIP (case sensitive) to leave this camera unassigned +# Override camera device ID 1 detection (copy from device manager, do not escape) Leave blank to automatically detect cam.device_id1= # Override camera device ID 2 detection (copy from device manager, do not escape) Leave blank to automatically detect, or set to SKIP (case sensitive) to leave this camera unassigned -- 2.54.0 From 9c338a0db642446e3b60437e239bc671869cad55 Mon Sep 17 00:00:00 2001 From: Jeffrey Paine Date: Mon, 10 Apr 2023 15:42:35 -0400 Subject: [PATCH 13/15] iidx25-29 - Fix settings description in config files Co-authored-by: icex2 --- dist/iidx/iidxhook-25.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/iidx/iidxhook-25.conf b/dist/iidx/iidxhook-25.conf index 1cb5f95..5ba9b8a 100644 --- a/dist/iidx/iidxhook-25.conf +++ b/dist/iidx/iidxhook-25.conf @@ -46,7 +46,7 @@ cam.disable_camera2=false # Override camera device ID 1 detection (copy from device manager, do not escape) Leave blank to automatically detect cam.device_id1= -# Override camera device ID 2 detection (copy from device manager, do not escape) Leave blank to automatically detect, or set to SKIP (case sensitive) to leave this camera unassigned +# Override camera device ID 2 detection (copy from device manager, do not escape) Leave blank to automatically detect cam.device_id2= # Disable card reader emulation and enable usage of real card reader hardware on COM1 (for games supporting slotted readers) -- 2.54.0 From 05e6beef3c0f3a22fa7738b2ea33a1dca89e85c8 Mon Sep 17 00:00:00 2001 From: Jeffrey Paine Date: Mon, 10 Apr 2023 15:42:43 -0400 Subject: [PATCH 14/15] iidx25-29 - Fix settings description in config files Co-authored-by: icex2 --- dist/iidx/iidxhook-26.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/iidx/iidxhook-26.conf b/dist/iidx/iidxhook-26.conf index 08343f1..1cb5f95 100644 --- a/dist/iidx/iidxhook-26.conf +++ b/dist/iidx/iidxhook-26.conf @@ -43,7 +43,7 @@ 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 1 detection (copy from device manager, do not escape) Leave blank to automatically detect, or set to SKIP (case sensitive) to leave this camera unassigned +# Override camera device ID 1 detection (copy from device manager, do not escape) Leave blank to automatically detect cam.device_id1= # Override camera device ID 2 detection (copy from device manager, do not escape) Leave blank to automatically detect, or set to SKIP (case sensitive) to leave this camera unassigned -- 2.54.0 From b5d7874cdcb471b5f5fbdf447f99b19da51bd142 Mon Sep 17 00:00:00 2001 From: Jeffrey Paine Date: Mon, 10 Apr 2023 15:43:00 -0400 Subject: [PATCH 15/15] iidx25-29 - Fix settings description in config files Co-authored-by: icex2 --- dist/iidx/iidxhook-26.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/iidx/iidxhook-26.conf b/dist/iidx/iidxhook-26.conf index 1cb5f95..5ba9b8a 100644 --- a/dist/iidx/iidxhook-26.conf +++ b/dist/iidx/iidxhook-26.conf @@ -46,7 +46,7 @@ cam.disable_camera2=false # Override camera device ID 1 detection (copy from device manager, do not escape) Leave blank to automatically detect cam.device_id1= -# Override camera device ID 2 detection (copy from device manager, do not escape) Leave blank to automatically detect, or set to SKIP (case sensitive) to leave this camera unassigned +# Override camera device ID 2 detection (copy from device manager, do not escape) Leave blank to automatically detect cam.device_id2= # Disable card reader emulation and enable usage of real card reader hardware on COM1 (for games supporting slotted readers) -- 2.54.0