"CHEAPO" MOUSE For some time I had been interested in connecting a mouse to my Sam COUPE but never got around to deciding whether to buy the SAMCO or Blue Alpha mouse. Eventually I designed my own interface around a cheap C64 mo use, it's quite simple using only 3 TTL chips and when I plug it into the Joystick port it emulates a joystick rather as I expect the Blue Alpha mouse does. I then made up a short adapter cable and with this I can connect my mouse to the mouse port of the SAM. The only problem, on the mouse-port I wanted it to emulate the SAMCO mouse which meant a new mouse-driver routine was necessary. I've also included one or two routines with this letter which may be of interest to people who don't want to build my 'Cheapo-mouse' interface and simply want to experiment with the BASIC commands XMOUSE/YMOUSE and BUTTON. The program 'MDRIVER' (the same name that I believe SAMCO used for it's mouse-driver), is a small routine which when loaded relocates itself to the 'System Heap' and sets the mouse vector to it's start address. Once this has been done SAM works normally but my 'Cheapo-mouse' then has control of the XMOUSE,YMOUSE and BUTTON values so that they are correctly returned by the BASIC commands, just like the SA MCO mouse. The XMOUSE value is allowed to vary between 0 and 511 in MODE 3 or 0-255 in other modes, the YMOUSE value is limited 0 to 191. This routine has one enhancement over the standard driver in that you can 'POKE 23440,x' where 'x' is between 0 and 63 and sets the 'raster' or number of pixel steps and thereby the speed of movement for the mouse. Normally this value is '1' but storing '2' would for example double the speed by moving the mouse in 2 pixel steps, storing '0' would disable mouse movement. The system variables area has effectively 2 new variables : Location. 23438 RAW MOUSE DATA 23440 MOUSE RASTER As the SAMCO mouse has 3 buttons and my C64 mouse only one, I use a small trick to emulate button s 2 and 3. When you press the mouse button then you can test it with the command BUTTON 1. If you hold the 'Symbol-shift' key an d press the mouse button it produces BUTTON 2 and with the 'Shift' key and the mouse button pressed, BUTTON 3. This may not seem very interesting as none of Sam Supplements readers other than 'Frank Harrop' have my cheapo-mouse but the routine will also work with the 'cursor-keys' for movement and the CNTRL key to simulate the mouse button, so anyone can try it out. The second program 'JDRIVER' can be used instead of 'MDRIVER' and will allow the control of the 3 BASIC functions XMOUSE,YMOUSE and BUTTON with a standard Joystick on the Joystick port or it should work with the 'Blue-Alpha mouse'. The routines can be tested with your SAMOS program from Sam Supplement Nr.26 by simply replacing the 'MDRIVER' program on the disk with either my 'MDRIVER' or 'JDRIVER' routines. The 'DRIVER' (Windows for SAM) program has it's own integrated mouse driver, so I have developed the program 'MAUSPATCH1'. Copy it to the 'DRIVER' disk and then load it. It will modify DRIVER v1.0 to work with my 'Cheapo-mouse'. At the moment this is the version of 'DRIVER' that I have, for later versions a modification of the PATCH address may be necessary but if anyone is interested they should send me a copy of their version and I will patch it for them. Of course there is a question, is my Cheapo-mouse identical to the SAMCO mouse and the answer is no, in 99% of cases there is no effective difference. However the origional design decision to overlay the cursor keys with the mouse-port was to say the least not a good one and SAMCO had to make a fairly complex interface to compensate for that and my interface which only uses 3 simple TTL chips can't emulate everything. This means that in certain circumstances such as when working with 'Notepad' under DRiVER, the 'cursor-marker' and the mouse pointer both move together. However this is more a minor annoyance than a really serious problem. It would be possible with the addition of a 4th chip to overcome this problem and maybe I will do it, when I can find the time. This would then emulate the SAMCO system of reading the mouse twice to differentiate between the cursor keys and the mouse (the mouse only responding to the second read). I've included the circuit diagram of my 'Cheapo-mouse' interface as a 'SCREEN$'. I've also included details of the adapter cable (as a 'SCREEN$') to connect it to the mouse port rather than the Joystick port if required. I used a C64 Datalux SV-705 mouse but I suspect any C64 mouse could be used. I like to have both my mouse and the joystick connected when I'm using my SAM, so I built my interface in an old DRAGON joystick interface case, this has two connectors so that when I use it on the 'Joystick Port' I can plug both the mouse and the joystick into it at the same time. However the same effect could be achieved by using a joystick splitting cable between the interface and the 'Joystick Port'. When I plug the interface into the 'Mouse Port' then it's even easier, as the joystick can simply be pluggged into the 'Joystick port' as usual. Best wishes, Ian D Spencer