Because Tokumaru's tile compressor takes a max of 4kb of tile data I wrote a simple C program that carves up the standard 8kb chr file for myself. Here's an example program for you that fits your needs:
Code:
#include <stdio.h>
#include <stdlib.h>
char* extractKB(char* indata,int size){
char* cut = malloc(size);
memcpy(cut,indata,size); //copy first kb
return cut;
}
int getFileSize(FILE* fp){
int count = 0;
while(fgetc(fp)!=EOF)
count++;
fseek(fp,0,0);
return count;
}
int main(int argc,char** argv) {
if(argc < 3)
return 1;
FILE* fp = fopen(argv[1],"rb");
int size = getFileSize(fp);
char* buffer= malloc(size);
fread(buffer,1,size,fp);
fclose(fp);
fp = fopen(argv[2],"wb");
char* extracted = extractKB(buffer,1024);
fwrite(extracted,1,1024,fp);
fclose(fp);
free(buffer);
free(extracted);
return 0;
}
It takes two command line args, the chr file and then the output file.