ALL of the low-level display code that was intertwined with the emulator main loop is now gone. It has moved to its own completely separate thread. If you want the long-winded explanation...
The initial reason was that having the processing of sending display data out to displays was completely tied to the emulation loop, synchronously processed. Well, this is not the way it ever worked for real PDP-1s. The displays had their own logic and were separate devices. The -1 side interfaced to them via IOTs. I don't think the code ever belonged where it was.
Ok, fine, but it worked. So, why the change?
Because it didn't really work for any display systems other than the Type 30. Since the processing was synchronous, it forced timing in 5 microsecond intervals unless the code was mushed in with the internal emulator timing loop. The Type 30 took a multiple of 5 us to work, so that was OK.
But, nothing else does. neither the symbol generator nor the Type 340 display. This made it basically impossible to accurately duplicate the timing. Additionally, I really don't like how aap did his symgen implementation, burying it into the emulator also. It doesn't belong there.
Great, what does it do now? The display subsystem is completely independent from the emulator. It is communicated with via IOTs, which is much more like the real systems did. The logic runs in its own asynchronous thread with its own buffers and timing. IOTs talk to it via a simple set of commands that use mutexes to keep things sorted properly.
This means that not only does the main emulator not have to get changed for new display things that get added, the emulator code is much cleaner and so is the implementation of the various displays themselves. The only link between the emulator and the display system is a call made from main() to set the fds. The dynamic IOTs do get called, as they should, from the emulator with the correct pulse timing.
The thing that pushed me over the edge to do this was the Type 340 display. It's really a computer itself and it runs with its own timing that I just couldn't duplicate. Its only timing interaction with the -1 is the time to fetch a word from memory. Otherwise each of its 'instructions' have variable timing that needs timing down to 200 nsecs or so. Which it can now do. And yes, it runs in again another independent thread.
That's it for now,
Bill