diff --git a/platform/config.c b/platform/config.c index 7064d8b..4bce134 100644 --- a/platform/config.c +++ b/platform/config.c @@ -276,6 +276,7 @@ void syscfg_config_load(struct syscfg_config *cfg, const wchar_t *filename) { cfg->enable = GetPrivateProfileIntW(L"syscfg", L"enable", 1, filename); cfg->log_level = GetPrivateProfileIntW(L"syscfg", L"log_level", 1, filename); + cfg->country = GetPrivateProfileIntW(L"syscfg", L"country", 0, filename); } void vfs_config_load(struct vfs_config *cfg, const wchar_t *filename) diff --git a/platform/syscfg.c b/platform/syscfg.c index 4d73eeb..337ed7a 100644 --- a/platform/syscfg.c +++ b/platform/syscfg.c @@ -20,6 +20,7 @@ static HRESULT syscfg_log_level(void *bytes, uint32_t *nbytes); static HRESULT syscfg_news_path(void *bytes, uint32_t *nbytes); static HRESULT syscfg_event_path(void *bytes, uint32_t *nbytes); static HRESULT syscfg_log_path(void *bytes, uint32_t *nbytes); +static HRESULT syscfg_country(void *bytes, uint32_t *nbytes); static const struct reg_hook_val fake_com_keys[] = { { @@ -54,7 +55,11 @@ static const struct reg_hook_val fake_com_keys[] = { .name = L"LogPath", .read = syscfg_log_path, .type = REG_SZ, - }, + },{ + .name = L"Country", + .read = syscfg_country, + .type = REG_SZ, + } }; HRESULT syscfg_hook_init(const struct syscfg_config *cfg, const uint32_t gid) @@ -116,3 +121,11 @@ static HRESULT syscfg_log_path(void *bytes, uint32_t *nbytes) { return reg_hook_read_wstr(bytes, nbytes, L"D:\\"); } + +static HRESULT syscfg_country(void *bytes, uint32_t *nbytes) +{ + // 0x00000000 jp + // 0x00000001 cn + // 0x00000002 hk (english) + return reg_hook_read_u32(bytes, nbytes, config.country); +} \ No newline at end of file diff --git a/platform/syscfg.h b/platform/syscfg.h index abb3447..8be7823 100644 --- a/platform/syscfg.h +++ b/platform/syscfg.h @@ -7,6 +7,7 @@ struct syscfg_config { bool enable; uint32_t log_level; + uint32_t country; }; HRESULT syscfg_hook_init(const struct syscfg_config *cfg, const uint32_t gid);