PiyoTaro wrote: ↑
Thu May 30, 2019 5:24 pm
About the future implementation of ZXSpectrumNext's "expansion bus".
Does that mean that disabling and enabling the "expansion bus connector" determines the initial setting (it is a machine profile or a config file of a system card?)?
Below is a description of how the expansion bus is intended to work. Please keep in mind this is not tested yet.
The expansion bus has a set of device enable bits associated with it. These bits are all set to 1 to enable the zx next's internal devices. The user can individually disable internal devices like the mouse, ay, joysticks, etc by resetting bits in this bit field.
The expansion bus can be turned on and off at any time. When it is turned on, the machine is slowed to 3.5MHz automatically and the associated device enables are in force. The next will filter io cycles from the expansion bus based on those device enables. For example, if you have the internal AY enabled (the default) then the next's internal ay chips will respond to ports FFFD and BFFD, and the io cycle is not propagated to the expansion bus. This way devices on the expansion bus will not conflict with ports used by internal devices. If you switch off the AY device enable, the next's internal AY will not respond on ports FFFD and BFFD and the io cycle will go out to the expansion bus, giving an add-on a chance to respond to those ports. When I say the io cycle is not propagated I mean /iorq will be held high through the entire io cycle.
When you switch off the expansion bus, the next returns to normal cpu speed and the internal devices work as usual. The expansion bus signals are held in a neutral state (including the clock which is held high).
When the next boots up the expansion bus is disabled. External signals will have seen /RESET go low but that's about it. You can manually pull /RESET low on the expansion bus at any time through a nextreg bit that will not reset the zx next itself. This is reset is shared by the esp wifi so doing this will causes /RESET to go low on the expansion bus as well as reset the esp wifi chip.
There is a second expansion bus enable mode. You can program it to automatically enable on a soft reset and you can indicate if you want a 48k rom only or the 128k one (128, pentagon, +3 depending on the machine type at boot. The zx next is a +3 type). So after you've booted up, set the device enables, indicate the expansion bus turns on on a soft reset, choose if you want a 48k machine on reset. Then soft reset the machine. The machine will restart in 48k mode or normal with the expansion bus on so that devices will see a full power on sequence. You can still enable and disable the expansion bus as described above.