if(gbSgbCGBSupport > 4) gbSgbCGBSupport = 0;
void gbSgbPicture(){  gbSgbRenderScreenToBuffer();  memcpy(gbSgbBorder, gbSgbScreenBuffer, 2048);    u16 *paletteAddr = (u16 *)&gbSgbScreenBuffer[2048];    for(int i = 64; i < 128; i++) {    gbPalette[i] = READ16LE(paletteAddr++);  }  if(gbBorderAutomatic && !gbBorderOn) {    gbBorderOn = 1;    systemGbBorderOn();  }  if(gbBorderOn)     gbSgbRenderBorder();  gbSgbCGBSupport |= 4;    if(gbSgbMode && gbCgbMode && gbSgbCGBSupport > 4) {    gbSgbCGBSupport = 0;    gbSgbMode = 0;    gbSgbMask = 0;    gbReset();  }}