27 static coord_t CharFilter_XMin = 0;
28 static coord_t CharFilter_XMax = APP_SCREEN_WIDTH;
29 static coord_t CharFilter_YMin = 0;
30 static coord_t CharFilter_YMax = APP_SCREEN_HEIGHT;
37 coord_t Screen_Height;
45 const u8* CurrentFont;
47 color_t bmpTmp[LCD_DMA_SIZE];
68 void LCD_DrawCharSetFilter( coord_t xmin, coord_t xmax, coord_t ymin, coord_t ymax )
70 CharFilter_XMin = xmin;
71 CharFilter_XMax = xmax;
72 CharFilter_YMin = ymin;
73 CharFilter_YMax = ymax;
97 void LCD_DrawChar( coord_t x, coord_t y, coord_t width,
const u8* bmp, color_t textColor, color_t bGndColor, mag_t charMagniCoeff )
101 coord_t i1 = Char_Width;
107 coord_t x0 = MAX( x, CharFilter_XMin );
108 coord_t y0 = MAX( y, CharFilter_YMin );
109 static coord_t width0;
110 static coord_t height0;
113 UNREFERENCED_PARAMETER( width );
115 width0 = MIN( Char_Width * charMagniCoeff, CharFilter_XMax - x0 );
116 height0 = MIN( Char_Height * charMagniCoeff, CharFilter_YMax - y0 );
119 height0 -= ( y0 - y );
122 width0 -= ( x0 - x );
124 if ( ( width0 <= 0 ) || ( height0 <= 0 ) )
127 i0 = ( x0 - x ) / charMagniCoeff;
128 i1 = width0 / charMagniCoeff;
130 lin1 = height0 + lin0;
132 for ( i = i0; i < i1; i++ )
135 if ( Transparency && ( charMagniCoeff < 4 ) )
136 LCD_RectRead( x0 + ( charMagniCoeff * i ), y0, charMagniCoeff, height0, ( u8* ) &bmpTmp );
139 #if DMA2D_AVAIL //Fill Vertically first
140 if ( DMALCD_ModeLCDAccess == LCD_Only )
146 LCD_SendLCDCmd_RAM_Access();
149 for ( k1 = 0; k1 < charMagniCoeff; k1++ )
152 #if DMA2D_AVAIL //Fill horizontally first
153 if ( DMALCD_ModeLCDAccess != LCD_Only )
159 for ( j = 0x80; j; j >>= 1 , j2++ )
162 for ( k2 = 0; k2 < charMagniCoeff; k2++ , n++ )
164 if ( ( n < lin0 ) || ( n >= lin1 ) )
167 if ( ( Transparency == 0 ) || ( charMagniCoeff > 3 ) )
173 if ( ( bmp[2 * i] & j ) )
185 for ( j = 0x80; j > ( 16 - Char_Height ); j >>= 1 , j2++ )
188 for ( k2 = 0; k2 < charMagniCoeff; k2++ , n++ )
190 if ( ( n < lin0 ) || ( n >= lin1 ) )
193 if ( ( Transparency == 0 ) || ( charMagniCoeff > 3 ) )
199 if ( ( bmp[2 * i + 1] & j ) )
212 LCD_SendLCDCmd_RAM_Access_End();
234 void LCD_Handler(
void )
237 #if BACKLIGHT_INTERFACE
243 LCD_BackLightChange();
244 #endif // BACKLIGHT_INTERFACE
269 void LCD_FillRect_Circle( coord_t x, coord_t y, coord_t width, coord_t height, color_t color )
278 LCD_SendLCDCmd_RAM_Access();
281 for ( Line = width; Line > 0; --Line )
283 for ( Column = height; Column > 0; Column-- )
290 LCD_SendLCDCmd_RAM_Access_End();
308 NODEBUG2
void LCD_ClearAllScreen( color_t color )
315 LCD_FillRect_Circle( 0, 0, PHYS_SCREEN_WIDTH, PHYS_SCREEN_HEIGHT, color );
345 void LCD_FillRect( coord_t x, coord_t y, coord_t width, coord_t height, color_t color )
352 if ( x > Screen_Height )
354 if ( ( x + width ) > Screen_Height )
355 width = Screen_Height - x;
358 if ( y > Screen_Width )
360 if ( ( y + height ) > Screen_Width )
361 height = Screen_Width - y;
366 if ( x > Screen_Width )
368 if ( ( x + width ) > Screen_Width )
369 width = Screen_Width - x;
372 if ( y > Screen_Height )
374 if ( ( y + height ) > Screen_Height )
375 height = Screen_Height - y;
380 LCD_FillRect_Circle( x, y, width, height, color );
402 void LCD_DrawRect( coord_t x, coord_t y, coord_t width, coord_t height, color_t color )
436 void LCD_DisplayChar( coord_t x, coord_t y, u8 ascii, color_t textColor, color_t bGndColor, mag_t charMagCoeff )
439 if ( ( ascii >= CurrentFontDef->
ASCII_start ) && ( ascii <= CurrentFontDef->ASCII_end ) )
440 LCD_DrawChar( x, y, Char_Width, ( u8* )&CurrentFont[( ascii - CurrentFontDef->
ASCII_start ) * ( 2 * Char_Width )], textColor, bGndColor, charMagCoeff );
443 #if BACKLIGHT_INTERFACE
462 Current_CCR_BackLightStart = newBacklightStart;
483 Current_CCR_BackLightStart = 0;
517 return Current_CCR_BackLightStart;
520 #endif // BACKLIGHT_INTERFACE
538 CurrentRotateScreen = RotateScreen;
557 return CurrentRotateScreen;
577 TOOLBAR_RedrawToolbar( TOOLBAR_REDRAW );
579 CurrentScreenOrientation = ScreenOrientation;
580 LCD_DisplayRotate( CurrentScreenOrientation );
581 #if TOUCHSCREEN_AVAIL
582 TOOLBAR_RedrawToolbar( TOOLBAR_REDRAW );
601 return CurrentScreenOrientation;
618 CurrentFont = NewFont;
637 CurrentFontDef = FontDef;
638 Char_Width = CurrentFontDef->
width;
639 Char_Height = CurrentFontDef->
height;
661 return CurrentFontDef;
694 if ( ID < Font_Table.nb )
696 CurrentFontDef = (
tFontDef* ) &Font_Table.fonts[ID];
697 Char_Width = CurrentFontDef->
width;
698 Char_Height = CurrentFontDef->
height;
699 CurrentFont = CurrentFontDef->
font;
734 Screen_Width = APP_SCREEN_WIDTH - ( 2 * LCD_Offset );
735 Screen_Height = APP_SCREEN_HEIGHT - ( 2 * LCD_Offset );
737 POINTER_Info.xPos = ( Screen_Width / 2 ) - ( POINTER_WIDTH / 2 ) - 1;
738 POINTER_Info.yPos = ( Screen_Width / 2 ) - ( POINTER_WIDTH / 2 ) - 1;
739 POINTER_Info.shift_PosX = 0;
740 POINTER_Info.shift_PosY = 0;
742 PosCurY = Screen_Height - Char_Height;
743 RightMarginX = Screen_Width;
744 HighMarginY = Screen_Height;
746 LCD_DrawCharSetFilter( 0, Screen_Width, 0, Screen_Height );
783 return Screen_Height;
801 Transparency = NewTransparency;