skip rom header

This commit is contained in:
David Voswinkel
2009-07-06 22:12:28 +02:00
parent fd1e5d890a
commit bcd3d802f0
3 changed files with 55 additions and 9 deletions

View File

@@ -171,9 +171,20 @@ int main(int argc, char **argv)
fseek (fp, 0, SEEK_END);
file_size = ftell (fp);
fseek (fp, 0, SEEK_SET);
if (strstr(argv[2],".smc") || strstr(argv[2],".swc")){
printf("Skip 512 Byte header\n");
file_size -= 512;
fseek (fp, 512, SEEK_SET);
} else {
fseek (fp, 0, SEEK_SET);
}
bank_cnt = file_size / BANK_SIZE;
printf("Transfer '%s' %i Bytes, %i Banks\n",argv[2],file_size,bank_cnt);
read_buffer = (unsigned char *) malloc(READ_BUFFER_SIZE);
crc_buffer = (unsigned char *) malloc(0x1000);