public void drawKeyFrame(AnimationKeyframeData kf){
     if(kf == null){
             return;
         }
        CHRTile spr = new CHRTile(modelRef.getCHRModel().getPatternTableBytesForTile(getSpriteBank(), kf.spriteIndex), PPUConstants.SPRITE_PALETTE_TYPE, modelRef, kf.oamIndex);
        int  pix[] = spr.getPix();
        
        for(int y=0;y<8;y++){
            int curY = (y + kf.yPos) & 0xFF;
            int newY = (kf.isFlippedHorizontal) ? (7-y) : y;
            if(curY < 240) {
                int offY = curY * 256;
                for(int x=0;x<8;x++){
                    int curX = (x + kf.xPos) & 0xFF;
                    int newX = (kf.isFlippedVertical) ? (7-x) : x;
                    sprPix[offY+curX] = pix[newY*8+newX];
                }
            }
        }
        
     }