$regfile = "m32def.dat" $crystal = 20000000 $baud = 384000 $hwstack = 32 ' default use 32 for the hardware stack $swstack = 10 ' default use 10 for the SW stack $framesize = 40 Config Portb.0 = Input ' default use 40 for the frame space Config Portb.1 = Input Config Portb.2 = Input Config Portb.3 = Input Config Portb.4 = Input Portb.0 = 1 Portb.1 = 1 Portb.2 = 1 Portb.3 = 1 K_l Alias Pinb.3 K_r Alias Pinb.2 K_u Alias Pinb.1 K_d Alias Pinb.0 K_res Alias Pinb.4 $lib "glcdKS108.lib" Config Graphlcd = 128 * 64sed , Dataport = Porta , Controlport = Portc , Ce = 3 , Ce2 = 4 , Cd = 7 , Rd = 6 , Reset = 2 , Enable = 5 Config Portd.7 = Output Portd.7 = 1 Cls Setfont Font16x16 'Lcdat 1 , 1 , "SDOUX" Dim Fps As Integer , Tim_i As Byte Config Timer0 = Timer , Prescale = 1024 'On Timer0 Tim0_isr 'Enable Timer0 Enable Interrupts Dim Font_color As Byte , Font_t As Byte Dim Font_x1 As Byte , Font_x2 As Byte , Font_y1 As Byte , Font_y2 As Byte , Font_font As Byte , Font_ttt As Byte Dim Font_xyxy(4) As Byte Dim Zoom As Byte Dim Sys_tmp As Byte Font_xyxy(1) = 0 Font_xyxy(2) = 0 Font_xyxy(3) = 8 Font_xyxy(4) = 8 Do Font_x1 = Font_xyxy(1) : Font_y1 = Font_xyxy(2) : Font_x2 = Font_xyxy(3) : Font_y2 = Font_xyxy(4) : Font_color = 1 : Gosub Disp_num Font_x1 = Font_x1 + 1 : Font_y1 = Font_y1 + 1 : Font_x2 = Font_x2 + 1 : Font_y2 = Font_y2 + 1 : Gosub Disp_num For Sys_tmp = 1 To 8 Waitms 100 If K_l = 0 Then Do If K_l = 1 Then Exit Do Loop Cls Font_xyxy(3) = Font_xyxy(3) - 2 End If If K_r = 0 Then Do If K_r = 1 Then Exit Do Loop Cls Font_xyxy(3) = Font_xyxy(3) + 2 End If If K_u = 0 Then Do If K_u = 1 Then Exit Do Loop Cls Font_xyxy(4) = Font_xyxy(4) - 2 End If If K_d = 0 Then Do If K_d = 1 Then Exit Do Loop Cls Font_xyxy(4) = Font_xyxy(4) + 2 End If Next Sys_tmp If Font_font <> 1 Then Gosub Font_hide Else Font_x1 = Font_xyxy(1) : Font_y1 = Font_xyxy(2) : Font_x2 = Font_xyxy(3) : Font_y2 = Font_xyxy(4) : Font_color = 0 : Gosub Disp_num Font_x1 = Font_x1 + 1 : Font_y1 = Font_y1 + 1 : Font_x2 = Font_x2 + 1 : Font_y2 = Font_y2 + 1 : Gosub Disp_num End If Font_font = Font_font + 1 If Font_font = 10 Then Font_font = 0 Gosub Font_show Loop End '$include "font8x8.font" $include "font16x16.font" Font_hide: Font_t = Font_xyxy(3) - Font_xyxy(1) Font_ttt = Font_t / 2 Font_ttt = Font_ttt - 1 For Zoom = 0 To Font_ttt Step 1 Font_x1 = Font_xyxy(1) + Zoom : Font_y1 = Font_xyxy(2) : Font_x2 = Font_xyxy(3) -zoom : Font_y2 = Font_xyxy(4) : Font_color = 1 : Gosub Disp_num Font_x1 = Font_xyxy(1) + Zoom : Font_y1 = Font_xyxy(2) : Font_x2 = Font_xyxy(3) -zoom : Font_y2 = Font_xyxy(4) : Font_color = 1 Font_x1 = Font_x1 + 1 : Font_y1 = Font_y1 + 1 : Font_x2 = Font_x2 + 1 : Font_y2 = Font_y2 + 1 : Gosub Disp_num Waitms 10 Font_x1 = Font_xyxy(1) + Zoom : Font_y1 = Font_xyxy(2) : Font_x2 = Font_xyxy(3) -zoom : Font_y2 = Font_xyxy(4) : Font_color = 0 : Gosub Disp_num Font_x1 = Font_xyxy(1) + Zoom : Font_y1 = Font_xyxy(2) : Font_x2 = Font_xyxy(3) -zoom : Font_y2 = Font_xyxy(4) : Font_color = 0 Font_x1 = Font_x1 + 1 : Font_y1 = Font_y1 + 1 : Font_x2 = Font_x2 + 1 : Font_y2 = Font_y2 + 1 : Gosub Disp_num Next Zoom Return Font_show: Font_t = Font_xyxy(3) - Font_xyxy(1) Font_t = Font_t / 2 'Font_t = Font_t - 2 For Zoom = Font_t To 0 Step -2 Font_x1 = Font_xyxy(1) + Zoom : Font_y1 = Font_xyxy(2) : Font_x2 = Font_xyxy(3) -zoom : Font_y2 = Font_xyxy(4) : Font_color = 1 : Gosub Disp_num Font_x1 = Font_xyxy(1) + Zoom : Font_y1 = Font_xyxy(2) : Font_x2 = Font_xyxy(3) -zoom : Font_y2 = Font_xyxy(4) : Font_color = 1 Font_x1 = Font_x1 + 1 : Font_y1 = Font_y1 + 1 : Font_x2 = Font_x2 + 1 : Font_y2 = Font_y2 + 1 : Gosub Disp_num Waitms 30 Font_x1 = Font_xyxy(1) + Zoom : Font_y1 = Font_xyxy(2) : Font_x2 = Font_xyxy(3) -zoom : Font_y2 = Font_xyxy(4) : Font_color = 0 : Gosub Disp_num Font_x1 = Font_xyxy(1) + Zoom : Font_y1 = Font_xyxy(2) : Font_x2 = Font_xyxy(3) -zoom : Font_y2 = Font_xyxy(4) : Font_color = 0 : Gosub Disp_num Font_x1 = Font_x1 + 1 : Font_y1 = Font_y1 + 1 : Font_x2 = Font_x2 + 1 : Font_y2 = Font_y2 + 1 : Gosub Disp_num Next Zoom Return Disp_num: Font_t = Font_y2 - Font_y1 Font_t = Font_t / 2 Font_t = Font_t + Font_y1 If Font_font <> 1 And Font_font <> 4 Then '1 Line(font_x1 , Font_y1 ) -(font_x2 , Font_y1) , Font_color End If If Font_font <> 1 And Font_font <> 2 And Font_font <> 3 And Font_font <> 7 Then '2 Line(font_x1 , Font_y1 ) -(font_x1 , Font_t) , Font_color End If If Font_font <> 1 And Font_font <> 5 And Font_font <> 6 Then '3 Line(font_x2 , Font_y1 ) -(font_x2 , Font_t) , Font_color End If If Font_font <> 1 And Font_font <> 7 And Font_font <> 0 Then '4 Line(font_x1 , Font_t ) -(font_x2 , Font_t) , Font_color End If If Font_font <> 1 And Font_font <> 3 And Font_font <> 4 And Font_font <> 5 And Font_font <> 7 And Font_font <> 9 Then '5 Line(font_x1 , Font_t ) -(font_x1 , Font_y2) , Font_color End If If Font_font <> 1 And Font_font <> 2 Then '6 Line(font_x2 , Font_t ) -(font_x2 , Font_y2) , Font_color End If If Font_font <> 1 And Font_font <> 4 And Font_font <> 7 And Font_font <> 9 Then '7 Line(font_x1 , Font_y2 ) -(font_x2 , Font_y2) , Font_color End If If Font_font = 1 Then '* Font_t = Font_x2 - Font_x1 Font_t =Font_t /2 Font_t = Font_t + Font_x1 Line(font_t , Font_y1 ) -(font_t , Font_y2) , Font_color End If Return Tim0_isr: Tim_i = Tim_i + 1 If Tim_i = 76 Then Cls Lcdat 1 , 1 , "FPS:" ; Fps ; " " Fps = 0 : Tim_i = 0 End If Return