mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +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++;
|
||||
}
|
||||
|
||||
while (newsize != ftell(rom)) /* ROM needs resizing */
|
||||
fputc(padvalue, rom);
|
||||
|
||||
if (newsize > 0x800000) /* ROM is bigger than 8MiB */
|
||||
fprintf(stderr, "ROM size is bigger than 8MiB\n");
|
||||
|
||||
ftruncate(fileno(rom), newsize);
|
||||
|
||||
fseek(rom, 0x148, SEEK_SET);
|
||||
fputc(headbyte, rom);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user