Skip to content

Commit 9e977c1

Browse files
committed
use pad axis motion sensor
hookup first axis to update background alpha-channel on the fly, requires a "smooth" algorithm now...
1 parent ce1f83b commit 9e977c1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

main.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,23 @@ static void draw_frame(CellPadData *data)
183183
}
184184
else // default, blend + starfield
185185
{
186+
#ifdef DEBUG
187+
// hookup the first axis value and play with it...
188+
int8_t r = (uint8_t)(data->button[20] - 0x200) /16;
189+
uint8_t fr[4];
190+
191+
fr[0] = GET_A(p->c[0]), fr[1] = GET_R(p->c[0]),
192+
fr[2] = GET_G(p->c[0]), fr[3] = GET_B(p->c[0]);
193+
194+
fr[0] += r; // update alpha
195+
dbg_printf("fr: 0x%.2x %x\n", fr[0], r);
196+
197+
uint32_t tc = ARGB(fr[0], fr[1], fr[2], fr[3]);
198+
dbg_printf("updt bg: 0x%.8x\n", tc);
199+
200+
set_background_color(tc); // update bg color
201+
#endif
202+
186203
draw_background(); // alpha-blended background
187204

188205
#ifdef HAVE_STARFIELD

0 commit comments

Comments
 (0)