Re: [cc65] Including binary-stuff question

From: Marko Mäkelä <marko.makela1hut.fi>
Date: 2004-09-06 11:57:11
On Mon, Sep 06, 2004 at 12:27:28PM +0300, Karri Kaksonen wrote:
> In lyxass I had a command ibytes that I could use to include raw binary
> sprite data like:
> 
> my_hero: ibytes "sprites/myhero.spr"
> 
> Is there a similar command available in the cc65 assembler?

Have you considered writing a simple program that converts the binary
data to hexadecimal notation?  Something like the following, for
generating C code on a unix-like system:

echo "static const unsigned char my_hero[] = {"
od -w12 -vt x1 < sprites/myhero.spr \
| sed -ne 's/ \(..\)/ 0x\1,/g;s/^[0-9]* /  /p'
echo "};"

It shouldn't be too hard to adapt the above for producing ca65 code.
It's best to include rules for such generated files in the Makefile,
listing the source files and the code generator script as dependencies.

	Marko
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Sep 6 11:57:21 2004

This archive was generated by hypermail 2.1.8 : 2004-09-06 11:58:00 CEST