so, some of my changes broke homebrew game loading. i fixed that.

This commit is contained in:
zeromus 2008-12-26 05:49:54 +00:00
parent 5ee96233be
commit 2d7891cbec
2 changed files with 8 additions and 11 deletions

View File

@ -376,8 +376,7 @@ int NDS_LoadROM( const char *filename, int bmtype, u32 bmsize,
}
//check that size is at least the size of the header
//and also that the size is a power of 2
if (size < 352+160 || ones32(size) != 1) {
if (size < 352+160) {
reader->DeInit(file);
free(noext);
return -1;
@ -385,15 +384,13 @@ int NDS_LoadROM( const char *filename, int bmtype, u32 bmsize,
//zero 25-dec-08 - this used to yield a mask which was 2x large
//mask = size;
//mask |= (mask >>1);
//mask |= (mask >>2);
//mask |= (mask >>4);
//mask |= (mask >>8);
//mask |= (mask >>16);
mask = size-1;
mask |= (mask >>1);
mask |= (mask >>2);
mask |= (mask >>4);
mask |= (mask >>8);
mask |= (mask >>16);
//but now, we know it is a power of 2 so the mask is easy to create
mask = size-1;
// Make sure old ROM is freed first(at least this way we won't be eating
// up a ton of ram before the old ROM is freed)
if(MMU.CART_ROM != MMU.UNUSED_RAM)

View File

@ -474,6 +474,6 @@ void DecryptSecureArea(u8 *romdata, long romlen)
}
else
{
fprintf(stderr, "File doesn't appear to have a secure area!\n"); exit(1);
printf("File doesn't appear to have a secure area.\n");
}
}