for(i = 0; i < 4; i++) { gbPalette[i*4] = (0x1f) | (0x1f << 5) | (0x1f << 10); gbPalette[i*4+1] = (0x15) | (0x15 << 5) | (0x15 << 10); gbPalette[i*4+2] = (0x0c) | (0x0c << 5) | (0x0c << 10); gbPalette[i*4+3] = 0; }
void gbSgbReset(){  gbSgbPacketTimeout = 0;  gbSgbCGBSupport = 0;  gbSgbMask = 0;  gbSgbPacketState = GBSGB_NONE;  gbSgbBit = 0;  gbSgbPacketNBits = 0;  gbSgbPacketNumber = 0;  gbSgbMultiplayer = 0;  gbSgbFourPlayers = 0;  gbSgbNextController = 0x0f;  gbSgbReadingController = 0;  memset(gbSgbSCPPalette, 0, 512*4);  memset(gbSgbATF, 0, 20*18);  memset(gbSgbATFList, 0, 45 * 20 * 18);  memset(gbSgbPacket, 0, 16 * 7);  memset(gbSgbBorderChar, 0, 32*256);  memset(gbSgbBorder, 0, 2048);  for(int i = 1; i < 2048; i+=2) {    gbSgbBorder[i] = 1 << 2;  }}