3

I want to show animation in verifone vx520. Here is my code but it doesn't show anything on the screen. How should I my initialize my bitmapped file to this function? How can I use and animate animationbmp?

#define RGB2PIXEL565(r,g,b)            \
         ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3))
void animate(void) {
char animationbmp[]="move.bmp"
    int con;
short * frameBuffer;
         frameBuffer=(short*)malloc(8); 
         con = open (DEV_CONSOLE, 0);
         frameBuffer[0]= RGB2PIXEL565 (0xFF,  0,  0 ); // red
         frameBuffer[1]= RGB2PIXEL565 (0,   0xFF, 0 ); // green
         frameBuffer[2]= RGB2PIXEL565 (0,   0,  0xFF); // blue
         frameBuffer[3]= RGB2PIXEL565 (0xFF, 0, 0xFF); // purple

         set_display_coordinate_mode (PIXEL_MODE);
         display_frame_buffer(0,0,4,1,frameBuffer);
         display_frame_buffer(1,2,2,2,frameBuffer);
         display_frame_buffer(5,1,1,4,frameBuffer);
}
Farshid.M
  • 389
  • 2
  • 4
  • 17

1 Answers1

0

I don't know exactly if Verifone Vx520 can show animation files, but the easiest way to display animation is to periodically change pictures. Here are an example of code:

void animation(char *file1, char *file2, int x, int y){
    set_display_coordinate_mode(PIXEL_MODE);
    put_BMP_at(x,y, (char *)file1);    //Draw image on a display starting from pos (x;y)
    SVC_WAIT(some_pause_in_msec);    //system function like "sleep"
    put_BMP_at(x,y, (char *)file2);    //Draw image on a display
    SVC_WAIT(some_pause_in_msec);    
    set_display_coordinate_mode(CHARACTER_MODE);    //Back to text display mode (optional)
}

About how to work with image files (".BMP") you can read here. Your files must be black-white ".bmp" files for Vx520.