segatools2/cxbhook/config.c

70 lines
1.5 KiB
C
Raw Normal View History

2022-12-11 22:01:51 +00:00
#include <windows.h>
#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
#include "amex/amex.h"
#include "amex/config.h"
#include "board/config.h"
#include "board/sg-reader.h"
#include "cxbhook/config.h"
#include "gfxhook/config.h"
#include "hooklib/config.h"
#include "platform/config.h"
#include "platform/platform.h"
void cxb_dll_config_load(
struct cxb_dll_config *cfg,
const wchar_t *filename)
{
2024-03-13 23:14:51 +00:00
assert(cfg != NULL);
assert(filename != NULL);
2022-12-11 22:01:51 +00:00
2024-03-13 23:14:51 +00:00
GetPrivateProfileStringW(
L"cxbio",
L"path",
L"",
cfg->path,
_countof(cfg->path),
filename);
2022-12-11 22:01:51 +00:00
}
void revio_config_load(struct revio_config *cfg, const wchar_t *filename)
{
2024-03-13 23:14:51 +00:00
assert(cfg != NULL);
assert(filename != NULL);
2022-12-11 22:01:51 +00:00
2024-03-13 23:14:51 +00:00
cfg->enable = GetPrivateProfileIntW(L"revio", L"enable", 1, filename);
2022-12-11 22:01:51 +00:00
}
void led_config_load(struct led_config *cfg, const wchar_t *filename)
{
2024-03-13 23:14:51 +00:00
assert(cfg != NULL);
assert(filename != NULL);
2022-12-11 22:01:51 +00:00
2024-03-13 23:14:51 +00:00
cfg->enable = GetPrivateProfileIntW(L"led", L"enable", 1, filename);
2022-12-11 22:01:51 +00:00
}
void cxb_hook_config_load(
struct cxb_hook_config *cfg,
const wchar_t *filename)
{
assert(cfg != NULL);
assert(filename != NULL);
memset(cfg, 0, sizeof(*cfg));
platform_config_load(&cfg->platform, filename);
amex_config_load(&cfg->amex, filename);
aime_config_load(&cfg->aime, filename);
gfx_config_load(&cfg->gfx, filename);
cxb_dll_config_load(&cfg->dll, filename);
revio_config_load(&cfg->revio, filename);
led_config_load(&cfg->led, filename);
}