Ready to start working on MSX

Post Reply
AxelStone
New member
Posts: 7
Joined: Thu Oct 24, 2019 7:38 pm

Ready to start working on MSX

Post by AxelStone »

Hello everyone, I'm MSX coder using ASCII MSX-C during last years. In the last months I've seen that I need to use a cross compiler to break some limitations so I've decide to try with Z88dk.

Just installed and I have 2 first questions:
1. Most complete documentation available? I have no clear where to start to read.
2. Tehnical one: how I can generate my own library? I mean, I've done some code in C and I'd like to create the asociated .lib

Thanks and see you.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

hey,
you stepped in while we're doing changes and the documentation is under revision :)
Well.. there was never such a moment where we had a perfect coherence, I'm just joking !

You can start here:
https://github.com/z88dk/z88dk/wiki/Platform---MSX

Most of the existing example programs should work, including the ones outside the MSX folder (e.g. games, console, sound and graphics related examples). If in trouble just ask.

The libraries are a slightly advanced subject. Z88dk permits interesting tricks (most requiring good assembly knowledge) to reduce the stack usage, you might begin looking at an existing library folder, e.g. the MSX only stuff is here:

(library code)
https://github.com/z88dk/z88dk/tree/mas ... target/msx
(startup and definitions)
https://github.com/z88dk/z88dk/tree/mas ... target/msx
(headers)
https://github.com/z88dk/z88dk/blob/mas ... lude/msx.h
https://github.com/z88dk/z88dk/tree/master/include/msx

Many other folders are involved, this is the main .lst file agglomerating them all together:
https://github.com/z88dk/z88dk/blob/mas ... rc/msx.lst
AxelStone
New member
Posts: 7
Joined: Thu Oct 24, 2019 7:38 pm

Post by AxelStone »

Yes I see that you are moving docs from old wiki to the new one :-). I'll take a look in depth to understand it better.

About second question I didn't explain well, I don't want to replace Z88DK libs I want to add my custom libs :-). Supose I've created text.c (and corresponding text.h) that has some custom function to handle strings. I want to generate corresponding text.lib to be used in other programs. How can I do it?

I've been developing in ASCII MSX-C during last years and to generate corresponding lib (text.rel in this case, it uses CP/M notation) it's quite easy with M80.

Thanks so much!
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

Creating a library is pretty easy with z80asm as well.

The incremental way (so works with makefiles):

1. Compile to .o files
2. z80asm -xmylibrary [.o files]

Or you can do it in one go (for example from scripts):

zcc +msx -x -o mylibrary *.c *.asm
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

To be mentioned: same function names in your custom functions will override the z88dk ones by just adding -l(libname) ;)
Post Reply