forked from Dniel97/segatools
cxb: fixed configs
This commit is contained in:
parent
097b74d849
commit
774a639bb7
@ -23,22 +23,32 @@ void cxb_dll_config_load(
|
||||
struct cxb_dll_config *cfg,
|
||||
const wchar_t *filename)
|
||||
{
|
||||
assert(cfg != NULL);
|
||||
assert(filename != NULL);
|
||||
|
||||
GetPrivateProfileStringW(
|
||||
L"cxbio",
|
||||
L"path",
|
||||
L"",
|
||||
cfg->path,
|
||||
_countof(cfg->path),
|
||||
filename);
|
||||
}
|
||||
|
||||
void revio_config_load(struct revio_config *cfg, const wchar_t *filename)
|
||||
{
|
||||
assert(cfg != NULL);
|
||||
assert(filename != NULL);
|
||||
|
||||
}
|
||||
|
||||
void network_config_load(struct network_config *cfg, const wchar_t *filename)
|
||||
{
|
||||
|
||||
cfg->enable = GetPrivateProfileIntW(L"revio", L"enable", 1, filename);
|
||||
}
|
||||
|
||||
void led_config_load(struct led_config *cfg, const wchar_t *filename)
|
||||
{
|
||||
assert(cfg != NULL);
|
||||
assert(filename != NULL);
|
||||
|
||||
cfg->enable = GetPrivateProfileIntW(L"led", L"enable", 1, filename);
|
||||
}
|
||||
|
||||
void cxb_hook_config_load(
|
||||
@ -56,6 +66,5 @@ void cxb_hook_config_load(
|
||||
gfx_config_load(&cfg->gfx, filename);
|
||||
cxb_dll_config_load(&cfg->dll, filename);
|
||||
revio_config_load(&cfg->revio, filename);
|
||||
network_config_load(&cfg->network, filename);
|
||||
led_config_load(&cfg->led, filename);
|
||||
}
|
@ -10,7 +10,6 @@
|
||||
#include "cxbhook/cxb-dll.h"
|
||||
#include "cxbhook/revio.h"
|
||||
#include "cxbhook/led.h"
|
||||
#include "cxbhook/network.h"
|
||||
|
||||
#include "gfxhook/gfx.h"
|
||||
|
||||
@ -23,7 +22,6 @@ struct cxb_hook_config {
|
||||
struct gfx_config gfx;
|
||||
struct cxb_dll_config dll;
|
||||
struct revio_config revio;
|
||||
struct network_config network;
|
||||
struct led_config led;
|
||||
};
|
||||
|
||||
@ -32,7 +30,6 @@ void cxb_dll_config_load(
|
||||
const wchar_t *filename);
|
||||
|
||||
void revio_config_load(struct revio_config *cfg, const wchar_t *filename);
|
||||
void network_config_load(struct network_config *cfg, const wchar_t *filename);
|
||||
void led_config_load(struct led_config *cfg, const wchar_t *filename);
|
||||
|
||||
void cxb_hook_config_load(
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "cxbhook/config.h"
|
||||
#include "cxbhook/revio.h"
|
||||
#include "cxbhook/led.h"
|
||||
#include "cxbhook/network.h"
|
||||
|
||||
#include "cxbio/cxbio.h"
|
||||
|
||||
@ -103,12 +102,6 @@ static DWORD CALLBACK cxb_pre_startup(void)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
hr = network_hook_init(&cxb_hook_cfg.network);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
hr = led_hook_init(&cxb_hook_cfg.led);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
|
@ -49,7 +49,13 @@ static struct hook_symbol lamp_syms[] = {
|
||||
|
||||
HRESULT led_hook_init(struct led_config *cfg)
|
||||
{
|
||||
dprintf("LED: Init\n");
|
||||
assert(cfg != NULL);
|
||||
|
||||
if (!cfg->enable) {
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
dprintf("LED: Hook enabled.\n");
|
||||
return proc_addr_table_push("CommLamp.dll", lamp_syms, _countof(lamp_syms));
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,5 @@ shared_library(
|
||||
'revio.h',
|
||||
'led.c',
|
||||
'led.h',
|
||||
'network.c',
|
||||
'network.h',
|
||||
],
|
||||
)
|
||||
|
@ -1,13 +0,0 @@
|
||||
#include <windows.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "cxbhook/network.h"
|
||||
|
||||
#include "util/dprintf.h"
|
||||
|
||||
HRESULT network_hook_init(struct network_config *cfg)
|
||||
{
|
||||
dprintf("Network: Init\n");
|
||||
return S_OK;
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
struct network_config {
|
||||
bool enable;
|
||||
bool disable_ssl;
|
||||
char title_server[PATH_MAX];
|
||||
};
|
||||
|
||||
HRESULT network_hook_init(struct network_config *cfg);
|
@ -82,7 +82,13 @@ static struct hook_symbol revio_syms[] = {
|
||||
|
||||
HRESULT revio_hook_init(struct revio_config *cfg)
|
||||
{
|
||||
dprintf("Revio: Init\n");
|
||||
assert(cfg != NULL);
|
||||
|
||||
if (!cfg->enable) {
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
dprintf("Revio: Hook enabled.\n");
|
||||
return proc_addr_table_push("CommIo.dll", revio_syms, _countof(revio_syms));
|
||||
}
|
||||
|
||||
|
2
dist/cxb/segatools.ini
vendored
2
dist/cxb/segatools.ini
vendored
@ -110,7 +110,7 @@ path=
|
||||
|
||||
[revio]
|
||||
; Enable emulation of the rev IO board
|
||||
enabe=1
|
||||
enable=1
|
||||
; Test button virtual-key code. Default is the F1 key.
|
||||
test=0x70
|
||||
; Service button virtual-key code. Default is the F2 key.
|
||||
|
@ -82,7 +82,7 @@ HRESULT dns_platform_hook_init(const struct dns_config *cfg)
|
||||
return hr;
|
||||
}
|
||||
|
||||
// croosbeats REV.
|
||||
// crossbeats REV.
|
||||
hr = dns_hook_push(L"https://rev-ent.ac.capcom.jp:443", cfg->title);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
|
Loading…
Reference in New Issue
Block a user