cheatsWriteHalfWord((u16 *)&workRAM[address & 0x3FFFE], value, *((u16 *)&freezeWorkRAM[address & 0x3FFFE]));
cheatsWriteHalfWord(address & 0x203FFFE, value);
void CPUWriteHalfWord(u32 address, u16 value){#ifdef DEV_VERSION  if(address & 1) {    if(systemVerbose & VERBOSE_UNALIGNED_MEMORY) {      log("Unaligned halfword write: %04x to %08x from %08x\n",          value,          address,          armMode ? armNextPC - 4 : armNextPC - 2);    }  }#endif    switch(address >> 24) {  case 2:#ifdef SDL    if(*((u16 *)&freezeWorkRAM[address & 0x3FFFE]))      cheatsWriteHalfWord((u16 *)&workRAM[address & 0x3FFFE],                          value,                          *((u16 *)&freezeWorkRAM[address & 0x3FFFE]));    else#endif      WRITE16LE(((u16 *)&workRAM[address & 0x3FFFE]),value);    break;  case 3:#ifdef SDL    if(*((u16 *)&freezeInternalRAM[address & 0x7ffe]))      cheatsWriteHalfWord((u16 *)&internalRAM[address & 0x7ffe],                          value,                          *((u16 *)&freezeInternalRAM[address & 0x7ffe]));    else#endif      WRITE16LE(((u16 *)&internalRAM[address & 0x7ffe]), value);    break;      case 4:    CPUUpdateRegister(address & 0x3fe, value);    break;  case 5:    WRITE16LE(((u16 *)&paletteRAM[address & 0x3fe]), value);    break;  case 6:    if(address & 0x10000)      WRITE16LE(((u16 *)&vram[address & 0x17ffe]), value);    else      WRITE16LE(((u16 *)&vram[address & 0x1fffe]), value);    break;  case 7:    WRITE16LE(((u16 *)&oam[address & 0x3fe]), value);    break;  case 8:  case 9:    if(address == 0x80000c4 || address == 0x80000c6 || address == 0x80000c8) {      if(!rtcWrite(address, value))        goto unwritable;    } else if(!agbPrintWrite(address, value)) goto unwritable;    break;  case 13:    if(cpuEEPROMEnabled) {      eepromWrite(address, (u8)value);      break;    }    goto unwritable;  case 14:    if(!eepromInUse | cpuSramEnabled | cpuFlashEnabled) {      (*cpuSaveGameFunc)(address, (u8)value);      break;    }    goto unwritable;  default:  unwritable:#ifdef DEV_VERSION    if(systemVerbose & VERBOSE_ILLEGAL_WRITE) {      log("Illegal halfword write: %04x to %08x from %08x\n",          value,          address,          armMode ? armNextPC - 4 : armNextPC - 2);    }#endif    break;  }}