mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
NCSD CIA builder: Use proper index
This commit is contained in:
parent
8ee0fac6c4
commit
eb265e9575
@ -1609,13 +1609,14 @@ u32 BuildCiaFromNcsdFile(const char* path_ncsd, const char* path_cia) {
|
||||
|
||||
// insert NCSD content
|
||||
TmdContentChunk* chunk = cia->content_list;
|
||||
for (u32 i = 0; i < 3; i++) {
|
||||
for (u32 i = 0, idx = 0; i < 3; i++) {
|
||||
NcchPartition* partition = ncsd.partitions + i;
|
||||
u32 offset = partition->offset * NCSD_MEDIA_UNIT;
|
||||
u32 size = partition->size * NCSD_MEDIA_UNIT;
|
||||
if (!size) continue;
|
||||
memset(chunk, 0, sizeof(TmdContentChunk));
|
||||
chunk->id[3] = chunk->index[1] = i;
|
||||
chunk->id[3] = i;
|
||||
chunk->index[1] = idx++;
|
||||
if (InsertCiaContent(path_cia, path_ncsd, offset, size, chunk++, NULL, false, (i == 0), false) != 0) {
|
||||
free(cia);
|
||||
return 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user