MSXgl – A new C game library for MSX

ページ 1/16
| 2 | 3 | 4 | 5 | 6

By aoineko

Champion (443)

aoineko さんの画像

16-01-2022, 16:24

Hi all,

After several years of work it is time for me to release the first "alpha" version of my C game library for MSX: MSXgl.

The goal of MSXgl (formerly known as CMSX) is to offer to C programmers, the whole set of functionalities to create games on MSX with high performances. Sure, a C program can never be as efficient as a program written entirely in assembler, but the goal is to try to get as close as possible.

Even if there are certainly many things still to optimize, the most expensive features are written in assembler and the library uses as much as possible the new features of SDCC 4.1.12 to pass parameters through the registers rather than through the stack. Also, the library is dynamically compiled to allow the user to configure the functionalities to optimize them for his needs.

The other goal was to create a library that could be totally independent of the BIOS. This is good for performance and makes it much easier to use the 16K of page 0. The library provides an interrupt handling code to easily create ROMs that always remain on page 0.

The MSXgl’s Build Tool allows to create a final program for a large number of formats in 1-click:
- Plain ROM from 8K to 64K (interrupt handler can be install in page 0),
- Mapped ROM from 64K to 4096K (ASCII-8, ASCII-16, Konami and Konami SCC mappers),
- MSX-DOS 1 or 2 binary program,
- BASIC binary program.

For now, the library supports the following devices: VDP (TMS9918 and V9938), PSG (AY-3-8910), Keyboard/Joystick, ROM mapper, slot manager, and Real Time Clock (RP-5C01).

Here are also the supported audio formats:
- PT3 (Vortex Tracker II)
- ayFX
- VGM (AY-3-8910 only)
- PCM-Encoder (aka. "Crystal clean PCM 8bit samples on the poor PSG")

The library is far from being “mature” yet, but it already allows to run my Final Smash tennis game and a lot of sample programs.
Among the things left to do:
- Support for Linux/MacOS environment (script/tools uses win64)
- Disk support (even for ROM)
- MSX2+ & Turbo R specific features support
- Support for other devices (especially sound processors)

A big thanks to the members of the MSX Ressource Center and MSX Village without whom this library would never have been possible.

The library is distribute under Creative Commons BY-SA license. Tools or sources from other authors could use other free license.

For those who would worry that one more C library only disperse the energy that could be put in one (like Fusion-C), be reassured. On the contrary, I am in regular contact with EricB, the one behind Fusion-C, and I present him all the new features I add to my library so that he can add them in Fusion-C.

If you're interested to alpha-test MSXgl – whether it's just to compiling and test sample programs or to create a new one – I'm available here (or on Discord) to guide you through your first steps.




ログイン/登録して投稿

By Bengalack

Hero (578)

Bengalack さんの画像

16-01-2022, 17:17

Wow! That is an impressive featureset already.

By karloch

Prophet (2157)

karloch さんの画像

16-01-2022, 17:45

Impressive feature set! Thank you for the development!

By ARTRAG

Enlighted (6843)

ARTRAG さんの画像

16-01-2022, 18:01

Are you going to support SDCC v4.1.12 ? It will include a UGE change in the way functions pass parameters, with an expected speed gain of about the 20%
Great that you already rom mappers!

By aoineko

Champion (443)

aoineko さんの画像

16-01-2022, 18:27

ARTRAG wrote:

Are you going to support SDCC v4.1.12 ? It will include a UGE change in the way functions pass parameters, with an expected speed gain of about the 20%

MSXgl does need SDCC v4.1.12 because it use the new calling convention (sdcccall_1).
All needed SDCC files are included in the MSXgl package.

By ARTRAG

Enlighted (6843)

ARTRAG さんの画像

16-01-2022, 18:41

I overlooked your post, it is already reported.
Actually I am slowly trying to see how sdcc v 4.1.12 goes adapting Eric's work to it.
I was just missing mapped roms, I think I will give a try to your library
One interesting feature could be to include MDL optimization in the toolchain.
Why not include an option to an MDL pass?

By aoineko

Champion (443)

aoineko さんの画像

16-01-2022, 18:56

I am very interested in MDL and the SDCC peep-hole system. It just hasn't been a priority until now so I haven't really looked into it.

By Manuel

Ascended (18781)

Manuel さんの画像

16-01-2022, 20:48

The latest official release of SDCC is 4.1.0 apparently... isn't it a bit too early to rely on 4.1.12, which seems to be just an internal development version?

By Cylicano

Supporter (3)

Cylicano さんの画像

16-01-2022, 21:03

Good work Aoineko ! Wink

By aoineko

Champion (443)

aoineko さんの画像

16-01-2022, 21:21

Manuel wrote:

The latest official release of SDCC is 4.1.0 apparently... isn't it a bit too early to rely on 4.1.12, which seems to be just an internal development version?

All their snapshots are validated on a whole battery of self-tests so it seems quite safe.
I trusted Philipp Klaus Krause, one of the main contributors to the z80 part of SDCC, who advised me to use the version 4.1.12.
I've been using it for 2 months now and if I had some problems to make the transition, none of the problems came from SDCC.
That said, I could totally understand people who prefer to wait for 4.2.0.

By ARTRAG

Enlighted (6843)

ARTRAG さんの画像

16-01-2022, 21:57

I've been toying with v4.1.12 for a few weeks without facing problems, moreover the speed improvement is worth the risk. Now finally it is starting to compete with Hi-techC for MSDOS (I use v7.80p2). What I need to understand is the support to paged roms in SDCC. In Hi-tech C I was exploiting the large memory model introduced for z180. SDCC seems much more convoluted on this subject, the manual does not include a large memory model for z80/z180 cpus. I hope that aoineko's tools will help me to understand how things work in this new enviroment.

ページ 1/16
| 2 | 3 | 4 | 5 | 6