www.pudn.com > netbox-ii_ks0108_192x64.rar > LCD_API.CPP


#include  
#include  
#include "HD61202.h" 
#include "lcd_api.h" 
#include "dotlib.h" 
 
DOTLIB  LCD_Dot; 
 
int XOREnable; 
// return =  0: ok! 
//        = -1: fail 
int  LCD_Init( char* CHN_FntFile, char* ASCII_FntFile ) 
{ 
   InitLCD( ); 
   LCD_Dot.initiChinese( CHN_FntFile, ASCII_FntFile ); 
   XOREnable = 0; 
   return 0; 
} 
 
int  LCD_Clearup( ) 
{ 
   return ClearScreen( ); 
} 
 
// Mode = 0: copy write for dot, line 
//      = 1: xor write for dot, line 
int  LCD_SetMode( int Mode ) 
{ 
   if( Mode == 0 ) XOREnable = 0; 
   else            XOREnable = 0x80; 
   return 0; 
} 
 
// x0, x1 = 0 -- 127; y0, y1 = 0 -- 63; 
// color = 0, 1 
int  LCD_PutPixel( int x0, int y0, int color ) 
{ 
   return WritePixel( x0, y0, color|XOREnable ); 
} 
 
int  LCD_DrawLine( int x0, int y0, int x1, int y1, int color ) 
{ 
   int i, x1x, y1y, y; 
 
   if( x1>x0)  	{ x1x=x1-x0; } 
   else		{ x1x=x0-x1; } 
   if( y1>y0)  	{ y1y=y1-y0; y=y0; } 
   else		{ y1y=y0-y1; y=y1; } 
 
   if( x1x!=0 ) 
      { 
      for( i=0; ix1 ) 
	    { 
	    if( y0