Beispiel #1
0
    private bool shiftLeft(what_to_shift section)
    {
        int counter;
        int scroll_length;
        int ref_length;

        if (section == what_to_shift.nothing)
        {
            shift_position = 0;
            return(true);
        }

        if (section == what_to_shift.first_line)
        {
            ref_length = line_lengths[0];
        }
        else
        {
            ref_length = x;
        }

        if (ref_length + 11 > max_line_length)
        {
            scroll_length = max_line_length;
        }
        else
        {
            scroll_length = ref_length + 11;
        }

        for (counter = 0; counter < scroll_length - 1; counter++)
        {
            if (shift_position + counter > scroll_length - 1)
            {
                if (section == what_to_shift.all)    // all 16 lines
                {
                    led_columns_red_out[counter]   = led_columns_red[counter + shift_position - (scroll_length)];
                    led_columns_green_out[counter] = led_columns_green[counter + shift_position - (scroll_length)];
                }
                else if (section == what_to_shift.first_line)    // upper 8 lines
                {
                    led_columns_red_out[counter]    = (UInt16)(led_columns_red[counter + shift_position - (scroll_length)] & 0xFF);
                    led_columns_red_out[counter]   |= (UInt16)(led_columns_red[counter] & 0xFF00);
                    led_columns_green_out[counter]  = (UInt16)(led_columns_green[counter + shift_position - (scroll_length)] & 0xFF);
                    led_columns_green_out[counter] |= (UInt16)(led_columns_green[counter] & 0xFF00);
                }
                else if (section == what_to_shift.second_line)    // lower 8 lines
                {
                    led_columns_red_out[counter]    = (UInt16)(led_columns_red[counter + shift_position - (scroll_length)] & 0xFF00);
                    led_columns_red_out[counter]   |= (UInt16)(led_columns_red[counter] & 0xFF);
                    led_columns_green_out[counter]  = (UInt16)(led_columns_green[counter + shift_position - (scroll_length)] & 0xFF00);
                    led_columns_green_out[counter] |= (UInt16)(led_columns_green[counter] & 0xFF);
                }
            }
            else
            {
                if (section == what_to_shift.all)    // all 16 lines
                {
                    led_columns_red_out[counter]   = led_columns_red[shift_position + counter];
                    led_columns_green_out[counter] = led_columns_green[shift_position + counter];
                }
                else if (section == what_to_shift.first_line)    // upper 8 lines
                {
                    led_columns_red_out[counter]    = (UInt16)(led_columns_red[shift_position + counter] & 0xFF);
                    led_columns_red_out[counter]   |= (UInt16)(led_columns_red[counter] & 0xFF00);
                    led_columns_green_out[counter]  = (UInt16)(led_columns_green[shift_position + counter] & 0xFF);
                    led_columns_green_out[counter] |= (UInt16)(led_columns_green[counter] & 0xFF00);
                }
                else if (section == what_to_shift.second_line)    // lower 8 lines
                {
                    led_columns_red_out[counter]    = (UInt16)(led_columns_red[shift_position + counter] & 0xFF00);
                    led_columns_red_out[counter]   |= (UInt16)(led_columns_red[counter] & 0xFF);
                    led_columns_green_out[counter]  = (UInt16)(led_columns_green[shift_position + counter] & 0xFF00);
                    led_columns_green_out[counter] |= (UInt16)(led_columns_green[counter] & 0xFF);
                }
            }
        }

        shift_position++;

        if (shift_position > ref_length + 11)
        {
            shift_position = 1;
            return(false);
        }
        return(true);
    }
Beispiel #2
0
    private bool shiftLeft(what_to_shift section)
    {
        int counter;
        int scroll_length;
        int ref_length;

        if(section == what_to_shift.nothing)
        {
            shift_position = 0;
            return true;
        }

        if(section == what_to_shift.first_line)
            ref_length = line_lengths[0];
        else
            ref_length = x;

        if(ref_length + 11 > max_line_length)
            scroll_length = max_line_length;
        else
            scroll_length = ref_length + 11;

        for(counter=0;counter< scroll_length - 1;counter++)
        {
            if(shift_position + counter > scroll_length - 1)
            {
                if(section == what_to_shift.all) // all 16 lines
                {
                    led_columns_red_out[counter] = led_columns_red[counter + shift_position - (scroll_length)];
                    led_columns_green_out[counter] = led_columns_green[counter + shift_position - (scroll_length)];
                }
                else if(section == what_to_shift.first_line) // upper 8 lines
                {
                    led_columns_red_out[counter] = (UInt16)(led_columns_red[counter + shift_position - (scroll_length)] & 0xFF);
                    led_columns_red_out[counter] |= (UInt16)(led_columns_red[counter] & 0xFF00);
                    led_columns_green_out[counter] = (UInt16)(led_columns_green[counter + shift_position - (scroll_length)] & 0xFF);
                    led_columns_green_out[counter] |= (UInt16)(led_columns_green[counter] & 0xFF00);
                }
                else if(section == what_to_shift.second_line) // lower 8 lines
                {
                    led_columns_red_out[counter] = (UInt16)(led_columns_red[counter + shift_position - (scroll_length)] & 0xFF00);
                    led_columns_red_out[counter] |= (UInt16)(led_columns_red[counter] & 0xFF);
                    led_columns_green_out[counter] = (UInt16)(led_columns_green[counter + shift_position - (scroll_length)] & 0xFF00);
                    led_columns_green_out[counter] |= (UInt16)(led_columns_green[counter] & 0xFF);
                }
            }
            else
            {
                if(section == what_to_shift.all) // all 16 lines
                {
                    led_columns_red_out[counter] = led_columns_red[shift_position+counter];
                    led_columns_green_out[counter] = led_columns_green[shift_position+counter];
                }
                else if(section == what_to_shift.first_line) // upper 8 lines
                {
                    led_columns_red_out[counter] = (UInt16)(led_columns_red[shift_position+counter] & 0xFF);
                    led_columns_red_out[counter] |= (UInt16)(led_columns_red[counter] & 0xFF00);
                    led_columns_green_out[counter] = (UInt16)(led_columns_green[shift_position+counter] & 0xFF);
                    led_columns_green_out[counter] |= (UInt16)(led_columns_green[counter] & 0xFF00);
                }
                else if(section == what_to_shift.second_line) // lower 8 lines
                {
                    led_columns_red_out[counter] = (UInt16)(led_columns_red[shift_position+counter] & 0xFF00);
                    led_columns_red_out[counter] |= (UInt16)(led_columns_red[counter] & 0xFF);
                    led_columns_green_out[counter] = (UInt16)(led_columns_green[shift_position+counter] & 0xFF00);
                    led_columns_green_out[counter] |= (UInt16)(led_columns_green[counter] & 0xFF);
                }
            }
        }

        shift_position++;

        if(shift_position > ref_length + 11)
        {
            shift_position = 1;
            return false;
        }
        return true;
    }