English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 21 March 2024, 08:10   #1
Hannibal
Registered User
 
Join Date: May 2015
Location: Kirkland, Washington, USA
Posts: 56
Sending message from Windows App to running WinUAE instance

I'm working on a level editor (which runs in Windows) for an Amiga game, and I'd like to do Live Editing with WinUAE- when I make a change in the editor, it sends a message to the WinUAE instance to apply the change to the running game.

I've got WinUAE launching just fine and loading up the game on start, but what's the best way to send a message over, that the game engine can instantly pick up, without WinUAE having to check for modified files at a regular interval? Is there a way to send a debugger command over? that would be ideal for me.
Secondarily, And if I have multiple WinUAEs running, how do I make sure the message goes to all instances?
Hannibal is offline  
Old 21 March 2024, 21:20   #2
copse
Registered User
 
Join Date: Jul 2009
Location: Lala Land
Posts: 522
Not an expert, but in IO ports there is an option to set the serial port to TCP. This has a hard-coded port by the look of it 1234, and there was a command-line option to set it for a given winuae instance but that appears to be commented out.

Opening TCP serial port:

https://github.com/tonioni/WinUAE/bl...arser.cpp#L951
copse is offline  
Old 22 March 2024, 17:56   #3
Hannibal
Registered User
 
Join Date: May 2015
Location: Kirkland, Washington, USA
Posts: 56
That’s interesting, but would only work with one process, right?. I have also seen named pipes mentioned in code, but couldn’t get them to work in the past - does anyone have an example that works on either option?

Last edited by Hannibal; 22 March 2024 at 20:05.
Hannibal is offline  
Old 23 March 2024, 20:53   #4
copse
Registered User
 
Join Date: Jul 2009
Location: Lala Land
Posts: 522
Well, here's my experiment steps for configuration possibilities.

1. Activate the option.
2. Save configuration.
3. Observe win32.serial_port=TCP://0.0.0.0:1234 in file and change 1234 to 1235.
4. Reopen winuae.
5. Load configuration.
6. Switch to IO ports (observe 1234 is displayed in fixed list).
7. Save configuration.
8. Observe 1235 is still in configuration file and has not been overwritten.

So, in theory I would expect you can configure two WinUAE instances to open different ports for serial ports. This could be tested with netstat or whatever, given the two active running emulators. Verify it works for the first with the default port. Change the second and verify that is also running with the second port.

At that point the real investment is writing the communication code if this is the best path to pursue?
copse is offline  
Old 23 March 2024, 20:57   #5
copse
Registered User
 
Join Date: Jul 2009
Location: Lala Land
Posts: 522
Of course, if you can open a socket from Amiga code and you have access to the OS, maybe uaenet and bsdsocket in Expansions are much simpler possibilties given the sockets are exposed to the host (which one would assume was possible).
copse is offline  
Old 24 March 2024, 07:28   #6
Hannibal
Registered User
 
Join Date: May 2015
Location: Kirkland, Washington, USA
Posts: 56
I will have a go at that. Thanks for the suggestion
Hannibal is offline  
Old 24 March 2024, 08:01   #7
Hannibal
Registered User
 
Join Date: May 2015
Location: Kirkland, Washington, USA
Posts: 56
OK, I found the IPCTester sample in the WinUAE github. There was an old chat here on EAB explaining it. I got it to work, and that meets my needs just fine. Thank you again
Hannibal is offline  
Old 25 March 2024, 01:28   #8
copse
Registered User
 
Join Date: Jul 2009
Location: Lala Land
Posts: 522
I'd love to hear about what you do with it and any technical specifics. It seems extremely handy to be able to direct debugger commands through a named pipe for instance.
copse is offline  
Old 25 March 2024, 06:28   #9
Hannibal
Registered User
 
Join Date: May 2015
Location: Kirkland, Washington, USA
Posts: 56
It has a lot of possible uses, but the first one I want to use it for is hot loading of scripts.
I have a script language that compiles down to a binary file. I will use the debugger command to load a file at an absolute address.

I compile in a system-unfriendly way so I use absolute addresses. Therefore I compile with a buffer of empty space at a known address. Every frame I just check if a script has reloaded (just check on a magic value), and will copy it over to its “real” address in memory if it found a script.
I use a spare buffer instead of loading straight into the final destination because the debugger command can happen at any time during the frame. I don’t want to risk it reloading while it is processing the script, as that can be a source of many hard-to-reproduce bugs
Hannibal is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
WinUAE 4.4.0 two instance double mouse probs FlashArt support.WinUAE 2 27 July 2020 12:55
Winuae running 0s4.1 classic and Windows 10 network question KronusOfChaos support.WinUAE 2 03 March 2017 21:54
External windows program communicating with program running inside WinUAE xxxxx support.WinUAE 10 19 February 2013 09:27
Only one instance of WinUAE at a time NewDeli request.UAE Wishlist 3 11 May 2010 14:19
Disable Windows shortcuts while running WinUAE on Vista thomas request.UAE Wishlist 11 24 July 2008 10:49

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:59.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.08171 seconds with 15 queries