diff options
-rw-r--r-- | miscutils/fbsplash.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c index 04d583df6..988439b25 100644 --- a/miscutils/fbsplash.c +++ b/miscutils/fbsplash.c | |||
@@ -143,7 +143,7 @@ static void fb_open(const char *strfb_device) | |||
143 | 143 | ||
144 | // map the device in memory | 144 | // map the device in memory |
145 | G.addr = mmap(NULL, | 145 | G.addr = mmap(NULL, |
146 | G.scr_var.xres * G.scr_var.yres * G.bytes_per_pixel, | 146 | G.scr_var.yres * G.scr_fix.line_length, |
147 | PROT_WRITE, MAP_SHARED, fbfd, 0); | 147 | PROT_WRITE, MAP_SHARED, fbfd, 0); |
148 | if (G.addr == MAP_FAILED) | 148 | if (G.addr == MAP_FAILED) |
149 | bb_perror_msg_and_die("mmap"); | 149 | bb_perror_msg_and_die("mmap"); |
@@ -213,8 +213,8 @@ static void fb_drawrectangle(void) | |||
213 | thispix = fb_pixel_value(nred, ngreen, nblue); | 213 | thispix = fb_pixel_value(nred, ngreen, nblue); |
214 | 214 | ||
215 | // horizontal lines | 215 | // horizontal lines |
216 | ptr1 = G.addr + (G.nbar_posy * G.scr_var.xres + G.nbar_posx) * G.bytes_per_pixel; | 216 | ptr1 = G.addr + G.nbar_posy * G.scr_fix.line_length + G.nbar_posx * G.bytes_per_pixel; |
217 | ptr2 = G.addr + ((G.nbar_posy + G.nbar_height - 1) * G.scr_var.xres + G.nbar_posx) * G.bytes_per_pixel; | 217 | ptr2 = G.addr + (G.nbar_posy + G.nbar_height - 1) * G.scr_fix.line_length + G.nbar_posx * G.bytes_per_pixel; |
218 | cnt = G.nbar_width - 1; | 218 | cnt = G.nbar_width - 1; |
219 | do { | 219 | do { |
220 | fb_write_pixel(ptr1, thispix); | 220 | fb_write_pixel(ptr1, thispix); |
@@ -224,14 +224,14 @@ static void fb_drawrectangle(void) | |||
224 | } while (--cnt >= 0); | 224 | } while (--cnt >= 0); |
225 | 225 | ||
226 | // vertical lines | 226 | // vertical lines |
227 | ptr1 = G.addr + (G.nbar_posy * G.scr_var.xres + G.nbar_posx) * G.bytes_per_pixel; | 227 | ptr1 = G.addr + G.nbar_posy * G.scr_fix.line_length + G.nbar_posx * G.bytes_per_pixel; |
228 | ptr2 = G.addr + (G.nbar_posy * G.scr_var.xres + G.nbar_posx + G.nbar_width - 1) * G.bytes_per_pixel; | 228 | ptr2 = G.addr + G.nbar_posy * G.scr_fix.line_length + (G.nbar_posx + G.nbar_width - 1) * G.bytes_per_pixel; |
229 | cnt = G.nbar_height - 1; | 229 | cnt = G.nbar_height - 1; |
230 | do { | 230 | do { |
231 | fb_write_pixel(ptr1, thispix); | 231 | fb_write_pixel(ptr1, thispix); |
232 | fb_write_pixel(ptr2, thispix); | 232 | fb_write_pixel(ptr2, thispix); |
233 | ptr1 += G.scr_var.xres * G.bytes_per_pixel; | 233 | ptr1 += G.scr_fix.line_length; |
234 | ptr2 += G.scr_var.xres * G.bytes_per_pixel; | 234 | ptr2 += G.scr_fix.line_length; |
235 | } while (--cnt >= 0); | 235 | } while (--cnt >= 0); |
236 | } | 236 | } |
237 | 237 | ||
@@ -254,7 +254,7 @@ static void fb_drawfullrectangle(int nx1pos, int ny1pos, int nx2pos, int ny2pos, | |||
254 | cnt1 = ny2pos - ny1pos; | 254 | cnt1 = ny2pos - ny1pos; |
255 | nypos = ny1pos; | 255 | nypos = ny1pos; |
256 | do { | 256 | do { |
257 | ptr = G.addr + (nypos * G.scr_var.xres + nx1pos) * G.bytes_per_pixel; | 257 | ptr = G.addr + nypos * G.scr_fix.line_length + nx1pos * G.bytes_per_pixel; |
258 | cnt2 = nx2pos - nx1pos; | 258 | cnt2 = nx2pos - nx1pos; |
259 | do { | 259 | do { |
260 | fb_write_pixel(ptr, thispix); | 260 | fb_write_pixel(ptr, thispix); |