             baseY = 128 + tileY * 28
             for tileX in [0...8]
                 baseX = tileX << 5
-                color = @$readPalette 0x3F00 | (tileY << 3) | tileX
+                color = @ppuMemory.readPalette (tileY << 3) | tileX
                 @renderPaletteTile baseX, baseY, color
         undefined
 

        @supressNMI = false     # Whether to supress NMI generation
        @nmiDelay = 0           # Number of cycles after which NMI is generated
        @oddFrame = false       # Whether odd frame is being rendered
        @renderedSprite = null  # Currently rendered sprite
        @spriteCount = 0        # Total number of sprites on current scanline
        @spriteNumber = 0       # Number of currently fetched sprite
        @spriteCache = (0 for [0..261])         # Preprocesed sprite data for current scanline (cycle -> sprite rendered on that cycle)

    readData: ->
        address = @$incrementAddress()
        oldBufferContent = @vramReadBuffer
        @vramReadBuffer = @ppuMemory.read address                                # Always increments the address
        if @$isPaletteAddress address then @vramReadBuffer else oldBufferContent # Delayed read outside the palette memory area

    writeData: (value) ->
        address = @$incrementAddress()                      # Always increments the address
        @ppuMemory.write address, value unless @$isRenderingActive() # Only during VBlank or disabled rendering
        value

    incrementAddress: ->
