[SDCC] Vote on this to fix makebin!

Door pizzapower

Expert (72)

afbeelding van pizzapower

04-06-2022, 18:26

I've created this bug report for the makebin executable bundled in SDCC. As it is, makebin is useless if you want to convert IHX into ROM files that don't start at #0, i.e. all of them. Unless you want to create 48K ROM files or bigger. Extra advantage: less dependency on stuff, namely old hex2bin that is no longer maintained.

Let's raise the chance of this being fixed by voting on this! (warning: requires login)

Aangemeld of registreer om reacties te plaatsen

Van aoineko

Champion (487)

afbeelding van aoineko

04-06-2022, 21:33

Hi,
I have created a tool (MSXhex) that I use to replace Hex2bin in my MSXgl library.
It allows to create ROMs (plain or mapped) and executables for BASIC and MSX-DOS.
For mapped-ROM, I use the SDCC bank format to automatically place the ROM segments at their right place.
I wrote a doc about creating mapped-ROM in MSXgl (https://aoineko.org/msxgl/index.php?title=Create_a_mapped_ROM), but the principle can be applied to other toolchains.

Here are the parameters that can be used with MSXhex.

MSXhex 0.1.3 - Convert Intel HEX file to binary
--------------------------------------------------------------------------------
Usage: msxhex  [options]

Options:
 -o filename    Output filename (default: use input filename with '.bin')
 -e ext         Output filename extension (can't be use with -o)
 -s addr        Starting address (default: 0)
 -l length      Total data length (default: 0, means autodetect)
 -b length      Bank size (default: 0, means don't use)
 -p value       Pading value (default: 0xFF)
 -check         Validate records
 -log           Log records

 All integers can be decimal or hexadecimal starting with '0x'.
 One of the following named values can also be used:
  1K, 2K, 4K, 8K, 16K, 24K, 32K, 48K, 64K, 128K, 256K, 512K, 1M, 2M, 4M

Van pizzapower

Expert (72)

afbeelding van pizzapower

05-06-2022, 00:15

Nice tool, aoineko! Thanks!

Van aoineko

Champion (487)

afbeelding van aoineko

05-06-2022, 00:15

aoineko wrote:

For mapped-ROM, I use the SDCC bank format to automatically place the ROM segments at their right place.

Hum... it's not explain in my doc but SDCC bank format is quit simple: It use 32-bits addressing with lower 16-bits to define actual z80 address and higher 16-bits as a segment index.
MSXhex use the segment index to put segment at the right place in the ROM according to bank size parameter.

Van msxchris

Supporter (8)

afbeelding van msxchris

17-06-2022, 12:16

What's the usage of makebin compared to sdobjcopy?

Van aoineko

Champion (487)

afbeelding van aoineko

17-06-2022, 12:52

I don't know sdobjcopy, but makebin is used to convert IHX file generated by the linker (binary data informations store in a text format) to binary file.

Van msxchris

Supporter (8)

afbeelding van msxchris

17-06-2022, 13:08

sdobjcopy does the same, part of SDCC