MISC for Scorpion
ZXNet echo conference «real.speccy»
From Alexandr Kalinkin → To All 15 October 2000
People, please provide a diagram for connecting the Momed, DMA and mouse to the scorpion.
┌┐╔══ Goblin ZX ╗
└┘╚══ [FST][D0S f0rever][PAS&MODULA2] ══ў└┘╚C00Lў
From Kirill Frolov → To All 20 October 2000
urnal. These were advertising articles from St. Petersburg manufacturers and sellers of mouse interfaces. I will not argue with any of
them, I just want to suggest that those who know how to
hold a soldering iron in their hands can assemble this
device on their own.
First, you need to answer the question: why exactly Kempston Mouse Interface?
After all, some craftsmen manage to solder the mouse to Kempston joystick socket,
others use AY-mouse. Why is Kempston
Mouse Interface better?
First of all, it should be noted that any attempts to connect a mouse to the joystick socket are a mockery of the mouse. The mouse has one remarkable quality - in addition to the direction of movement, it also reacts to the speed of this very movement, therefore the cursor on the screen does not move in proportion to the movement of your hand, i.e. when you move the mouse
slowly, the cursor moves slowly,
when you move the mouse quickly, the cursor
moves quickly. Due to this, working with a mouse is incomparably more convenient than a joystick.
A joystick is not able to react to the speed of movement, it only takes into account the direction. Therefore, if you connect a mouse to the joystick socket, regardless of the speed at which you move the mouse,the cursor will move at
a constant speed. And you may not have enough table space to move the cursor from one edge of the screen to the other.
Apparently, the AY-mouse option does not have this drawback. But not enough programs have been adapted for AY-mouse.
So why are we so vigorously advocating
you for the Kempston Mouse Interface? The answer is banal: it's a matter of standardization. This
device was invented quite a long time ago,
it is the same standard as
Kempston Joystick or Sinclair Joystick and
it is supported by proprietary programs, such as
Art Studio or Artist
II. So why reinvent the wheel and create a lot of your own standards, if it is simpler and more logical to use what has already been invented, especially since there is already software support for this option.
Kempston
Mouse Interface received its greatest distribution in St. Petersburg, this and
it’s understandable, because it was in St. Petersburg that its Russian analogue was made. Along with the already named Art Studio and Artist II, proprietary support for Kempston Mouse was found in Victory Road, Battle Command, Carrier Command. Very quickly they were quickly adapted to Kempston Mouse Interface programs F Commander v4.01, Instrument v2.01,
DCU 2.32, etc...
New programs began to be written taking into account
the fact of appearance onKempston Mouse
Interface light and mouse support can also
be found in FUT v2.01, ZXWORD v2.5m,
ZxZip/ZxUnzip v1.02, Instrument v3.01,
FPM v3.5, and others.
Adapted for 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, Armageddon Man, etc...
New electronic The ZX-Format magazine that you are reading has supported Kempston Mouse Interface from the very first issue.
Feeling the wishes of his friends, Slava
Mednonogov added mouse support to his
new game UFO II, and after trying to play it with a mouse himself dragged along immeasurably.
What I’m talking about seems clear. The number of mouse programs is steadily increasing, almost all new St. Petersburg's own programs have mouse support. Branded programs in which mouse control would be logical are also adapted to the Kempston Mouse Interface.
What other arguments are needed for this particular device? It seems like there are enough arguments.
Just try to sit in the mouse Art Studio once, after that you are unlikely to be dragged back. You will be furious looking at how long it takes to crawlan arrow controlled by a joystick or buttons.
Whereas with a mouse everything just flutters. And you will be amazed to realize how much
time you spent simply moving
through menus.
So, almost all St. Petersburg programmers support the Kempston Mouse Interface standard. Therefore, we urge all
users to solder this device for themselves, and all
programmers to support it,
so that users do not have to heat up the soldering iron too often when something like the Sinclair Joystick Mouse or say
ZX Lprint III Mouse appears... :-)
That's the introductory note part ends, let's move directly to the circuit.
The author of the circuit is Michael Kondraty-
ev, the circuit was developed after studying
the drivers of the Art Studio and Artist programs.
The original version contained 11 cases, this was due to the fact that the author used the most available microcircuits
from those that were at hand. Subsequently, the number of microcircuits was reduced to 8. For some time, the scheme was a commercial product, and the rights were transferred to Sergei Zonov. Last year
Sergei Zonov allowed its distribution,
after which the Kempston Mouse Interface
circuit was published in the Fi-
doNet electronic network.
It is most often
used as the manipulator itselfordinary gray passive
mouse from Search. At a minimal price, it
works quite well. Although those who wish
can use branded passive
mice. In the complete absence of passive mice in the visibility zone, you can use active ones, however, you will have to dig a little deeper into them (see notes to the diagram).
So, stock up on a pencil or a printer and look carefully:
=========================================================
Kempston Mouse diagram Interface:
DD1 DD5
5┌──┬──┬─┐ 6 2┌──┬──┬─┐18 D0║
┌────oCa│CT│0├────────┤D1│|>│1├─────Є
Xb ─┴─ 15├──┤ │ │11 4│ │ │ │16 D1║
──┬──────/C │ │1├────────┤D2│ │2├─────Є
Xa│ 10│ │ │ │14 6│ │ │ │14 D2║
───┬─────┤U/D │2├────────┤D3│ │3├─────Є
││ 9├──┤ │ │ 2 8│ │ │ │12 D3║
││ ┌───┤R │ │3├────────┤D4│ │4├─────Є
││ │ 1│ │ │ │ 11│ │ │ │ 9 D4║
││ ├───┤S │ │ │ ┌─────┤D5│ │5├─────Є
││─┴─ 4│ │ │ │ │ 13│ │ │ │ 7 D5║
││ ──┤0 │ │ │ │┌────┤D6│ │6├─────Є
││ 12│ │ │ │ ││ 15│ │ │ │ 5 D6║
││ ──┤1 │ │ │ ││┌───┤D7│ │7├─────Є
││ 13│ │ │ │ │││ 17│ │ │ │ 3 D7║
││ ──┤2 │ │ │ │││┌──┤D8│ │8├─────Є
││ 3│ │ ├─┤ 7││││19├──┤ │ │ ║
││ ──┤3 │ │Co─┐││││┌─oE2│ │ │ ║
││ └──┴──┴─┘ ││││││1│ │ │ │║
││ ┌────────────┘││││├─oE1│ │ │ ║
││ │ DD2 │││││ └──┴──┴─┘ ║
││ │ 5┌──┬──┬─┐ 6│││││ /XCS ║
││ └──oCa│CT│0├──┘│││└──── ║
││ 15├──┤ │ │11 │││ ║
└──────/C │ │1├───┘││ ║
│ 10│ │ │ │14 ││ ║
└─────┤U/D │2├────┘│ ║
9├──┤ │ │ 2 │ ║
┌───┤R │ │3├─────┘ ║
│ 1│ │ │ │ ║
├───┤S │ │ │ ║
─┴─ 4│ │ │ │ ║
──┤0 │ │ │ ║
12│ │ │ │ ║
──┤1 │ │ │ ║
13│ │ │ │ ║
──┤2 │ │ │ ║
3│ │ ├─┤ 7 ║
──┤3 │ │Co── ║
└──┴──┴─┘ ║
║
DD3 DD6 ║
5┌──┬──┬─┐ 6 2┌──┬──┬─┐18 D0║
┌────oCa│CT│0├────────┤D1│|>│1├─────Є
Ya ─┴─ 15├──┤ │ │11 4│ │ │ │16 D1║
──┬──────/C │ │1├────────┤D2│ │2├─────Є
Yb│ 10│ │ │ │14 6│ │ │ │14 D2║
───┬─────┤U/D │2├────────┤D3│ │3├─────Є
││ 9├──┤ │ │ 2 8│ │ │ │12 D3║
││ ┌───┤R │ │3├────────┤D4│ │4├─────Є
││ │ 1│ │ │ │ 11│ │ │ │ 9 D4║
││ ├───┤S │ │ │ ┌─────┤D5│ │5├─────Є
││─┴─ 4│ │ │ │ │ 13│ │ │ │ 7 D5║
││ ──┤0 │ │ │ │┌────┤D6│ │6├─────Є
││ 12│ │ │ │ ││ 15│ │ │ │ 5 D6║
││ ──┤1 │ │ │ ││┌───┤D7│ │7├─────Є
││ 13│ │ │ │ │││ 17│ │ │ │ 3 D7║
││ ──┤2 │ │ │ │││┌──┤D8│ │8├─────Є
││ 3│ │ ├─┤ 7││││19├──┤ │ │ ║
││ ──┤3 │ │Co─┐││││┌─oE2│ │ │ ║
││ └──┴──┴─┘ ││││││1│ │ │ │ ║
││ ┌─────────────┘││││├─oE1│ │ │ ║
││ │ DD4 │││││ └──┴──┴─┘ ║
││ │ 5┌──┬──┬─┐ 6│││││ /YCS ║
││ └───oCa│CT│0├──┘│││└────── ║
││ 15├──┤ │ │11 │││ ║
└──────/C │ │1├───┘││ ╔══════════════ў
│ 10│ │ │ │14 ││ ║
└─────┤U/D │2├────┘│ ║
9├──┤ │ │ 2 │ ║
┌───┤R │ │3├─────┘ ║
│ 1│ │ │ │ ║
├───┤S │ │ │ ║
─┴─ 4│ │ │ │ ║
──┤0 │ │ │ ║
12│ │ │ │ ║
──┤1 │ │ │ ║
13│ │ │ │ ║
──┤2 │ │ │ ║
3│ │ ├─┤ 7 ║
──┤3 │ │Co── ║
└──┴──┴─┘ ║
╔════ў
DD7.2 ║ DD8
RIGHB 5┌─┬──┐6 D0║A10 1┌─┬──┬─┐15
─────────┤D│|>├─────Ґ─────┤1│DC│0o──
4│ │ │ ║A8 2│ │ │ │14
┌──oE│ │ ╟─────┤2│ │1o──
│ └─┴──┘ ║A7 3│ │ │ │13
│ DD7.3 ╟─────┤4│ │2o──
LEFTB │ 9┌─┬──┐8 D1║/RD 5├─┤ │ │12
─────────┤D│|>├─────Ґ─────o&│ │3o──
│10│ │ │ ║A0 6│ │ │ │11 /BCS
├──oE│ │ ╟─────┤ │ │4o───────
│ └─┴──┘ ║ 4│ │ │ │10
│ DD7.4 ║ ┌──oS│ │5o──
MIDLB │12┌─┬──┐11 D2║ │ │ │ │ │ 9 /XCS
─────────┤D│|>├─────Є │ │ │ │6o───────
│13│ │ │ ║ │ │ │ │ │ 7 /YCS
├──oE│ │ ║ │ │ │ │7o───────
│ └─┴──┘ ║ │ └─┴──┴─┘
│ ║ └────────────┐
│ /BCS ║ DD7.1 │
└──────── ║/IORQ 2┌─┬──┐3 │
╟───────┤D│|>├──┘
DD1..DD4 - К561ИЕ11 ║A5 1│ │ │
DD5, DD6 - К555АП5 ╟───────oE│ │
DD7 - К155ЛП8 ║ └─┴──┘
DD8 - К555ИД7
(c) 1994 Michael Kondratyev
=========================================
Пpимечания:
- жиpной линией обозначена шина Spectrum;
- на мышь идут следующие сигналы: Xa, Xb,
Ya, Yb, RIGHTB, MIDLB, LEFTB, +5V, GND;
- /BCS, /XCS, /YCS - внутpенние сигналы
схемы, соединяются с одноименными паp-
ными на схеме;
- схема пpиведена для мыши пасивного типа
(мышь для "Поиска" ММП-9B), для дpугих
необходимо вывести сигналы Xa, Xband
Ya, Yb, which are taken from the optocouplers after
the Schmidt transistor-trigger chain;
- in the computer it is necessary to provide blocking
port 0DFh;
- it is possible to replace the decoding circuit
(DD7.1, DD8) with a plug of type
556PT4(PT11), the remaining free output can be used to block
ports.
=============================================================================
If you have any wishes/complaints, questions/ideas, then you can contact circuit designer Michael Kondratyev:
2:5030/362.1@FidoNet
So, now let’s explain how a programmer can work with Kempston Mouse Interface. There is nothing difficult to understand, since the interface is quite simple and understandable. There are three ports, here are
their addresses: #FADF, #FBDF, #FFDF;
the width of each is 8 bits, i.e. byte.
#FADF - button port, the significant ones in it
are the lower three bits:
0 bit - the state of the right button;
1 bit - the state of the left button;
2 bit - the state of the middle button.
When the buttons are not pressed, all bits are in `1'.
When the button is pressed, the corresponding bit
is set to `0'.
According to the ancient tradition, the left button is used as a selection (Fire), the right - as
cancel. The middle button is
usually used for additional functions.
#FBDF - X-coordinate port;
#FFDF -Y-coordinate port.
As you move the mouse
the values in the ports change, and also
cyclically, i.e. upon reaching #FF and
further increasing, they become
zero again and grow further, again to #FF. When moving in the other direction, the picture is similar, only changes occur in the opposite direction. The following picture will help to imagine this matter:
y^.
│.
│.
│2
│1
│012...
┼──────────>
x
Thus Thus, it is necessary to read the values of the ports, and the difference between the current
and the previous value determines the direction of movement of the mouse.
If very precise manipulations are required, the driver is written taking this into account, and the arrow is moved by one point. when the value read from the port changes by 2, 3, 5, or more units.
Recently, a smarter
driver has become fashionable, which at the beginning waits for a button to be pressed, and the first pressed button on the mouse
becomes (for the driver) the left one. This applies only to the two outer buttons, the middle button is also the middle button in Africa. This is useful for people who are used to holding the mouse in their left hand, or in case someone often stepped on your mouse and one of its buttons works worse than the rest. Such a driver is considered good manners. And ifyou noticed, this is exactly what the ZX-Format driver does.
You can check the operation of the newly assembled
interface directly from Basic by doing
PRINT IN from ports:
64479 - X, 65503 - Y - when moving
the mouse the values should change cyclically. When reading from port 64423 - Fire
the three least significant bits should click when buttons are pressed.
And finally - an example of the Kempston
Mouse driver used in the ZX-Format:
;MOUSE DRIVER WITH FIRE BUTTON AUTOCONFIG
; (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 *****
15 Oct 00 15:13, Alexandr Kalinkin wrote to All:
AK> Пиплы, подкиньте схему подключения момеда, DMA и мыши к скоpпиону.
mouse.
H160 +- ZX-Spectrum
From Valerij Kozhevnikoff → To All 21 October 2000
20 Oct 00 06:51, Kirill Frolov -> Alexandr Kalinkin:
KF> #FADF is a button port, the significant ones in it
KF> are the lower three bits:
KF> 0 bit - the state of the right button;
KF> 1 bit - the state of the left buttons;
_Verse versa!_ Zero bit - left button!
WBR, Jason.
[Team Obituary][Team Friday 13th][Team Evil Maniacs][Team Huge Axes]
From Kirill Frolov → To All 22 October 2000
VK> _On the contrary!_ Zero bit is the left button!
You have the left one. And I have the right one.
Suggestion: in order to avoid further confusion, tear off the left and right buttons from the mice
and use only the middle one - everyone has the same one,
if they have one at all.
From Dmitriy Nesmachny → To All 23 October 2000
Figwam! Where and how. I just installed a switch that hardware
swaps the left and right buttons. Very convenient, I recommend it to everyone.
Sincerely, Dmitriy.
From Oleg Groskow → To All 24 October 2000
KF> You have the left one. And I have the right one.
KF> Suggestion: in order to avoid further confusion, tear off the
KF> left and right buttons from the
KF> mice and use only the middle one - it
;)
Damn, isn’t it easier to write programs normally? Determination by the first button pressed?
Best regards, Oleg. [ZX]
From Oleg Golenkoff → To All 28 October 2000
there is no standard :( so it’s better to make a switch on the mouse :)
Minisoft avec NRJ^ACL from home [ZX] [KAY1024]
PC Station: 2:451/19 ZX Station: 500:152/2
E-mail: ascen...@mail.ru
* Origin:
G (2:451/19.16)
--- Old grandfather ...
* Origin:
G (2:451/19.16)