Inferno #05
30 апреля 2004
  Железо  

DIY - Fits the mouse from the Amiga to the ZX Spectrum.

<b>DIY</b> - Fits the mouse from the Amiga to the ZX Spectrum.
Amiga mouse for ZX Spectrum

  Myshkrysizatsii all Russian fields ...

         ART! Dedicated.


   This article was written at the request of AlCo.
However, once upon a time I wished to do
this problem seriously. As a result, business
congestion, the problem lasted for
years frivolous trial, error, successes and failures.



           Speccy - not a toy.


   Even in the 90 years I have wanted to do the documentation 
of their securities on the Speccy. Since considered (as always) 
it not only as a toy, but as a business system that features 
which I usually like. In addition to any fine records and 
tables, which I did not learn normally releases on the Speccy 
(should not just storage, search and calculator, but also 
access from other program - a program, a third-party request

information from the database, such as the library, or 
overlay), we must draw graphics - Schemes, plans and views. Of 
course, it does not deal with 6912-byte screen, but short - the 
sister of talent (not like my articles), and You can learn a 
lot from Speccy, including including effective VRISOVYVAT that 
no boars will not fit in his ТРИПОЛЕЧЕРЕЗВОСЬМИСТРОЧНОБУТНУТЫЙ 
screen. Now for I have a sporting interest, only time, as 
always, is not enough. 

   Then, in the 90's, I studied drawing
because of the time, completely absent, and
psychological barrier to learning-
assembler Z80.



           Problems drawing.


   Fantasy enough, and it all depends on my mood, sometimes 
very hunting for something portray. But I could not imagine

how to draw a sector-bounded colors
with push-button control or the joystick.
That is why my first official picture was painted in the 
X-colore, fortunately assembly coder. Another would be: point 
mode - color, 8-color palette, Speccy, NO

attributes, as I did this, he is not the
understand, recalling how he sat with a ruler and
calculator and took it for - cost encoder and its
detali.Vot since I officially shemy.Fakticheski technical 
drawing black and white pictures, so the attributes do not 
bother me, and actually kind of control, too - the scheme are 
drawn more or less standard way - straight lines. 

   Actually, I liked to climb in the ART
STUDIO, drawing primitives, drag windows,
pour ... But it was a game, and I seriously
nothing painted. At that time I had
black and white, although it was stained and SECAM, while in an 
attempt to improve the quality of this I SECAM is not a 
reversal. But then presence / absence of color I did not 
strongly confused, otherwise I would have fallen down from the 
Speccy. Draw artistic images hindered mainly attributes. But 
sometimes, just like something to represent and, of course, on 
the way this was an interface # FE. Instead of

to the usual movement of the hand to hold
curve on the screen, much time is spent on
interpolation - perekoordinatsiyu.


             Problems of choice.


   Often, visiting from Dave, I watched with envy how easily he 
spends a line or stroke a path myshoy on Amiga. I heard about 
different mouse scheme Speccy, but I stopped the principle 
nadezhnosti.Mne need above all a reliable PC that is always 
ready and you can not turn off several consecutive dney.Imenno 
therefore, having received from Steve inherited by his 
Pentagon, I obkonderil and propayal it concretely, and ensured 
its PC-shnym power supply, network filter and bespereboynikom. 
I hate these thin tracks, and do not want your welling

Speccy to buggy state but to sustain progress, see for yourself 
one way: independent design and carving Motherboard universal, 
modular Speccy. Of course, it is very difficult, but reliable. 

   I know about AY-mouse, it certainly is not eating
data bus, but I pay AY (a Kempston joystick) is in socket Z80, 
and access to it is complicated by the drive, and hang

Mouse over a scheme would be too inconvenient and unreliable.



               Compromise.


   The desire to somehow humanize drawing led to what I was 
trying to realize the light is really pero.Voobsche 2 
transistors (of items 10 somewhere), with adjustable 
sensitivity. Signal - 2 bits - filed a Kempston Joystick

(1 bit of a button located at the intersection).
Of course, a program he wrote himself, in assembler.
This is a very interesting problem, we recommend
nastroeniyu.Priemlemuyu program I wrote, but it's real. Perot 
does not tolerate dynamics, we must carefully, gently draw.

It's funny and somehow unusual, and although the pen - a very 
natural method - by hand - uncomfortable to stand in front of 
the screen, and from afar almost impossible to paint: too 
difficult. For some it's a compromise, but I think that

Pen is well suited for light gaming, although
I have them on the Speccy had not seen. Who came
interest in this subject - would recommend trying to do, maybe, 
that good will, but do universally by port and bits.



                  Amiga.


   When (when it was ...) I have visited the AMIGA 600, I could 
not fully appreciate the murine rulez because mouse as such 
simply did not exist. To use the joystick to Consoles SEGA. But 
even then I said to itself an interesting feature: a high-tech 
complex uses the simplest method management - all 4 bits are 
transmitted with optics in the game port, instead of bits of 
the cross. Simple, cheap and reliable (good wires

are very long).

   This principle is explained, and he initially
followed by the creators of the Amiga. Even then I was thinking 
over the same exact release the mouse on the Speccy, through 
its standard game Port # 1F, t.e.kempston-dzhoystik.Plyusy were

clear: a single standard Amiga mouse, port
Speccy and a bit of control, any excess
schematic gorodby not necessary, unless
that bring the technological power (it is a
I already had - 5V through a resistor 2 ohms at
a simple cog in a plastic housing company: you food - pulled 
the wire nut, and all). Reliability companies will remain the 
same level, in fact, need only the mouse. Of course, the 
obvious drawbacks - no software support was not all the time 
the processor will go to poll the port. But in the particular 
case - normalno.Ved quite aware that most non-art images drawn 
by hand - most of the time literally on the points. 



      Passion for logic levels.


   Since my Speccy was Kempston
Joystick, with full and with inversion (buffer K555AP3), this 
gave the overall lead - minus t.e.aktivnomu bits of port

# 1F (units), are consistent with the logical
0 on the inputs - the closure of the entrances to minus.
Once upon a time I thought was a logical unit
active state of any signal, psychologically, this is true (type 
0 - nothing, but unit - something already). Even at 48 Speccy 
confuses me, plus the total on the Kempston joystick: the 
remaining nests companies had a common drawback. Was the risk 
of closure, I soldered 100 ohm for protection and not thought 
of this uncomfortable incident, and now I would put the 
inverter. (K561LN2 - more profitable than the transistors.)


   One should not confuse logic with physics. All 5voltovaya 
logic is built on an active origin. The initial state of the 
free entry - 1, t.k.tok through him absent, and at 0

(Closure of the entrance to the minus sign) significant
input current is actively involved in the switching logic. 
Thus, output 0 is much stronger than the 1. (For the K555 
series of "0" normalized to 8 mA, and "1" - only to 0.4 mA 
load). Ideally, all input signals must be

active at 0, t.e.v initial state suspended to positive 
resistors (optimally 5 - 10 k), and active - close to minus.


   Then the minus is a common wire company
for all its signals. Less used
for shielding from interference and is ideal
common. Unfortunately, the logical switch with inversion is 
very small, and you can not always get K555AP3 - full analogue 
AP5, but reversed outputs. If you're going to put myself 
Kempston Joystick, better K555AP3 order. Who AP5, the best 
substitute for AP3. However, if we use Port # 1F for the mouse, 
it is enough to provide Playing XOR mask entered, t.k.mysh

a signal, but does not close on a common wire port.

   The overall minus adopted in almost all digital systems, 
consoles, companies, and in most analog devices, although those 
where the bipolar power supply, common wire net will not name. 



           Serial krysopark.


   As a result, given a single standard logic levels Gameport 
from his company and the Amiga, I decided to find yourself a 
mouse Amiga standard and write simple

editor, which would draw from
hand, in the modes of OR, XOR, AND.

   Amiga Mouse on sale and was not to be
could not, because AMIGA even for most
Sellers was the only foreign word
language. Dave said it was for sale type mice parallel some 
firms, but I they never found. The rest is a variety of

rodents were serial - that is, sequential type. Well, no, there 
should be such creatures naplodit! There just can not see the 
mutants. And (probably) with four wires (2 for

power and 2 signal). There does tailless monster, even their 
prices - to bite. The mouse I have not bought - I do not like 
to break good. Later, Dave was an unnecessary

Krysko, without a single LED, without a tail
that is what, poludohluyu, I'm sheltered.

   Later in the article describes the simplest and cheapest of 
PCs, shnaya Krys - 3-button (With two, probably no longer 
available). 


               Krysburger.


   Since the official data from rat
I do not have all further information is based only on personal 
experience, very few. 

   In the rat there are 3 buttons, optical (sphere and
optical engine, light and photodiodes),
mikruha that receives signals from the optics and the buttons, 
quartz, frequency setting mikruhi, a few resistors (current 
limitation LEDs, the binding logic levels)

Conder from interference, a pair of diodes (restriction, or 
stabilization, power supply and limit the logic level). 

   Usually 4 wires: two for power and two
informatsionnyh.Mikruha sequentially transmits all signals in 
the rat komp.Vozmozhno, one signal wire bidirectional, may 
mikruha passes ready coordinates rats. 

   Later in my possession came
other rats, almost the same. She was almost well, all the 
details in place, I was a little corrected its mechanism, and 
while it is an entire PC-shnaya lies idle. I do not want to 
break it. 

   Until then saw the other rats, too simple, and can draw the 
following conclusion (for Simple rats): rats are different ... 
black, white, red ... but everyone wants the same ... Oops! ... 
What was I ...? 

   Usually within a rat total - plus it
goes to the cathodes of photodiodes and buttons
(A variant not seen). Optics is of two
species: the large and small step. Accordingly, the light, the 
photodiodes of the two species under different step size. 
However, various LEDs, photodiodes, and various similar. They 
are very low-soldered, sometimes slightly tilted.

LEDs - rectangles with a small
sferoy.Byvayut pink (seen in rats with small increments) and 
white (seen in the rat with a big step). Photodiodes - black 
rectangles (a rat with a big step a little larger) with three 
nozhkami.Fakticheski - a pair. Inside the two photodiodes 
connected in katodami.Sredny conclusion - the common cathode 
(cathode) and two extreme output - two of the anode.


   In rats with a major step drives look
as the gears - a circle cloves. Y
rats with fine pitch wheels without teeth in
them are small slits along the circumference.

   In rats melkoshagovyh turnover disc is the 12-odd mm path, 
and the disc 44 prorezi.U krupnoshagovyh turnover disc for 10

mm path, and 36 teeth on the drive. Consequently, the rate of 
both types of rats, standard, approximately 36 pulses 1 
photodiode 1 cm puti.Poetomu recommend a mouse with a big step. 
It is more stable t.k.razmer backlash and inaccuracies in the 
assembly is less than commensurate with step, and it is easier 
to build. But to assert it can not, t.k.sebe remade 
melkoshagovuyu mouse. 



   Few of the mouse device. Classics.



   BALL - has the property to roll in any direction and respect 
the minimum its surface area of ​​two perpendicular axes. 
Spring-loaded ball and pressed to AXIS special emphasis, 
located in opposite side of the axes. Little

contact area allows you move the mouse in any direction with 
minimal friction on the ball axle, transfer BID rotation is 
proportional to the speed of rotation of the ball. Thus, one 
axis is rotated with the horizontal velocity, the other with 
vertical vertical. 

   Axis - is enshrined in the special uporah.Na one end 
attached BID DRIVE. AXLE passes  rotation of the disk.


   CD - rotates on an axis. On the circle
DISC evenly spaced slots or
cloves. When moving the mouse of
voids, and scrolling in front of any
edge of the disc is proportional to the rate transitions 
displaced. Two axes - two discs. 

   OPTICS - scans slotted disk. Sos toit of two pairs - a pair 
of the disk. 

   PARA - consists of a simple infrared LED, which illuminates 
the edge of the disk with one hand, and FOTOPARY taking the 
signal from the  the other side of the disc.


   FOTOPARA - are two of the photodiode in a single
korpuse.Oni located a short distance from each other, so that 
when one lit through the open slot, the other somewhere 
half-closed. When turning the two photosensor signal are offset 
in time, and it is not possible to analyze

only the speed but also direction of movement, depending on 
whether someone is ahead. 

   But for this signal is shifted and
overlap, not simply an inversion commute.

   IR - infrared radiation used in remote controls, sensors in 
mice, VCRs, consoles, center, cassette player (for high-quality 
transmission sound from the head, in a very expensive models)

optic communication lines. See the impossible, and do not try, 
ID. 

   ID - IDIOT, said the same: do not try, well
 as he saw?

   IDIOT - The ideal friend and an excellent Tova risch.

   DM - I do not remember and do not know is some
garbage, with pimpochkami, four-and there it says, and when you 
press that something somewhere is going on. 


   Limitation of voltage - diode on
5.6 V.

   LED current limited resistor 3 ohms, and voltage 5 V and 1.1 
fall In each LED was about 1

mA, which is almost twice smaller than my mouse.


           Reinvent the rat.


   Available to you a simple way to remove the serial rat. Must
(Naturally) with a working optics and mehanikoy.Poprostu check 
with friends on a PC. Just a porous, in the simple mode of any 
graphics editor. If you are satisfied with the dynamics of 
rodent behavior - can embarking on its transformation scheme. 
Open rats (one screw, probably). Inspect scheme. Make sure that 
the photosensors to the general cathode - the average output is 
suitable to positive pitaniya.Esli can not find a plus - check 
testerom.Tok on a positive dipstick - extreme (any) feet 
photosensor, a negative schupu - in the middle legs of the 
photocell - should greatly exceed reverse inclusion. If not - 
look for  another rat. All coincided - proceed.


  1. Vypayayte - gnaw (as convenient)
mikruhu, quartz, and zener rezyuki if
do not understand if there is stabilization.
Keep only one resistor - successively included with LEDs.

  2. Solder mikruhu K561TL1. Placing
its a convenient way (plus or aligning
minus the food, because the old mikruhi feet
 more than this).

  3. Cut off the track, going from buttons to
mikruhe, and going to the outputs of photodetectors
new mikruhi. According to "The scheme, using
wire dosoedinite photodiodes to the inputs
(Number of inputs do not matter: it is important
to each gate signal coming from one photodiode). The result 
should be 4 pairs: photodiode - gate. 4 free entrance (one from 
each element) is connected to a plus -  14 foot.


  4. If the buttons with a common advantage - Cut off from 
their common path, and connect with  net.


  5. If not broke, collect power scheme,
instructions on the scheme, if broke and razberaetes
in stabilizing the - put at least a diode, if ever broke, put 
Conder  10 uF in parallel feeding.


  6. Take the insulating tube diameter of 4-6 mm and 9 wires to 
the desired length. Thin wire, stranded, isolated,

Of course, with a diameter smaller than 1 mm. Length to 3
meters (personally, I'll put these in order of
telly with computers and the sofa ...). Take
more thick and hard wire, for example,
Solid in the varnish insulation from transformatora.Prodente 
this wire in the insulating tube, clear and obludite its end. 
Strip 5-10 mm obludite ends the remaining 9 wires, assemble 
them into one beam and soldered together - gently and firmly. 
Solder this beam to the rigid wire. Now gently pull the free 
the end of a hard wire, it will pass through insulating tube 
and drag for a the remaining 9 wires. You will get burned

- Tail of the mouse. If you used a wire mark MGTF (thin, white, 
like pink (copper-rayed) and 4-mm translucent (slightly 
yellowish) insulation tubule, the reliability and flexibility 
can be no doubt (I have over the years klava work with the 
wiring had not stopped that only a cat nibbling once). 

   You can use the cord from the joystick to
Consoles SEGA - just 9 wires, but he
unreliable, can be stopped, and the harsh
not long.

   Of course, the manufacturer of tow - this class cunt, but 
suddenly you are doing it for the first time? .. 

  7. If there is an opportunity - take out the knockdown 9-pin 
connector for a mouse, because in the old tail connector - pass 
only 4 wires, and there are only 4 kontakta.Inache use any 
suitable soedinitelshteker. Solder the connector to the tail 
and the tail  the mouse, observing the signals and power.


  8. Connect the mouse to the Speccy - kempstondzhoystiku, but 
regardless of the implementation Kempston Port Power the mouse:

output to negative G - GND Speccy,
and the output "+", respectively, to +5 V. (By the 
technological +5 V, through the 2 ohm resistor from this +5 V 
supply). 

   Write a program - actually a cycle,
which takes on the mask bits from Kempston-port and its colors 
of border, to example, in black / white mask tsvet.Opredelite 
0-th bit and look at the wiring diagram to which it corresponds 
to the logical element, find the entrance - photo sensor. Run 
the program - a cycle. Border will one color, even if you rotate

drive this fotodioda.Teper jumper photodiode (entrance LE) to 
minus. Border must change the color for the closure, or 
somewhere near You break - the closure of the signals. If the 
border changes, pick up a resistor, closing the entrance to 
zemlyu.Nominal will be within 2 - 510 ohms. Literally iterate 
denominations in these predelah.Podpayav regular resistor, roll 
the disk (the axis, which refers to the ball, after removing 
the ball). Search by denomination, in which border flashes 
proportional to the speed of rotation of the disk, even at very 
fast rotation (as you can, while blinking border

should turn into a strip on the curb, not
less than 4 lanes (with a shallow step - slotted
drive, at least 8 pages). If the rapid
rotation of the curb stops flashing, coloring in one color, so 
close to the nominal optimal and requires selection within

50%. When will pick the right resistor, solder the 3 such as 
the rest of the photodiode. Selection of the others, probably 
not necessary, however, change the mask bit and scan the rest 
of photodiodes, for sure they work just as well. 



          (To be continued.)

Ed: Today Amiga Mouse is supported only in one program - in
Journal Subliminal Extasy # 3.


   Schemes are looking for in the annex (AmiMousS.C,
K_J__myP.C, MOUSplat.C).




Other articles:

CacheVox - The code for import and subsequent playback of digital music from floppy disks.

For Coderz - RAYCASTING - make yourself a little DOOM'a. Tracing algorithm 3D maze in the game WOLF.

Inferno - O magazine.

DIY - Fits the mouse from the Amiga to the ZX Spectrum.

Softinka - an overview screen wrappers for ZX Spectrum.

Inferno - The authors and editorial contacts.

Gameland - description of the game Stronghold (Bastion).

Softinka - Package CacheVox v1.0 to import and play digital music from floppy disks.

Interview - an interview with Disabler'om - coder, artist and zhelezyachnikom from Rostov-on-Don.

Others - Bugs writing to floppy disks. Causes and methods of struggle.

Gameland - Short description of the problems the game Dune: Imperia 2.

Inferno - Errors in the previous numbers.

For Coderz - Small programmers' tricks.

Spectrum - compressed data format on the ZX Spectrum.

Gameland - the game Hexagonal Filler.

Softinka - Hrum 3.5i - the fastest LZ-extractor with the bit stream.

DIY - Production of the tail for the mouse.

Iron - We investigate the chip K561IE10A.

Iron - We investigate the chip KR1533IE7.

Iron - We investigate the chip K561TL1. .

Softinka - display compressor Laser Compact 4.0.

Inferno - Letters to the Editor.

Softinka - Compressor texts MS Pack 01.96.

Inferno - On the shell.

Softinka - the benefits archiver Rar.

Softinka - Packer RGB images Powerful Code Decreaser v6.2.

Likbez - What are the plus and minus voltage.

Likbez - How does the protection of the circuit elements.

For Coderz - Nuances Raycasting-a.

Softinka - Real Information Packer 0.2x - one of the most powerful compressor on the ZX.

For Coderz - autobuild program. Optimize the assembly process.

Inferno - Intro.

Others - The results of the survey.

Others - The Compo. On the survey.

About Spectrum - thinking about the future of the Spectrum.

Iron - Once again, the protection circuits KR1818VG93.


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Hobby - Bonsai.
Razbiralka - Game Description THE DOUBLE.
Fantasy - "A virtual Sindpom (tpagikomichesky faps).

В этот день...   23 November