mirror of
https://github.com/djhackersdev/bemanitools.git
synced 2026-09-09 08:55:09 -05:00
iidxhook-util: Add config for io stuff
Switches to disable card reader and IO emulation
This commit is contained in:
56
src/main/iidxhook-util/config-io.c
Normal file
56
src/main/iidxhook-util/config-io.c
Normal file
@@ -0,0 +1,56 @@
|
||||
#include "cconfig/cconfig-util.h"
|
||||
|
||||
#include "iidxhook-util/config-io.h"
|
||||
|
||||
#include "util/log.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);
|
||||
}
|
||||
}
|
||||
18
src/main/iidxhook-util/config-io.h
Normal file
18
src/main/iidxhook-util/config-io.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef IIDXHOOK_UTIL_CONFIG_IO_H
|
||||
#define IIDXHOOK_UTIL_CONFIG_IO_H
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "cconfig/cconfig.h"
|
||||
|
||||
struct iidxhook_config_io {
|
||||
bool disable_card_reader_emu;
|
||||
bool disable_io_emu;
|
||||
};
|
||||
|
||||
void iidxhook_config_io_init(struct cconfig *config);
|
||||
|
||||
void iidxhook_config_io_get(
|
||||
struct iidxhook_config_io *config_io, struct cconfig *config);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user