lronaldo / cpctelera

Astonishingly fast Amstrad CPC game engine for C developers
http://lronaldo.github.io/cpctelera/
GNU Lesser General Public License v3.0
229 stars 54 forks source link

cpct_bin2c add option to prefix array #49

Open Arnaud6128 opened 7 years ago

Arnaud6128 commented 7 years ago

Hello, in some case i have to set to array a specific address (for music for example). And i have to set manually the prefix __at for each generation of my modified data.

I was thinking about a new option --prefix

ex: cpct_bin2c music.bin --prefix __at(0x40) > music.h

in order to have : _at(0x40) const unsigned char G_music[] = { ... };

Thanks, Arnaud.

lronaldo commented 7 years ago

Hi @Arnaud6128,

Latest version of CPCtelera (actual v1.5 branch) includes cpct_aks2c script integrated within the build system. That means that you don't need to manually convert and place your music. You only have to edit cfg/music_conversion.mk, add one line asking for the conversion you want, and it automatically converts your music every time it gets changed.

With respect to cpct_bin2c, it might be of use to add something to place converted output at a given memory location. However, I would rather not use __at, because it has some potential linking issues. I think it will be preferably to convert output to assembly and use .org for automatic placement.

As this is not urgent, I think it is worth considering again after next release.

Thank you for your continuous effort, @Arnaud6128 :)