for(i = (size+1)&~1; i < 0x2000000; i+=2) {
for(i = (romSize+1)&~1; i < 0x2000000; i+=2) {
int CPULoadRom(const char *szFile){  int size = 0x2000000;    if(rom != NULL) {    CPUCleanUp();  }  systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED;    rom = (u8 *)malloc(0x2000000);  if(rom == NULL) {    systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),                  "ROM");    return 0;  }  workRAM = (u8 *)calloc(1, 0x40000);  if(workRAM == NULL) {    systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),                  "WRAM");    return 0;  }  u8 *whereToLoad = rom;  if(cpuIsMultiBoot)    whereToLoad = workRAM;  if(CPUIsELF(szFile)) {    FILE *f = fopen(szFile, "rb");    if(!f) {      systemMessage(MSG_ERROR_OPENING_IMAGE, N_("Error opening image %s"),                    szFile);      free(rom);      rom = NULL;      free(workRAM);      workRAM = NULL;      return 0;    }    bool res = elfRead(szFile, size, f);    if(!res || size == 0) {      free(rom);      rom = NULL;      free(workRAM);      workRAM = NULL;      elfCleanUp();      return 0;    }  } else if(!utilLoad(szFile,                      utilIsGBAImage,                      whereToLoad,                      size)) {    free(rom);    rom = NULL;    free(workRAM);    workRAM = NULL;    return 0;  }  u16 *temp = (u16 *)(rom+((size+1)&~1));  int i;  for(i = (size+1)&~1; i < 0x2000000; i+=2) {    WRITE16LE(temp, (i >> 1) & 0xFFFF);    temp++;  }  bios = (u8 *)calloc(1,0x4000);  if(bios == NULL) {    systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),                  "BIOS");    CPUCleanUp();    return 0;  }      internalRAM = (u8 *)calloc(1,0x8000);  if(internalRAM == NULL) {    systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),                  "IRAM");    CPUCleanUp();    return 0;  }      paletteRAM = (u8 *)calloc(1,0x400);  if(paletteRAM == NULL) {    systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),                  "PRAM");    CPUCleanUp();    return 0;  }        vram = (u8 *)calloc(1, 0x20000);  if(vram == NULL) {    systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),                  "VRAM");    CPUCleanUp();    return 0;  }        oam = (u8 *)calloc(1, 0x400);  if(oam == NULL) {    systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),                  "OAM");    CPUCleanUp();    return 0;  }        pix = (u8 *)calloc(1, 4 * 241 * 162);  if(pix == NULL) {    systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),                  "PIX");    CPUCleanUp();    return 0;  }        ioMem = (u8 *)calloc(1, 0x400);  if(ioMem == NULL) {    systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),                  "IO");    CPUCleanUp();    return 0;  }        CPUUpdateRenderBuffers(true);  return size;}