10 static unsigned char graybuffer
[LCD_HEIGHT
*LCD_WIDTH
] IBSS_ATTR
; /* off screen buffer */
12 static const unsigned char graylevels
[16] = {
13 N0
, (6*N0
+1*N1
)/7, (5*N0
+2*N1
)/7, (4*N0
+3*N1
)/7,
14 (3*N0
+4*N1
)/7, (2*N0
+5*N1
)/7, (1*N0
+6*N1
)/7, N1
,
15 B0
, (6*B0
+1*B1
)/7, (5*B0
+2*B1
)/7, (4*B0
+3*B1
)/7,
16 (3*B0
+4*B1
)/7, (2*B0
+5*B1
)/7, (1*B0
+6*B1
)/7, B1
19 void init_spect_scr(void)
22 unsigned mask
= settings
.invert_colors
? 0xFF : 0;
24 for(i
= 0; i
< 16; i
++)
25 sp_colors
[i
] = graylevels
[i
] ^ mask
;
27 sp_image
= (char *) &image_array
;
28 spscr_init_mask_color();
29 spscr_init_line_pointers(HEIGHT
);
33 void update_screen(void)
40 int srcx
, srcy
=0; /* x / y coordinates in source image */
41 image
= sp_image
+ ( (Y_OFF
)*(WIDTH
) ) + X_OFF
;
42 unsigned char* buf_ptr
;
44 for(y
= 0; y
< LCD_HEIGHT
; y
++)
46 srcx
= 0; /* reset our x counter before each row... */
47 for(x
= 0; x
< LCD_WIDTH
; x
++)
49 *buf_ptr
=image
[(srcx
>>16)];
50 srcx
+= X_STEP
; /* move through source image */
53 srcy
+= Y_STEP
; /* move through the source image... */
54 image
+= (srcy
>>16)*WIDTH
; /* and possibly to the next row. */
55 srcy
&= 0xffff; /* set up the y-coordinate between 0 and 1 */
58 #ifdef USE_BUFFERED_GREY
59 grey_gray_bitmap(graybuffer
, 0, 0, LCD_WIDTH
, LCD_HEIGHT
);
62 if ( settings
.showfps
) {
64 int TPF
= HZ
/50;/* ticks per frame */
65 if ((*rb
->current_tick
-start_time
) > TPF
)
66 percent
= 100*video_frames
/((*rb
->current_tick
-start_time
)/TPF
);
67 rb
->snprintf(str
,sizeof(str
),"%d %%",percent
);
68 #if defined USE_BUFFERED_GREY
77 #if defined USE_BUFFERED_GREY
80 grey_ub_gray_bitmap(graybuffer
, 0, 0, LCD_WIDTH
, LCD_HEIGHT
);