openMSX remote commanding trough sockets

Page 1/2
| 2

Par NYYRIKKI

Enlighted (5843)

Portrait de NYYRIKKI

23-01-2020, 07:19

Hi,

I tried to compile openmsx-control-socket.cc from Contrib-folder for Windows, but after few hours of banging my head to the wall, I realized that my skills are not in a level to actually compile even a single file, single library program on this kind of complex, modern platform... Oh, well... If I could I probably would fail to modify it to my needs anyway.

Therefore I ask, if there could be any kind soul that could build a tool that would pass the arguments given to an active openMSX session? I don't mind even if it could not return anything back, but I would prefer it to use socket method so that I could start the session from Catapult and use the Debugger at a same time.

The idea is that I could use it ie. inside BAT-file like:
Command_openMSX "diska C:/MSX/project/testdisk/"

Personally I would also like to use it in Windows Explorer so that if I right click some folder or .DSK with mouse, I could ie. have "mount as openMSX diska" in the context menu... I guess you get the point... The idea is that I could send a command to existing openMSX session without each time starting a new one.

!login ou Inscrivez-vous pour poster

Par Manuel

Ascended (18088)

Portrait de Manuel

23-01-2020, 07:37

What's going wrong with compilation?

Par NYYRIKKI

Enlighted (5843)

Portrait de NYYRIKKI

23-01-2020, 07:48

Mostly I think the problem is that I have no idea what I'm actually doing, what I should have installed to my machine to what directories and so on... Practically I've just been clicking randomly around Cygwin setup program... To be honest I don't read the source even well enough to know what it is supposed to be doing, but I just wanted to try...

During my tests I've had tons of different errors, but latest was:

$ i686-w64-mingw32-g++ `xml2-config --cflags` `xml2-config --libs` openmsx-control-socket.cc -lwsock32
openmsx-control-socket.cc:16:10: fatal error: sys/select.h: No such file or directory
 #include 
          ^~~~~~~~~~~~~~
compilation terminated.

Par Manuel

Ascended (18088)

Portrait de Manuel

23-01-2020, 21:34

Well, look what I got:

$ x86_64-w64-mingw32-g++ `xml2-config --cflags` `xml2-config --libs` openmsx-control-socket.cc -lwsock32
openmsx-control-socket.cc:16:10: fatal error: sys/select.h: No such file or directory
 #include 
          ^~~~~~~~~~~~~~

It almost looks like you were running this on Linux. But you said you were using Cygwin. I think you need MinGW instead... But I'm just guessing a bit here. In any case, i think this example isn't working on Windows anyway, I see this TODO item:
- Update Contrib/openmsx-control-socket.cc for SSPI (TODO by mfeingol)

So, unfortunately, the SSPI thing makes things a bit more complex on Windows and I have no experience with it. I hope some Windows developer steps up and implements it. There is already example code in the Debugger, of course.

Par NYYRIKKI

Enlighted (5843)

Portrait de NYYRIKKI

16-01-2021, 16:10

One year later... Pretty please!

Could some kind soul consider helping me out on this problem? My Windows programming skills are not up to the task.

Par Sandy Brand

Master (239)

Portrait de Sandy Brand

16-01-2021, 16:45

Manual is probably right, it seems you are trying to compile this on the wrong platform?

Windows equivalent for select() function

Without knowing what you exactly want to do in terms of coding, it will be hard to give specific help.

Maybe a better way to approach this is to have a look at the code of the openMSX debugger. That program also opens sockets to send commands to a running instance of the openMSX emulator that was launched through catapult. It is written using the QT library which has things like QAbstractSocket which solves the kind of problems you are running into when developing on different platforms.

Par ro

Scribe (4451)

Portrait de ro

15-02-2021, 11:31

Nyyrikki is looking for a solution to kind of "batch" openMSX commands. As the CLI is missing full clipboard functionality (I'm on Win10, only copy to openMSX works), doing remote sessions could be the next solutions. I'm struggling with the same.. Perhaps another option is to make use of TCL scripts. But I dunno how to get that work, either (any good tutorial on that?)

so, what's the easiest way to "batch" the openMSX cli using external sources (I consider the clipboard an external source too).

Par Manuel

Ascended (18088)

Portrait de Manuel

15-02-2021, 18:52

What do you want to achieve, ro? Can you give an example?

Par turbor

Champion (481)

Portrait de turbor

15-02-2021, 19:34

ro wrote:

so, what's the easiest way to "batch" the openMSX cli using external sources (I consider the clipboard an external source too).

If you know which commands you want to execute before you launch openMSX there is the '-script ' way to load a TCL script . Write a temporary file and pass this on the CLI. Each line in that file can be the same as you would type in the console (<F10> by default)
If you can be more precise about your goal we will gladly assist you.

Par ro

Scribe (4451)

Portrait de ro

16-02-2021, 07:23

I didn't want to hijack Ny's threat, just expand on it Smile
but: I like to on the fly copy CLI instructions. Not only from external to openMSX but also the other way around. Keeping a list of used cli lines. Like the very long "diskmanipulator chdir hda2 /bla/bla/bla". Yes I can use the up key to recall a line. sure. Following Ny's post, I wouldn't mind using external means to input CLI matter. I'm talking workflow here Smile

Par Manuel

Ascended (18088)

Portrait de Manuel

16-02-2021, 14:13

You can even search in the command line history. Try first 'diskm' and then up...

Page 1/2
| 2