PiyoTaro wrote: ↑
Mon May 27, 2019 7:06 pm
Hmmm. I will search the literature for "/IORQULA".
I was told that this is a function after "ZX Spectrum +2".
This webpage is pretty good about documenting the various spectrum edge connectors:
https://faqwiki.zxnet.co.uk/wiki/ZX_Spe ... _connector
That page shows a common subset of signals that is portable across all models. There are links there that show the three types of spectrum edge connectors with all their signals: 48k, 128k, +3.
The next edge connector is a 48k/128k one (not a +3). The differences from the common subset page above is only +5/+9 is available, /IORQULA is available on lower 13, lower 15 and upper 4 (the +3 romcs signals) are disconnected, and upper 28 is connected but we're not sure what to do with it yet.
If there is a conflicting problem in decoding the "even" address, will the problem not occur if "A0" is not used?
To avoid conflicts with port 0xfe, you must check that A0=1.
And to avoid conflicts with ports xxFD, A1:A0 must not be "01".
In addition to the 8-bit IO decoding, A8 and A9 are used for TIMEX's AY interface that I referred to.
If A15:A8 are used in the port decoding then you must use "IN r,(C)" and "OUT (C),r" instructions to access the device as only these instructions make a full 16-bit port address that is independent of the data being OUTed. The "IN A,(n)" and "OUT (n),a" instructions place A on the upper 8-bits of the address bus but in an OUT, the upper 8-bits is not independent of the data being written.
The timex is different as it completely decodes all io ports. On a spectrum, port 0xfe is active when A0=0 but on a timex port 0xfe is only active if A7:A0=0xfe. With timex machines there is considerably more freedom in selecting port addresses.
Sinclair was a bit cheap and didn't expect anyone to have more than one or two devices plugged in. In the next we have dozens and it is a minefield to find a non-conflicting port address
So there are two approaches to help out. The easy one is to find a port address that doesn't conflict. Another way is to use /IORQULA when it is available to disable ports internal to the machine.
I'm a little reluctant to say how the expansion bus is being handled because we don't know if it works yet but it's directly relevant to what you are doing.
The /IORQULA signal is there but it has to be asserted very early in the io cycle before /IORQ goes low. So it must be generated by peripherals by looking at the address lines only. Right now only port 0xfe is disabled by /IORQULA being pulled high (you must only drive /IORQULA high and otherwise let it float). But I think it's likely it will be applied to at least the xxFD ports and maybe all of the internal ports. If present on original spectrums, then /IORQULA only disables port 0xfe to allow use of even port numbers.
The expansion bus is going to be off by default and must be turned on by the user. While the expansion bus is off, signals will be held in a neutral state.
When the expansion bus is on, the cpu speed will be limited to 3.5MHz (but maybe settable in the future). The user can disable internal devices individually. If the next determines that a port is being answered internally, it will not propagate the io cycle to the expansion bus. So external peripherals will not see an io cycle handled by an internal device.
Regarding your FM device, I don't know if you are still considering having it respond on port FFFD, BFFD as there is software out there for some FM devices on these ports. But it would be possible by setting the expansion bus register to disable the internal AY chips when the expansion bus is on. Then the internal AY chips will not respond to ports BFFD, FFFD and the io cycle will propagate to the expansion bus where your device can respond.
Anyway, it is easiest if you can find a non-conflicting port.