FUSION-C the C library for MSX (SDCC)

FUSION-C the C library for MSX (SDCC)

por ericb59 en 15-01-2019, 09:27
Tema: Desarrollo
Idiomas:

FUSION-C Is a C library, 100% dedicated to MSX. Functions dedicated to the hardware of the MSX are available in order to easily code games or tools for our machines: MSX1, MSX2, MSX2 + or MSX Turbo-R.
FUSION-C is intended to make programs that run under MSX-DOS 1 or 2, this does not prevent to transform your programs in ROM.
With FUSION-C you have more functions than under Basic, you will find functions for

  • Screen modes management from screen 0 to screen 8
  • Drawing
  • Copy of graphic area in VRAM or RAM
  • Sprites management
  • File management under MSX-DOS
  • Keyboard and joystick control
  • Management of the Memory Mapper under MSX-DOS2
  • Management of the PSG for the sound part
  • Player of music files .PT3
  • AYFX music file player for sound effects
  • etc

FUSION-C use the Cross Compiler C, SDCC (Version 3.6 preferably), compilations scripts are provided with the library.
The library is provided with all the source codes, so you can modify it and change it to your needs.

For simplicity I recommend a suitable tools-chain, compatible for Mac OS / Windows / Linux. This tools-chain consists of SDCC 3.6, the Hex2Bin module that converts the code from SDCC into a code usable under MSX-DOS, the code editor Sublime Text, and openMSX emulator.
Once the tools-chain is configured, a simple press of CTRL + B in Sublime Text starts the compilation of your code and its execution in openMSX.

The configuration of the Tools-chain, is explained in a 280 pages 's Paper book "Fusion-c Complete journey" available on Amazon for 12.99 Euros.
This book in English, supplements the documentation provided with the library by essential information about the MSX, its environment, the configuration of the tool-chain, and for beginners all the information to start coding in C, as well as a comparison of MSX Basic VS Fusion-C instructions.
Buy the book! it will be a kind of reward for the work done!

Fusion C is available for free at: www.repro-factory.com
in the FUSION-C section.

You can leave here, your comments, suggestions, problems & bugs encountered ...

Have a good coding day !

Media browser (5)

  • FUSION-C the C library for MSX (SDCC)
  • FUSION-C the C library for MSX (SDCC)
  • FUSION-C the C library for MSX (SDCC)
  • FUSION-C the C library for MSX (SDCC)
  • FUSION-C the C library for MSX (SDCC)

Comentarios (43)

Por gdx

Prophet (2561)

Imagen del gdx

15-01-2019, 09:42

Good job Eric! I'm impressed.

Por Grauw

Enlighted (7840)

Imagen del Grauw

15-01-2019, 09:56

Sounds like a great library for MSX C programmers, and also it's interesting that you combine it with a book! Seems really useful for starting C programmers especially! A lot of effort must've gone into this.

Por alexito

Champion (323)

Imagen del alexito

15-01-2019, 10:02

I bought mine from Amazon with Free Shipping.

Sound very interesting because I never really programming in C ever.

Great job Eric.

Wink

Por fr3nd

Resident (58)

Imagen del fr3nd

15-01-2019, 10:18

It looks promising. Will the source code be released? Is it possible to collaborate to the project in GitHub?

Por Grauw

Enlighted (7840)

Imagen del Grauw

15-01-2019, 10:26

@fr3nd "Fusion C is available for free at: www.repro-factory.com in the FUSION-C section."

Did you miss that part? It was a bit hidden in a little sentence at the bottom :).

Por Pencioner

Paladin (843)

Imagen del Pencioner

15-01-2019, 10:26

Great, thanks Eric!

Por ericb59

Paladin (798)

Imagen del ericb59

15-01-2019, 11:13

Fusion-c library is provided with all source code (C and ASM source codes are include), also include a script to compile the library with new functions, or if you make changes in functions's sources code.
You can collaborate of course. If you have idea, new functions, bugs, let me know. All your ideas and new functions can be included in further release ... Share you work Big smile

Por fr3nd

Resident (58)

Imagen del fr3nd

15-01-2019, 12:11

Yes, I saw the link and I went there, but I got confused when I had to go trough a checkout and registering process to download it... I guess I was expecting something more "developer-friendly" to make collaboration easier for everyone...

But please, don't get me wrong... I think this is a really interesting project that can make much easier to develop using modern tools, I just would have liked it to be in GitHub (or Bitbucket) so it's more available to everyone.

Por ericb59

Paladin (798)

Imagen del ericb59

15-01-2019, 14:07

@fr3nd : Yes, GitHub is great and I'm using it also. I've chosen to publish FUSION-C via Repro-factory, to keep an eye on its distribution, i'm just curious to know how many people will download it.
Anyway in the futur the library will be available on GitHub too...

Por fr3nd

Resident (58)

Imagen del fr3nd

15-01-2019, 15:12

ericb59 wrote:

Anyway in the futur the library will be available on GitHub too...

I'm glad to hear that! kudos for the project! I can't wait to test it.

Por Danjovic

Rookie (31)

Imagen del Danjovic

15-01-2019, 15:14

Cool! Gotta try it out on Linux!

Por wimpie3

Master (214)

Imagen del wimpie3

15-01-2019, 16:11

"this does not prevent to transform your programs in ROM"

How do you guys convert an MSX DOS program to a ROM version?

Por ericb59

Paladin (798)

Imagen del ericb59

15-01-2019, 16:19

@wimple3 : with disk2rom utility (included in tools folders). Ok this is not suitable for 32K or 64K rom size but in most cases you can make a rom version of any floppy disk, and put it in a 512K or 1024K Cartridge.

Por Victor

Champion (462)

Imagen del Victor

15-01-2019, 18:27

Congratulations Eric and Fernando...

Thanks for this grat work!

Por wimpie3

Master (214)

Imagen del wimpie3

15-01-2019, 18:52

OK, so this basically means the program cannot be used to make games for the MSDEV competition.

Por ToriHino

Champion (279)

Imagen del ToriHino

15-01-2019, 19:39

wimpie3 wrote:

OK, so this basically means the program cannot be used to make games for the MSDEV competition.

You can always submit for the MSX Freestyle category, as the rules state:
There’s no limit at all. Feel free to use whatever you want (graphic expansions, sound extensions, add-ons, later machines than MSX1, etc.)

Por Wolverine_nl

Paladin (1002)

Imagen del Wolverine_nl

15-01-2019, 20:53

There is a guide online how to create a rom file from SDCC, several, here is one.
But Fusion-C probably has a few libraries using things specifically for DOS 1/2, also probably some CALLSLOT resolves. These need to be altered for a ROM project of course.

I think this is great, thanks Eric! :)

Por Josb

Master (195)

Imagen del Josb

15-01-2019, 21:28

Thanks, I'm stunned by your great job.

Por rvanzon

Supporter (14)

Imagen del rvanzon

15-01-2019, 22:15

Great work Eric and Fernando!
Thanks! Smile

Por wimpie3

Master (214)

Imagen del wimpie3

16-01-2019, 06:50

Is it true what Wolverine says?

Por La Gaseta Msx

Supporter (13)

Imagen del La Gaseta Msx

18-01-2019, 14:12

>>¿How do you guys convert an MSX DOS program to a ROM version?

>> with disk2rom utility (included in tools folders). Ok this is not suitable for 32K or 64K rom size but in most cases you >>can make a rom version of any floppy disk, and put it in a 512K or 1024K Cartridge.

As far as my understanding arrives, you can't.
As MSX-DOS is in a ROM any you are trying to executing another ROM.
Both occupuies the same logic space. Thus, it is not possible.

SDCC with tools can produce a .COM file
But a COM file can not be executed in a ROM.

Por ericb59

Paladin (798)

Imagen del ericb59

18-01-2019, 16:13

La Gaseta Msx wrote:

As far as my understanding arrives, you can't.
As MSX-DOS is in a ROM any you are trying to executing another ROM.
Both occupuies the same logic space. Thus, it is not possible.

SDCC with tools can produce a .COM file
But a COM file can not be executed in a ROM.

Just download and try Brick Breaker demo
http://msx.ebsoft.fr/bbreaker/

as you see this is Game Demo made with FUSION-C. You have the DISK version, and the ROM Version
Rom version was made with DISK2ROM utility.

Por Grauw

Enlighted (7840)

Imagen del Grauw

18-01-2019, 19:00

La Gaseta Msx wrote:

As far as my understanding arrives, you can't.
As MSX-DOS is in a ROM any you are trying to executing another ROM.
Both occupuies the same logic space. Thus, it is not possible.

SDCC with tools can produce a .COM file
But a COM file can not be executed in a ROM.

You can, it works very well.

How it works is the first 16K of the ROM is a diskROM, one which interfaces with the ROM mapper instead of a disk controller. The remainder of the ROM then contains a disk image, a ROM disk very similar to how a RAM disk works. The program is loaded in the computer's RAM memory exactly like a DOS game.

Downside is that it requires a 64K MSX, and that data needs to be loaded rather than accessing ROM banks directly. Upside is that you have the DOS environment with the full 64K of TPA RAM space available, rather than the first 32K to 48K occupied by ROM (BIOS + ROM data).

The large TPA is useful for any program, but especially for C programs I think. And it's easy to install a custom ISR and to use self-modifying or generated code, and on turboR it will run in fast internal memory. Lastly you can program for one environment and release both a downloadable disk and cartridge ROM version with little extra effort.

Por gdx

Prophet (2561)

Imagen del gdx

19-01-2019, 01:17

wimpie3 wrote:

Is it true what Wolverine says?

Yes because Ericb59 chose the simplest method for developers. Maybe, with next version, we will be able to choose the execution environment of the program during compilation. There are several possibilities on MSX (MSX-DOS command, Disk that boot on sector 0, Binary file under Basic, then ROM 16k, 32k, 48k/64k and megaroms, raw file).

I hope that Fision-C will become so complete someday. I think this will depend on the project participants. For the moment, I imagine that it is not even optimized but it is already a good tool.

Por ToriHino

Champion (279)

Imagen del ToriHino

19-01-2019, 13:25

I received the book today, looks great!

Por sinus

Expert (74)

Imagen del sinus

19-01-2019, 19:20

What I've seen so far is really well done and rational, it breaks with the austerity and complexity of previous options to get to C language on MSX. Of course I am willing to support your efforts, I've bought the book and will try to contribute somehow some day Tongue
I personnaly stood among those who had prefered relying on a proper C language solution instead of developping in a specific Z80 or MSX related language (ASM or compiled BASIC however good they are). For sure I much welcome the energy involved in Fusion-C, authors gathering others' contributions as a shared tools pool. I hope this package with help 'new' guy to join the force and unleash their skills to create even more quality software: a virtuous circle Wink
Thanks,
Sinus

Por ericb59

Paladin (798)

Imagen del ericb59

19-01-2019, 19:35

Thanks
I also hope the developers will use FUSION-C, and the Library will evolve with the needs of the coders. Do not forget to share your work, so that everyone can enjoy, and thus make a futur version 2.0
Wink

Por alexito

Champion (323)

Imagen del alexito

20-01-2019, 17:09

I received mine too. Look awesome. Thanks Eric.

Por karloch

Paragon (2033)

Imagen del karloch

20-01-2019, 23:57

I always wanted a good set of libraries and extensive documentation for developing C in MSX. I already ordered the book Smile Combining FUSION-C with ASMLIB I think many interesting things can be achieved!

Por hbarcellos

Hero (558)

Imagen del hbarcellos

21-01-2019, 03:25

If it's coming from Eric = instant buy for me.
Congratulations! Open Source, Amazingly Useful stuff, optional purchase for a useful and collective item (Book).
All the Best guys.

Por wimpie3

Master (214)

Imagen del wimpie3

21-01-2019, 17:08

Got the book yesterday and I'm a bit disappointed. This is basically a reference guide, not a programmer's manual. Perhaps I was expecting too much. Lots of English mistakes too.

Por ericb59

Paladin (798)

Imagen del ericb59

22-01-2019, 12:26

@wimpie : Yes there are English mistakes. I done it with my very bad knowledge of Shakespeare's spoken language ! You can point to me the mistakes and I will correct them.
It's not a programmer's guide, my goal was not to make a C learning Book, there are many books, or websites about that. But, there is a complete C memento that beginners can read to learn C. In any case you must know at least the basics of programming.

@hbarcellos : thank you for your support :-)

Por wimpie3

Master (214)

Imagen del wimpie3

22-01-2019, 12:50

@ericb59 What I expected (and what I would have liked personnaly) is a bit more guidance on how to make sprites move, how to create tiles, basically how to create software on the MSX. The book is now only a reference for the libraries (which is good) and partly an introduction in C (which is also good). However, there is not much material that glues both together. Most examples in the second part are limited to the standard SCREEN 0. Which is not bad, you have to start at the beginning. But begin the book with a library reference talking about screen modes, sprites, sound, followed by a C introduction talking about pointers, variables, functions... without a connection between both sections. How to create sprites? Tiles? Music? This means there is still a lot left to explore and learn for people not used to work with the MSX. The book is IMHO probably too easy for someone who knows the MSX, but too difficult for beginners.

Por wimpie3

Master (214)

Imagen del wimpie3

22-01-2019, 12:51

(arghhh... why can't you correct spelling mistakes here on this forum?)

Por ericb59

Paladin (798)

Imagen del ericb59

22-01-2019, 13:19

wimpie3 wrote:

(arghhh... why can't you correct spelling mistakes here on this forum?)

I do not understand what you 're meaning

Making sprites with Fusion-c is explained in the Book.
An you're right, this is not a guide for people who never tried to code something. This was not my purpose.

Por DarkNekros

Supporter (2)

Imagen del DarkNekros

23-01-2019, 23:33

Thanks Eric for writing a great book (a little hard to read some times (typos, incomprehensible paragraphs, etc), but with a good content).
The first thing I thought about it was: " Shocked! It's a very huge book!!", but finally it comes handy when you have to see the screenshots or read the code. I've almost finished it and now it's time to write down some code!!

Por Caetano

Supporter (1)

Imagen del Caetano

24-01-2019, 15:19

Would be nice to have a digital version of the book, take long time to ship to Brazil Cool

Por alexito

Champion (323)

Imagen del alexito

25-01-2019, 00:22

I have already installed the Fusion C Toolchain + SDCC + SublimeText on my Windows Vista 64 (Athlon X2 CPU 3.2Ghz)
Compiled Successfully the "HELLO WORLD" and "HARDWARE SCROLL" C Programs.

I just follow the instructions in the book everything works good for me at the moment.

Thanks Eric.

Por ericb59

Paladin (798)

Imagen del ericb59

25-01-2019, 15:46

alexito wrote:

I have already installed the Fusion C Toolchain + SDCC + SublimeText on my Windows Vista 64 (Athlon X2 CPU 3.2Ghz)
Compiled Successfully the "HELLO WORLD" and "HARDWARE SCROLL" C Programs.

I just follow the instructions in the book everything works good for me at the moment.

Thanks Eric.

I'm really happy to read such answer Wink

Por ToriHino

Champion (279)

Imagen del ToriHino

26-01-2019, 01:12

Setting up the tool chain indeed worked well by following the steps in the book. Already made some steps on the first project Smile

Por wilsonpilon

Champion (270)

Imagen del wilsonpilon

28-01-2019, 15:47

Hi...

I just received my book. I'm already reading and configuring the system. good job!

Por chouimat

Supporter (2)

Imagen del chouimat

05-02-2019, 18:44

Hi,
I just received the book, looks good

Por Fideton

Supporter (1)

Imagen del Fideton

20-02-2019, 22:08

I have just received my book too. Great work!

My MSX profile