Upgrade BDK

This commit is contained in:
suchmememanyskill
2023-07-22 18:37:52 +02:00
parent b0233b796e
commit 4505217b2c
73 changed files with 2223 additions and 2734 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2020 shchmue
* Copyright (c) 2019-2022 shchmue
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -61,7 +61,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define VERSION_RMAP 0x10000
#define VERSION_IVFC 0x20000
#define SAVE_BLOCK_SIZE_DEFAULT 0x4000
#define SAVE_BLOCK_SIZE_DEFAULT SZ_16K
#define SAVE_NUM_HEADERS 2
@@ -232,6 +232,6 @@ typedef struct {
};
} save_header_t;
static_assert(sizeof(save_header_t) == 0x4000, "Save header size is wrong!");
static_assert(sizeof(save_header_t) == SZ_16K, "Save header size is wrong!");
#endif

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2020 shchmue
* Copyright (c) 2019-2022 shchmue
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -41,7 +41,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <stdint.h>
#define RMAP_ALIGN_SMALL 0x200
#define RMAP_ALIGN_LARGE 0x4000
#define RMAP_ALIGN_LARGE SZ_16K
typedef struct {
uint32_t magic; /* RMAP */

View File

@@ -99,9 +99,10 @@ bool save_data_file_write(save_data_file_ctx_t *ctx, uint64_t *out_bytes_written
if (!save_data_file_validate_write_params(ctx, offset, count, ctx->mode, &is_resize_needed))
return false;
if (!save_data_file_set_size(ctx, offset + count))
return false;
if (is_resize_needed) {
if (!save_data_file_set_size(ctx, offset + count))
return false;
}
*out_bytes_written = save_allocation_table_storage_write(&ctx->base_storage, buffer, offset, count);
return true;

View File

@@ -250,7 +250,7 @@ uint32_t save_fs_list_allocate_entry(save_filesystem_list_ctx_t *ctx) {
if (capacity == 0 || length >= capacity) {
uint64_t current_size, new_size;
save_allocation_table_storage_get_size(&ctx->storage, &current_size);
if (!save_allocation_table_storage_set_size(&ctx->storage, current_size + 0x4000))
if (!save_allocation_table_storage_set_size(&ctx->storage, current_size + SZ_16K))
return 0;
save_allocation_table_storage_get_size(&ctx->storage, &new_size);
if (!save_fs_list_set_capacity(ctx, (uint32_t)(new_size / sizeof(save_fs_list_entry_t))))

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2020 shchmue
* Copyright (c) 2019-2022 shchmue
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,