forked from TeamTofuShop/segatools
Improve JVS bus life cycle handling
This commit is contained in:
@ -39,12 +39,7 @@ static DWORD CALLBACK idz_pre_startup(void)
|
||||
/* Initialize emulation hooks */
|
||||
|
||||
platform_hook_init(&idz_hook_cfg.platform, "SDDF", "AAV2", idz_hook_mod);
|
||||
amex_hook_init(&idz_hook_cfg.amex);
|
||||
|
||||
if (idz_hook_cfg.amex.jvs.enable) {
|
||||
idz_jvs_init();
|
||||
}
|
||||
|
||||
amex_hook_init(&idz_hook_cfg.amex, idz_jvs_init);
|
||||
sg_reader_hook_init(&idz_hook_cfg.aime, 10);
|
||||
|
||||
/* Initialize debug helpers */
|
||||
|
@ -51,18 +51,23 @@ static const uint16_t idz_jvs_gear_signals[] = {
|
||||
|
||||
static struct io3 idz_jvs_io3;
|
||||
|
||||
HRESULT idz_jvs_init(void)
|
||||
HRESULT idz_jvs_init(struct jvs_node **out)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
hr = idz_io_init();
|
||||
assert(out != NULL);
|
||||
|
||||
dprintf("JVS I/O: Starting Initial D Zero backend DLL\n");
|
||||
hr = idz_io_jvs_init();
|
||||
|
||||
if (FAILED(hr)) {
|
||||
dprintf("JVS I/O: Backend error, I/O disconnected; %x\n", (int) hr);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
io3_init(&idz_jvs_io3, NULL, &idz_jvs_io3_ops, NULL);
|
||||
jvs_attach(&idz_jvs_io3.jvs);
|
||||
*out = io3_to_jvs_node(&idz_jvs_io3);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -2,4 +2,6 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
HRESULT idz_jvs_init(void);
|
||||
#include "jvs/jvs-bus.h"
|
||||
|
||||
HRESULT idz_jvs_init(struct jvs_node **root);
|
||||
|
Reference in New Issue
Block a user