"Invalid CBA code. Format is XXXXXXXX YYYY.");
N_("Invalid CBA code. Format is XXXXXXXX YYYY."));
void cheatsAddCBACode(const char *code, const char *desc){  if(strlen(code) != 13) {    // wrong cheat    systemMessage(MSG_INVALID_CBA_CODE,                  "Invalid CBA code. Format is XXXXXXXX YYYY.");    return;  }    int i;  for(i = 0; i < 8; i++) {    if(!CHEAT_IS_HEX(code[i])) {      // wrong cheat      systemMessage(MSG_INVALID_CBA_CODE,                    "Invalid CBA code. Format is XXXXXXXX YYYY.");      return;    }  }  if(code[8] != ' ') {    systemMessage(MSG_INVALID_CBA_CODE,                  "Invalid CBA code. Format is XXXXXXXX YYYY.");    return;      }    for(i = 9; i < 13; i++) {    if(!CHEAT_IS_HEX(code[i])) {      // wrong cheat      systemMessage(MSG_INVALID_CBA_CODE,                    "Invalid CBA code. Format is XXXXXXXX YYYY.");      return;    }  }      char buffer[10];  strncpy(buffer, code, 8);  buffer[8] = 0;  u32 address;  sscanf(buffer, "%x", &address);  strncpy(buffer, &code[9], 4);  buffer[4] = 0;  u32 value;  sscanf(buffer, "%x", &value);  u8 array[8] = {    address & 255,    (address >> 8) & 255,    (address >> 16) & 255,    (address >> 24) & 255,    (value & 255),    (value >> 8) & 255,    0,    0  };  if(cheatsCBAGetCount() == 0 &&     (address >> 28) == 9) {    u32 seed[8];    cheatsCBAParseSeedCode(address, value, seed);    cheatsCBAChangeEncryption(seed);    cheatsAdd(code, desc, address & 0x0FFFFFFF, value, 512, UNKNOWN_CODE);  } else {    if(cheatsCBAShouldDecrypt())      cheatsCBADecrypt(array);    address = READ32LE(((u32 *)array));    value = READ16LE(((u16 *)&array[4]));        int type = (address >> 28) & 15;    if(isMultilineWithData(cheatsNumber-1)) {      cheatsAdd(code, desc, address, value, 512, UNKNOWN_CODE);      return;    }        switch(type) {    case 0x00:      {        if(!cheatsCBATableGenerated)          cheatsCBAGenTable();        u32 crc = cheatsCBACalcCRC(rom, 0x10000);        if(crc != address) {          systemMessage(MSG_CBA_CODE_WARNING,                        "Warning: Codes seem to be for a different game.\nCodes may not work correctly.");        }        cheatsAdd(code, desc, address & 0x0FFFFFFF, value, 512,                   UNKNOWN_CODE);      }      break;    case 0x02:      cheatsAdd(code, desc, address & 0x0FFFFFFF, value, 512,                 CBA_OR);      break;    case 0x03:      cheatsAdd(code, desc, address & 0x0FFFFFFF, value, 512,                 INT_8_BIT_WRITE);      break;    case 0x04:      cheatsAdd(code, desc, address & 0x0FFFFFFF, value, 512,                 CBA_SLIDE_CODE);      break;    case 0x05:      cheatsAdd(code, desc, address & 0x0FFFFFFF, value, 512,                CBA_SUPER);      break;    case 0x06:      cheatsAdd(code, desc, address & 0x0FFFFFFF, value, 512,                 CBA_AND);      break;    case 0x07:      cheatsAdd(code, desc, address & 0x0FFFFFFF, value, 512,                 CBA_IF_TRUE);      break;    case 0x08:      cheatsAdd(code, desc, address & 0x0FFFFFFF, value, 512,                 INT_16_BIT_WRITE);      break;    case 0x0a:      cheatsAdd(code, desc, address & 0x0FFFFFFF, value, 512,                 CBA_IF_FALSE);      break;    case 0x0b:      cheatsAdd(code, desc, address & 0x0FFFFFFF, value, 512,                 CBA_LT);      break;    case 0x0c:      cheatsAdd(code, desc, address & 0x0FFFFFFF, value, 512,                 CBA_GT);      break;    case 0x0d:      cheatsAdd(code, desc, address & 0x0FFFFFFF, value, 512,                 CBA_IF_KEYS_PRESSED);      break;    case 0x0e:      cheatsAdd(code, desc, address & 0x0FFFFFFF, value, 512,                CBA_ADD);      break;    default:      // unsupported code      cheatsAdd(code, desc, address & 0xFFFFFFFF, value, 512,                 UNKNOWN_CODE);      break;    }  }}