public function decodePalette($startIndex, $data)
{
if (!$this->cGBC) {
$this->gbPalette[$startIndex] = $this->colors[$data & 0x3] & 0xffffff;
// color 0: transparent
$this->gbPalette[$startIndex + 1] = $this->colors[$data >> 2 & 0x3];
$this->gbPalette[$startIndex + 2] = $this->colors[$data >> 4 & 0x3];
$this->gbPalette[$startIndex + 3] = $this->colors[$data >> 6];
//@PHP - Need to copy the new palette
$this->checkPaletteType();
}
}