freemyipod r377 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r376‎ | r377 | r378 >
Date:04:22, 23 December 2010
Author:theseven
Status:new
Tags:
Comment:
embios: Fix utterly broken renderfillrect()
Modified paths:
  • /embios/trunk/drawing.S (modified) (history)

Diff [purge]

Index: embios/trunk/drawing.S
@@ -88,13 +88,11 @@
8989 ldmfd sp, {r1,r2}
9090 renderfillrect_y:
9191 cmp r1, #0
 92+ cmpne r3, #0
9293 moveq pc, lr
9394 sub r1, r1, #1
9495 mov r12, r3
9596 renderfillrect_x:
96 - cmp r12, #0
97 - beq renderfillrect_y
98 - sub r12, r12, #1
9997 #if (LCD_BYTESPERPIXEL == 1)
10098 strb r2, [r0], #1
10199 #elif (LCD_BYTESPERPIXEL == 2)
@@ -104,7 +102,20 @@
105103 #else
106104 #error Unknown number of bytes per pixel!
107105 #endif
108 - b renderfillrect_x
 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
109120 .size renderfillrect, .-renderfillrect
110121
111122