hConvert

hConvert Logo

Introduction
Hay kiddies! Guess what? I made you this special little app that helps you break that nasty habit of yours. Do you want to convert some data out of a .c, .cpp, or .h file into REAL, ACTUAL binary data? Does everybody on #dsdev yell at you for using .h files for your graphics instead of .bin files, but your graphic converter only converts graphics into .h? Enter hConvert: the hero of smashing text based binary data. It'll parse through a (currently limited) hex based, comma delimited, "{" starting, "};" terminated dump of binary data and spit out a little .bin file. Super useful! You know you want it oh so badly.

Using bin files, devkitARM, and the default makefile for devkitARM (which uses bin2o) is the recommended way of linking binary data into your program. However, the most portable way of including binary data in your program is through an isolated translation unit, ie a .c file a textual representation of the data to be linked. Many kiddies would make the mistake of then including this file, #include "my_gfx_thingy.c", which is bad bad bad. NEVER DO IT. The proper way to make it a truly isolated and portable translation unit is to make a .h file that will refer to it using the extern keyword. That would look like this in the .h file (not the .c) which we include from where ever we want to reference the graphic, continuing our previous example, extern const uint16 my_gfx_thingy[];.

hConvert would be useful, if you are concerned about portability and would never use devkitARM's bin2o makefile rule that wouldn't exist in another toolchain, in converting a .c isolated translation unit into binary data for use with a file system, such as GBA_NDS_FAT lib from chishm or Nintendo's file system (using their tools).

About
hConvert is an application for x86 Linux and Macintosh OS X (PPC and Intel) and Windows. It converts C-style textually represented binary data into actual binary data.

Change Log

  • hConvert v0.31 - Now with Mac OS X Intel Binary
  • hConvert v0.3 - Initial Stable Release
  • Please contact me if you have any feature requests or bug reports. Enjoy!

    Download

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Use the special tag [adsense:format:group:channel] or [adsense:block:location] to display Google AdSense ads.

More information about formatting options