Home Forums Game Frame Technical Support pixel order question for DIY gameframe Reply To: pixel order question for DIY gameframe

#2527
avs.stolyarovavs.stolyarov
Participant

Try to change the getIndex routine like this (TOP-LEFT, ZIG-ZAG):

byte getIndex(byte x, byte y)
{
  byte index;
if (y % 2 == 1){
         int rawIndex = (x + (y * 16));
         int begin = y * 16;
         int end = (y * 16) + 15;
         index = end - (rawIndex - begin);
      }
      else{
          index = x + (y * 16);
       }
  return index;
}