All Arduino Mega Pins + 5 shift Registers - 6x8 Grid Animation Code Help

PaulS:
No, I'm trying to make OP think. If OP doesn't get it, OP should ask. Then. my next question would be what range of values can be store in an int, and then whether OP really needs to deal with negative pin numbers. At some point, I'd ask about the range that can be stored in other types. At some point, OP should realize that there are smaller types that are more appropriate.

And, that is going to be essential, given the amount of data he/she is going to be dealing with. The wrong type for any array is going to either waste memory, which will be in short supply, or cause overflow. It is, therefore, essential to understand, BEFORE writing a sh*tload of code, about how much memory is available, and how not to waste any of it.

My bad, I saw your last sentence as a joke since 2^32 and 2^64 are A LOT of pins.

OP, for animations, since you have lots of free space, you could store lookup tables for different animations. If I read correctly, you have 192 led to be driven. So for 1 state or frame, you need 192bit = 24bytes. The mega has 256KB flash, let's reserve 56KB for program, so you have 200KB freespace.

200e3 bytes / 24 bytes = 8333 frames you can store in your progmem