kosarev / zx

ZX Spectrum emulator written in a mix of Python and C++
https://twitter.com/z80tools
MIT License
21 stars 1 forks source link

Feature request: send data to I/O ports #16

Open boriel opened 4 years ago

boriel commented 4 years ago

Not a bug but a feature request: It would be nice to programmatically send ports values which could be read by the CPU using IN. This could allow to send simulated "keypresses" or "joystick events" to the program to automate QA testing.

kosarev commented 4 years ago

That's what the emulator actually does; all the keyboard/tape handling is in Python. I guess it would be a good idea to add some documentation, examples and tests as well as provide some public API to that feature. I think we can even provide some high-level API on top of the port-reading hook so key strokes can be emulated in a more natural and high-level way (again, we already do that internally on Python side of the zx code).

Hope to be able to make some progress with this this weekend. Thanks for filing the ticket!