Skip to content

Commit

Permalink
Merge pull request #96 from JeffVi/Lockpick-1.19.10-bdk-upgrade
Browse files Browse the repository at this point in the history
Fix v5 save flush
  • Loading branch information
suchmememanyskill authored May 23, 2024
2 parents 2b2c5b7 + 61a0c7c commit f812818
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions bdk/libs/nx_savedata/save.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,14 @@ void save_free_contexts(save_ctx_t *ctx) {
}

static ALWAYS_INLINE bool save_flush(save_ctx_t *ctx) {
if (ctx->header.layout.version < VERSION_DISF_5) {
if (!save_cached_storage_flush(ctx->core_data_ivfc_storage.data_level)) {
EPRINTF("Failed to flush cached storage!");
}
if (save_remap_storage_write(&ctx->meta_remap_storage, ctx->fat_storage, ctx->header.layout.fat_offset, ctx->header.layout.fat_size) != ctx->header.layout.fat_size) {
EPRINTF("Failed to write meta remap storage!");
}
} else {
if (!save_cached_storage_flush(ctx->core_data_ivfc_storage.data_level)) {
EPRINTF("Failed to flush cached storage!");
}
if (save_remap_storage_write(&ctx->meta_remap_storage, ctx->fat_storage, ctx->header.layout.fat_offset, ctx->header.layout.fat_size) != ctx->header.layout.fat_size) {
EPRINTF("Failed to write meta remap storage!");
}

if (ctx->header.layout.version >= VERSION_DISF_5) {
if (!save_cached_storage_flush(ctx->fat_ivfc_storage.data_level)) {
EPRINTF("Failed to flush cached storage!");
}
Expand Down

0 comments on commit f812818

Please sign in to comment.