mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Improve performance when padding: don't write a byte at a time.
This commit is contained in:
@@ -390,12 +390,11 @@ main(int argc, char *argv[])
|
|||||||
headbyte++;
|
headbyte++;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (newsize != ftell(rom)) /* ROM needs resizing */
|
|
||||||
fputc(padvalue, rom);
|
|
||||||
|
|
||||||
if (newsize > 0x800000) /* ROM is bigger than 8MiB */
|
if (newsize > 0x800000) /* ROM is bigger than 8MiB */
|
||||||
fprintf(stderr, "ROM size is bigger than 8MiB\n");
|
fprintf(stderr, "ROM size is bigger than 8MiB\n");
|
||||||
|
|
||||||
|
ftruncate(fileno(rom), newsize);
|
||||||
|
|
||||||
fseek(rom, 0x148, SEEK_SET);
|
fseek(rom, 0x148, SEEK_SET);
|
||||||
fputc(headbyte, rom);
|
fputc(headbyte, rom);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user