Iron:
ZX-Spectrum and mouse.
To begin to answer the question: why Kempston Mouse Interface?
After all, some craftsmen manage to solder the mouse to the
nest Kempston joystick other uses AY-mouse. What is the Kempston
Mouse Interface is Better?
First of all, it should be noted that any attempt to connect
the mouse to the nest joystick is a mockery
mouse. Mouse distinguishes one remarkable
quality - in addition to the direction of movement
She also reacts to the speed of this very moving, so the screen
cursor moves in proportion to the movement of your hand, ie,
when you move the mouse slowly, the cursor moves as slowly
when you move the mouse quickly, the cursor
moves quickly. Due to this work
mouse much more convenient than the joystick.
Joystick is not able to respond to
travel speed, it takes into account only
direction. Therefore, in the case of connecting your mouse to
the nest joystick, no matter how fast you move the mouse, the
cursor will move to constant speed. And the move
cursor from one screen edge to another
you may not have enough space table.
Judging by everything, this deficiency deprived version of
AY-mouse. But under the AY-mouse adapted not enough programs.
So why are we so vigorously agitating you for the Kempston
Mouse Interface? Reply trite: the case in the standard. This
device invented long ago,
it is the same standard as
Kempston Joystick or Sinclair Joystick and
it is supported by proprietary software such as Art Studio or
Artist II. So why invent a bicycle and
produce a lot of their standards, if the simpler and more
logical to use what is already invented, the more so because
under this option already exists software support. The most
widespread Kempston Mouse Interface received in St. Petersburg,
this understandable, since it was made in St. Petersburg
his Russian counterpart. Along with the already mentioned Art
Studio and Artist II brand podderku Kempston Mouse found in
Victory Road, Battle Command, Carrier
Command.
Very quickly, were quickly adapted to
Kempston Mouse Interface Program
F - Commander v4.01, Instrument v2.01,
DCU 2.32, etc ...
New programs were written with a view
the fact of the birth of Kempston Mouse
Interface and support for the mouse can also be
found in the FUT v2.01, ZXWORD v2.5m,
ZxZip / ZxUnzip v1.02, Instrument v3.01,
FPM v3.5, and others.
Have adapted Kempston Mouse Interface
and games, for example:
Hero Quest, Dragon Spirit, Space Crusade,
A New Whole Ball Game, The A Team 1 ', 2
Operation Wolf, Operation Thunderbolt,
World Cup Challenge, Gunsmoke, R-Type,
Gemini Wing, 1943 The Battle Begin,
Zombi, Armagedon Man, etc ...
A new electronic journal ZX-Format, which you can read, from
the very first issue supports the Kempston Mouse Interface.
Feel about the wishes of friends, Glory
Mednonogov put support for mouse in its
new game UFO II, and tried to play
it with the mouse itself nemeryannom dragged.
What I am talking like understandable. Number of mouse programs
has steadily increased, almost all new Piterskie author's
programs are supported mouse. Branded programs that control the
mouse it would be logical also adapted to the Kempston Mouse
Interface. What other arguments are needed specifically for this
device? It seems to be enough arguments.
Just try it once to sit in a murine Art Studio, then you are
hardly to pull back. You'll be mad,
looking at how dooolgo creeps arrow controlled by a joystick or
buttons. At that time, as with the mouse all just flutters. And
you will be amazed when he realized how much time you spend on
simple movement on menues.
Thus, virtually all Piterskie programmers support the standard
Kempston Mouse Interface. We therefore urge all users to solder
yourself this device and all programmers - just to maintain it,
that the user does not have too often
soldering iron to heat the appearance of something
type Sinclair Joystick Mouse or say
ZX Lprint III Mouse ... :-)
At this introductory part is over, go directly to the scheme.
The author of the scheme is Michael Kondratyev, a scheme was
developed after studying Driver Programs Art Studio and Artist.
The original version contained 11 buildings, this was due to
the fact that the author used the most affordable chip
of those that were at hand. Later
chip count was reduced to
8'mi. For some time the scheme is a commercial product, the
right not it have been transferred to Sergei Zonov. In the past
year Sergei Zonov allow its distribution,
after which the scheme Kempston Mouse Interface
was published in an electronic network FidoNet.
As an arm of the most
used an ordinary gray passive
mouse from the search. At the lowest price it
works quite well. While wishing to
may use proprietary passive
mouse. With a complete lack of visibility in the area of
passive mice can be used and active, however, will have to
dig deeper into them a bit (see the notes to the diagram).
So, store a pencil or a printer and to look:
=========================================
Scheme Kempston Mouse Interface:
DD1 DD5
5 June 2, 1918 D0
oCa CT 0 D1 |> 1
Xb 15 Apr. 11, 1916 D1
/ C 1 D2 2
Xa 10 June 14, 1914 D2
U / D 2 D3 3
9 2 August 1912 D3
R 3 D4 4
1 11 9 D4
S D5 5
4 July 13 D5
D6 0 6
12 May 15 D6
A D7 7
1913 March 17 D7
2 D8 8
3 July 1919
3 Co oE2
1
oE1
DD2
May 6 / XCS
oCa CT 0
November 15
/ C 1
October 1914
U / D 2
February 9
R 3
1
S
4
0
12
1
13
2
July 3
3 Co
DD3 DD6
5 June 2, 1918 D0
oCa CT 0 D1 |> 1
Ya 15 Apr. 11, 1916 D1
/ C 1 D2 2
Yb 10 June 14, 1914 D2
U / D 2 D3 3
9 2 August 1912 D3
R 3 D4 4
1 11 9 D4
S D5 5
4 July 13 D5
D6 0 6
12 May 15 D6
A D7 7
1913 March 17 D7
2 D8 8
3 July 1919
3 Co oE2
1
oE1
DD4
May 6 / YCS
oCa CT 0
November 15
/ C 1
October 1914
U / D 2
February 9
R 3
1
S
4
0
12
1
13
2
July 3
3 Co
DD7.2 DD8
RIGHB May 6 D0 A10 January 1915
D |> 1 DC 0o
A8 4 February 1914
oE 2 1o
A7 March 1913
DD7.3 4 2o
LEFTB September 8 D1 / RD May 1912
D |> o '3o
10 June 1911 A0 / BCS
oE 4o
April 1910
DD7.4 oS 5o
MIDLB December 11 D2 9 / XCS
D |> 6o
July 13 / YCS
oE 7o
/ BCS DD7.1
/ IORQ March 2
D |>
DD1 .. DD4 - K561IE11 A5 1
DD5, DD6 - K555AP5 oE
DD7 - K155LP8
DD8 - K555ID7
(C) 1994 Michael Kondratyev
=========================================
Notes:
- Thick line denotes the bus Spectrum;
- On the mouse are the following signals: Xa, Xb,
Ya, Yb, RIGHTB, MIDLB, LEFTB, +5 V, GND;
- / BCS, / XCS, / YCS - internal signals
scheme, combined with the same pairs
GOVERNMENTAL in the scheme;
- The scheme is presented for the passive-type mice
(Mouse to the "Search" MMP-9B), for other
necessary to derive signals Xa, Xb and
Ya, Yb, which are taken from the optocouplers after
chain transistor Schmitt trigger;
- The computer is required to ensure the block
Kirovka port 0DFh;
- Possible replacement scheme decoding
(DD7.1, DD8) on plmku type
556RT4 (RT11), is still free you
approach can be used to block
ports.
=========================================
If you have any suggestions / complaints, questions / ideas,
then you can contact the author Michael Kondratyev'ym scheme:
2:5030 / 362.1 @ FidoNet
So now explain how to work with the Kempston Mouse Interface
programmer. Nothing difficult to understand not expected,
because the interface rather simple and straightforward. There
are three ports, so their addresses: # FADF, # FBDF, # FFDF;
bit of each - 8 bits, ie, bytes.
# FADF - Port buttons meaningful it
are the lowest three bits:
0 bits - a state the right button;
1 bit - the state of the left button;
2 bits - the state of the middle button.
As for the buttons of rest, all the bits in `1 '.
When you click on the corresponding bit
set to `0 '.
According to ancient tradition, the left button is used as a
selection (Fire), right - as Cancel (Cancel). Middle button made
used for additional functions.
# FBDF - port X-coordinate;
# FFDF - Port Y-coordinate.
As you move the mouse-arm
values in the port has changed, and yet
and cyclically, ie when reaching # FF and
further increases are again
zero and grow further, again to # FF. When
Traffic in the opposite direction a similar pattern, but
changes occur in the opposite direction. Submit the matter help
is such a picture: y ^.
.
.
2
1
012 ...
>
x
Therefore, you must read the values of ports, and the
difference between the current and the previous value is
determined by the direction of Mixing Capacity mouse. If you
need a very precise manipulation of the driver is written with
this in mind, and move the arrow at one point made when the
value read from the port to 2, 3, 5, or more ednits. In recent
years become fashionable smarter driver, which at the beginning
waits for button and you press the button on a mouse
becomes (for drivers) left. These things only applies to the
two extreme buttons Middle button - it is in Africa average.
This is useful for people who keep
a mouse in his left hand, or in case if someone often comes to
your mouse and keyboard one of the buttons it works worse than
others. Such a driver is considered good form. And if you
notice, just so ZX-supplied driver Format'a.
Check the work had just been harvested
interface can operate directly from with the Basic, making
PRINT IN of the ports:
64479 - X, 65503 - Y - when moving
mouse values should vary cyclically. When reading from port
64423 - Fire need to click three younger bitika at
Pressing buttons.
And finally - an example of driver Kempston
Mouse, used in the ZX-Format'e:
; MOUSE DRIVER WITH FIRE BUTTON AUTOCONFIG
And (c) Andrey Rachkin'95
JR MDRV
DIRECTZ DEFB 0; FIRE
DEFB 0; UP
DEFB 0; DOWN
DEFB 0; RIGHT
DEFB 0; LEFT
DEFB 0; CANCEL
MCOORD DEFW 0; LAST CURSOR COORDS
; IN PIXELZ
MPORTS DEFW 0; LAST READED MAUSY COORDS
NONDEF AND 3; HERE COMEZ BUTTONZ
; CONTROL IF FIRE BUTON
; NOT DEFINED
JR Z, MDRV4; IF NONE BUTTON
; PUSHED
CP 1
JR Z, NONDEF_
XOR A
LD (MDRV3 +2), A
LD A, 5
LD (MDRV2 +2), A
NONDEF_ LD HL, 0
LD (MDRV1), HL
POP IX
; ***** MAIN PROC OF MOUSEDRIVER *****
MDRV PUSH IX
LD HL, DIRECTZ
PUSH HL
POP IX
XOR A
LD (HL), A; CLEARING
INC HL; OF
LD (HL), A; DIRECTZ
INC HL; BUFER
LD (HL), A
INC HL
LD (HL), A
INC HL
LD (HL), A
INC HL
LD (HL), A
INC HL
LD BC, # FADF; BUTTONZ CONTROL
IN A, (C); READING FROM PORT
; OF BUTTONS
CPL
MDRV1 JR NONDEF; JR UNTIL FIRE
; BUTTON NOT DEFINED
RRA
MDRV2 RL (IX +0); FIRE
RRA
MDRV3 RL (IX +5); CANCEL
; ***** COORDS CONTROL *****
MDRV4 LD HL, (MCOORD); FORM LAST
; CURSOR COORDS
LD DE, (MPORTS); FROM LAST
; READED MOUSE
; COORDS
LD BC, # FBDF
IN A, (C); READING FROM
; PORT X-COORD (0 - # FF)
LD (MPORTS), A
SUB E
JR Z, MDRV9
JP P, MDRV6
LD (IX +4), 1; MOVE LEFT
ADD A, L
JR C, MDRV5
XOR A; MIN X-COORD
MDRV5 LD L, A
JR MDRV9
MDRV6 ADD A, L
LD (IX +3), 1; MOVE RIGHT
JR C, MDRV7
CP # FE; MAX X-COORD
JR C, MDRV8
MDRV7 LD A, # FE; MAX X-COORD
MDRV8 LD L, A
MDRV9 LD B, # FF
IN A, (C); READING FROM
; PORT Y-COORD (0 - # FF)
LD (MPORTS +1), A
SUB D
JR Z, MDRV14
NEG
JP P, MDRV11
LD (IX +1), 1; MOVE UP
ADD A, H
JR C, MDRV10
XOR A; MIN Y-COORD
MDRV10 LD H, A
JR MDRV14
MDRV11 ADD A, H
LD (IX +2), 1; MOVE DOWN
JR C, MDRV12
CP # BF; MAX Y-COORD
JR C, MDRV13
MDRV12 LD A, # BF; MAX Y-COORD
MDRV13 LD H, A
MDRV14 LD (MCOORD), HL; NEW CURSOR
; POSITION
; IN PIXELZ
POP IX
RET
; ***** DRIVER END *****