#include <stdio.h>


// to lazy for a cmd  line support
#define CMDFILE     "BLOCKS.BIN"



/*
 * main
 */
int main(void)
{
    FILE* h;
    unsigned char c;
    
    printf("16bits Fast Trans color for SegaSaturn by Cafe-Alpha.\n");
    printf(" Cmd file : %s\n", CMDFILE);
    printf("More infos in readme.txt\n");
    printf("\n");


    if( h = fopen(CMDFILE,"rb+") )
    {
        printf("Opening file ...\n");

        while(!feof(h))
        {
            c=fgetc(h);
            if(c&0x80)//MSB set ?
            {
                //printf(" %d\n", c);
                fgetc(h);
            }
            else
            {
                //printf("%d\n", c);
                fseek(h, -1, SEEK_CUR);
                fputc(0, h);
                fputc(0, h);
            }
        }

        fclose(h);
        printf("Done.\n");


    }//fopen
    else
    {
        printf("Error opening file.\n");
    }

    return 0;
}

