Un-ignored: the dev drive is the ground truth the restoration and emulator work constantly reference (DPL3/LIBDPL + VRENDER i860 renderer source, BT/RP live+dev game trees, VGL_LABS pod boot, scene/audio content). Kept in-repo for the pod-owner community. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
80 lines
1.7 KiB
C++
80 lines
1.7 KiB
C++
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
/*{{{ void copy_image ( int *dest, int *src, in x0, int y0 )*/
|
|
void copy_image ( int *dest, int *src, int x0, int y0 )
|
|
{
|
|
int i, s_index, d_index, j;
|
|
|
|
d_index=(y0*256)+x0;
|
|
s_index=15;
|
|
|
|
for (j=0; j<64; j++ ) {
|
|
for (i=0; i<32; i++) {
|
|
int t;
|
|
t=src[s_index+i];
|
|
if (t==0) {
|
|
dest[d_index+i]=0x0;
|
|
}
|
|
else {
|
|
dest[d_index+i]=t | 256;
|
|
}
|
|
}
|
|
|
|
d_index+=256;
|
|
s_index+=64;
|
|
}
|
|
}
|
|
/*}}} */
|
|
|
|
/*{{{ int main ( int argc, char **argv )*/
|
|
int main ( int argc, char **argv )
|
|
{
|
|
FILE *s, *d;
|
|
char fname[256];
|
|
int *dest=malloc(256*256*sizeof(int));
|
|
int *src =malloc(64*64*sizeof(int));
|
|
int i, j, fix=1, index;
|
|
|
|
for (j=0; j<4; j++ ) {
|
|
for (i=0; i<8; i++) {
|
|
int ii, jj;
|
|
int *srcp=src;
|
|
|
|
sprintf ( fname, "t:/usr/phil/f%d.tga", fix );
|
|
fix++;
|
|
printf ("read file %s\n", fname );
|
|
s=fopen( fname, "rb" );
|
|
fread ( src, 1, 18, s ); /* throw away tga header */
|
|
|
|
for (ii=0; ii<64; ii++ ) { /* read tga as 24-bit pixels */
|
|
for (jj=0; jj<64; jj++ ) {
|
|
char *csrcp=(char *) srcp;
|
|
|
|
*srcp=0;
|
|
|
|
fread ( csrcp+1, 1, 1, s );
|
|
fread ( csrcp+2, 1, 1, s );
|
|
fread ( csrcp+3, 1, 1, s );
|
|
|
|
srcp++;
|
|
}
|
|
}
|
|
|
|
fclose (s);
|
|
index=(j*256*64)+(i*32);
|
|
|
|
printf ("extracting central portion\n" );
|
|
|
|
copy_image(dest, src, i*32, j*64 );
|
|
}
|
|
}
|
|
|
|
strcpy ( fname, "t:/usr/phil/allovem.svt" );
|
|
d=fopen( fname, "wb" );
|
|
fwrite ( dest, 1, 256*256*4, d );
|
|
fclose (d);
|
|
}
|
|
/*}}} */
|