[makerom] Fixed makerom ROMFS file limitation. +Several bug fixes.

This commit is contained in:
jakcron
2015-11-11 23:20:03 +08:00
parent 88c0f66c4a
commit e7dc460436
14 changed files with 369 additions and 272 deletions
+24
View File
@@ -615,6 +615,10 @@ int CheckRomConfig(cci_settings *set)
void WriteCciDataToOutput(cci_settings *set)
{
if (set->options.verbose) {
printf("[CCI] Writing header to file... ");
}
// NCSD Header
WriteBuffer(set->headers.ccihdr.buffer, set->headers.ccihdr.size, 0, set->out);
// Card Info Header
@@ -629,18 +633,34 @@ void WriteCciDataToOutput(cci_settings *set)
memset(dummy_data, 0xff, len);
WriteBuffer(dummy_data, len, (set->headers.ccihdr.size + set->headers.cardinfohdr.size),set->out);
free(dummy_data);
if (set->options.verbose) {
printf("Done!\n");
}
// NCCH Partitions
u8 *ncch;
for(int i = 0; i < CCI_MAX_CONTENT; i++){
if(set->content.active[i]){
if (set->options.verbose) {
printf("[CCI] Writing content %d to file... ", i);
}
ncch = set->content.data + set->content.dOffset[i];
WriteBuffer(ncch, set->content.dSize[i], set->content.cOffset[i], set->out);
if (set->options.verbose) {
printf("Done!\n");
}
}
}
// Cci Padding
if(set->options.padCci){
if (set->options.verbose) {
printf("[CCI] Writing padding to file... ");
}
fseek_64(set->out,set->romInfo.usedSize);
// Determining Size of Padding
@@ -655,6 +675,10 @@ void WriteCciDataToOutput(cci_settings *set)
fwrite(pad,set->romInfo.blockSize,1,set->out);
free(pad);
if (set->options.verbose) {
printf("Done!");
}
}
return;