summaryrefslogtreecommitdiff
path: root/firmware/target/arm/ipod
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-03-21 18:54:52 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2022-03-21 23:53:48 -0400
commitcfeeb7889d5346e2abaf9b198375df62c58b098f (patch)
treef9956033372abe7d8bffa4e04bef0662dfb0da02 /firmware/target/arm/ipod
parent60e5786b481a26ca7c0c810d812bf5664a58cb44 (diff)
downloadrockbox-cfeeb7889d5346e2abaf9b198375df62c58b098f.tar.gz
rockbox-cfeeb7889d5346e2abaf9b198375df62c58b098f.zip
Lcd save function pointer to frame buffer get_address_fn before loops
Calling multiple levels of indirection in a loop slows things down Really these need to be rewritten to take a start and end address like most of the rest of the codebase But this is safer without having test hardware in hand Change-Id: Idae7b92ee779d020ed7fcc9334e2d5a9c710e64d
Diffstat (limited to 'firmware/target/arm/ipod')
-rw-r--r--firmware/target/arm/ipod/lcd-gray.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/firmware/target/arm/ipod/lcd-gray.c b/firmware/target/arm/ipod/lcd-gray.c
index d8695cdb10..883897b997 100644
--- a/firmware/target/arm/ipod/lcd-gray.c
+++ b/firmware/target/arm/ipod/lcd-gray.c
@@ -333,17 +333,18 @@ void lcd_update_rect(int x, int y, int width, int height)
333 x >>= 3; 333 x >>= 3;
334 width = xmax - x + 1; 334 width = xmax - x + 1;
335 335
336 for (; y <= ymax; y++) 336 void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn;
337 for (; y <= ymax; y++)
337 { 338 {
338 lcd_cmd_and_data(R_RAM_ADDR_SET, (y << 5) + addr_offset - x); 339 lcd_cmd_and_data(R_RAM_ADDR_SET, (y << 5) + addr_offset - x);
339 lcd_prepare_cmd(R_RAM_DATA); 340 lcd_prepare_cmd(R_RAM_DATA);
340 341 fb_data *data = fbaddr(2*x,y);
341#if defined(IPOD_MINI) || defined(IPOD_MINI2G) 342#if defined(IPOD_MINI) || defined(IPOD_MINI2G)
342 if (pix_offset == -2) 343 if (pix_offset == -2)
343 lcd_write_data_shifted(FBADDR(2*x, y), width); 344 lcd_write_data_shifted(data, width);
344 else 345 else
345#endif 346#endif
346 lcd_write_data(FBADDR(2*x, y), width); 347 lcd_write_data(data, width);
347 } 348 }
348} 349}
349 350