segatools2/hkbio/config.c

32 lines
1.1 KiB
C

#include <windows.h>
#include <assert.h>
#include <stddef.h>
#include <stdio.h>
#include "hkbio/config.h"
void hkb_io_config_load(
struct hkb_io_config *cfg,
const wchar_t *filename)
{
wchar_t key[240];
int i;
assert(cfg != NULL);
assert(filename != NULL);
cfg->vk_test = GetPrivateProfileIntW(L"io4", L"test", '1', filename);
cfg->vk_service = GetPrivateProfileIntW(L"io4", L"service", '2', filename);
cfg->vk_coin = GetPrivateProfileIntW(L"io4", L"coin", '3', filename);
cfg->vk_up = GetPrivateProfileIntW(L"io4", L"up", VK_UP, filename);
cfg->vk_down = GetPrivateProfileIntW(L"io4", L"down", VK_DOWN, filename);
cfg->vk_left = GetPrivateProfileIntW(L"io4", L"left", VK_LEFT, filename);
cfg->vk_right = GetPrivateProfileIntW(L"io4", L"right", VK_RIGHT, filename);
cfg->vk_enter = GetPrivateProfileIntW(L"io4", L"enter", VK_SPACE, filename);
cfg->vk_cancel = GetPrivateProfileIntW(L"io4", L"cancel", VK_LSHIFT, filename);
cfg->vk_arr_right = GetPrivateProfileIntW(L"io4", L"right_arrow", 'A', filename);
cfg->vk_arr_left = GetPrivateProfileIntW(L"io4", L"left_arrow", 'D', filename);
}