taitools/sivaio/config.c

30 lines
1.5 KiB
C
Raw Permalink Normal View History

2024-02-11 04:38:24 +00:00
#include <windows.h>
#include <assert.h>
#include <stddef.h>
#include <stdio.h>
#include "sivaio/config.h"
void siva_io_config_load(struct siva_input_config *cfg, const wchar_t *filename)
{
cfg->test = GetPrivateProfileIntW(L"jvs", L"test", VK_HOME, filename);
cfg->service = GetPrivateProfileIntW(L"jvs", L"service", VK_DELETE, filename);
cfg->coin = GetPrivateProfileIntW(L"jvs", L"coin", VK_INSERT, filename);
cfg->is_xinput = GetPrivateProfileIntW(L"deck", L"deck", 0, filename);
cfg->xinput_player = GetPrivateProfileIntW(L"deck", L"controller_num", 0, filename);
cfg->btn_l = GetPrivateProfileIntW(L"deck", L"left_button", 'C', filename);
cfg->btn_r = GetPrivateProfileIntW(L"deck", L"right_button", 'N', filename);
cfg->stick_l_up = GetPrivateProfileIntW(L"deck", L"left_stick_up", 'W', filename);
cfg->stick_l_right = GetPrivateProfileIntW(L"deck", L"left_stick_right", 'D', filename);
cfg->stick_l_down = GetPrivateProfileIntW(L"deck", L"left_stick_down", 'S', filename);
cfg->stick_l_left = GetPrivateProfileIntW(L"deck", L"left_stick_left", 'A', filename);
cfg->stick_r_up = GetPrivateProfileIntW(L"deck", L"right_stick_up", 'I', filename);
cfg->stick_r_right = GetPrivateProfileIntW(L"deck", L"right_stick_right", 'L', filename);
cfg->stick_r_down = GetPrivateProfileIntW(L"deck", L"right_stick_down", 'K', filename);
cfg->stick_r_left = GetPrivateProfileIntW(L"deck", L"right_stick_left", 'J', filename);
}