English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 17 February 2013, 04:28   #1
xxxxx
Registered User
 
Join Date: Jan 2012
Location: N/A
Posts: 38
External windows program communicating with program running inside WinUAE

Hi guys, I've been trying to find information about this, but haven't come up with anything solid yet.
I'd like an Amiga program inside WinUAE, and a companion program on PC, and have the PC program be able to send data to, and read data from the Amiga program.
I am open to any way of doing it, but it should be able to run with any Amiga configuration (A500 up to A4000), and ideally I'd like it to be accessible with the system is disabled, but worst case I can work around that.

Some of the ways I was thinking this could work
* if it is possible to read/write directly to the emulated memory (so it could send read/write requests somehow)
* serial/parallel interfaces, which I can somehow read with low level access
* ethernet or other kind of communication emulation

Do you guys out there have any recommendations for how to do this?
xxxxx is offline  
AdSense AdSense  
Old 17 February 2013, 07:31   #2
xxxxx
Registered User
 
Join Date: Jan 2012
Location: N/A
Posts: 38
I just noticed the threads about lua scripting in FS-UAE and WinUAE - if it is possible for the lua code to communicate with external windows programs then this sounds by far like the best and most flexible solution. Fingers crossed that this will come in.
xxxxx is offline  
Old 17 February 2013, 10:12   #3
FrodeSolheim
FS-UAE Developer

FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 37
Posts: 3,418
Hi, yes I was definitively thinking about letting lua scripts handle IPC communication. Lua scripts can already read/write emulated memory.

As with any feature/ideas, it is often prioritized higher if someone has a real and current use case for it, and not just would-nice-to-have-sometime-in-the-future.

So one thing you can do - if you have a project / use case in mind - is to tell more about it, so requirements for the scripting API / IPC communication can be identified early.

EDIT: IPC could be implemented with named pipes on Windows, and unix sockets on other platforms - or regular sockets, listening on 127.0.0.1 by default. The nice thing about the former is that you don't have to choose a specific port, and IPC can be limited to the current logged in user. With the latter, the advantage is that you get the exact same IPC mechanism on all platforms.
FrodeSolheim is offline  
Old 17 February 2013, 10:32   #4
xxxxx
Registered User
 
Join Date: Jan 2012
Location: N/A
Posts: 38
Sure, I'd be happy to share. My use case is that I am writing an old-school A500 demo using WinUAE, and I run with the system completely disabled (I have a flag to run with the system enabled, but then things like memory usage is not as predictable etc).

I want to use a companion app running on PC that can help with the syncing of the demo, and therefore can send commands over in real time, so I don't have to compile to see my timing changes. I also want the companion app to read important info back, such as CPU usage, song position, free memory etc.

Since I kill the system I can easily use the memory read/write function for everything I need.

I just need things to run on Windows, so named pipes would be fine for my case. I haven't messed with either sockets or named pipes, but I'm sure I can pick that up.
xxxxx is offline  
Old 17 February 2013, 10:41   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 20,912
WinUAE has named pipe that can be used to send input events, debugger commands and change and query config entries.

You may find more information by searching for ipctester.exe.
Toni Wilen is online now  
Old 17 February 2013, 10:54   #6
FrodeSolheim
FS-UAE Developer

FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 37
Posts: 3,418
It's quite possible WinUAE has what you need (ref. the last post from Toni Wilen). I'll probably implement an IPC mechanism in FS-UAE sooner or later, and specifically one that can be controlled with Lua (for flexibility).

I imagine a feature where you open an IPC channel to FS-UAE, and the first thing you do is to push a Lua script through the IPC channel, and then this script will be started inside FS-UAE to handle further communication. This would make it very flexible, as only the IPC "bootloader" - and a few Lua functions to handle general communication, needs to be implemented in FS-UAE. You would also be able to close the current IPC channel, start a new one with a new/altered script without restarting FS-UAE / the Amiga.

Give me a notice if the script approach would work better for you, and you're interested in pursuing that idea further.
FrodeSolheim is offline  
Old 17 February 2013, 11:30   #7
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 20,912
Script solution will be better and more flexible but I want stable enough API design before implementing anything.

Changing it between versions will be very annoying to users.
Toni Wilen is online now  
Old 17 February 2013, 19:52   #8
xxxxx
Registered User
 
Join Date: Jan 2012
Location: N/A
Posts: 38
Thanks Tony and Frode. I will look at ipctester - it sounds fine for my needs
xxxxx is offline  
Old 17 February 2013, 23:09   #9
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 757
The amiga Anaiis USB stack has a "host controller driver" that lets it talk to the libusb windows dll and so you can use USB inside WinUAE.. How much this is a hack and if it'll do what you want, I'm not sure, but maybe worth investigating?

http://aminet.net/package/driver/other/anaiis_hostusb
hooverphonique is offline  
Old 18 February 2013, 15:50   #10
Gilloo
Registered User
 
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 170
Quote:
Originally Posted by hooverphonique View Post
The amiga Anaiis USB stack has a "host controller driver" that lets it talk to the libusb windows dll and so you can use USB inside WinUAE.. How much this is a hack and if it'll do what you want, I'm not sure, but maybe worth investigating?

http://aminet.net/package/driver/other/anaiis_hostusb
Yes you can use it, but you must be a really good programmer in the both sides

There is also another dll using the WinUAE/Windows capabilities: Wazp3D, a kind or Warp3D, but with WinUAE.
http://thellier.free.fr/Wazp3D.htm

Don't forget to check "Use native code" in host/miscellaneous settings of WinUAE.

Please Toni, even if it's ugly, keep this door opened
Gilloo is offline  
Old 19 February 2013, 09:27   #11
thellier
Registered User
 
Join Date: Sep 2011
Location: Paris/France
Posts: 172
Thanks Gilloo

In fact you need to create a DLL on the PC side then call it from WinUAE with a "native call"
Have a look to
aminet/wazp3D/winuaenative.h
aminet/wazp3D/soft3d_pc_glue.h/SOFT3D_DoUpdateUAE
this function only transmit an amiga pointer to the PC side : the basis to share data between Amiga & PC side


Alain Thellier - Wazp3D author

BTW: To WinUAE authors : there is no easy way to find out if the z3offset must be added to a given Amiga adresse : I mean no easy way to find out if a given adresse is in z3 memory/chip/elsewhere...
thellier is offline  
AdSense AdSense  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Send keypresses from external program to WinUAE? bazizten support.WinUAE 2 24 June 2012 18:05
For a beginner what Program and Program language would you recommend? amigang New to Emulation or Amiga scene 5 27 March 2012 13:06
Running Pinball Dreams and Fantasies from HD inside WinUAE Leffmann support.Games 10 29 August 2008 12:27
is it possible to launch windows program from workbench(winuae) turrican3 New to Emulation or Amiga scene 31 19 January 2008 18:31
Calling another program from a compiled Amos program...? andyr support.Apps 3 24 October 2004 23:47

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 19:21.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Page generated in 0.22755 seconds with 12 queries