thewiz wrote: ↑22 Nov 2018 13:48
What would be read?
In normal operation an interrupt is triggered on an edge (can't remember which on). Would not the bit read just reflect if an edge has been detected or not?
As an aside, one of these days, when the emulators are up to it, I would love to write a tape loader with music and loading screen. The only example of this FBITD is Jet Set Willy.
TTFN
Circuitry in the MTX converts an edge at the cassette input into a short pulse at the CTC C/T3 input. The ROM sets CTC channel 3 to counter mode triggered on the falling edge of C/T3 with a time constant of 1 and interrupts enabled. (I used the rising edge in the Speculator but it makes no difference.) Thus every cassette edge will generate an interrupt, which occurs when the down-counter is decremented to zero, then automatically re-loaded with the time constant.
The current value of the down-counter can be read at any time by an IN from the CTC channel port, which can be polled to see when a cassette edge has occurred. Suppose the time constant is 2 and interrupts are disabled. If IN 0BH changes to 1, then an edge has happened and if it changes to 0 there has been another edge and the down-counter is re-loaded with 2. The next edge decrements it to 1 again, etc.
Therefore bit 0 of IN 0BH is in effect the cassette input, provided the time constant is any even number. Polarity is irrelevant as there is no way of knowing whether or not the tape player inverts the signal. This means interrupts are not needed for cassette input and a load routine could be similar to the Spectrum. I have never tested this as my MTX is packed away in the attic. Perhaps someone would like to try it?