Well, I went for an "easy" solution. The main difficulty here is to handle the Pixmap. How to export Pixmap to something else?
Each tile is 32x32 pixel, and the screen is composed by a 10x8 => 320*256.
A simple *2 means some cut pixels also in the height.
So the solution is to use an intermediate Pixmap where you double the Width, the you double the Height (or almost double to avoid missing part) to the final Window.
The code is:
void drawdouble(Pixmap pix)
{
int i;
//create a new pixmap widtx2*heigth
for (i=0; i<WIDTH; i++) {
XCopyArea(display, pix, backdouble, whitegc, i, 0, 1, HEIGHT, i*2, 0);
XCopyArea(display, pix, backdouble, whitegc, i, 0, 1, HEIGHT, i*2+1, 0);
}
// now double width when blitting to the screen
int j = 0;
for (i=0; i<HEIGHT; i++) {
XCopyArea(display, backdouble, window, whitegc, 0, i, WIDTH*2, 1, 80, j++);
if (i%8!=0) XCopyArea(display, backdouble, window, whitegc, 0, i, WIDTH*2, 1, 80, j++);
// if ((j>16) && (j<464)) XCopyArea(display, backdouble, window, whitegc, 0, i, WIDTH*2, 1, 80, j++);
}
}
I will let Loic finish now, and check that all screens goes through the drawdouble function and publish a v2.