platform: make billing type configurable

This commit is contained in:
2022-12-10 23:21:54 -05:00
parent 8f0d21200a
commit dce5bbe66d
4 changed files with 19 additions and 2 deletions

View File

@ -222,6 +222,7 @@ void nusec_config_load(struct nusec_config *cfg, const wchar_t *filename)
filename);
cfg->region = GetPrivateProfileIntW(L"keychip", L"region", 1, filename);
cfg->region = GetPrivateProfileIntW(L"keychip", L"billingType", 1, filename);
cfg->system_flag = GetPrivateProfileIntW(
L"keychip",
L"systemFlag",

View File

@ -134,8 +134,9 @@ HRESULT nusec_hook_init(
if (nusec_cfg.platform_id[0] == '\0') {
memcpy(nusec_cfg.platform_id, platform_id, sizeof(nusec_cfg.platform_id));
}
nusec_nearfull = 0x00010200;
// High 16 bits is billing type, low is actual playlimit
nusec_nearfull = (nusec_cfg.billing_type << 16) + 512;
nusec_play_count = 0;
nusec_play_limit = 1024;

View File

@ -14,6 +14,7 @@ struct nusec_config {
uint8_t region;
uint8_t system_flag;
uint32_t subnet;
uint16_t billing_type;
wchar_t billing_ca[MAX_PATH];
wchar_t billing_pub[MAX_PATH];
};