TCL in openMSX

By iamweasel2

Hero (577)

iamweasel2's picture

10-06-2020, 14:15

What are the limits of using TCL scripts in openMSX? Is everything in TCL available ? For instance, can I use it to write a txt file with data? Show a message on the emulated MSX screen? To play sounds with it (using the SDL API used in openMSX)?

Is there some tutorial / book / whatever about using TCL in openMSX?

Login or register to post comments

By Grauw

Ascended (9050)

Grauw's picture

10-06-2020, 15:00

Yes, yes, no.

By iamweasel2

Hero (577)

iamweasel2's picture

10-06-2020, 15:03

Grauw wrote:

Yes, yes, no.

Since there are more questions than answers provided, I don't know what you mean. Can you be more specific?

By Manuel

Ascended (16625)

Manuel's picture

10-06-2020, 15:47

iamweasel2 wrote:

What are the limits of using TCL scripts in openMSX? Is everything in TCL available ?

Depending on your installation, everything is available (e.g. on Linux) or only the Tcl functionality in libtcl (without supporting scripts) is available. The later is in the case of an openMSX build done with 'make staticbindist', currently the case for Windows, macOS, Android.

Quote:

For instance, can I use it to write a txt file with data?

Sure, that's already happening in many scripts that come with openMSX.

Quote:

Show a message on the emulated MSX screen?

Yes, for example, use osd::display_message "hi there" as you can see in many existing scripts.

Quote:

To play sounds with it (using the SDL API used in openMSX)?

No, the SDL API is not exposed to Tcl. SDL is considered an implementation detail from Tcl point of view.
And we have not made something available to produce sound.

Quote:

Is there some tutorial / book / whatever about using TCL in openMSX?

No, but you can study all the scripts that come with openMSX. That's quite a large amount of examples.
And you can ask here or on IRC. We'll be glad to help Smile

By Grauw

Ascended (9050)

Grauw's picture

10-06-2020, 16:03

Grauw wrote:

Yes, yes, no.

Sorry I was on my phone and got distracted. I was answering these:

"For instance, can I use it to write a txt file with data? Show a message on the emulated MSX screen? To play sounds with it (using the SDL API used in openMSX)?"

By iamweasel2

Hero (577)

iamweasel2's picture

11-06-2020, 01:17

Thanks guys for your help.