For getting old rPeak values, store them when a new peak appears, i.e. when rPeak becomes smaller.

Code:
static int Peak1 = 99999, Peak2, Peak3;

ZigZag(....);
if(rPeak < Peak1) {
  Peak3 = Peak2+1;
  Peak2 = Peak1+1;
  Peak1 = rPeak;
} else {
  Peak3++;
  Peak2++;
  Peak1++;
}