FreeCalypso > hg > fc-magnetite
annotate src/cs/drivers/drv_app/r2d/lcds/luna/r2d_task_i.c @ 702:9394305d4ff5 default tip
etm_audio.c: fix off-by-one error in auw of FIR coefficients
This fix was already made in FC Tourmaline a while back, but it is also
the kind of bugfix that deserves to be backported to Magnetite and
Selenite as well.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 31 Oct 2022 00:14:44 +0000 |
parents | ba32dc03f550 |
children |
rev | line source |
---|---|
650
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 #include "r2d/lcds/luna/r2d_luna_lcd.h" |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 void r2d_lcd_power_on(void) |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 { |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 } |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 void r2d_lcd_power_off(void) |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 { |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 } |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 void r2d_refresh(void) |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 { |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 UINT16 i,j; |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 UINT32 v; |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 UINT32 *p; |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 INT16 x1,x2,y1,y2,de,ds; |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 p=r2d_g_framebuffer->p_memory_words; |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 x1=(r2d_update_ul_x>>1)<<1; //0 |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 x2=((r2d_update_br_x>>1)<<1)+1; //174; |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 ds=(x1>>1); |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 de=R2D_MWWIDTH-(x2>>1)-1; // WHY -1, is formula right ???? |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 y1=r2d_update_ul_y; //0 |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 y2=r2d_update_br_y; //219 |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 /* set window area */ |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 LCD_REG_WR(0x36, x2); |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 LCD_REG_WR(0x37, x1); |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 LCD_REG_WR(0x38, y2); |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 LCD_REG_WR(0x39, y1); |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 /* set current write address */ |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 LCD_REG_WR(0x20, x1); |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 LCD_REG_WR(0x21, y1); |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 /* set up for GRAM write */ |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 LCD_IR = 0x22; |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 p=p+y1*R2D_MWWIDTH; |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 for(i=y1;i<=y2;i++) |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 { |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 p+=ds; |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 for(j=(x1>>1);j<=(x2>>1);j++) |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 { |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 v=*p++; |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 v=~v; |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 /*white*/ |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 /*v=0xffffffff*/ |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 /*black*/ |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 /*v=0x00000000*/ |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 LCD_DR = v&0x0FFFF; |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 LCD_DR = v>>16; |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 } |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 p+=de; |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 } |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 |
654
8c0bd0b6447c
.../luna/r2d_task_i.c: r2d_check_and_send_event() call removed
Mychaela Falconia <falcon@freecalypso.org>
parents:
650
diff
changeset
|
61 //r2d_check_and_send_event(r2d_g_framebuffer); |
650
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 r2d_reinit_update_region(); |
7d6878435c85
R2D: Luna LCD driver implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 } |