@@ -0,0 +1,913 @@
+#!/usr/bin/env python%0A%0Aimport argparse%0Aparser = argparse.ArgumentParser(description='Convert binary file to c-header.')%0Aparser.add_argument('infile'  , type=str, nargs=1, help='infile')%0Aparser.add_argument('outfile' , type=str, nargs=1, help='outfile')%0Aparser.add_argument('--blobName' , dest='blobName', type=str, required=False,  default='rom')%0Aargs = parser.parse_args()%0A%0Ainfile = args.infile%5B0%5D%0Aoutfile = args.outfile%5B0%5D%0A%0Ab = ''%0Awith open(infile, 'rb') as f:%0A    b = f.read();%0A%0Ai = 0%0Awith open(outfile, 'w') as g:%0A    g.write('#ifndef __%25s_H%5Cn#define __%25s_H%5Cn%5Cnunsigned char %25s%5B%5D = %7B%5Cn%5Ct%5Ct' %25 (args.blobName, args.blobName, args.blobName))%0A    first = 1%0A    for c in b:%0A        i += 1;%0A        if first:%0A            first = 0%0A            g.write(%22 %22)%0A        else:%0A            g.write(', ')%0A        g.write(%220x%2502x%22 %25 ord(c))%0A        if i %25 12 == 0:%0A            g.write('%5Cn%5Ct%5Ct')%0A    g.write('%7D;%5Cn#endif%5Cn')%0A%0A

Create yab2hp.py