Exemple #1
0
void XTft_EraseBullet(
  Xuint32 BaseAddress,
  Xuint32 BGAddress,
  Xuint32 type,
  Xuint32 xu,
  Xuint32 yu)
 {  
  Xuint32 col, x, y;
  Xuint16 val;

  for (y = 0; y < XTFT_BULLET_HEIGHT; y++)
  {
    val = XTft_bullets[(Xuint32) type][y/2];
    for (x = 0; x < XTFT_BULLET_WIDTH; x++)
    {
      if (val & (1 << (XTFT_BULLET_WIDTH/2 - x/2 - 1)))
        col = XTft_mGetPixel(BGAddress, xu+x, yu+y);
      else
		continue;
        //col = bgColor;
      
        XTft_mSetPixel(BaseAddress, xu+x, yu+y, col);
     }
  }
}
Exemple #2
0
XStatus XTft_GetPixel(XTft *InstancePtr, Xuint32 x, Xuint32 y, Xuint32 *color)
{
  XASSERT_NONVOID(InstancePtr != XNULL);
  XASSERT_NONVOID(InstancePtr->IsReady == XCOMPONENT_IS_READY);

  *color = XTft_mGetPixel(*(Xuint32 *)InstancePtr->BaseAddress, x, y);
  
  return XST_SUCCESS;
}
Exemple #3
0
void XTft_EraseExplosion(
  Xuint32 BaseAddress,
  Xuint32 BGAddress,
  Xuint32 xu,
  Xuint32 yu)
 {  
  Xuint32 col, x, y;
  Xuint16 val;
  for (y = 0; y < XTFT_EXPLOSION_HEIGHT; y++)
  {
    val = XTft_Explosion[y/2];
    for (x = 0; x < XTFT_EXPLOSION_WIDTH; x++)
    {
		if (yu+y > 330)
			col = XTft_mGetPixel(BGAddress, xu+x, yu+y);
		else
			col = 0;
     XTft_mSetPixel(BaseAddress, xu+x, yu+y, col);
    }
  }
}
Exemple #4
0
void XTft_EraseAlien(
  Xuint32 BaseAddress,
  Xuint32 BGAddress,
  Xuint32 type,
  Xuint32 xu,
  Xuint32 yu)
 {  
  Xuint32 col, x, y;
  Xuint16 val;
  for (y = 0; y < XTFT_ALIEN_HEIGHT; y++)
  {
    val = XTft_vidAliens[(Xuint32) type][y/2];
    for (x = 0; x < XTFT_ALIEN_WIDTH; x++)
    {
		if ((yu+y > 330 && yu+y < 640) || yu+y < 100)
			col = XTft_mGetPixel(BGAddress, xu+x, yu+y);
		else
			col = 0;
     XTft_mSetPixel(BaseAddress, xu+x, yu+y, col);
    }
  }
}
Exemple #5
0
XStatus XTft_Scroll(XTft *InstancePtr)
{
  Xuint32 col;
  Xuint32 x, y;

  XASSERT_NONVOID(InstancePtr != XNULL);
  XASSERT_NONVOID(InstancePtr->IsReady == XCOMPONENT_IS_READY);

  for (y = 0; y < XTFT_DISPLAY_HEIGHT-XTFT_CHAR_HEIGHT; y++)
  {
    for (x = 0; x < XTFT_DISPLAY_WIDTH; x++)
    {
      col = XTft_mGetPixel(*(Xuint32 *)InstancePtr->BaseAddress, x, y+XTFT_CHAR_HEIGHT);
      XTft_mSetPixel(*(Xuint32 *)InstancePtr->BaseAddress, x, y, col);
    }
  }
  XTft_FillScreen(*(Xuint32 *)InstancePtr->BaseAddress,
                  0, XTFT_DISPLAY_HEIGHT-XTFT_CHAR_HEIGHT,
                  XTFT_DISPLAY_WIDTH, XTFT_DISPLAY_HEIGHT-1,
                  InstancePtr->BgColor);

   return XST_SUCCESS;
 }