From 8a417edb26a0f0a0149391af4e0d5e7e21abb5c3 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Fri, 11 Jan 2008 01:32:19 +0000 Subject: Another small optimisation for greyscale blitting on SH1 (making better use of page mode by reordering accesses). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16053 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/sh/archos/lcd-as-archos-bitmap.S | 55 ++++++++++++------------ 1 file changed, 28 insertions(+), 27 deletions(-) (limited to 'firmware/target') diff --git a/firmware/target/sh/archos/lcd-as-archos-bitmap.S b/firmware/target/sh/archos/lcd-as-archos-bitmap.S index a60ea9aad1..ae7b7f85cc 100644 --- a/firmware/target/sh/archos/lcd-as-archos-bitmap.S +++ b/firmware/target/sh/archos/lcd-as-archos-bitmap.S @@ -223,22 +223,22 @@ _lcd_write_data: * r4 - current value address * r5 - current phase address * r6 - end address - * r7/r8 - current/next pixel phase - * r9 - current pixel value - * r10 - 0x00000080 \ - * r11 - 0x00008000 > for phase sign check - * r12 - 0x00800000 / + * r7/r8 - current/next block of phases (alternating) + * r9/r10 - current blocks of values + * r11 - 0x00000080 \ + * r12 - 0x00008000 > for phase sign check + * r13 - 0x00800000 / */ _lcd_grey_data: mov.l r8, @-r15 /* save r8 */ - shll2 r6 /* v */ mov.l r9, @-r15 /* save r9 */ - shll r6 /* r6 *= 8; (8 pixels per block) */ mov.l r10, @-r15 /* save r10 */ - add r4, r6 /* end address */ + shll2 r6 /* v */ + mov.l r11, @-r15 /* save r11 */ + shll r6 /* r6 *= 8; (8 pixels per block) */ mov.l .lcdr, r3 /* put lcd data port address in r3 */ - nop /* keep alignment */ + add r4, r6 /* end address */ /* This code will fail if an interrupt changes the contents of PBDRL. * If so, we must disable the interrupt here. If disabling interrupts @@ -248,17 +248,17 @@ _lcd_grey_data: mov.b @r3, r0 /* r0 = PBDRL */ or #(LCD_DS|LCD_SD), r0 /* r0 |= LCD_DS|LCD_SD */ - mov.l r11, @-r15 /* save r11 */ - and #(~(LCD_CS|LCD_SC)), r0 /* r0 &= ~(LCD_CS|LCD_SC) */ mov.l r12, @-r15 /* save r12 */ + and #(~(LCD_CS|LCD_SC)), r0 /* r0 &= ~(LCD_CS|LCD_SC) */ + mov.l r13, @-r15 /* save r13 */ neg r0, r2 /* r2 = 0 - r0 */ /* loop exploits that SD is on bit 0 for recorders and Ondios */ - mov.w .ptest, r10 - swap.b r10, r11 + mov.w .ptest, r11 + swap.b r11, r12 mov.l @r5, r7 - swap.w r10, r12 + swap.w r11, r13 mov.l .pmask, r0 .greyloop: @@ -269,66 +269,67 @@ _lcd_grey_data: add #(LCD_SC), r1 mov.b r1, @r3 - tst r12, r7 - mov.l @(4,r5), r8 + tst r13, r7 + mov.l @r4+, r10 negc r2, r1 mov.b r1, @r3 add #(LCD_SC), r1 mov.b r1, @r3 - tst r11, r7 + tst r12, r7 + mov.l @(4,r5), r8 negc r2, r1 - tst r10, r7 mov.b r1, @r3 add #(LCD_SC), r1 mov.b r1, @r3 + tst r11, r7 or r0, r7 - sub r9, r7 negc r2, r1 mov.b r1, @r3 add #(LCD_SC), r1 mov.b r1, @r3 cmp/pz r8 - mov.l r7, @r5 + sub r9, r7 negc r2, r1 mov.b r1, @r3 add #(LCD_SC), r1 mov.b r1, @r3 - tst r12, r8 - mov.l @r4+, r9 + tst r13, r8 + mov.l r7, @r5 negc r2, r1 mov.b r1, @r3 add #(LCD_SC), r1 mov.b r1, @r3 - tst r11, r8 + tst r12, r8 mov.l @(8,r5), r7 negc r2, r1 mov.b r1, @r3 add #(LCD_SC), r1 mov.b r1, @r3 - tst r10, r8 + tst r11, r8 or r0, r8 negc r2, r1 mov.b r1, @r3 add #(LCD_SC), r1 mov.b r1, @r3 - sub r9, r8 + sub r10, r8 mov.l r8, @(4,r5) add #8, r5 cmp/hi r4, r6 bt .greyloop - mov.l @r15+, r12 /* restore r12 */ + mov.l @r15+, r13 /* restore r13 */ mov #(LCD_CS|LCD_DS|LCD_SD|LCD_SC), r0 - mov.l @r15+, r11 /* restore r11 */ + mov.l @r15+, r12 /* restore r12 */ or r0, r1 /* restore port */ + mov.l @r15+, r11 /* restore r11 */ mov.l @r15+, r10 /* restore r10 */ mov.l @r15+, r9 /* restore r9 */ mov.l @r15+, r8 /* restore r8 */ -- cgit v1.2.3