You mustn't use either of these two lines. It's invalid C because the value of temp is modified twice in the same expression (ie, temp+=1 is an assignment, and so is temp=). The compiler might well compile it, and it might well do what you want, but it's wrong.
temp = (temp+=1)&2047;
temp = (temp++)&2047;
You should do this:
temp++;
temp&=2047;
This expression is silly:
buffer[x+ ((y+70)*640) ]=
Because x only ever goes up by 1, you can have outside the loop.
unsigned int *buffer_ptr = buffer+70*640;
Then, inside the loop, you can just do
*buffer_ptr++ =
Jim