         colorBit1 =  (@colorBit1Row >>> inverseFineXScroll) & 0x01
         colorBit2 = ((@colorBit2Row >>> inverseFineXScroll) & 0x01) << 1
         # Optimization - we compute this only when coarse scroll X was incremented 4 times.
-        if (@vramAddress & 0x0003) is 0 or @firstPixelIsRendered
+        if (@vramAddress & 0x0003) is 0 or @frameStart
             # We compute pointer to attribute table as $2.NN11.11YY.Y.XXX
             # where YYY and XXX are 3 upper bits of YYYYY and XXXXX.
             # Each attribute applies to area of 4x4 tiles (that's why we removed 2 lower bits of YYYYY and XXXXX).
-            attributeTableAddress = 0x2000 | (@vramAddress & 0x0C00) | 0x03C0
+            attributeTableAddress = 0x23C0 | (@vramAddress & 0x0C00)
             attributeNumber = (@vramAddress >>> 4) & 0x38 | (@vramAddress >>> 2) & 0x07
             attributeAddress = attributeTableAddress + attributeNumber
             attribute = @read attributeAddress

        @objectAttributeMemory = (0 for [0..0x100]) # 256B

    resetRegisters: ->
        @setControl 0       # 8-bit
        @setMask 0          # 8-bit
        @setStatus 0        # 8-bit
        @oamAddress = 0     # 16-bit
        @vramAddress = 0    # 16-bit
        @vramReadBuffer = 0 # 8-bit
        @fineXScroll = 0    # 3-bit

    resetVariables: ->
        @scanline = -1 # Total 262+1 scanlines (-1..261)

            # We have to find in which subarea are we in. This is decided by bit 1 of YYYYY and XXXXX values.
            subareaNumber = (@vramAddress >>> 5) & 0x02 | (@vramAddress >>> 1) & 0x01
            @colorBits43 = ((attribute >>> subareaNumber) & 0x03) << 2
        # This 4-bit color value is actualy index to background color palette,
        # so we have to read 1 of 16 entries from that palette.
        color = @colorBits43 | colorBit2 | colorBit1
