Latest on C dev for the MTX SDCC etc,

Everything about programming, including VDP and Sound programming.
Potholepete
Posts: 42
Joined: 11 Aug 2012 22:13

Latest on C dev for the MTX SDCC etc,

Post by Potholepete »

I have been wondering if there was a way of making a more tailored MTX hardware specific flavour of C (SDCC etc) so that those who have either long forgotten assembler or only know a bit of C might be able to create new MTX specific software. I know there is plenty of things relating to the MSX1 and others using similar hardware and just thought that if something was set up with the MTX in mind it may encourage more software to be written?

last post was 2018 so I am hoping there has been some useful developments since then that I am not aware of?

It would need some decent instructions to help those of us who are rusty with setting up the IDE, what libraries to include, how to compile, then test a project and so on.

Jim
Bill B
Posts: 338
Joined: 26 Jan 2014 16:31

Re: Latest on C dev for the MTX SDCC etc,

Post by Bill B »

As far as I know, the only recent MTX work using C has been the software for the NFX, which Andy originally wrote using SDCC and I continued in the same fashion.

I tend not to use an IDE for software development, just a decent editor (in my case Emacs), and then Makefiles for compilation.

Apart from that I think all recent MTX software development, mainly by Martin, has been in assembler.
User avatar
Dave
Posts: 976
Joined: 11 Aug 2012 18:16
Contact:

Re: Latest on C dev for the MTX SDCC etc,

Post by Dave »

‘During Memofest 2015, Andy demonstrated his library of assembler routines to control the MTX VDP and sound chip, the routines are callable from C which should make writing programs for the MTX a little easier, with only the speed critical parts of the code using assembly language”

Unfortunately, I don’t think that Andy ever released his library into the public domain- it is not available on his website

You might like to ask him about it?

Regards
Dave
Potholepete
Posts: 42
Joined: 11 Aug 2012 22:13

Re: Latest on C dev for the MTX SDCC etc,

Post by Potholepete »

Thanks Bill / Dave,

I will drop Andy a message and see what he says.

Jim
Potholepete
Posts: 42
Joined: 11 Aug 2012 22:13

Re: Latest on C dev for the MTX SDCC etc,

Post by Potholepete »

Spoke with Andy and he said he is not aware that there are any specific MTX libraries in C that would allow control of the MTX chips. There is for the MSX as I have seen it mentioned a fair bit online but nothing for the MTX at the moment.... anyone ;-)

Jim
Bill B
Posts: 338
Joined: 26 Jan 2014 16:31

Re: Latest on C dev for the MTX SDCC etc,

Post by Bill B »

I'm not volunteering, I am currently struggling with my own project.

However, what do you expect such a library to provide? At its simplest, you only need two routines, one to read an I/O port, the other to write to a port. Given those two you can write everything else in C.

You mention libraries for the MSX. Do you have references for these? Can they be adapted for the MTX? I don't know anything about MSX machines but I believe that they are not too dissimilar to the MTX. Is it just a matter of changing a few port addresses?

If you want to set a challenge you need to make it explicit :)
Potholepete
Posts: 42
Joined: 11 Aug 2012 22:13

Re: Latest on C dev for the MTX SDCC etc,

Post by Potholepete »

Hi Bill,

I'm not sure really as not an expert but the link below is one that I have looked at and wondered if there were similar or could be for the MTX or even if its worth doing? My thinking is that perhaps if there were an easier way to use C with the MTX more people might be inclined to write some new homebrew software for it. At the moment its assembler really for MTX hardware chips and my tired old brain would probably give in ;-) Unity is bad enough..

https://github.com/ericb59/Fusion-C-v1.2

Jim
stephen_usher
Posts: 238
Joined: 27 Nov 2016 19:58

Re: Latest on C dev for the MTX SDCC etc,

Post by stephen_usher »

Looking at the code, I doubt a lot of it would be useful. It's doing a lot of hand-off to MSX-DOS. Some of the files specify that the library as written doesn't work with the BASIC ROM, only MSX-DOS.

Also, a great deal of it is purely for the sound stuff, and MSX uses an AY chip, which is very different from the MTX.

There are a few routines which deal with the TMS graphics chip (MSX1) which could probably be modified.
Potholepete
Posts: 42
Joined: 11 Aug 2012 22:13

Re: Latest on C dev for the MTX SDCC etc,

Post by Potholepete »

Hi Stephen,

Apart from the VDP related stuff then it sounds like the rest is no use. I thought the colecovision uses the same hardware chips though for sound and video so I wonder if there is anything on that side that might be a good starting base to work from?
Bill B
Posts: 338
Joined: 26 Jan 2014 16:31

Re: Latest on C dev for the MTX SDCC etc,

Post by Bill B »

In my usual habit of starting too many projects and failing to finish most of them, I have been thinking further about this.

One question that would need to be decided early on is what the target for the library would be:
  • Would the games be intended to be run from SDX Basic. In which case a good start to the library would be providing an SDCC callable interface to key ROM routines.
    • There is then a question of how to load the game. The SDCC compiler / linker could produce a binary file, which then requires a separate two line Basic program to "USER READ" the binary file into memory, followed by a "USR(x)" call to execute the code in memory.
    • Or the game code could be embedded in a large "CODE" statement. In that case there would either need to be separate versions for 32K and 64K machines, or the game would have to be prefixed by some code that relocates the game to a fixed address above 0x8000 irrespective of whether loaded on a 32K or 64K machine. I doubt the SDCC linker could produce this without some post processing.
  • Or would the games be in the form of COM files, started from CP/M, although they would presumably use the VDP for display. In this case the hardware access routines would largely have to be written from scratch. Many of the useful ROM routines are likely to assume the existence of system variables or work space in memory regions occupied by CP/M.
Any thoughts?
Post Reply