"Invalid GSA code. Format is XXXXXXXXYYYYYYYY");
N_("Invalid GSA code. Format is XXXXXXXXYYYYYYYY"));
void cheatsAddGSACode(const char *code, const char *desc, bool v3){  if(strlen(code) != 16) {    // wrong cheat    systemMessage(MSG_INVALID_GSA_CODE,                  "Invalid GSA code. Format is XXXXXXXXYYYYYYYY");    return;  }    int i;  for(i = 0; i < 16; i++) {    if(!CHEAT_IS_HEX(code[i])) {      // wrong cheat      systemMessage(MSG_INVALID_GSA_CODE,                    "Invalid GSA code. Format is XXXXXXXXYYYYYYYY");      return;    }  }    char buffer[10];  strncpy(buffer, code, 8);  buffer[8] = 0;  u32 address;  sscanf(buffer, "%x", &address);  strncpy(buffer, &code[8], 8);  buffer[8] = 0;  u32 value;  sscanf(buffer, "%x", &value);  cheatsDecryptGSACode(address, value, v3);  if(value == 0x1DC0DE) {    u32 gamecode = READ32LE(((u32 *)&rom[0xac]));    if(gamecode != address) {      char buffer[5];      *((u32 *)buffer) = address;      buffer[4] = 0;      char buffer2[5];      *((u32 *)buffer2) = READ32LE(((u32 *)&rom[0xac]));      buffer2[4] = 0;      systemMessage(MSG_GBA_CODE_WARNING, "Warning: cheats are for game %s. Current game is %s.\nCodes may not work correctly.",                    buffer, buffer2);    }    cheatsAdd(code, desc, address & 0x0FFFFFFF, value, v3 ? 257 : 256,               UNKNOWN_CODE);    return;  }  if(isMultilineWithData(cheatsNumber-1)) {    cheatsAdd(code, desc, address, value, v3 ? 257 : 256, UNKNOWN_CODE);    return;  }  if(v3) {    int type = (address >> 25) & 127;    u32 addr = (address & 0x00F00000) << 4 | (address & 0x0003FFFF);    switch(type) {    case 0x00:      if(address == 0) {        type = (value >> 25) & 127;        addr = (value & 0x00F00000) << 4 | (value & 0x0003FFFF);        switch(type) {        case 0x04:          cheatsAdd(code, desc, 0, value & 0x00FFFFFF, 257, GSA_SLOWDOWN);          break;        case 0x08:          cheatsAdd(code, desc, 0, addr, 257, GSA_8_BIT_GS_WRITE2);          break;        case 0x09:          cheatsAdd(code, desc, 0, addr, 257, GSA_16_BIT_GS_WRITE2);          break;        case 0x0a:          cheatsAdd(code, desc, 0, addr, 257, GSA_32_BIT_GS_WRITE2);          break;        case 0x0c:        case 0x0d:        case 0x0e:        case 0x0f:          cheatsAdd(code, desc, 0, value & 0x00FFFFFF, 257, GSA_16_BIT_ROM_PATCH2);          break;        case 0x40:          cheatsAdd(code, desc, 0, addr, 257, GSA_8_BIT_SLIDE);          break;        case 0x41:          cheatsAdd(code, desc, 0, addr, 257, GSA_16_BIT_SLIDE);          break;        case 0x42:          cheatsAdd(code, desc, 0, addr, 257, GSA_32_BIT_SLIDE);          break;        default:          cheatsAdd(code, desc, address, value, 257, UNKNOWN_CODE);          break;        }      } else        cheatsAdd(code, desc, addr, value, 257, GSA_8_BIT_FILL);      break;    case 0x01:      cheatsAdd(code, desc, addr, value, 257, GSA_16_BIT_FILL);      break;    case 0x02:      cheatsAdd(code, desc, addr, value, 257, INT_32_BIT_WRITE);      break;    case 0x04:      cheatsAdd(code, desc, addr, value, 257, GSA_8_BIT_IF_TRUE);      break;    case 0x05:      cheatsAdd(code, desc, addr, value, 257, CBA_IF_TRUE);      break;    case 0x06:      cheatsAdd(code, desc, addr, value, 257, GSA_32_BIT_IF_TRUE);      break;    case 0x08:      cheatsAdd(code, desc, addr, value, 257, GSA_8_BIT_IF_FALSE);      break;    case 0x09:      cheatsAdd(code, desc, addr, value, 257, CBA_IF_FALSE);      break;    case 0x0a:      cheatsAdd(code, desc, addr, value, 257, GSA_32_BIT_IF_FALSE);      break;    case 0x24:      cheatsAdd(code, desc, addr, value, 257, GSA_8_BIT_IF_TRUE2);      break;    case 0x25:      cheatsAdd(code, desc, addr, value, 257, GSA_16_BIT_IF_TRUE2);      break;    case 0x26:      cheatsAdd(code, desc, addr, value, 257, GSA_32_BIT_IF_TRUE2);      break;    case 0x28:      cheatsAdd(code, desc, addr, value, 257, GSA_8_BIT_IF_FALSE2);      break;    case 0x29:      cheatsAdd(code, desc, addr, value, 257, GSA_16_BIT_IF_FALSE2);      break;    case 0x2a:      cheatsAdd(code, desc, addr, value, 257, GSA_32_BIT_IF_FALSE2);      break;    default:      cheatsAdd(code, desc, address, value, 257, UNKNOWN_CODE);      break;    }  } else {    int type = (address >> 28) & 15;      switch(type) {    case 0:    case 1:    case 2:      cheatsAdd(code, desc, address & 0x0FFFFFFF, value, 256, type);      break;    case 6:      address <<= 1;      type = (address >> 28) & 15;      if(type == 0x0c) {        cheatsAdd(code, desc, address & 0x0FFFFFFF, value, 256,                   GSA_16_BIT_ROM_PATCH);        break;      }      // unsupported code      cheatsAdd(code, desc, address, value, 256,                 UNKNOWN_CODE);      break;    case 8:      switch((address >> 20) & 15) {      case 1:        cheatsAdd(code, desc, address & 0x0F0FFFFF, value, 256,                   GSA_8_BIT_GS_WRITE);        break;      case 2:        cheatsAdd(code, desc, address & 0x0F0FFFFF, value, 256,                   GSA_16_BIT_GS_WRITE);        break;      case 3:        cheatsAdd(code, desc, address & 0x0F0FFFFF, value, 256,                   GSA_32_BIT_GS_WRITE);      case 15:        cheatsAdd(code, desc, 0, value & 0xFF00, 256, GSA_SLOWDOWN);        break;      default:        // unsupported code        cheatsAdd(code, desc, address, value, 256,                   UNKNOWN_CODE);        break;      }      break;    case 0x0d:      if(address != 0xDEADFACE) {        cheatsAdd(code, desc, address & 0x0FFFFFFF, value, 256,                   CBA_IF_TRUE);      } else        cheatsAdd(code, desc, address, value, 256,                   UNKNOWN_CODE);      break;    default:      // unsupported code      cheatsAdd(code, desc, address, value, 256,                 UNKNOWN_CODE);      break;    }  }}