Fix pattern loop every time on pos 0

Add a status byte that holds the pattern start position. If the pat_max is arrived, the loop begins with the start position not with pos 0.