MOUSE OR CURSOR, THAT IS THE QUESTION I hope that some Sam Supplement readers found the idea of building their own mouse interesting. Too date I know of at least 3 'Cheapo-mice' which have been built and all worked first time. I am very satisfied with my 'mouse' but as I mentioned in the first article the 3 chip interface is very simple and there are one or two situation where this can cause problems. Let me explain, when the mouse is connected to the mouse-port via the adapter cable it simply overlays the 'cursor keys' which was very usefull for anyone wanting to try out the mouse-driver program without actually building the mouse but which is really not ideal. For example when running NOTEPAD under DRiVER, NOTEPAD uses the mouse to move a large pointer around the screen and the 'cursor keys to move a small underline cursor within the text. With my three chip interface it's not possible for SAM to tell the difference between a 'cursor key' press and a mouse movement which means both cursors tend to move together and sometimes the 'arrow' dissapears from the screen. Something my friend Frank Harrop calls 'Arrow-amnesia'. Fortunately the solution is not too complicated , it's possible by simply adding a 4th chip to overcome this problem and make the 'Cheapo-mouse' a 100% replacement for the SAMCO mouse. The extra chip is a 74LS123 monostable which is used along with a couple of spare gates in one of the 7401 chips already in the interface. The new circuit is placed between the 7404 gate pin 10 and the chain of 7401 gates in the interface. I've included a SCREEN$ (INTERFACE2) to show you exactly where it fits. In the origional interface each of the chips took it's power from pin 14 which had to be connected to Plus 5 volts and pin 7 ground. The 74LS123 is a 16 pin chip and it needs 5 volts on pin 16 and ground on pin 8. It is of course necessary to change the 'mdriver' mouse program to use the modified circuit and I have included on this diskette a new 'mdriver' program (version 2.0) plus a new 'MPATCH2' program which should be run to modify your DRiVER version 1.0 diskette to work with the new mouse interface and a program 'SPPATCH15' which will patch SAMPAINT version 1.5. I think these are the current versions of DRiVER and SAMPAINT but if anyone has another version, send me a copy and I'll patch it for you. The modified circuit has a switch built into it which you could leave out, however as my friend Slawek pointed out the switch actually gives you three mice for the price of one. With the input to the 7401 gate connected to the output of the 74LS123 monostable you get a mouse which is the equivant of the SAMCO mouse for use with DRiVER/SAMPAINT etc. With the two inputs of the 7401 gate connected together you have the origional 'Cheapo-mouse' which on the mouse-port works like the cursor keys which can be very usefull for some games such as 'LEMMING' which uses the cursor keys for movement and with the interface connected to the 'Joystick' port your mouse replaces the 'Joystick' and works in a similar way to a 'Blue-Alpha' mouse. Not bad for the price of a switch. For the technically minded among you here is how it all works. In the origional interface whenever SAM addressed the cursor keys this was detected by the interface and the mouse position information was sent to the SAM via the chain of 7401 gates. This meant that when the 'keyboard' routine in SAMs ROM read the cursor keys it also saw the mouse data and accepted either. In the MK2 interface when the 'keyboard' routine reads the cursor keys this just triggers the 74LS123 monostable but the mouse doesn't try to input any data and the 'keyboard' routine only sees the cursor keys. After about 10 microseconds or so the monostable resets and thats that. The 'keyboard' routine runs every 20 milliseconds and the operation is repeated. The new 'mdriver' mouse routine also runs ever 20 milliseconds but works slightly differently, it reads the cursor keys just like the 'keyboard' routine, which of course triggers the monostable. If the 'mdriver' routine sees that you'r pressing a cursor key then it terminates and no attempt is made to input data from the mouse. If however you are not pressing a cursor key then the 'mdriver' routine reads the cursor keys a second time and this time because the monostable is still set the mouse inputs it's data and the 'mdriver' routine now has genuine mouse data. In this way the 'keyboard' routine always sees the cursor keys and the 'mdriver' routine always the mouse and they don't interfere with each other. Dave Tonks wrote to me explaining that C46 mice are becoming a rare breed in England, something about them being exterminated along with there computers by fanatical 'Spectrum' owners. Anyway if you can't find a C64 mouse in the shops and can't persuade a misguided C64 owner to part with his mouse then the question arises could perhaps an ATARI or AMIGA mouse be used instead. Well Dave very kindly sent me an ATARI mouse to play with and it may be possible. The good news is that the ATARI mouse can simply be plugged into the 'Cheapo-mouse' interface you don't need to modify it in any way, the bad news is that the electronics in the ATARI mouse is rather primitive when compared to the C64 mouse which means the 'mdriver' routine has to do a lot more work which has two negative effects, firstly it will have to be more complicated (longer) which could make patching DRIVER and SAMPAINT more difficult as SAMPAINT for example, only has 115 bytes of space for the 'mouse driver' and secondly it will in certain circumstances use up more CPU time, slowing SAM down a bit. Anyway not making any promises I will try to find the time to work with the ATARI mouse, the first 'ATARI mdriver' routine is already running and I'll send Dave the information for the supplement if I get it running acceptably. Best wishes Ian D Spencer