MiniDisplay/FutabaVfd.cpp
changeset 23 1f607fa8542f
parent 22 ca9e48af31e6
     1.1 --- a/MiniDisplay/FutabaVfd.cpp	Fri May 30 15:02:15 2014 +0200
     1.2 +++ b/MiniDisplay/FutabaVfd.cpp	Sun Jun 01 21:15:33 2014 +0200
     1.3 @@ -74,7 +74,7 @@
     1.4  GP1212A01A::GP1212A01A():
     1.5  	iDisplayPositionX(0),iDisplayPositionY(0),
     1.6      iOffScreenMode(true),
     1.7 -    iUseFrameDiffAlgo(true),
     1.8 +    iUseFrameDifferencing(true),
     1.9      iFrameNext(NULL),
    1.10      iFrameCurrent(NULL),
    1.11      iFramePrevious(NULL),
    1.12 @@ -376,7 +376,7 @@
    1.13  	if (OffScreenMode())
    1.14  		{
    1.15  		//Send host back buffer to device back buffer
    1.16 -        if (!iUseFrameDiffAlgo || iNeedFullFrameUpdate<KNumberOfFrameBeforeDiffAlgo)
    1.17 +        if (!iUseFrameDifferencing || iNeedFullFrameUpdate<KNumberOfFrameBeforeDiffAlgo)
    1.18              {
    1.19              iNeedFullFrameUpdate++;
    1.20              SetPixelBlock(0,0,63,FrameBufferSizeInBytes(),iFrameNext->Ptr());
    1.21 @@ -406,20 +406,20 @@
    1.22  	}
    1.23  
    1.24  
    1.25 +//Define the edge of our pixel block
    1.26 +//Pixel blocks of 32x32 seems to run almost as fast as full screen update in worse case scenarii.
    1.27 +//Though I wonder if in some situations 16 could be better. Make this an attribute at some point if need be.
    1.28 +const int KPixelBlockEdge = 32;
    1.29 +const int KPixelBlockSizeInBits = KPixelBlockEdge*KPixelBlockEdge;
    1.30 +const int KPixelBlockSizeInBytes = KPixelBlockSizeInBits/8;
    1.31 +
    1.32 +
    1.33  /**
    1.34   * @brief GP1212A01A::SendModifiedPixelBlocks
    1.35   * Compare our back and front buffer and send to the device only the modified pixels.
    1.36   */
    1.37  void GP1212A01A::SendModifiedPixelBlocks()
    1.38      {
    1.39 -    //The largest pixel block we can sanely send with one report is 16*16
    1.40 -    //const int KBlocksPerRow = WidthInPixels()/16; //16
    1.41 -    //const int KBlocksPerColumn = HeightInPixels()/16; //4
    1.42 -
    1.43 -    const int KPixelBlockEdge = 16;
    1.44 -    const int KPixelBlockSizeInBits = KPixelBlockEdge*KPixelBlockEdge;
    1.45 -    const int KPixelBlockSizeInBytes = KPixelBlockSizeInBits/8;
    1.46 -
    1.47      int w=WidthInPixels();
    1.48      int h=HeightInPixels();
    1.49