freemyipod r496 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r495‎ | r496 | r497 >
Date:15:21, 30 January 2011
Author:theseven
Status:new
Tags:
Comment:
emCORE: Remove old LCD-native rendering code.
Modified paths:
  • /emcore/trunk/drawing.S (modified) (history)
  • /emcore/trunk/drawing.h (modified) (history)
  • /emcore/trunk/export/syscallapi.h (modified) (history)
  • /emcore/trunk/export/syscallwrappers.h (modified) (history)
  • /emcore/trunk/syscallapi.c (modified) (history)

Diff [purge]

Index: emcore/trunk/drawing.S
@@ -69,104 +69,7 @@
7070 .size rendertext, .-rendertext
7171
7272
73 -.section .icode.renderfillrect, "ax", %progbits
74 -.align 2
75 -.global renderfillrect
76 -.type renderfillrect, %function
77 -renderfillrect:
78 - ldr r12, [sp,#8]
79 - mla r1, r12, r2, r1
80 -#if (LCD_BYTESPERPIXEL == 1)
81 - add r0, r0, r1
82 -#elif (LCD_BYTESPERPIXEL == 2)
83 - add r0, r0, r1,lsl#1
84 -#elif (LCD_BYTESPERPIXEL == 4)
85 - add r0, r0, r1,lsl#2
86 -#else
87 -#error Unknown number of bytes per pixel!
88 -#endif
89 - ldmfd sp, {r1,r2}
90 -renderfillrect_y:
91 - cmp r1, #0
92 - cmpne r3, #0
93 - moveq pc, lr
94 - sub r1, r1, #1
95 - mov r12, r3
96 -renderfillrect_x:
97 -#if (LCD_BYTESPERPIXEL == 1)
98 - strb r2, [r0], #1
99 -#elif (LCD_BYTESPERPIXEL == 2)
100 - strh r2, [r0], #2
101 -#elif (LCD_BYTESPERPIXEL == 4)
102 - str r2, [r0], #4
103 -#else
104 -#error Unknown number of bytes per pixel!
105 -#endif
106 - subs r12, r12, #1
107 - bne renderfillrect_x
108 - ldr r12, [sp,#8]
109 - sub r12, r12, r3
110 -#if (LCD_BYTESPERPIXEL == 1)
111 - add r0, r0, r12
112 -#elif (LCD_BYTESPERPIXEL == 2)
113 - add r0, r0, r12,lsl#1
114 -#elif (LCD_BYTESPERPIXEL == 4)
115 - add r0, r0, r12,lsl#2
116 -#else
117 -#error Unknown number of bytes per pixel!
118 -#endif
119 - b renderfillrect_y
120 -.size renderfillrect, .-renderfillrect
121 -
122 -
12373 #if (LCD_BYTESPERPIXEL == 2)
124 -.section .icode.renderbmp, "ax", %progbits
125 -.align 2
126 -.global renderbmp
127 -.type renderbmp, %function
128 -renderbmp:
129 - mov r2, r2,lsl#1
130 - ldrh r3, [r1]
131 - sub r3, r3, #0x4d00
132 - subs r3, r3, #0x42
133 - movne pc, lr
134 - stmfd sp!, {r4,lr}
135 - ldrh r4, [r1,#18]
136 - ldrh r12, [r1,#20]
137 - orr r4, r4, r12,lsl#16
138 - ldrh r3, [r1,#22]
139 - ldrh r12, [r1,#24]
140 - orr r3, r3, r12,lsl#16
141 - ldrh lr, [r1,#10]
142 - ldrh r12, [r1,#12]
143 - orr lr, lr, r12,lsl#16
144 - add r1, r1, lr
145 - mul lr, r2, r3
146 - add r0, r0, lr
147 -renderbmp_row:
148 - mov r12, r4
149 - sub r0, r0, r2
150 -renderbmp_pixel:
151 -#ifdef LCD_BIGENDIAN
152 - ldrb lr, [r1,#1]
153 - strb lr, [r0], #1
154 - ldrb lr, [r1], #2
155 - strb lr, [r0], #1
156 -#else
157 - ldrh lr, [r1], #2
158 - strh lr, [r0], #2
159 -#endif
160 - subs r12, r12, #1
161 - bne renderbmp_pixel
162 - tst r4, #1
163 - addne r1, r1, #2
164 - sub r0, r0, r4,lsl#1
165 - subs r3, r3, #1
166 - bne renderbmp_row
167 - ldmfd sp!, {r4,pc}
168 -.size renderbmp, .-renderbmp
169 -
170 -
17174 .section .icode.renderchar, "ax", %progbits
17275 .align 2
17376 .global renderchar
Index: emcore/trunk/drawing.h
@@ -34,8 +34,6 @@
3535
3636 void renderchar(void* buffer, int fgcol, int bgcol, char text, int stride);
3737 void rendertext(void* buffer, int fgcol, int bgcol, char* text, int stride);
38 -void renderbmp(void* buffer, void* bitmap, int stride);
39 -void renderfillrect(uint16_t* buffer, int x, int y, int width, int height, int color, int stride);
4038 int get_font_width(void);
4139 int get_font_height(void);
4240
Index: emcore/trunk/export/syscallwrappers.h
@@ -48,10 +48,8 @@
4949 #define readdir __emcore_syscall->readdir
5050 #define mkdir __emcore_syscall->mkdir
5151 #define rmdir __emcore_syscall->rmdir
52 -#define renderbmp __emcore_syscall->renderbmp
5352 #define renderchar __emcore_syscall->renderchar
5453 #define rendertext __emcore_syscall->rendertext
55 -#define renderfillrect __emcore_syscall->renderfillrect
5654 #define get_font_width __emcore_syscall->get_font_width
5755 #define get_font_height __emcore_syscall->get_font_height
5856 #define execimage __emcore_syscall->execimage
Index: emcore/trunk/export/syscallapi.h
@@ -108,10 +108,8 @@
109109 typeof(readdir) *readdir;
110110 typeof(mkdir) *mkdir;
111111 typeof(rmdir) *rmdir;
112 - typeof(renderbmp) *renderbmp;
113112 typeof(renderchar) *renderchar;
114113 typeof(rendertext) *rendertext;
115 - typeof(renderfillrect) *renderfillrect;
116114 typeof(get_font_width) *get_font_width;
117115 typeof(get_font_height) *get_font_height;
118116 typeof(execimage) *execimage;
Index: emcore/trunk/syscallapi.c
@@ -169,10 +169,8 @@
170170 .lcd_get_height = lcd_get_height,
171171 .lcd_get_bytes_per_pixel = lcd_get_bytes_per_pixel,
172172 .lcd_translate_color = lcd_translate_color,
173 - .renderbmp = renderbmp,
174173 .renderchar = renderchar,
175174 .rendertext = rendertext,
176 - .renderfillrect = renderfillrect,
177175 .get_font_width = get_font_width,
178176 .get_font_height = get_font_height,
179177 #endif