bio2emu: Remove requirement for bio2emu_init_end to be called

Instead bio2emu_setupapi_hook_init is called during init, this is safe because the game's IO thread isn't initialized at this point, and nothing could be attempting to open devices at this point in time.
This commit is contained in:
Will Xyen
2019-10-12 14:15:28 -04:00
parent b6216c696e
commit 1c415eb207
3 changed files with 5 additions and 13 deletions

View File

@@ -28,13 +28,9 @@
static struct array bio2_active_ports;
void bio2emu_init_start()
void bio2emu_init()
{
array_init(&bio2_active_ports);
}
void bio2emu_init_end()
{
bio2emu_setupapi_hook_init(&bio2_active_ports);
}

View File

@@ -1,5 +1,5 @@
#ifndef BIO2EMU_H
#define BIO2EMU_BIO2EMU_H
#ifndef BIO2EMU_EMU_H
#define BIO2EMU_EMU_H
#include "hook/iohook.h"
#include "acioemu/emu.h"
@@ -17,8 +17,7 @@ struct bio2emu_port {
};
void bio2emu_init_start();
void bio2emu_init_end();
void bio2emu_init();
void bio2emu_port_init(struct bio2emu_port* bio2emu_emu);
void bio2emu_port_fini(struct bio2emu_port* bio2emu_emu);

View File

@@ -149,11 +149,8 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
rs232_hook_limit_hooks();
if (!iidxhook8_config_io.disable_bio2_emu) {
bio2emu_init_start();
bio2emu_init();
bio2_emu_bi2a_init(&bio2_emu, iidxhook8_config_io.disable_poll_limiter);
bio2emu_init_end();
}
if (!iidxhook8_config_io.disable_card_reader_emu) {