\r
/* allocate the planes */\r
for(i=0; i<4; i++) {\r
- p.plane[i] = _fmalloc(p.height * p.pwidth);\r
+ p.plane[i] = _fmalloc((p.height * p.pwidth)+1);\r
}\r
\r
return p;\r
/* write the pixel the specified number of times */\r
//fprintf(stderr, "\nputting in memory~ %u\n", w++);\r
for(; count && (index[0]+index[1]+index[2]+index[3]) < bufSize; count--,index[plane]++) {\r
+ // copy to each plane\r
+ result.plane[plane][index[plane]]=(word)val;\r
+//fprintf(stdout, "plane=%u index val=%02X val=%02X\n", plane, result.plane[plane][index[plane]], val);\r
switch (plane)\r
{\r
case 4:\r
plane=0;\r
break;\r
}\r
- // copy to each plane\r
- result.plane[plane][index[plane]]=val;\r
//fprintf(stdout, "count=%02X index=%u plane=%u ", count, index[plane], plane);\r
-//fprintf(stdout, "index val=%02X val=%02X\n", result.plane[plane][index[plane]], val);\r
}\r
+ //val++;\r
// fprintf(stdout, "\nindex=%lu bufsize=%lu\n\n", (dword)(index[0]+index[1]+index[2]+index[3]), bufSize);\r
} while((index[0]+index[1]+index[2]+index[3]) < bufSize);\r
loadPcxpbufPalette(file, &result);\r
fclose(file);\r
// fprintf(stderr, "\n\n%s count=%d index=%d plane=%d\n", filename, count, (dword)(index[0]+index[1]+index[2]+index[3]), pla);\r
-// exit(0);\r
return result;\r
\r
}\r
// }\r
for(plane=0; plane < 4; plane++) {\r
i=0;\r
- modexSelectPlane(PLANE(plane+x));\r
+ modexSelectPlane(PLANE(plane-1));\r
for(; y < py+p->height; y++) {\r
//for(px=0; px < p->width; px++) {\r
//printf("%02X ", (int) p->plane[plane][i++]);\r