3 /* screen routines for color targets */
15 static const fb_data _16bpp_colors
[32] = {
17 LCD_RGBPACK(N0
, N0
, N0
), LCD_RGBPACK(N0
, N0
, N1
),
18 LCD_RGBPACK(N1
, N0
, N0
), LCD_RGBPACK(N1
, N0
, N1
),
19 LCD_RGBPACK(N0
, N1
, N0
), LCD_RGBPACK(N0
, N1
, N1
),
20 LCD_RGBPACK(N1
, N1
, N0
), LCD_RGBPACK(N1
, N1
, N1
),
21 LCD_RGBPACK(B0
, B0
, B0
), LCD_RGBPACK(B0
, B0
, B1
),
22 LCD_RGBPACK(B1
, B0
, B0
), LCD_RGBPACK(B1
, B0
, B1
),
23 LCD_RGBPACK(B0
, B1
, B0
), LCD_RGBPACK(B0
, B1
, B1
),
24 LCD_RGBPACK(B1
, B1
, B0
), LCD_RGBPACK(B1
, B1
, B1
),
26 LCD_RGBPACK(IN0
, IN0
, IN0
), LCD_RGBPACK(IN0
, IN0
, IN1
),
27 LCD_RGBPACK(IN1
, IN0
, IN0
), LCD_RGBPACK(IN1
, IN0
, IN1
),
28 LCD_RGBPACK(IN0
, IN1
, IN0
), LCD_RGBPACK(IN0
, IN1
, IN1
),
29 LCD_RGBPACK(IN1
, IN1
, IN0
), LCD_RGBPACK(IN1
, IN1
, IN1
),
30 LCD_RGBPACK(IB0
, IB0
, IB0
), LCD_RGBPACK(IB0
, IB0
, IB1
),
31 LCD_RGBPACK(IB1
, IB0
, IB0
), LCD_RGBPACK(IB1
, IB0
, IB1
),
32 LCD_RGBPACK(IB0
, IB1
, IB0
), LCD_RGBPACK(IB0
, IB1
, IB1
),
33 LCD_RGBPACK(IB1
, IB1
, IB0
), LCD_RGBPACK(IB1
, IB1
, IB1
),
36 void init_spect_scr(void)
39 int offset
= settings
.invert_colors
? 16 : 0;
41 for(i
= 0; i
< 16; i
++)
42 sp_colors
[i
] = i
+ offset
;
44 sp_image
= (char *) &image_array
;
45 spscr_init_mask_color();
46 spscr_init_line_pointers(HEIGHT
);
50 void update_screen(void)
57 #if LCD_HEIGHT >= ZX_HEIGHT && LCD_WIDTH >= ZX_WIDTH
59 scrptr
= (byte
*) SPNM(image
);
60 frameb
= rb
->lcd_framebuffer
;
61 for ( y
= 0 ; y
< HEIGHT
*WIDTH
; y
++ ){
62 frameb
[y
] = _16bpp_colors
[(unsigned)sp_image
[y
]];
67 int srcx
, srcy
=0; /* x / y coordinates in source image */
69 image
= sp_image
+ ( (Y_OFF
)*(WIDTH
) ) + X_OFF
;
70 frameb
= rb
->lcd_framebuffer
;
71 for(y
= 0; y
< LCD_HEIGHT
; y
++)
73 srcx
= 0; /* reset our x counter before each row... */
74 for(x
= 0; x
< LCD_WIDTH
; x
++)
76 *frameb
= _16bpp_colors
[image
[srcx
>>16]];
77 srcx
+= X_STEP
; /* move through source image */
80 srcy
+= Y_STEP
; /* move through the source image... */
81 image
+= (srcy
>>16)*WIDTH
; /* and possibly to the next row. */
82 srcy
&= 0xffff; /* set up the y-coordinate between 0 and 1 */
86 if ( settings
.showfps
) {
88 int TPF
= HZ
/50;/* ticks per frame */
89 if ((*rb
->current_tick
-start_time
) > TPF
)
90 percent
= 100*video_frames
/((*rb
->current_tick
-start_time
)/TPF
);
91 rb
->snprintf(str
,sizeof(str
),"%d %%",percent
);
92 rb
->lcd_putsxy(0,0,str
);