Steves Yaroze Page.
"Anything is possible, even Impossible sais "I'm possible".


Up
Next

Binary conversion tool

 

Include your data files directly into your source.

Avoid mucking about with explicit memory addresses for data.  Simply include the data in your source.  This command line tool takes binary files, i.e. tmds, tims, seqs etc, and makes a 'C' source code array for inclusion in your code.  So instead of fiddling around with memory addresses, loading the data to that address etc, you can simply included the binary directly in your source.

Try it on your favorite tmd by simply typing

bin2hex mytmd.tmd >> Cstruct.txt

Now simply cut and paste 'Cstruct.txt' into your C or C++ source.

You can also place a 'width' flag in the command line.  This formats the array definition to the specified with,

i.e.

bin2hex mytmd.tmd 4 >> Cstruct.txt will produce;

unsigned char data[] = {
0x41, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x00,
0x00, 0x00, 0xfc, 0x01, 0x00,
0x00, 0x1a, 0x00, 0x00, 0x00,
0xcc, 0x02, 0x00, 0x00, 0x18 };

I've heard enough !  Let me get my hands on this tool now !



Visit my other home-page

ICQ:14349918

Sign My Guestbook   View My Guestbook
Guestbook by GuestWorld
Last updated 9th August 1998.   This page has been visited Times