From 61a0c7c9db73e34a654a91ecec74a741430d33d9 Mon Sep 17 00:00:00 2001 From: Jeff <57104907+JeffVi@users.noreply.github.com> Date: Mon, 20 May 2024 17:35:05 +0200 Subject: [PATCH] Fix v5 save flush --- bdk/libs/nx_savedata/save.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bdk/libs/nx_savedata/save.c b/bdk/libs/nx_savedata/save.c index b7fea65..bbcb376 100644 --- a/bdk/libs/nx_savedata/save.c +++ b/bdk/libs/nx_savedata/save.c @@ -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!"); }