VOGONS


First post, by mastemah

User metadata
Rank Newbie
Rank
Newbie

Hello everyone,

I want to write a program that programatically uses the DOXBox environment to automize some games and/or programs running in DOSBox. The program should be able to execute commands in the emulator, send keyboard commands to DOSBox, etc.

I intend to do this using Python 3 and pywin32. I played around a little and already noticed that sending keyboard input is not necessarily straight forward (for some reason, the key bindings are somewhat mixed up... sending a slash will result in sending a v character for example)... but there is a way around that, by remapping the keys in Python.

However, I haven't found a way yet to read output out of DOSBox. So, let's assume that I get an error message in DOSBox, and I would like to be able to read it in Python to analyze later. Is there any interface or way to do that?

I checked the documentation and tried a search on the forums without finding something that could point me in the right direction. Does anybody have a clue how to able to do that?

Although I don't think this is relevant in this case, here are my specs according to the guidelines:

Motherboard: Acer Aspire V notebook
Processor type and speed: i5 6267U
Amount and type of RAM- 8GB DDR3
Video board w/ RAM amount and type: Intel Iris Graphics 550
Sound board: onboard
Operating system: Windows 10
Game name (and version, if applicable): Only working on DOS currently, no game loaded yet.
Description of problem (be detailed: saying "it's jerky" doesn't help, saying "the player sprites seem to be jerky when I'm pressing any of the arrow keys" does): Cannot read out standard output (from command line) into Host system / Python.
Reproducibility of problem (always, only once, always but only on a specific level, etc.): Always
Sound mode used: not applicable
Video mode (Software, OpenGL, Direct3D, or Glide, and resolution): not applicable
Version of emulator (for VDMSound, probably 2.0.4 or 2.1.0; for DOSBox, 0.58+): 0.74
Steps already attempted to solve the problem (please say you've read the README if you haven't, and READ IT IF YOU HAVEN'T!): I can programtically start DOSBox from Python. I can also send keyboard input, although I have to remap the keys in Python to get the desired result.

Reply 1 of 3, by aqrit

User metadata
Rank Member
Rank
Member

A. Screenshot the dosbox window then use OCR on the image.
B. Modify dosbox source code.
C. Use standard game hacking techniques.
D. Custom shell program in dosbox that echos output to a file?

The JPC-RR is a emulator that may better align with your goal(s).
http://tasvideos.org/EmulatorResources/JPC.html

Reply 2 of 3, by mastemah

User metadata
Rank Newbie
Rank
Newbie
aqrit wrote:

...

Thanks for the information and the suggestions. They all seem to involve quite some mindbends to work.

I researched a little bit further, it seems that I might be able to do that in Linux using KVM as Virtual Machine Environment and libvirt.. I will give this a try and give some feedback here in case somebody stumbles across this thread.

Reply 3 of 3, by spiroyster

User metadata
Rank Oldbie
Rank
Oldbie

Whats this for? game training?
Is it just dosbox errors you are looking to subscribe to? Or specfic/generic application errors?

I think it would be easy enough to send the events (User32.dll:SendInput etc), but consuming and repsonding to certain types of events might be difficult.