2021-12-21 05:02:17 +00:00
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "mercuryio/config.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
Wacca Default key binding
|
2022-01-08 07:25:42 +00:00
|
|
|
Inner left
|
|
|
|
Inner right
|
|
|
|
2nd inner left
|
|
|
|
2nd inner right
|
|
|
|
3rd inner left
|
|
|
|
3rd inner right
|
|
|
|
outer left
|
|
|
|
outer right
|
2021-12-21 05:02:17 +00:00
|
|
|
*/
|
|
|
|
|
2022-01-08 07:25:42 +00:00
|
|
|
static const int mercury_io_default_cells[] = {
|
|
|
|
'1','1','1','2','2','2','3','3','3','4','4','4','5','5','5','6','6','6','7','7','7','8','8','8','9','9','9','0','0','0',
|
|
|
|
'A','A','A','S','S','S','D','D','D','F','F','F','G','G','G','H','H','H','J','J','J','K','K','K','L','L','L',';',';',';',
|
|
|
|
'1','1','1','2','2','2','3','3','3','4','4','4','5','5','5','6','6','6','7','7','7','8','8','8','9','9','9','0','0','0',
|
|
|
|
'A','A','A','S','S','S','D','D','D','F','F','F','G','G','G','H','H','H','J','J','J','K','K','K','L','L','L',';',';',';',
|
|
|
|
'Q','Q','Q','W','W','W','E','E','E','R','R','R','T','T','T','Y','Y','Y','U','U','U','I','I','I','O','O','O','P','P','P',
|
|
|
|
'Z','Z','Z','X','X','X','C','C','C','V','V','V','B','B','B','N','N','N','M','M','M',',',',',',','.','.','.','/','/','/',
|
|
|
|
'Q','Q','Q','W','W','W','E','E','E','R','R','R','T','T','T','Y','Y','Y','U','U','U','I','I','I','O','O','O','P','P','P',
|
|
|
|
'Z','Z','Z','X','X','X','C','C','C','V','V','V','B','B','B','N','N','N','M','M','M',',',',',',','.','.','.','/','/','/',
|
|
|
|
};
|
|
|
|
|
2021-12-21 05:02:17 +00:00
|
|
|
void mercury_io_config_load(
|
|
|
|
struct mercury_io_config *cfg,
|
|
|
|
const wchar_t *filename)
|
|
|
|
{
|
2022-01-08 07:25:42 +00:00
|
|
|
wchar_t key[240];
|
|
|
|
int i;
|
|
|
|
|
2021-12-21 05:02:17 +00:00
|
|
|
assert(cfg != NULL);
|
|
|
|
assert(filename != NULL);
|
|
|
|
|
2022-01-08 07:25:42 +00:00
|
|
|
cfg->vk_test = GetPrivateProfileIntW(L"io4", L"test", 0x2D, filename);
|
|
|
|
cfg->vk_service = GetPrivateProfileIntW(L"io4", L"service", 0x2E, filename);
|
|
|
|
cfg->vk_vol_up = GetPrivateProfileIntW(L"io4", L"volup", 0x24, filename);
|
|
|
|
cfg->vk_vol_down = GetPrivateProfileIntW(L"io4", L"voldown", 0x23, filename);
|
|
|
|
|
|
|
|
for (i = 0 ; i < 240 ; i++) {
|
|
|
|
swprintf_s(key, _countof(key), L"cell%i", i + 1);
|
|
|
|
cfg->vk_cell[i] = GetPrivateProfileIntW(
|
|
|
|
L"touch",
|
|
|
|
key,
|
|
|
|
mercury_io_default_cells[i],
|
|
|
|
filename);
|
|
|
|
}
|
2021-12-21 05:02:17 +00:00
|
|
|
}
|