Using the ARBG888 format, I need to use the following bit of code to get the pixels into the frame buffer memory:
pmem = addr;
for(i=0;i<N;i++){
offset=0;
for(j=0;j<M;j++){
a4bpix.byte[0] = 0x00;
a4bpix.byte[1] = ibuf[i][j];
a4bpix.byte[2] = ibuf[i][j];
a4bpix.byte[3] = ibuf[i][j];
memcpy(pmem+offset, a4bpix.byte, 4);
offset+=4;
}
pmem+=((M*32)>>3);
}
question: Why do I need to multiply by 32 and shift right by 3 bits, multiply by 4 all together) the pointer after each line? If I do not do this I get a segmentation fault. What is going on in the hardware that makes the pointer adjustment necessary?
Lee Holeva