VOGONS


First post, by Darmok

User metadata
Rank Newbie
Rank
Newbie

Hi all! Sorry for the long text in my weak English (I'm almost sure that I use English prepositions and articles incorrectly).

I have developed and made an experimental prototype of a serial optical mouse specifically designed for use with DOS. The purpose of this development was to practically test its usability and, in general, to determine the right to exist of such a conceptual solution. Since this development is purely experimental in nature and contains an idea whose usefulness may be questioned, I decided to put it in a separate topic. My previous solutions can be found here - Homemade Serial Optical Mouse? It's Simple! .

file.php?mode=view&id=203903

A few words about the reasons that made me create such a mouse. For some of the devices I develop for my retro computers, I also have to develop simple programs that control these devices. The most convenient way to develop and debug programs is directly on the target retro computer in the DOS environment. For these purposes, I use a dual-monitor system (VGA and monochrome). In this case, using one or more DOS sessions of Windows, I run the development environment on one monitor (usually monochrome), and on the other monitor I display help information or texts with program examples or something else useful during the development process. There is a constant need to move back and forth through the text. I am so used to using mouse wheel scrolling in Windows that I was always irritated by the lack of such an option in DOS. Therefore, my initial goal was to be able to implement mouse wheel scrolling emulation in DOS.
One of the options is to use an IntelliMouse compatible mouse together with the CuteMouse driver and write a resident utility that emulates pressing the UP and DOWN keys when rotating the wheel. However, this will not work in DOS sessions of Windows, since in this case Windows uses its own mouse drivers. For this reason, I decided to develop a hardware solution that is independent of drivers and the OS used. During the development, I also added support for some popular old DOS games. Many DOS games access the keyboard controller directly, so using a resident utility to map buttons and a mouse wheel to keyboard keys becomes impossible, again a hardware solution is needed.
In my solution, support for DOS games is quite limited due to the complexity of my hardware implementation method. Adding something more is prevented by the lack of space on the mouse PCB. This limitation can be overcome by using a microcontroller, but this may be the next possible step, at this stage it was easier and faster for me to make a simplified hardware solution.

The experimental prototype I developed is a hybrid device. That is, a combination of two independent devices - the mouse itself and a keyboard simulator in the mouse body. The mouse is an ordinary serial optical two-button MS Mouse. The keyboard simulator is based on a controller board from a PC keyboard. The mouse is connected to both the COM port and the keyboard port. Since the keyboard port cannot be directly connected to two devices at the same time, and using a computer without a keyboard is practically pointless, it is necessary to use Keyboard Port Tripler ( Simple DIY Keyboard Port Tripler ) developed by me earlier for similar purposes.
A similar solution is possible for a mouse with any interface. I chose a mouse with a serial RS232 interface as the most universal, in order to cover the possibility of using it on any computer except XT. If you use a keyboard key controller with support for switching between AT and XT modes, the solution will be completely universal. I only have one keyboard with such controller and I didn't want to destroy it.
Due to the fact that the mouse I developed does not require any drivers other than standard system ones, it can be used not only with real retro computers, but also with PC emulators, the main condition is that the computer has a PS/2 keyboard port and a COM port. For many not very new computers, this condition is met.

Mouse block diagram
file.php?mode=view&id=203904

The mouse has three additional side buttons for the thumb. Two buttons can be used both in DOS and in games. These buttons imitate pressing ALT and CTRL. In the game settings, you can assign some actions to these keys, such as running or squatting or something else. When working in DOS and Windows, I found it convenient to use them for combinations such as CTRL-C, CTRL-V, ALT-F4, ALT-ENTER and some others.
The third button is the game mode button, used to support DOS games. By pressing and holding it, you can select four modes by rotating the wheel towards you. The selection occurs in a ring, i.e. after the fourth, the first again. Each mode is accompanied by yellow and red LED indication. The modes are reset to default DOS mode by rotating the wheel away from you while holding down the game mode button, allowing you to quickly return to DOS mode when you finish a game. Additionally, when you press and hold the game mode button, all game modes are paused and the normal mouse action (without scrolling) is temporarily activated. This can be useful in the game menu and in some other cases.
The first mode is the DOS/Game1 mode, i.e. a regular two-button mouse, but with the ability to scroll with the mouse wheel. This is the default mode and is active immediately after loading the mouse driver. It is important to note that the keyboard simulator starts working immediately after turning on the computer, even before the mouse driver is loaded. Scrolling in DOS applications such as various viewers (browsers) is implemented by simulating pressing the UP and DOWN keys when rotating the wheel. The default scrolling mode is not convenient for text editors, so an alternative scrolling mode such as PGUP and PGDOWN is provided. Switching between scrolling modes is done by pressing the wheel button. The alternative mode is indicated by a green LED. Scrolling with the wheel also works in Windows, although not as fully as native Windows scrolling, but in many cases it is sufficient.
In the first mode, but when used in games, you can switch to a sub-mode of the default scrolling mode, in which HOME/END are used instead of UP/DOWN. This sub-mode frees up the arrow keys on the keyboard for independent use in the game. The ability to use the alternative scrolling mode is preserved in the same form. Switching between the sub-mode and the default scrolling mode is done by pressing the wheel button while holding down the game mode button. The sub-mode is indicated by a blue LED.
In all other game modes, HOME/END are always used instead of UP/DOWN, regardless of whether the sub-mode or the default scrolling mode is selected. The ability to switch to the alternative scrolling mode is retained.
The second mode (Game2) locks the mouse movement along the Y axis. This mode is indicated by a yellow LED. The mode is intended for DOOM and games based on its engine.
The third mode (Game3) permanently holds the SHIFT key. This can be used in some games to enable permanent running if the game does not have a toggle key or for something else. This mode is indicated by a red LED.
The fourth mode (Game4) is a combination of the second and third. This mode is specially designed for Wolf3D. If you use SHIFT to enable side step, then left-right steps will be performed with the arrow keys on the keyboard and the game controls will be similar to control in modern games. This mode is indicated by yellow and red LEDs lit simultaneously.
The mouse wheel also finds its uses in games. It can be used, for example, to look up and down in games like HEXEN or ROTT. Additionally, some games, such as ROTT, allow you to use the alternative scrolling mode to change weapons or, for example, to change inventory in HEXEN.
Since the mouse is also intended for games, I implemented the ability to select an interface speed increased to 4800 baud using a jumper on the mouse board, which increases the number of reports per second from 40 to 160. Of course, in this case it is necessary to use modified mouse drivers or a COM port accelerator. Modified drivers can be found here - Re: USB to Serial Mouse using the Pi Pico! .

Internal mouse design
file.php?mode=view&id=203902

The OM02 optical sensor and mouse body are used from the A4tech SWOP-35 PS/2 mouse.
The keyboard key controller marked as PCB-00046-22E is from some PS/2 keyboard.
The Truedox RTS781 controller is taken from the DINOS (FCC ID: HQA2VTEAO-1) serial ball mouse. I could not find a datasheet for this controller, so the way to connect it was obtained by reverse engineering the mouse circuit. The purpose of some pins remained unclear.

Electrical diagram

file.php?mode=view&id=203901

Since I couldn't find a thin enough six-wire cable, I had to use a USB mouse cable and a transistor switch inside the DB9 connector housing to transmit the RTS signal along with the +5V supply. This is a forced solution and it is not mandatory. In order to reduce the number of components in the electrical circuit and save space on the PCB, I used a simplified method of connecting the serial mouse controller to the COM port. This method does not meet the requirements of the RS232 standard, but it works with IBM PC-compatible computers. Since the mouse is designed specifically for such computers, this is not a serious drawback.
Those who wish can use the part of the diagram that relates to the mouse to independently make the simplest version of a serial optical mouse powered, for example, from the keyboard port. In this case, you need to remove the jumper J2, short-circuit the diode SD1 and instead of the resistor R6, install a zener diode for a voltage of 4.3V with the anode to ground. You do not need to use the transistor switch, but instead you will only need a four-wire cable. Also, resistor R3 can be shorted.
Those who would like to independently develop and make a gamepad for old DOS games can use the Key Control Unit diagram as an example of connecting a keyboard key controller to get the ability to replace the mapping of the gamepad buttons to the keyboard keys on the fly. It should be noted that different controllers have different correspondence between the pin numbers and keys, and you will need to determine it yourself.

The electrical circuit and design of the mouse look quite cumbersome, but this is an inevitable consequence of the hardware implementation from ready-made units. I am not sure that anyone will dare to repeat it. Therefore, the optimal solution would be to use one of the currently available optical mouse sensors and a programmable microcontroller. Any five-button mouse can be used as the basis for the design. In this way, it is possible to develop a gaming mouse specifically designed for old DOS games. When using a microcontroller, it is possible to implement a completely software-redefinable assignment of buttons, including the main mouse buttons. You can get a mouse in the IntelliMouse standard for Windows and a two-button mouse with scrolling for DOS. You can make it so that the rotation of the wheel will sequentially cause pressing of keys 1, 2, 3, etc., which will allow you to change weapons in DOOM. You can implement multiple keystrokes or even sequential pressing of different keys when pressing a mouse button. You can use double-clicks of the side buttons and pressing the side button simultaneously with the main mouse button. Mouse movements can be interpreted as key presses, which may allow the mouse to be used in programs and games that do not support it. You can come up with a lot more. It is enough to implement only a small set of basic functions, and leave their specific content to the users. To do this, users need to be given a corresponding tool ¬– a utility for creating, saving and loading a mouse game profile into the mouse. Apparently, nothing prevents using the COM port to transfer packets with profile settings from the computer to the mouse.
Developing a microcontroller version of the mouse exceeds my current capabilities and will require the involvement of a specialist familiar with microcontroller programming, as well as investment in the project. However, anyone interested in creating such a mouse can develop it themselves. I would be glad if my idea is interesting and useful to someone.

To find out the relevance of a possible future development, I want to ask the Vogons members: Do you need such a mouse? If yes, then:
Q1. Do you need scrolling with the wheel in DOS?
Q2. Do you need support for DOS games? The opinion of retro gamers is especially important.
Q3. What functionality would you like from the mouse?
Q4. Is there support for such mouse functionality in popular PC emulators?
Q5. What demand do you think it could have among retro gamers? What demand among ordinary retro computer enthusiasts?
Q6. Considering that with the future production of the mouse in small series, and also because of the need to supply a Keyboard Port Tripler with it, the mouse cannot be cheap. What price would you be willing to pay for such a mouse?

However, there is an alternative and possibly cheaper way to get similar mouse functionality. This is the way to create a special version of the converter, similar to the one developed by rasteri in his HIDman project ( HIDman - USB to PS/2 converter (Open Source) ). In my opinion, it will be enough to modify the HIDman code, perhaps change the electrical circuit a little, and develop a utility for managing mouse game profiles. Since the characteristics of USB mice from different manufacturers can differ significantly, it may be necessary to have tools for their software unification. To quickly switch the assignment of mouse buttons and wheel functions, you can use the assignable keys on the system keyboard, and use the LEDs on the keyboard in blinking mode for indication. Such development is beyond my interests and can be carried out by interested persons.
If you dream a little, it would be nice if you could add the ability to connect a USB gamepad to such a converter. This would allow any combination of gamepad buttons to be mapped to any combination of keyboard keys, making it possible to use gamepads in old DOS games.

Thank you for your attention to my project. Please, if it is not too much trouble, express your opinion about it. Critical comments and possible suggestions for its improvement are especially welcome.

Best regards.

Darmok.

Reply 1 of 11, by Darmok

User metadata
Rank Newbie
Rank
Newbie

A month has passed and not a single response to the project. A clear sign that this development has not generated interest. Apparently, further development of the idea does not make sense. Well, so be it.

Reply 2 of 11, by wbahnassi

User metadata
Rank Oldbie
Rank
Oldbie

I wouldn't implement scroll with up/down on keyboard. You want Ctrl+Up and Ctrl+Down instead, with configurable scroll speed causing the number of simulated presses to repeat if higher scroll speed is desired.
If no one cares about your invention, at least you care and it will help you in your work on the dual-monitor setup.

Turbo XT 12MHz, 8-bit VGA, Dual 360K drives
Intel 386 DX-33, TSeng ET3000, SB 1.5, 1x CD
Intel 486 DX2-66, CL5428 VLB, SBPro 2, 2x CD
Intel Pentium 90, Matrox Millenium 2, SB16, 4x CD
HP Z400, Xeon 3.46GHz, YMF-744, Voodoo3, RTX2080Ti

Reply 3 of 11, by Jo22

User metadata
Rank l33t++
Rank
l33t++
Darmok wrote on 2024-11-21, 12:31:

A month has passed and not a single response to the project. A clear sign that this development has not generated interest. Apparently, further development of the idea does not make sense. Well, so be it.

I did read it when it was new and found it fascinating, I just didn't know what to respond. 😟

Edit: I'm also not much of an gamer, except for those slow paced genres that others might find boring.
So I didn't have much to add, unfortunately. 🙁

Edit: A page up/down feature might be useful when working with Norton Commander, I can imagine.
Back in the 90s, I was often spending nights reading whole pages of text files on shareware CDs.
Having the scrolling feature directly on the mouse would have been really nice.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 4 of 11, by Spenno2000

User metadata
Rank Newbie
Rank
Newbie

Hey Darmok, these mouse projects of yours are awesome. Not a old PC enthusiast but I have a old IR wireless ball mouse I would like to modify to use a optical sensor (pretty sure the OMO2 is perfect for this). Seems like this is right in your wheelhouse and I don't have the skills or time to reverse engineer a solution. I can't PM on the forum, but can you possibly PM me and we could discuss and see if you are keen to help with this project? Genuine offer, happy to cover some costs for parts and time etc, even if we just find out it cannot be done, happy for whatever comes of it to be open source on here.

Reply 5 of 11, by Darmok

User metadata
Rank Newbie
Rank
Newbie

The main problem when converting ball mice into mice with an optical sensor is to provide sufficient current for the optical sensor LED. If you power the converted mouse from an external power source, for example, from a keyboard port, then the conversion can be very simple if you use the case from an optical mouse. If you want to preserve the appearance of a ball mouse, you will have to develop a new printed circuit board. If you want to use a mouse powered by a COM port, you will also have to develop a printed circuit board and use an optical sensor capable of operating with reduced supply voltage and, accordingly, current consumption. It should be noted that this mode is not guaranteed by the sensor manufacturer and requires experimental research. Not all sensors are suitable. In the case of a wireless mouse, everything depends on what kind of power source is used in it and its voltage. If this is an old ball mouse, then most likely it uses conventional galvanic cells. Then converting such a mouse will be impractical. Even if it is possible to implement an optical sensor there, the operating time before the cells are discharged will be short.

Reply 6 of 11, by amadeus777999

User metadata
Rank Oldbie
Rank
Oldbie

Clever Engineers like you Darmok are direly needed to keep a beautiful niche thriving & breathing - similar to the old (sports) cars "segment".

Reply 7 of 11, by Spenno2000

User metadata
Rank Newbie
Rank
Newbie

This is a example of the IR mouse I am playing around with below in the ebay link. I have a bunch of these, they come in a several brand names but are the same China mouse chassis and electronics underneath.

https://www.ebay.com.au/itm/204887532964

They use 2xAAA batteries so 3V so yes main issue is under voltage to the optical sensor that is expecting 5V (but since there is space for 2x batteries in the mouse already these may be able to be swapped to 5V cells of some kind). I think second issue is the chip in these that takes the signals from the ball and buttons is unknown, I cannot find any information on it so would need to map out its pins and what signals it expects in/out (this is where my skill set falls over). Then is the optical sensor able to input into this chip and what electronics would be needed to interface the optical sensor to the existing mouse chip. I would hope its as simple as the serial to optical interface on your previous project.

The attachment IMG_1333_preview.jpeg is no longer available

Reply 8 of 11, by Darmok

User metadata
Rank Newbie
Rank
Newbie

To embed an optical sensor in such a mouse, you need to do the following:
1. Reverse engineer the original mouse's electrical circuit.
2. Find a mouse with a suitable optical sensor somewhere and remove it along with the accompanying components. You will need a controller capable of operating with as little power current as possible. I recommend using HDNS-2000, ADNS-2001, since as I have found out, they can lower the supply voltage and this significantly reduces current consumption.
3. Develop a new electrical circuit with an optical sensor. This will not be difficult, since only four trivial connections are needed to connect a sensor with a quadrature output to the mouse controller. You will have to solve the problem of powering the sensor's LED. Practice has shown that you need to provide a current of at least 7-8 mA.
4. Develop a new PCB. If you leave the same mouse case, you will have to fit into the small size of its PCB, which will not be easy. Most likely, you will have to install the sensor not along the housing axis, but across. You will have to use passive SMD components and a two-layer PCB. All this is possible, although quite labor-intensive.
5. You will have to solve the issue of replacing the power cells with others. It is necessary to provide a supply voltage of at least 5.6 V with a current consumption of the sensor and its LED of 10 mA. In addition, you should take into account the current consumption of the mouse controller. To do this, you need to measure the current consumption of the mouse before reworking. In my opinion, this is the most difficult design solution. Perhaps it would be more rational to develop a new mouse case and print it on a 3D printer.

In any case, reworking such a mouse into an optical one is not an easy task and is very labor-intensive. But if you have the desire and persistence, then it is possible.

Reply 9 of 11, by Spenno2000

User metadata
Rank Newbie
Rank
Newbie

OK thanks mate, you have given me plenty to think about and I now understand the problem.

Basically the form factor of the larger (older) optical sensors that do quadrature outputs wont fit in this existing form factor (I have only a mouse ball worth of space about 25mm, the sensor + LED are like 50mm). I will need a custom PCB and housing to mate the two IC together and build the required passive components needed.

To rule out he issue of the 5v/3v power supply I have found the sensor ADNS-2030 which is quadrature output but operates on 3V so that is a start (made for old wireless mice that run on AA/AAA batteries). Next step is to try figure out what old mice come with this sensor so I can get my hands on one and maybe build a frankenstein prototype jumpering the optical mouse outputs into the existing IR mouse as a first step.

Thanks again.

ADNS-2030 datasheet:

https://docs.rs-online.com/b51e/0900766b804e3de5.pdf

Reply 10 of 11, by Darmok

User metadata
Rank Newbie
Rank
Newbie

I don't have ADNS-2030, but I tried using ADNS-2051 which differs only in 5V supply voltage with the same current consumption. I was unable to significantly reduce its current consumption by reducing the supply voltage, the sensor simply refused to work. This is due to the fact that ADNS-2051, like ADNS-2030, has a built-in stabilized 3.3V core power supply and when the overall supply voltage decreases, it apparently fails. In contrast, ADNS-2001 and HDNS-2000 use an external core power supply, so its voltage can be reduced to 2.5V while maintaining full sensor functionality. The interface supply voltage can be reduced to 3.5V. All these measures result in the overall sensor consumption decreasing to 3.5 mA. The sensors use LED current control to save energy, but if you try to reduce the LED current, then after the sensor enters the power saving mode, it will not be able to exit it. Therefore, I used the LED to be turned on directly from the power source, setting the minimum current through it at which the sensor remains operational (7 mA). If you want to keep the mouse powered by two AAA batteries, you will have to use some kind of voltage converter, which will take up additional space on the printed circuit board. I would also advise installing a power switch to save battery power when the mouse is not in use.

Reply 11 of 11, by Darmok

User metadata
Rank Newbie
Rank
Newbie

Your mouse uses two wheels, which means two IR LEDs, plus two IR LEDs for communication. Usually, such LEDs consume quite a lot of current. If I were you, I would first measure the current consumption of this mouse. If it turns out to be quite large (more than 20 mA), then perhaps there is no point in fighting to reduce the current consumption of the optical sensor and you can use the ADNS-2030 as is. You can try to power it with a voltage of 3V or even a little less, taking into account the voltage drop during partial discharge of the batteries. If it works normally in this case, then you can do without a voltage converter. However, the current of its LED should still be reduced, since it usually reaches 30-40 mA.