Very important knowledge. What would the particular functions be that you think need to be emulated?tofro wrote:MT.IPCOM actually is the only way to do those two things (keyboard direct scan, joystick input, BEEPing) in an at least somewhat HW-independent way, even on SMSQ/E. All the QL gamers would be quite unhappy without this call (not abstracting these two things is actually a serious omission in SMSQ/E, as all newer QL derivates had to at least somewhat emulate IPC communications in order to implement direct keyboard scan and sound. Even the Q68 does it.Nasta wrote: MT.IPCOM is a great example as I wonder how often it is used in applications - and I would bet mostly in OS extensions like Toolkit II etc, as there are higher level OS calls that may use it to produce sound or check keyboard rows for pressed keys.
Yes, that was my line of reasoning too. Keyboard input seems to be the most important part.Nasta wrote: Most of serial and even microdrive code sits behind an abstraction layer. Programs that do microdrive direct sector access (so is everything that checks copy-protection), however, have to access the hardware directly. But running copy-protected microdrives is maybe not a thing that happens often nowadays![]()
The next one is the matter of being able to read the clock 'counter' but that can actually be emulated in hardware in several different ways. If I remember correctly, the clock is set using OS calls so that part of the hardware would not be emulated.
One possible implementation of new hardware would be a different uC interfaced to the bus via a small dual port RAM. While those tend to be expensive (but could possibly be implemented in a FPGA along with other logic), it opens up a whole lot of new options, in particular regarding ports, HID and storage devices, and with some speed too.
The point is, of course, to rather re-write portions of MT.IPCOM (and in fact given more advanced hardware the actual new code might be easier to write!) than attempt to exactly emulate or re-implement an 8302/IPC. I do think some form of IPC (but largely invisible) is a great asset, though not always practical in terms of developing the firmware that runs on it. Given that it, and the corresponding firmware on the QL side would have to be written anew, it sort of intuitively makes one think of approximately squaring the number of bugs one can produce

A long time ago when fast serial ports were all the rage

This had the advantage of using all the usual development tools and familiar assembler, plus it was all mostly software defined so lots of things could be done. The ampunt of dual port RAM needed is actually small (1k would be enough) and this could be mapped into a convenient place on the QL side. The whole point is to have enough space for some 'mailbox' and circular buffers. Initially, the second CPU is kept in a reset state while the QL side sets up the bootstrap code etc.
That being said, while something like the IPC is laughably slow compared to the 68008, the 68008 is equally slow at these sorts of stupid but fast sort of tasks compared to even very cheap modern 8-bit uCs, but the same idea is quite difficult to do with modern uC chips as they have built-in flash that is pre-programmed (or can be programmed in circuit but with difficulty and/or risk of 'bricking' the hardware) and accessed exclusively as program memory and constant data in the interest of speed, plus the required tool-set is usually PC based. I am aware of less than a handful that are bootstrapped and run from RAM, but willing to be corrected.
Later on as I was thinking about GoldFire, I came up with the idea of adding a whole second CPU, which some may say is a combination of blasphemy and overkill

For lesser members of the 68k family, things get rather inefficient if you want to keep them simple (example above with 'testing' the need for bus access), or complex hardware-wise if you want to keep them efficient. In the latter case, each CPU has a separate bus with it's own set of devices on it, and bus bridge hardware to connect the buses to each other when one CPU wants access to the other one's bus, which is usually detected by a decoder - one's CPU bus is mapped into the other's address space and the other way around. This way the arbitrating logic knows when which CPU wants what and can decide when which one can do it or has to wait, on a cycle by cycle basis. The bus bridge can however become a fairly involved piece of hardware as it's also the ideal point to implement, say, a RAM controller- and it would need a rather large number of signals either way, assume 2x 32-bit data bus and not much fewer address lines - on both sides. It does not get drastically simpler even if the second CPU is a much lesser thing like a uC
