Skip to content

Instantly share code, notes, and snippets.

@bzztbomb
Created June 28, 2012 01:40
Show Gist options
  • Save bzztbomb/3008167 to your computer and use it in GitHub Desktop.
Save bzztbomb/3008167 to your computer and use it in GitHub Desktop.
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char* argv[])
{
FILE* f = fopen("robotron.nv", "r");
FILE* fout = fopen("robotron-converted", "w");
int a, b, c;
do
{
a = fgetc(f);
b = fgetc(f);
c = ((a & 0xF) << 4) + (b & 0xF);
printf("%x ", c);
fwrite(&c, 1, 1, fout);
} while (b != EOF);
fclose(fout);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment