GameBoy\Core::updateImage PHP Метод

updateImage() публичный Метод

public updateImage ( $tileIndex, $attribs )
    public function updateImage($tileIndex, $attribs)
    {
        $address_ = $tileIndex + $this->tileCount * $attribs;
        $otherBank = $tileIndex >= 384;
        $offset = $otherBank ? $tileIndex - 384 << 4 : $tileIndex << 4;
        $paletteStart = $attribs & 0xfc;
        $transparent = $attribs >= $this->transparentCutoff;
        $pixix = 0;
        $pixixdx = 1;
        $pixixdy = 0;
        $tempPix = $this->getTypedArray(64, 0, 'int32');
        if (($attribs & 2) != 0) {
            $pixixdy = -16;
            $pixix = 56;
        }
        if (($attribs & 1) == 0) {
            $pixixdx = -1;
            $pixix += 7;
            $pixixdy += 16;
        }
        for ($y = 8; --$y >= 0;) {
            $num = $this->weaveLookup[$this->VRAMReadGFX($offset++, $otherBank)] + ($this->weaveLookup[$this->VRAMReadGFX($offset++, $otherBank)] << 1);
            if ($num != 0) {
                $transparent = false;
            }
            for ($x = 8; --$x >= 0;) {
                $tempPix[$pixix] = $this->palette[$paletteStart + ($num & 3)] & -1;
                $pixix += $pixixdx;
                $num >>= 2;
            }
            $pixix += $pixixdy;
        }
        $this->tileData[$address_] = $transparent ? true : $tempPix;
        $this->tileReadState[$tileIndex] = 1;
        return $this->tileData[$address_];
    }