pointer to array problem

I am trying to modify the software pendant but I do not understand the next step

a = pgm_read_byte(ptr++);     // New frame X1/Y1
  if(a >= 0x90) {               // EOD marker? (valid X1 never exceeds 8)
    ptr = anim;                 // Reset animation data pointer to start
    a   = pgm_read_byte(ptr++); // and take first value
  }
  x1 = a >> 4;                  // X1 = high 4 bits
  y1 = a & 0x0F;                // Y1 = low 4 bits
  a  = pgm_read_byte(ptr++);    // New frame X2/Y2
  x2 = a >> 4;                  // X2 = high 4 bits
  y2 = a & 0x0F;                // Y2 = low 4 bits

  // Read rectangle of data from anim[] into portion of img[] buffer
  for(x=x1; x<=x2; x++) { // Column-major
    for(y=y1; y<=y2; y++) img[(x << 4) + y] = pgm_read_byte(ptr++);
  }

anim[] is a array 23086 byte long and img[] is a array 144 byte long

who explains it to me?

who explains it to me?

What is the next step, and what don't you understand?

It would appear that that snippet of code is locating the start of a 144 byte block of data in a large array, and then copying the bytes to an array in SRAM.

pgm_read_byte(ptr++)

This part reads the next byte from PROGMEM

It reads a byte and if the high half of the byte contains 9 that marks the end of the animation and it starts over.

If the top half isn't 9 the two halves are an X,Y coordinate pair. The next byte is also a coordinate pair. The loops scan the rectangle defined by the two coordinate pairs and fills that part of the image from PROGMEM.

What's your question?