OK, I can't test if the associated video page has been modified or closed. I will return to this problem if sometime the driver is put on Rom.
-------------------------------------------------
Now, just to clarify my mind, I will present here the logic I pretend for Autodetect mode(sys var 189=7) on the mouse driver.
Checking only for the presence or not of a controller is very difficult, as the controllers can be digital joysticks, MSX protocol or serial protocol. The presence can be more or less detected only on some of them, MSX and serial, but not on the joysticks.
Then I have though that the easiest way to switch between controllers is to search for activity on the different ports, just when the user stops the active controller and begins to move other.
But in order to use this method, first I need to know if a serial card is present, then, if a mouse is connected, its protocol, Mouse Systems or Microsoft. This can be figured out just at the initialisation of the serial card, so no problem here.
Is a fact that all Enterprises have an internal joystick..., is the only controller that is always connected, so it will be the default state. Priority is EnterMice(4 ), Boxsoft(3 ), Mouse Systems(5 ), Microsoft(6 ), Joystick 1(1 ), joystick2 (2 ) and Internal Joy(0 ). The first found activity makes it the active controller.
The Autodectect routine can be as this:
-At first the active controller is the internal joystick(0 ).
-Normal mouse reading loop.
-After 50 mouse readings(1 minute ) of the active controller without movement the auto-detection routine is triggered.
-Read columns J and K, rows 1 to 4, on the controllers ports and check for activity.
-Is there activity on column K? If yes, make EnterMice the active controller and return to Normal mouse reading loop.
-Is there activity on column J? If yes, check for impossible movements. If found, make Boxsoft the active controller and return to the reading loop.
-If there is a serial mouse we already know what protocol it has so, if there is activity make it the active controller and return to the reading loop.
-read column J rows 1 to 4 and 6 to 9 on the controllers ports and check for activity.
-Is there activity on rows 1 to 4? If yes, make Joystick 1 the active controller and return to the reading loop.
-Is there activity on rows 6 to 9? If yes, make Joystick 2 the active controller and return to the reading loop.
-Make the internal Joystick the active controller and return to the reading loop.