1
0
mirror of https://github.com/djhackersdev/bemanitools.git synced 2024-11-24 14:50:10 +01:00

iidxhook-util: allow setting specified ICCA emulation version

This commit is contained in:
Will Xyen 2020-08-02 23:03:04 -07:00 committed by adfe3beeadc615e0fa48b493761cc42aae47d399
parent bfbb7103ef
commit f028bdeb20
2 changed files with 23 additions and 0 deletions

View File

@ -30,6 +30,16 @@
static struct ac_io_emu iidxhook_util_acio_emu;
static struct ac_io_emu_icca iidxhook_util_acio_emu_icca[2];
static bool iidxhook_util_icca_override_version;
static enum ac_io_emu_icca_version iidxhook_util_icca_override_version_value;
void iidxhook_util_acio_override_version(enum ac_io_emu_icca_version version)
{
iidxhook_util_icca_override_version = true;
iidxhook_util_icca_override_version_value = version;
}
void iidxhook_util_acio_init(bool legacy_mode)
{
uint8_t i;
@ -43,6 +53,12 @@ void iidxhook_util_acio_init(bool legacy_mode)
for (i = 0; i < lengthof(iidxhook_util_acio_emu_icca); i++) {
ac_io_emu_icca_init(
&iidxhook_util_acio_emu_icca[i], &iidxhook_util_acio_emu, i);
if (iidxhook_util_icca_override_version) {
ac_io_emu_icca_set_version(
&iidxhook_util_acio_emu_icca[i],
iidxhook_util_icca_override_version_value
);
}
}
rs232_hook_add_fd(iidxhook_util_acio_emu.fd);

View File

@ -5,6 +5,7 @@
#include <stdbool.h>
#include "acioemu/icca.h"
#include "hook/iohook.h"
/**
@ -19,6 +20,12 @@
*/
void iidxhook_util_acio_init(bool legacy_mode);
/**
* Use the specified ICCA emulation version
*/
void iidxhook_util_acio_override_version(enum ac_io_emu_icca_version version);
/**
* Cleanup the ACIO emulation layer.
*/