TCL in openMSX

صفحة 1/2
| 2

بواسطة iamweasel2

Paladin (709)

صورة iamweasel2

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 أوregister لوضع تعليقاتك

بواسطة Grauw

Ascended (10707)

صورة Grauw

10-06-2020, 15:00

Yes, yes, no.

بواسطة iamweasel2

Paladin (709)

صورة iamweasel2

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?

بواسطة Manuel

Ascended (19300)

صورة Manuel

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

بواسطة Grauw

Ascended (10707)

صورة Grauw

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)?"

بواسطة iamweasel2

Paladin (709)

صورة iamweasel2

11-06-2020, 01:17

Thanks guys for your help.

بواسطة MsxKun

Paragon (1115)

صورة MsxKun

25-03-2021, 13:07

Manuel wrote:

And we have not made something available to produce sound.

Why not? Sad I read a bit about commands, and it seems you can write to VDP registers but not to PSG registers?
Any other way that is not "typing" something like "SOUND Reg, Val"?

بواسطة Manuel

Ascended (19300)

صورة Manuel

25-03-2021, 13:47

That is of course possible. But the question was about playing sound via the sdl API, not via the emulated MSX.

بواسطة MsxKun

Paragon (1115)

صورة MsxKun

25-03-2021, 15:21

Manuel wrote:

That is of course possible. But the question was about playing sound via the sdl API, not via the emulated MSX.

Good. Then how would it be the easier way to send a value to a PSG register?
Cause at the command reference I found:

- vdpreg Read or write a V99x8 register
and also
- v9990reg Read or write a V9990 register

but nothing like "PSGREG". Ony psg_log and doesn't seem what I want.

بواسطة Manuel

Ascended (19300)

صورة Manuel

25-03-2021, 17:00

You will neee to use the low level debug command. debug write PSG\ regs a v where a is the address and v the value.

بواسطة MsxKun

Paragon (1115)

صورة MsxKun

25-03-2021, 17:41

Manuel wrote:

You will neee to use the low level debug command. debug write PSG\ regs a v where a is the address and v the value.

Thank you, it works! Smile

صفحة 1/2
| 2