TCL in openMSX

Página 1/2
| 2

Por iamweasel2

Paladin (708)

Imagen del 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 sesión o register para postear comentarios

Por Grauw

Ascended (10634)

Imagen del Grauw

10-06-2020, 15:00

Yes, yes, no.

Por iamweasel2

Paladin (708)

Imagen del 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?

Por Manuel

Ascended (19058)

Imagen del 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.

引用:

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.

引用:

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.

引用:

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.

引用:

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

Por Grauw

Ascended (10634)

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

Por iamweasel2

Paladin (708)

Imagen del iamweasel2

11-06-2020, 01:17

Thanks guys for your help.

Por MsxKun

Paragon (1112)

Imagen del 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"?

Por Manuel

Ascended (19058)

Imagen del 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.

Por MsxKun

Paragon (1112)

Imagen del 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.

Por Manuel

Ascended (19058)

Imagen del 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.

Por MsxKun

Paragon (1112)

Imagen del 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

Página 1/2
| 2