TCL in openMSX

Page 3/3
1 | 2 |

By wouter_

Hero (535)

wouter_'s picture

18-08-2023, 16:28

Hi MsxKun,

I might be able to give a better answer if I better understand your goal. What are you trying to achieve?
For now I can only give you a general answer:

In principle Tcl is a full fledged general purpose programming language. And then of course it's possible to start external programs from a Tcl program: use the exec command. See here for the documentation on that command. Or read the documentation section on the same website for any other questions on the Tcl programming language itself.

Although Tcl is a general purpose language, I wouldn't recommend it for large programs. On the other hand it is well suited as a scripting language embedded in another tool (the name Tcl stands for "Tool command language). And that's exactly how Tcl is used in openMSX: instead of offering only a fixed set of functions, we integrated a scripting language. That way (advanced) users can often implement stuff we (the openMSX developers) had never thought about.

To achieve this, openMSX embeds a Tcl interpreter (this gives a general purpose scripting language). And to integrate this with the MSX emulator, we augment the standard set of Tcl command with several openMSX specific commands. For example commands to read/write the MSX memory.

By MsxKun

Paragon (1134)

MsxKun's picture

18-08-2023, 20:35

I think that's enough for a start. I put the link with doc on favourites to have it at hand.
The purpose is just fun and loose time without sense.
Maybe write a ROM that makes a fake call that TCL can notice (I already did this time ago, it works). Then the TCL maybe can start a Python program or anything crazy, just cause it can.
For example, from MSX BASIC, type "call MRC", and then the ROM opens internet with the MRC page. Something like that with zero (or almost zero) practical use, but you can say "Hah, it worked." That simple. Of couse a simple TCL with just read a value and then make the EXEC Whatever.
Thanks, I'll play with it next day!

Page 3/3
1 | 2 |