Go Down

Topic: Background DTX1 Screen Image (Read 44 times) previous topic - next topic


Aug 26, 2015, 04:58 pm Last Edit: Sep 01, 2015, 10:40 pm by leydar

I'm using the FT801 graphics chip to talk to a 480*272px TFT screen. I want to load a full background image. With the standard image importer doing so uses all of the available 256kb of graphics RAM. I have therefore split the image using a png2dtx1 converter. The output is 4 raw compressed image files. I managed to load these from memory and reassemble the image following instructions online.

The problem is that redrawing the background in the Loop function replaces the image after the first iteration with garbage. I figure the RAM is being overwritten and the memory locations are no longer viable. Is there any way of loading the image and storing it in a variable for the repaints?

Here is the code that draws the screen:

Code: [Select]

  FTImpl.ColorRGB(255, 255, 255);
  FTImpl.BitmapLayout(FT_L1, 60, 272);
  FTImpl.BitmapSize(FT_NEAREST,FT_BORDER,FT_BORDER, 480, 272);
  FTImpl.BitmapLayout(FT_RGB565, 240, 68);
  FTImpl.BitmapSize(FT_NEAREST,FT_BORDER,FT_BORDER, 480, 272);
  FTImpl.Vertex2ii(0, 0, 0, 0);
  FTImpl.Vertex2ii(0, 0, 0, 1);
  FTImpl.ColorMask(1, 1, 1, 0);
  FTImpl.Cmd_Scale(262144, 262144);
  FTImpl.Vertex2ii(0, 0, 2, 1);
  FTImpl.Vertex2ii(0, 0, 2, 0);



By adding the command FTImpl.Cmd_LoadIdentity(); just before the FTImpl.RestoreContext(); it repaints perfectly :)


Go Up