Game development on Z88dk

페이지 1/2
| 2

By fabento

Supporter (6)

fabento의 아바타

22-02-2019, 11:17

Hi everyone!!

I'm developing a game for msx1 using the z88dk compiler with some assembly routines. but I can't figure out how to do some features like "sprite flickering" and music routines. I also used other tools like nMSXtiles, 3DSmax and tinysprite for graphics creation.
Does anyone else use this compiler to develop games? Smile

https://www.youtube.com/watch?v=g9zHyB6X_7Y

Login or 등록 to post comments

By Timmy

Expert (114)

Timmy의 아바타

22-02-2019, 17:32

'Sprite flickering' is a feature? Do you mean it should not show the same sprites every time when there are too many sprites on the same line? You do that by looking at the list of sprites and then change the order of them.

Music on the MSX is done as every other game, you add an existing music player into your game. There are many music players out there, or write your own player. Smile For simple sound effects there is a simple PSG library in the z88dk forums (which is hidden in the Spectrum part of the forum, because I wrote it for the Spectrum first and then ported later).

PS: The games I made for MSXDev are made in z88dk.

By fabento

Supporter (6)

fabento의 아바타

22-02-2019, 19:07

Which games did you do on z88dk?

By santiontanon

Paladin (845)

santiontanon의 아바타

22-02-2019, 22:24

That video looks very promising!! Nice!

Never used z88dk, but as Timmy was saying, sprite flickering is just a matter of sending the sprites to the VDP in a different order in different frames. For music I use my own custom code, but the Arkos Tracker is a tracker that I have been wanting to look into to incorporate into my games to replace my custom code (which is very limited).

By Sandy Brand

Master (156)

Sandy Brand의 아바타

23-02-2019, 21:04

Your project looks very nice already!

Haven't used z88dk in-depth much but my experience so far has been mixed.

Maybe I am spoiled by the extreme high quality of modern day compilers, but z88dk has a tendency to throw very cryptic errors at you and often at at the wrong line numbers (I think this last part is due to macro expansions most likely). It also doesn't help that, internally, the compiler quietly truncates identifiers to 31 characters, resulting in annoying linker errors.

To be fair, the authors specifically state that z88dk supports only 'Small C' which is a sub-set of (ANSI?) C.

Still, I had problems with fairly standard stuff such as variadic parameters.

Oh and it is also very picky about where to put commas, for example:

typedef enum
{
    AAA = 1,
    BBB = 2,  // z88dk doesn't like this comma!
} EMyEnum;

Will fail with some very cryptic error messages:

Error:#39:Illegal symbol name:
Error:#32:Already defined

So in short: I would advise when using z88dk to try and compile your code first with a modern compiler/IDE (using stub functions for all the things that are MSX specific), fix all your compilation issues there and only then compile it using z88dk.

I have not done anything that requires speed, so I don't know the quality of the binaries that z88dk produces (I think there was someone on this forum that wanted to compare various Z80 compilers, but I can't find the link anymore).

Anyways, for anything that is a bit more advanced, such as 'sprite flickering', I would suggest to just go with assembly. You will need real speed there in order to keep up with the frame rate. Compilers, especially the ones for older platforms, were not designed to compete with assembly; they were mostly indented to ease the more mundane and boilerplate parts of coding.

By zPasi

Champion (472)

zPasi의 아바타

23-02-2019, 21:22

fabento wrote:

Does anyone else use this compiler to develop games? Smile

I do!

Except they aren't real games yet, but I hope eventually they will be as I'm slowly progressing with these ... things

I use a mixture of C and Z80 assembly.

By Timmy

Expert (114)

Timmy의 아바타

24-02-2019, 00:01

fabento wrote:

Which games did you do on z88dk?

I did a lot of games on z88dk, lots of Spectrum games (mostly action) and some MSX games (mostly thinking). I don't have a site with all of the games (yet) but I hope to make one this year (too busy in real life). For now, you can probably look for Spectrum games or MSX game by Timmy (I know it's not a very original name lol).

For me it's just the versatility of z88dk where you can write a game for the Spectrum, and then port it to the MSX (if the game is simple enough). The two games I did for MSXDev were both ported in a few days. A lot of the C routines didn't need changing; the challenging parts were mostly the I/O, and that was quite some work.

As for the music (at least for the Spectrum), I usually ask musicians to make music. And they give me a binary with start location and size, and I incorporate that into the game. Most music players already export both the music player and the song, so I'd suggest you to be flexible with that.

Good luck, and if you have more questions then please ask. Note that it may take me a while for me to answer, I'm not very active on here.

By DarkSchneider

Paladin (879)

DarkSchneider의 아바타

24-02-2019, 10:40

Hi, has the z88dk the libs required to compile for MSX-DOS2?

By zPasi

Champion (472)

zPasi의 아바타

25-02-2019, 13:37

DarkSchneider wrote:

Hi, has the z88dk the libs required to compile for MSX-DOS2?

Seems it has not.

I think Fusion-C suits better for MSX-DOS2 development.

By Timmy

Expert (114)

Timmy의 아바타

25-02-2019, 14:35

DarkSchneider wrote:

Hi, has the z88dk the libs required to compile for MSX-DOS2?

You should go to their forums and ask for it, if you need it. Z88dk supports so many machines that there will always be priority for things that people there tell them they need. If you are planning to wait on some other random forum hoping you get support then you can wait for a long time. Tongue

My only interest is that it supports 32K Rom files, because I use them for MSXDev. In fact, I made that 32K Rom support myself. Smile

By fabento

Supporter (6)

fabento의 아바타

28-02-2019, 03:50

thanks for the compliments about my the game, but I have some silly little problems in the development of it... as i said before i dont know how to make a sprite multiplexing routine (not flickering as i said Tongue ) and an interrupt routine also. i'm trying to use an interrupt routine (tried HKEYI and HTIMI hooks) but the game runs very slow using this ISR method...

thanks santiontanon for the Arkos tracker advice.

페이지 1/2
| 2