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

Re-design the input machinery #13

Open kosarev opened 4 years ago

kosarev commented 4 years ago

Functions like __generate_key_strokes() should be rewritten to install Python generators that produce input data and perform other actions as the emulator executes __run_quantum(), that is, as part of the usual execution path and without taking control for all the time of generating port inputs, key strokes, etc. Same mechanism should be used to interface with tape, playback players and, later, the time machine.

The problem with control-taking functions that execute out of the usual emulation loop is that we thus may attempt to load file (e.g., via F3) while being in the process of loading another file, and we don't actually (want to) support that.

This seems to be not only a bug-fixing work, but also an enhancement and a refactoring. :-)