Fusion C: making MSX-DEV20 entry ROMs

By MattyT

Rookie (26)

MattyT's picture

23-11-2019, 09:12

I am sure this has been asked many times before, but I can't work it out. How to turn a COM file to ROM file.

Currently using the Fusion-C compil.bat file I am producing COM files. I am having fun coding games for the first time in years and I am tempted to enter MSX-DEV20.

So this is the requirement from the competition rules:
"any size will be accepted as long as it does not require a ROM mapper. In other words, the acceptable ROM file sizes are 8 KB, 16 KB, 24 KB, 32 KB, 40 KB and 48 KB"

Trawling the threads I got this advice ".com files are just programs loaded at 0x100h, so you need to include the whole program in your ROM, and write a small program to relocate it to 100 h in RAM at runtime, do a JP 0100h and that's it."
I note that the .ihx file produced out of sdcc is at 0106h, but I couldn't work out a way to follow that advice. Any tools do it?

In the compil.bat script hex2bin makes a .com file out of the .ihx file
Is there some other tool or method that can turn it straight into a ROM file?

The other method "Put your com file on formatted MSX DSK image, add MSXDOS files and autoexec.bat that will run your com, and convert this DSK to ROM using DSK2ROM utility. " I was able to follow but the ROM image is much larger than any of those allowed ROM sizes.

I also tried bin2rom, but that told me my bin file was in the wrong format. It seems to be for BASIC.

Any advice appreciated.

Login or register to post comments

By gdx

Enlighted (6429)

gdx's picture

23-11-2019, 09:27

Fusion C is not adapted to make ROM file of sizes 8 KB to 48 KB. Fusion C is designed to make megarom from disk image.

https://www.msx.org/wiki/Develop_a_program_in_cartridge_ROM

By wimpie3

Champion (436)

wimpie3's picture

23-11-2019, 11:46

I've used CZ80++ for my MSXdev development. Compiles to roms without any issue.

I'm currently building a whole eco system around this compiler for usage on a PC, combined with an extensive usage manual. Not sure when it will be finished though.

By ericb59

Paragon (1124)

ericb59's picture

23-11-2019, 16:46

Hi,
Perhaps you can wait some time before submit your game to the MSX DEVS ?
I planned to adapt FUSION-C for the creation of ROMs within a few months.
It is necessary to rewrite some ASM routines. I think it's relatively easy. I just need some time.

By MattyT

Rookie (26)

MattyT's picture

24-11-2019, 08:49

Great Eric. I'll code away and await future enhancements.
And thanks for the other replies too. The CZ80++ thing sounds intriguing Wimpie.

By Timmy

Master (200)

Timmy's picture

24-11-2019, 11:46

I've used z88dk to build roms for my MSXDev entries. Works very well.

By wimpie3

Champion (436)

wimpie3's picture

24-04-2020, 14:25

Pulling this one up to check if Fusion-C can already create ROM files?

By santiontanon

Paragon (1830)

santiontanon's picture

27-04-2020, 08:59

Fyi, the rules do not specify any ROM size limitation: https://www.msxdev.org/2019/11/22/msxdev20-a-new-era/

By ducasp

Paladin (712)

ducasp's picture

27-04-2020, 13:44

MattyT wrote:

I am sure this has been asked many times before, but I can't work it out. How to turn a COM file to ROM file.

Currently using the Fusion-C compil.bat file I am producing COM files. I am having fun coding games for the first time in years and I am tempted to enter MSX-DEV20.

So this is the requirement from the competition rules:
"any size will be accepted as long as it does not require a ROM mapper. In other words, the acceptable ROM file sizes are 8 KB, 16 KB, 24 KB, 32 KB, 40 KB and 48 KB"

Trawling the threads I got this advice ".com files are just programs loaded at 0x100h, so you need to include the whole program in your ROM, and write a small program to relocate it to 100 h in RAM at runtime, do a JP 0100h and that's it."
I note that the .ihx file produced out of sdcc is at 0106h, but I couldn't work out a way to follow that advice. Any tools do it?

In the compil.bat script hex2bin makes a .com file out of the .ihx file
Is there some other tool or method that can turn it straight into a ROM file?

The other method "Put your com file on formatted MSX DSK image, add MSXDOS files and autoexec.bat that will run your com, and convert this DSK to ROM using DSK2ROM utility. " I was able to follow but the ROM image is much larger than any of those allowed ROM sizes.

I also tried bin2rom, but that told me my bin file was in the wrong format. It seems to be for BASIC.

Any advice appreciated.

Unfortunately it is not that easy, as a cartridge won't necessarily encounter a DOS and DOS routines that some fusion-c functions rely on... But quite a lot of functions use bios and those should work fine, there is a good project to use visual studio to build msx code along with sdcc and it supports roms, https://www.msx.org/forum/msx-talk/development/msx-applicati... , as long as you don't use fusion-c functions that are using dos calls, it should be fine :)

By wimpie3

Champion (436)

wimpie3's picture

27-04-2020, 18:10

I just asked because you wrote you'd be working on making ROMs possible.

By ducasp

Paladin (712)

ducasp's picture

27-04-2020, 22:11

wimpie3 wrote:

I just asked because you wrote you'd be working on making ROMs possible.

I think you're confusing me with Eric... I'm just telling you how you can do it today, using the visual studio profiles and sdcc and fusion-c library (as long the functions you use are bios based, not dos based) Wink