2019-06-04 04:27:45 +02:00
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stddef.h>
|
2021-05-23 17:54:24 +02:00
|
|
|
#include <stdlib.h>
|
2019-06-04 04:27:45 +02:00
|
|
|
|
2021-05-23 17:54:24 +02:00
|
|
|
#include "board/aime-dll.h"
|
2019-06-04 04:27:45 +02:00
|
|
|
#include "board/config.h"
|
2019-11-06 01:40:00 +01:00
|
|
|
#include "board/sg-reader.h"
|
2019-06-04 04:27:45 +02:00
|
|
|
|
2021-05-23 17:54:24 +02:00
|
|
|
static void aime_dll_config_load(struct aime_dll_config *cfg, const wchar_t *filename)
|
|
|
|
{
|
|
|
|
assert(cfg != NULL);
|
|
|
|
assert(filename != NULL);
|
|
|
|
|
|
|
|
GetPrivateProfileStringW(
|
|
|
|
L"aimeio",
|
|
|
|
L"path",
|
|
|
|
L"",
|
|
|
|
cfg->path,
|
|
|
|
_countof(cfg->path),
|
|
|
|
filename);
|
|
|
|
}
|
|
|
|
|
2019-06-04 04:27:45 +02:00
|
|
|
void aime_config_load(struct aime_config *cfg, const wchar_t *filename)
|
|
|
|
{
|
|
|
|
assert(cfg != NULL);
|
|
|
|
assert(filename != NULL);
|
|
|
|
|
2021-05-23 17:54:24 +02:00
|
|
|
aime_dll_config_load(&cfg->dll, filename);
|
2019-06-04 04:27:45 +02:00
|
|
|
cfg->enable = GetPrivateProfileIntW(L"aime", L"enable", 1, filename);
|
2023-08-15 17:28:19 +02:00
|
|
|
cfg->high_baudrate = GetPrivateProfileIntW(L"aime", L"highbaud", 1, filename);
|
2023-12-03 18:45:42 +01:00
|
|
|
cfg->gen = GetPrivateProfileIntW(L"aime", L"gen", 0, filename);
|
2019-06-04 04:27:45 +02:00
|
|
|
}
|
2020-10-07 19:26:12 +02:00
|
|
|
|
|
|
|
void io4_config_load(struct io4_config *cfg, const wchar_t *filename)
|
|
|
|
{
|
|
|
|
assert(cfg != NULL);
|
|
|
|
assert(filename != NULL);
|
|
|
|
|
|
|
|
cfg->enable = GetPrivateProfileIntW(L"io4", L"enable", 1, filename);
|
|
|
|
}
|