{\r
unsigned char *rom;\r
\r
+ // make size power of 2 for easier banking handling\r
+ int s = 0, tmp = filesize;\r
+ while ((tmp >>= 1) != 0)\r
+ s++;\r
+ if (filesize > (1 << s))\r
+ s++;\r
+ rom_alloc_size = 1 << s;\r
+\r
if (is_sms) {\r
- // make size power of 2 for easier banking handling\r
- int s = 0, tmp = filesize;\r
- while ((tmp >>= 1) != 0)\r
- s++;\r
- if (filesize > (1 << s))\r
- s++;\r
- rom_alloc_size = 1 << s;\r
// be sure we can cover all address space\r
if (rom_alloc_size < 0x10000)\r
rom_alloc_size = 0x10000;\r
}\r
else {\r
// align to 512K for memhandlers\r
- rom_alloc_size = (filesize + 0x7ffff) & ~0x7ffff;\r
+ rom_alloc_size = (rom_alloc_size + 0x7ffff) & ~0x7ffff;\r
}\r
\r
if (rom_alloc_size - filesize < 4)\r