Skip to content

Commit

Permalink
load keystones
Browse files Browse the repository at this point in the history
from Apollo data pack
  • Loading branch information
bucanero committed Dec 9, 2023
1 parent 9a07bde commit ca1af01
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ All notable changes to the `apollo-ps4` project will be documented in this file.

### Misc

* Include original keystones for 116 games
* Updated audio library to `libs3m`
* Updated [`apollo-lib`](https://github.com/bucanero/apollo-lib) Patch Engine to v0.6.0
- Add host callbacks (username, wlan mac, psid, account id)
Expand Down
14 changes: 9 additions & 5 deletions source/exec_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,15 +490,19 @@ static void copySavePFS(const save_entry_t* save)
return;
}

static void copyKeystone(int import)
static void copyKeystone(const save_entry_t* entry, int import)
{
char path_data[256];
char path_save[256];

snprintf(path_save, sizeof(path_save), "%ssce_sys/keystone", selected_entry->path);
snprintf(path_data, sizeof(path_data), APOLLO_USER_PATH "%s/keystone", apollo_config.user_id, selected_entry->title_id);
snprintf(path_save, sizeof(path_save), "%ssce_sys/keystone", entry->path);
snprintf(path_data, sizeof(path_data), APOLLO_USER_PATH "%s/keystone", apollo_config.user_id, entry->title_id);
mkdirs(path_data);

// try to import keystone from data folder
if (import && file_exists(path_data) != SUCCESS)
snprintf(path_data, sizeof(path_data), APOLLO_DATA_PATH "%s.keystone", entry->title_id);

LOG("Copy '%s' <-> '%s'...", path_save, path_data);

if (copy_file(import ? path_data : path_save, import ? path_save : path_data) == SUCCESS)
Expand Down Expand Up @@ -1167,12 +1171,12 @@ void execCodeCommand(code_entry_t* code, const char* codecmd)
break;

case CMD_EXP_KEYSTONE:
copyKeystone(0);
copyKeystone(selected_entry, 0);
code->activated = 0;
break;

case CMD_IMP_KEYSTONE:
copyKeystone(1);
copyKeystone(selected_entry, 1);
code->activated = 0;
break;

Expand Down

0 comments on commit ca1af01

Please sign in to comment.