Fix incorrect ROM size check

LoROMs have 32k (0x8000) banks, but the check required at least 64k.
This commit is contained in:
James Churchill 2016-03-25 19:39:48 +10:00
parent 3698bc2d2c
commit 54608e4a76

5
main.c
View file

@ -286,10 +286,9 @@ int main(int argc, char *argv[])
// Make sure the image is big enough
if (len < 0x10000 || (skip == 1 && len < 0x10200))
if (len < 0x8000 || (skip == 1 && len < 0x8200))
{
printf("This file looks too small to be a rom image.\n");
exit(1);
printf("This file looks too small to be a legitimate rom image.\n");
}
// Allocate mem for file. Extra 3 bytes to prevent segfault during memcpy