mirror of
https://github.com/djhackersdev/bemanitools.git
synced 2025-02-21 21:00:02 +01:00
launcher: Set soft_id_code before calling init as some games use it then
This commit is contained in:
parent
62bb717582
commit
8e9abf9906
@ -97,13 +97,29 @@ bool ea3_ident_invoke_module_init(
|
|||||||
ident->rev,
|
ident->rev,
|
||||||
ident->ext);
|
ident->ext);
|
||||||
|
|
||||||
|
/* Set up long-form sidcode env var */
|
||||||
|
|
||||||
|
str_format(
|
||||||
|
sidcode_long,
|
||||||
|
lengthof(sidcode_long),
|
||||||
|
"%s:%s:%s:%s:%s",
|
||||||
|
ident->model,
|
||||||
|
ident->dest,
|
||||||
|
ident->spec,
|
||||||
|
ident->rev,
|
||||||
|
ident->ext);
|
||||||
|
|
||||||
|
/* Set this up beforehand, as certain games require it in dll_entry_init */
|
||||||
|
|
||||||
|
std_setenv("/env/profile/soft_id_code", sidcode_long);
|
||||||
|
|
||||||
ok = module_context_invoke_init(module, sidcode_short, app_config);
|
ok = module_context_invoke_init(module, sidcode_short, app_config);
|
||||||
|
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Back-propagate sidcode */
|
/* Back-propagate sidcode, as some games modify it during init */
|
||||||
|
|
||||||
memcpy(ident->model, sidcode_short + 0, sizeof(ident->model) - 1);
|
memcpy(ident->model, sidcode_short + 0, sizeof(ident->model) - 1);
|
||||||
ident->dest[0] = sidcode_short[3];
|
ident->dest[0] = sidcode_short[3];
|
||||||
@ -111,7 +127,7 @@ bool ea3_ident_invoke_module_init(
|
|||||||
ident->rev[0] = sidcode_short[5];
|
ident->rev[0] = sidcode_short[5];
|
||||||
memcpy(ident->ext, sidcode_short + 6, sizeof(ident->ext));
|
memcpy(ident->ext, sidcode_short + 6, sizeof(ident->ext));
|
||||||
|
|
||||||
/* Set up long-form sidcode env var */
|
/* Set up long-form sidcode env var again */
|
||||||
|
|
||||||
str_format(
|
str_format(
|
||||||
sidcode_long,
|
sidcode_long,
|
||||||
|
@ -16,7 +16,7 @@ void *xcalloc(size_t nbytes)
|
|||||||
mem = calloc(nbytes, 1);
|
mem = calloc(nbytes, 1);
|
||||||
|
|
||||||
if (mem == NULL) {
|
if (mem == NULL) {
|
||||||
log_fatal("xmalloc(%u) failed", (uint32_t) nbytes);
|
log_fatal("xcalloc(%u) failed", (uint32_t) nbytes);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -31,7 +31,7 @@ void *xmalloc(size_t nbytes)
|
|||||||
mem = malloc(nbytes);
|
mem = malloc(nbytes);
|
||||||
|
|
||||||
if (mem == NULL) {
|
if (mem == NULL) {
|
||||||
log_fatal("xcalloc(%u) failed", (uint32_t) nbytes);
|
log_fatal("xmalloc(%u) failed", (uint32_t) nbytes);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user