AMX Mouse

ZXNet echo conference «hardware.zx»

From Vlad Semchenko To All 6 March 2006

Hello, All Many people have heard about this type of Spectrum mouse. It is known that UizuminkoyF device is the transfer of parameters (coordinates) through a changing vector interruptions. Can anyone provide a link to the device diagram?

From Vladimir Kladov To All 6 March 2006

Hello spensor I'm not sure about the changing one. I can rummage through how it is implemented in my emule, I don’t have a schematic, and I don’t know anything about schematics. It really is like that there cloudy...

From Vladimir Kladov To All 8 March 2006

Hello, Vladimir Kladov Well, is it necessary or not? Otherwise I’ll forget about this thread and goodbye.

From Vlad Semchenko To All 13 March 2006

Hello, Vladimir Kladov Vla> well, is it necessary or not? Otherwise I’ll forget about this thread and goodbye. If you asked, then you should! Well, I couldn’t show up on the forum earlier :(

From Vladimir Kladov To All 13 March 2006

Hello spensor Then I'll dig around now. Otherwise, what's the point in picking? This is the same time we need. So, this means: along the X, Y coordinates there are two separate interrupt vectors, called A and B respectively. -+-------------------------------- out 7F - setting vector B, IE and PIO-mode (i.e. to move the mouse along verticals - Y coordinate). if Value and 1 = 0 then AMX_IntVectorB := Value { vector B is set if output to port value - even (accordingly, only an even value can be set)} else if Value and 9 = 1 then AMX_IE_B := Value and $80 <> 0 {if the value is odd and bit 3 = 0, then bit 7 sets the new value of the IE checkbox} else if Value and $B = $B then { if bits 0,1,3 are all = 1, then the most significant 2 bits ask PIO-mode 0..3} AMX_PIOmode_B := Value shr 6; -+------------------- out 5f - approximately the same way sets vector A, IE and PIO mode for it (coordinate X): if Value and 1 = 0 then AMX_IntVectorA := Value { if even, then sets a new vector A} else if Value and 9 = 1 then AMX_IE_A := Value and $80 <> 0 { if odd and bit 3 = 0, then high bit sets IE } else if Value and $B = $B then AMX_PIOmode_A := Value shr 6; { if bits 0,1,3 are all 1, then the most significant 2 bits set PIO} -+-------------------------I don’t know why, but PIO must always be set to 01, and IE to 1. Otherwise, input from ports 1F and 3F won't tell you anything about AMX. (I will have other ports on these numbers read, Kemston Joy by 1F, at least). Within one frame, interruptions for each vector occur no more than 32 times. To change any coordinate by 1 pixel, 1 interrupt occurs in IM2 mode - hardware (i.e., regardless of the current IM mode in the CPU), while on the bus exhibited the corresponding vector A is for X, B is for Y. If the interrupt is enabled, the CPU eats and transfers control to where we need it. Yes, as the low byte of the address on the tire seems copy of the high byte, i.e. the vector value itself. Accordingly, if you set A=FE, then The subroutine address will be selected from the FEFE address. (I'm not sure it's 100% true). When moving to the right and down, the DATA bit = 0, in the other direction, respectively, 1. Meaning DATA is read from ports 1F - for X, and 3F - for Y. Key press: IN DF - gives 0 in the least significant bit of the read byte - left mouse, in bit 1 - right, in bit 2 - middle. Those. if the button is not pressed, in the corresponding bit 1. More it was supposed to read the port N times, combining a series of results by OR - into avoidance rattling (i.e. such a poor implementation that it could kind of rattle, if on it was not pressed). Well, in the emulator, once is enough, of course.I reset all counters (and, it seems, the current coordinate) by: - DI team, - by CPU reset, and using commands in the emulator to disable/enable mouse tracking (for example, by single Alt). Including when the emulator pauses. When reset, both vectors are set to PIO=0, IE=0. It might be wrong but for It was normal for those who tested the software. Apparently, it is assumed that the software re-initializes the mouse on every normal interrupt, at the beginning of every frame 1/50 sec. Apparently I was working with the "right" one software. That seems to be it.

From Vlad Semchenko To All 14 March 2006

Hello, Vladimir Kladov Thank you for your research! The truth is still little clear:( In particular, What does PIO mode have to do with it, and even more so with modifications? Maybe someone can translate what is described into “iron language”?

From Vlad Semchenko To All 14 March 2006

Hello caro car> The AMX mouse is described more clearly here: car> http://www.breezer.demon.co.uk/spec/tech/hware.html#amx car> AMX interface uses the Z80-PIO chip (programmable In/Out car> Interface). This is “closer to the body”, thank you!

From Kamil Karimov To All 14 March 2006

Hello spensor spe> The truth is still little clear:( In particular, what does the PIO mode have to do with it? spe> more with modifications? spe> Maybe someone can translate what is described into “iron language”? The AMX mouse is described more clearly here: http://www.breezer.demon.co.uk/spec/tech/hware.html#amx The AMX interface uses the Z80-PIO (programmable In/Out Interface) chip. These are two programmable 8-bit I/O ports. In IM2 mode, this chip can (like all interface chips from Z80 kit) When interrupted, set the address in the interrupt vector to the data bus. Well, read the rest in the above document and in datasheet on Z80-PIO

From Vladimir Kladov To All 14 March 2006

Hello spensor Now, if you believe this document, then One additional port, IN port #DF, reads out the mouse button status. It returns #FF or #00. Apparently I came across her for the first time, “thank you” to her. And in the picture in the list Hardware, after all, a three-button mouse is drawn, and not 1. In all other respects no difference other than small details. Actually, I don’t see what’s there at all more intelligible, oh well.