 #endif
 }
 
-static inline void nscale8_video_LEAVING_R1_DIRTY( unsigned char & i, unsigned char scale)
-{
-#if SCALE8_C == 1 || defined(LIB8_ATTINY)
-    i = (((int)i * (int)scale) >> 8) + ((i&&scale)?1:0);
-#elif SCALE8_AVRASM == 1
-    asm volatile(
-        "  tst %[i]\n\t"
-        "  breq L_%=\n\t"
-        "  mul %[i], %[scale]\n\t"
-        "  mov %[i], r1\n\t"
-        "  breq L_%=\n\t"
-        "  subi %[i], 0xFF\n\t"
-        "L_%=: \n\t"
-        : [i] "+a" (i)
-        : [scale] "a" (scale)
-        : "r0", "r1");
-#else
-#error "No implementation for scale8_video_LEAVING_R1_DIRTY available."
-#endif
-}
-
-static inline void cleanup_R1()
-{
-#if CLEANUP_R1_AVRASM == 1
-    // Restore r1 to "0"; it's expected to always be that
-    asm volatile( "clr __zero_reg__  \n\t" : : : "r1" );
-#endif
-}
-
-static inline void nscale8x3_video( unsigned char& r, unsigned char& g, unsigned char& b, unsigned char scale)
-{
-#if SCALE8_C == 1
-    unsigned char nonzeroscale = (scale != 0) ? 1 : 0;
-    r = (r == 0) ? 0 : (((int)r * (int)(scale) ) >> 8) + nonzeroscale;
-    g = (g == 0) ? 0 : (((int)g * (int)(scale) ) >> 8) + nonzeroscale;
-    b = (b == 0) ? 0 : (((int)b * (int)(scale) ) >> 8) + nonzeroscale;
-#elif SCALE8_AVRASM == 1
-    nscale8_video_LEAVING_R1_DIRTY( r, scale);
-    nscale8_video_LEAVING_R1_DIRTY( g, scale);
-    nscale8_video_LEAVING_R1_DIRTY( b, scale);
-    cleanup_R1();
-#else
-#error "No implementation for nscale8x3 available."
-#endif
-}
- 
 static inline unsigned char scale8_video_LEAVING_R1_DIRTY( unsigned char i, unsigned char scale)
 {
 #if SCALE8_C == 1 || defined(LIB8_ATTINY)
     unsigned char j = (((int)i * (int)scale) >> 8) + ((i&&scale)?1:0);
-    // unsigned char nonzeroscale = (scale != 0) ? 1 : 0;
-    // unsigned char j = (i == 0) ? 0 : (((int)i * (int)(scale) ) >> 8) + nonzeroscale;
     return j;
 #elif SCALE8_AVRASM == 1
     unsigned char j=0;

  for (unsigned char hue=0; hue < 255; hue++) {
    for (unsigned char index=0; index < PIXELS; index++) {
        unsigned char offset = index * delta * direction;
        hsv2rgb_rainbow(hue + offset, 255, 255, led_colors[index]);
        }
    show_all_led_colors();
    delay(20);

        : "r0", "r1");

    return j;
#else
#error "No implementation for scale8_video_LEAVING_R1_DIRTY available."
#endif
} 

void hsv2rgb_rainbow(unsigned char hue, unsigned char colors[3])
{
    // Yellow has a higher inherent brightness than
    // any other color; 'pure' yellow is perceived to
