I like to port my code to other systems, and since Memotech is similar to an MSX, it was a fairly easy conversion, once I had all the information. I'd probably target programmers who are programming for similar platforms, it's requires a fair amount of dedication and programming ability to start programming and learn for any of these 8bit systems.
I'd suggest creating a sample project and page with all the relevant hardware information in one page. I wrote a similar document for the Microbee
https://under4mhz.github.io/microbee/index.html
I like to know the VDP data/in ports and the PSG data port, also that the PSG is SN76489 (vs AY-3-8910). The amount of memory available is important as well (32/48k?). A memory map is useful as well, (ie that CPM is above 0xD000)
Code: Select all
#define VDP_DATA_OUT 0x01
#define VDP_DATA_IN 0x01
#define VDP_COMMAND 0x02
#define VDP_COMMAND_IN 0x02
#define PSG_DATA 0x06
and any other ports I may be missing.
Also important is some code on how to read the keyboard. I think I reverse engineered that from mame (I can't remember if I did or not, but I've had to for many other platforms).
A default crt0.s, with the correct org etc is important. I had to write my own, and that's a fair bit of messing around in assembler to get right.
Also highlight somewhere that since the z80 is running slightly faster than other systems at the time (3.6MHz vs 4.0MHz?) more wait states in the vdp code is needed.
Perhaps pick a format and hardware model for programmers to use and specify that in your documentation/examples. I'd probably suggest the MTX512, since it has the most memory (depends on the user base, though). Output as COM files, since those are fairly well known.
I'd suggest making a simple demo project, with everything included: ie type "make" and the whole thing is built and Memu is run automatically at the end (if it's in the path). I've done something like this for the Microbee
https://github.com/under4mhz/microbee, since they have no documentation at all on the thing. But my example project is targeted for someone like me, who knows these systems well and simple needs information on what the ports and how to run it on an emulator. You'd probably want to make a simple game with sprites and sounds for general use.
There are two TMS vdu projects I know of. Probably leveraging off these libraries is a good idea. I don't know how popular these are. From what I can tell, most programmers are like me and wrote their own libraries, we have to get pretty close to the metal to get the performance needed for most games.
An advantage to adding support to these is MTX is added to the list of support platforms, and that may generate some interest if they start to ask "MTX, what is that?" It also means programmers can recompile their code and expect it to work on the MTX (hopefully,mostly).
https://github.com/sehugg/cvlibc
https://github.com/sverx/devkitSMS
cvlib (for the ColecoVision) has the same hardware at the MTX. I'd probably suggest forking this and adding MTX support. I'm sure he'd be amenable to adding an other platforms. As I mentioned, make sure the demos make a COM file, and the needed crt0.s.
devkitSMS is for the Sega Master System, but also supports it's predecessor the SG-1000 (the system of my childhood), which is pretty much identical to the MTX as well. Though I'm not sure sverx would be open to adding MTX support (Sega forever), there are certainly tools to leverage in there and a maintained fork may be worthwhile.
It's also important to be able to create and show assets such as background images, sprites and text from png/bmps files. I would like to be able to create, load and show tiles in 8x8 and 16x16 (or larger for more advanced games).
Can I suggest making the default options enabled with Memu to be -vid-win -snd-portaudio -diag-vid-time-check (at least on Linux) I found it confusing to run Memu and have it do nothing. I think I gave up, and tried Mame at that point. Without the vid-time-check I was releasing code that wouldn't work a on real MTX machine, and it's a pain to have to go back and find out where that's occurring. It's easier the first time.
The Mame roms package on the Memotech website has the finnish.rom missing (one of them, anyway), at that point I think I gave up on MTX for a while. Eventually I figured out that the finnish rom was in Memu, and somehow figured out the Memu command line switches needed to get the sound and video going.
I think most people targeting this machine are probably going to technical people like me (I'm an embedded C++ programmer by trade), so I doubt many are going to writing code in basic. From what I can see, those who do BASIC did so as a kid and are picking it up again as an adult, not starting on a new system.
I use sdcc, and from what I can tell most of us hardcore Z80/TMS9918 programmers do, but z88dk also supports MTX as pointed out on the Memotech website.
http://primrosebank.net/computers/mtx/t ... _z88dk.htm. Maybe some specific instructions on how to build and run the demo projects maybe worthwhile. From what I can see, it's not immediately clear (ie easy) how to do that from the z88dk documentation.
I think it's important to have a demo project programmers can download, build and run. As a starter, I usually want to take someone's demo project and go from there. I just want to write games, not figure out all the bits before I can start (that can come later).
I know I'm lecturing on what others should do, rather than doing it myself. MTX isn't my main platform of choice, it's more of a side project.