MSXgl – A new C game library for MSX

Page 12/16
5 | 6 | 7 | 8 | 9 | 10 | 11 | | 13 | 14 | 15 | 16

By ARTRAG

Enlighted (6846)

ARTRAG's picture

25-02-2022, 14:54

jbikker wrote:

Ah yes, that does make those functions a bit shorter. The SDCC manual doesn't mention this behavior btw (https://gist.github.com/Konamiman/af5645b9998c802753023cf1be...); are the arguments still stored on the stack as well? That sounds like manual inlining could bring some extra performance here..

The OUTI(X) thing gives me an error during compilation.

By the way, is there a way to do some sort of a page flip in this screen mode? And would it be possible to change the sprite attribute data start address?

Too many questions, I probably need to read the red book again. :)

You can have page flipping in screen 1 (G1). You can define multiple page by changing the start position of the Pattern Generation Table. Just change R#4 for this, it holds the bit A11-A14 of the start address for patterns.
This is for msx2 but the info are the same
http://rs.gr8bit.ru/Documentation/V9938-programmers-guide.pdf

By ARTRAG

Enlighted (6846)

ARTRAG's picture

25-02-2022, 16:13

You can have up to 8 tile sets that can be used for page flipping
R#4 = 0 -> pgt=0000h
R#4 = 1 -> pgt=0800h
R#4 = 2 -> pgt=1000h
R#4 = 3 -> pgt=1800h
R#4 = 4 -> pgt=2000h
R#4 = 5 -> pgt=2800h
R#4 = 6 -> pgt=3000h
R#4 = 7 -> pgt=3800h

Naturally due to the fact that you need also room for colors (usually 32 bytes at 2000h), PNT (768 bytes at 1800h) and sprites, the number of pages actually usable is reduced

By aoineko

Champion (486)

aoineko's picture

25-02-2022, 18:34

ARTRAG wrote:

If you switch to SDCC v4.2

MSXgl is provided with SDCC 4.1.12 that include the new calling convention.

jbikker wrote:

are the arguments still stored on the stack as well? That sounds like manual inlining could bring some extra performance here..

SDCC offers several function calling conventions:
- sdcccall 0 (the old default convention) : all parameters are passed through the stack,
- sdcccall 1 (the new default convention) : some parameters are passed through the registers, the others through the stack (as described by ARTRAG),
- z88k_fastcall (inherited from another C toolchain) : only functions with 1 parameter are passed through the registers (L, HL or HLDE), the others through the stack.

MSXgl is mainly using sdcccall(1) (and sometime z88k_fastcall when I prefer to have my parameter in L register) but there are still functions with SDCC that need to be converted.

By jbikker

Rookie (17)

jbikker's picture

25-02-2022, 21:29

ARTRAG wrote:

You can have page flipping in screen 1 (G1). You can define multiple page by changing the start position of the Pattern Generation Table. Just change R#4 for this, it holds the bit A11-A14 of the start address for patterns.
This is for msx2 but the info are the same
http://rs.gr8bit.ru/Documentation/V9938-programmers-guide.pdf

This is wonderful! I can have two (or even four) fully unique sets of patterns, colors, layout, sprite patterns and sprite attributes, and flip them by setting some registers during the vertical retrace. That means that the cube can run fully artifact free regardless of frame rate. This should enable some very nice character-based effects. I will do some more coding then. ;)

By mcolom

Master (249)

mcolom's picture

25-02-2022, 22:22

It looks great, aoineko! There's a lot of work there.
I hope you'll add some Makefiles for us people working on Linux Smile

By aoineko

Champion (486)

aoineko's picture

26-02-2022, 00:50

Thank you Mcolom,
I'm not a big fan of Makefiles, but I plan to convert the Build tool to Python to make it more flexible. It would also make it cross-platform.

By aoineko

Champion (486)

aoineko's picture

16-03-2022, 00:21

Hello msxians,

Here is a new official release for MSXgl: version alpha 0.3.2

Change log (since v0.3.0):
○ Updated provided SDCC version to 4.2.0
○ Added modules to handle new audio hardware: MSX-Music, MSX-Audio and SCC.
○ Added modules to handle new audio format (in addition to PT3 and ayFX):
  • VGM (for all supported hardware),
  • lVGM (light-VGM own format for PSG),
  • WYZ (version 47c from mvac7 + version 47d from new asm code),
  • PCM-Encoder (from ARTRAG).
○ Added module (game_pawn) to handle character animation, movement and tile collision. The s_game sample has been updated to use this module as an example.
○ Added build option to automatically install BDOS driver for ROM program (using STKE hook).
○ Enhanced Emulicious emulator support (inline break-point, debug symbols and launch options).
○ Updated code documentation at /engine/doc/html/ (still "rough")

Planned features for future release:
○ Add support for new audio format: Arkos Tracker (WIP), TriloTracker.
○ Add module to handle screen scrolling.
○ Add wrapper module for BDOS functions (to handle disk access for DOS, BIN and ROM programs).
○ Add full support for MSX-DOS 1 & 2 (e.g. command line parameters).
○ Rewrite BuildTool in Python and add multi-plateform support (Linux & MacOS). Sorry, it's still for Windows only for the moment.
○ Optimize, optimize and optimize (in size and cycles)! ^^

MSXgl project highlight:
msx3d by jbikker (https://github.com/jbikker/msx3d)
https://msxvillage.fr/upload/msx3d.png

Wizzl by GFX (WIP)
https://msxvillage.fr/upload/wizzl_12.png

https://msxvillage.fr/upload/wizzl_15.png

If you have any question or need some help about MSXgl, I am available here or on Discord.

By jltursan

Prophet (2619)

jltursan's picture

16-03-2022, 08:30

Really good work!, the platform is evolving fast!

Btw, msxvillage doesn't allows cross-linking images...

By pizzapower

Expert (72)

pizzapower's picture

16-03-2022, 16:54

jltursan wrote:

Really good work!, the platform is evolving fast!

Btw, msxvillage doesn't allows cross-linking images...

They are these images from this post: https://msxvillage.fr/forum/topic-3952-10+msxgl.php#m90612


By ARTRAG

Enlighted (6846)

ARTRAG's picture

17-03-2022, 07:37

Great project
Greetings

Page 12/16
5 | 6 | 7 | 8 | 9 | 10 | 11 | | 13 | 14 | 15 | 16