Thread: \\.\pipe\WinUAE
View Single Post
Old 21 October 2015, 22:22   #7
Registered User

chaos's Avatar
Join Date: Mar 2013
Location: Slovenia
Posts: 133

I tried this myself (might come handy someday!), here's what I came up with:

- you should use win32file module (part of Python Win32 extensions), since using plain open() on a named pipe doesn't work so well (it does open, but windows being windows, the named pipe is 'special', not like in unix)
- win32file API:
- use ipctester.cpp & uaeipc.cpp as a guide
- the ipc_restore, ipc_quit, ipc_debug and ipc_event commands work
- none of the events or config options I tried to set were recognized (I got a 404 response), I don't know why
- I successfully used the debug commands, those work OK

Here's the code snippets, if it's any help:

- import win32file module:
from win32file import *
- open the WinUAE pipe (the syntax is basically copied from ipctester.cpp):
up = CreateFile(r'\\.\pipe\WinUAE', GENERIC_READ | GENERIC_WRITE, 0, None, OPEN_EXISTING, 0, None)
- write into pipe:
WriteFile(up, 'ipc_restore\0', None)
- read return status (reads are blocking, careful)
ReadFile(up, 4096)
# or to directly print the result:
print ReadFile(up, 4096)[1]
- close pipe:
So, debug stuff works:
WriteFile(up, 'DBG ea\0')
print ReadFile(up, 4096)[1]
but not much else ... for now ...

toni: what is the proper syntax of ipc message to, for example, set config value nr_floppies?

I tried lots of variations like 'CFG nr_floppies=1', but I always get a 404 response.

Last edited by TCD; 23 October 2015 at 12:01. Reason: Back-to-back posts merged.
chaos is offline  
Page generated in 0.08786 seconds with 9 queries