res = 0x8000 & x;
res = ((x>>16) & 0x8000);
void BIOS_ArcTan2(){#ifdef DEV_VERSION  if(systemVerbose & VERBOSE_SWI) {    log("ArcTan2: %08x,%08x (VCOUNT=%2d)\n",        reg[0].I,        reg[1].I,        VCOUNT);  }#endif    s16 x = reg[0].I;  s16 y = reg[1].I;  s16 res = 0;  if (y == 0) {    res = 0x8000 & x;  } else {    if (x == 0) {      res = (0x8000 & y) + 0x4000;    } else {      if (abs(x) > abs(y)) {        reg[1].I = x;        reg[0].I = y << 14;        BIOS_Div();        BIOS_ArcTan();        if (x < 0)          res = 0x8000 + reg[0].I;        else          res = ((y & 0x8000) << 1 ) + reg[0].I;      } else {        reg[0].I = x << 14;        BIOS_Div();        BIOS_ArcTan();        res = (0x4000 + (y & 0x8000)) - reg[0].I;      }    }  }  reg[0].I = ((u32)res) & 0xffff;  #ifdef DEV_VERSION  if(systemVerbose & VERBOSE_SWI) {    log("ArcTan2: return=%08x\n",        reg[0].I);  }#endif} 