     readData: ->
         address = @$incrementAddress()
         oldBufferContent = @vramReadBuffer
-        @vramReadBuffer = @$read address                                         # Always increments the address
+        @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
-        @$write address, value unless @$isRenderingActive() # Only during VBlank or disabled rendering
+        @ppuMemory.write address, value unless @$isRenderingActive() # Only during VBlank or disabled rendering
         value
 
     incrementAddress: ->

        if @ntscMode and @cycleFlags & F_CLIP_NTSC # Clip top/bottom 8 scanlines in NTSC
            @$clearFramePixel()
        else
            colorAddress = 0x3F00 | @renderFramePixel()
            @$setFramePixel @$readPalette colorAddress

    renderFramePixel: ->
        backgroundColor = @renderBackgroundPixel()
        spriteColor = @renderSpritePixel()
        if (spriteColor & 0x03) and (backgroundColor & 0x03)
            @spriteZeroHit ||= @renderedSprite.zeroSprite                    # Both bagckground and sprite pixels are visible
            if @renderedSprite.inFront then spriteColor else backgroundColor # Choose target by rendering priority
        else if spriteColor & 0x03
            spriteColor      # Sprite pixel is visible
        else
            backgroundColor  # Otherwise render backround

    ###########################################################
    # Background rendering

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

