Welcome, Guest. Please login or register.


Author Topic: Universal Mouse Driver (Read 21521 times)

Online gflorez

  • EP addict
  • *
  • Posts: 2380
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 43.0 Firefox 43.0
    • View Profile
Re: Universal Mouse Driver
« Reply #60 on: 2016.January.18. 10:23:36 »
To find connected controllers:

First step:      Search for activity on the two controller ports, all the 10 rows, reading port B6 bits 0, 1 and 2.
                    Found activity, if in K column the controller is directly an EnterMice.
                    Also if the activity is on J column but on a row greater than 4, the controller is Joystick 2
                    Discriminate the controller on J column lower rows by the procedure on the previous Message.
                    No activity, no mouse nor Joystick.

Second step:  Initialize the UART. Is there activity? If found we have a serial card.
                    Wait for the "M" character. If received it is directly a Microsoft mouse.
                    Initialisation code not received but movement received. Mouse Systems mouse.
                    No UART activity or no movement received. No serial mouse.

Fourth step:   If no activity found, set internal joystick as working controller.

No problem if two controllers are moved, the first found is the working one.

Online gflorez

  • EP addict
  • *
  • Posts: 2380
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 43.0 Firefox 43.0
    • View Profile
Re: Universal Mouse Driver
« Reply #61 on: 2016.January.18. 10:25:35 »

It can be extrange to search for movement on pauses of movement, but it is possible  because the user leaves resting the "working" controller and touches another, making it the new "working" one.

If the "Search Controller" routine is made fast enough it can be run at any situation, may be "pre-discriminating" serial modes at the initialisation: Is there a "serial card and mouse" connected? Is it a Microsoft mouse?


Online gflorez

  • EP addict
  • *
  • Posts: 2380
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 43.0 Firefox 43.0
    • View Profile
Re: Universal Mouse Driver
« Reply #62 on: 2016.January.18. 10:27:45 »
May be we can implement a new system var  with the possible controllers that can be searched. One byte with every bit meaning a controller, put to 0 if forbidden  or 1 if present. The list beginning with joy1, as the internal joystick is always active. This leaves us two bits for future use.

On initialisation, the driver can put serial options to 0 if no serial card or serial mouse plugged are found.
« Last Edit: 2016.January.19. 13:08:38 by gflorez »

Online gflorez

  • EP addict
  • *
  • Posts: 2380
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 43.0 Firefox 43.0
    • View Profile
Re: Universal Mouse Driver
« Reply #63 on: 2016.January.19. 12:58:17 »
A new System var can be excessive, better at initialisation an internal variable. Then a command can be  implemented to exclude a controller type, some like this:

:MOUSE EXCLUDE 3 5 6

--------------------------
Implementing commands can be very helpful  if "mouse pointer on a text mode" is achieved, because then it would be easy to open the Mouse device on an Exdos or WP screen only typing something like this:

:MOUSE £102
« Last Edit: 2016.January.19. 19:08:13 by gflorez »

Online gflorez

  • EP addict
  • *
  • Posts: 2380
  • Country: es
  • OS:
  • Unknown Unknown
  • Browser:
  • Firefox 43.0 Firefox 43.0
    • View Profile
Re: Universal Mouse Driver
« Reply #64 on: 2016.January.27. 12:25:48 »
Here is a new version of the mouse driver, this time there are a few modifications done:

-The :PB command has been removed definitively from the driver. Now the driver auto-initialises itself, and the EGI doesn't hang with this version.

-The Enter button now is the secondary mouse button when in Internal joystick mode(option 0).

-Also on the external joysticks(options 1 and 2), the two additional buttons implemented on EnterMice now act as the secondary and middle buttons.

-Now the serial Microsoft(option 6) begins to work (Zozo says it moves, but a little jumpy...).

I will update the links on the EnterMice wiki as fast as possible.

Edit: Done, but the wiki information still needs to be updated accordingly.

Edit: All wiki pages updated.
« Last Edit: 2016.January.28. 07:52:05 by gflorez »

Online gflorez

  • EP addict
  • *
  • Posts: 2380
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 43.0 Firefox 43.0
    • View Profile
Re: Universal Mouse Driver
« Reply #65 on: 2016.January.28. 11:30:53 »
I have to explain why the driver didn't work with the EGI when I removed the :PB command on formerly versions.

I think it was because the mouse driver never passed the beta-testing phase. The driver needed to be loaded, then the mouse device was linked but not initialised. Then the user(from Basic or the Paintbox program) needed to  type the :PB command to initialise it.

The coders of the driver wanted to initialise only the mouse, not the entire system, so the initialisation ended with registers "c"=0 and "a" loaded with the memory page where the driver was loaded.  This is why the initialisation command produced an error, 9000+memory page. The characteristic was only needed for testing purposes.

This behaviour was not important with the Paintbox program, because the resulting codes where ignored, but when the EGI loads, it takes over the entire system and initialises it sending the "Action Code 8" to all devices.

My error was that I only changed the :PB command by an  "Action Code 8" entry, not changing the results on registers "c" and "a" at the exit. The value on "a" can be 0 or an error code, but "c" must be 8 if we want the initialisation to be spread to all the devices(EXOS Kernel Specification 9.2.8 ). As a result, the drivers initialisation call always was stopped when it arrived to the mouse driver, so the EXDOS interface and other important devices ceased to be initialized.

It can be that the EGI coder, Rhodri Cusack, knew about that issue but didn't want to correct the Mouse driver by himself, as it wasn't his own creation.
« Last Edit: 2016.January.28. 11:42:17 by gflorez »

Online gflorez

  • EP addict
  • *
  • Posts: 2380
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 43.0 Firefox 43.0
    • View Profile
Re: Universal Mouse Driver
« Reply #66 on: 2016.January.28. 11:46:29 »
I forgot to say that, in the actual version, the serial modes buttons and movement no more are mixed with the joystick modes.

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13081
  • Country: hu
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 43.0 Firefox 43.0
    • View Profile
    • http://enterprise.iko.hu/
Re: Universal Mouse Driver
« Reply #67 on: 2016.January.28. 13:49:30 »
The coders of the driver wanted to initialise only the mouse, not the entire system, so the initialisation ended with registers "c"=0 and "a" loaded with the memory page where the driver was loaded.  This is why the initialisation command produced an error, 9000+memory page. The characteristic was only needed for testing purposes.
This is totaly EXOS incompatible solution! A for error code not for anything else.
(And if the MOUSE.XR loaded to segment F0h then you can decide Mouse.XR are present or not...)


Quote
This behaviour was not important with the Paintbox program, because the resulting codes where ignored
I'm sure the origin of PB are from PaintBox. Probably some early version used the ruterned value?

Anyway: good to forgot this strange - and very frustrating - solution!

Online gflorez

  • EP addict
  • *
  • Posts: 2380
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 43.0 Firefox 43.0
    • View Profile
Re: Universal Mouse Driver
« Reply #68 on: 2016.January.28. 14:12:33 »
I think they wanted to easily SPEEK the content of the driver variables while modifying the code, so they needed the page address where it had been loaded.

Of course, PB stands for Paintbox, the program types the command internally. May be somebody though the initialising command as a future copyright protection? The command is not mentioned inside the manual...

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13081
  • Country: hu
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 43.0 Firefox 43.0
    • View Profile
    • http://enterprise.iko.hu/
Re: Universal Mouse Driver
« Reply #69 on: 2016.January.28. 14:18:40 »
I think they wanted to easily SPEEK the content of the driver variables while modifying the code, so they needed the page address where it had been loaded.
More easy and compatible solution use a EXOS variable. For example the EXDOS store the EXDOS segment number to variable 64.

Online gflorez

  • EP addict
  • *
  • Posts: 2380
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 43.0 Firefox 43.0
    • View Profile
Re: Universal Mouse Driver
« Reply #70 on: 2016.January.28. 22:36:49 »
Still there is a spare 190 system var, may be at the end it will be used to store the Ram page if finally the Mouse driver Rom is  made.....




Edit:

Sorry, it's  my mistake, 190 is used for buttons and wheel(sometimes I don't remember what I have created....), but 191   is still unused.  192 and forward is used for Epdos.

Also below 180, slots from 162 to 179 are still unused.
« Last Edit: 2016.January.29. 16:00:19 by gflorez »

Online gflorez

  • EP addict
  • *
  • Posts: 2380
  • Country: es
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 44.0 Firefox 44.0
    • View Profile
Re: Universal Mouse Driver
« Reply #71 on: 2016.January.31. 00:01:14 »
I've discovered that the last version of the mouse driver collides with  the Reset funtion of the Enterprise because the mouse device is linked on every initialisation. If the Reset button is pressed the computer freezes on a solid screen. If pressed again it returns normally to Basic but then the driver does't work, the program in Basic is erased and the EGI also can't work.

I think is for that error that the Boxsoft team created the :PB. It only works if initialized individually, because it only can be initialized once.

For now I have to think on a way to fix it. At least this version works the very first time....

Anyone who wants a healthy OS, better use the formerly version...


------------------------------------------

When no mouse is connected, no mather if Boxsoft or Entermice modes, the pointer slowly goes to the bottom right corner.

This is produced because the joystick ports when not in use give all the direction bits set to 1, so a 255 is returned. But 255 is -1 for the Neos reading routine. Then a (-1 , -1 ) is executed every reading loop....




Offline Zozosoft

  • EP addict
  • *
  • Posts: 13081
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 43.0 Firefox 43.0
    • View Profile
    • http://enterprise.iko.hu/
Re: Universal Mouse Driver
« Reply #72 on: 2016.January.31. 08:10:41 »
When no mouse is connected, no mather if Boxsoft or Entermice modes, the pointer slowly goes to the bottom right corner.

This is produced because the joystick ports when not in use give all the direction bits set to 1, so a 255 is returned. But 255 is -1 for the Neos reading routine. Then a (-1 , -1 ) is executed every reading loop....
This can be used for autodetect!

Online gflorez

  • EP addict
  • *
  • Posts: 2380
  • Country: es
  • OS:
  • Unknown Unknown
  • Browser:
  • Firefox 44.0 Firefox 44.0
    • View Profile
Re: Universal Mouse Driver
« Reply #73 on: 2016.January.31. 13:13:10 »
Yes, and without moving necessarily the mouse. To receive the same results from a connected mouse you have to move the mouse as slowly and exactly the same diagonal direction, all  while the checking is done.

_-----------------------------------

About the initialization, I plan try to open a false mouse channel. Then what EXOS first do is to look for the device. If not linked then it gives the error and I can know then if I must initialise it again.

Online gflorez

  • EP addict
  • *
  • Posts: 2380
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 43.0 Firefox 43.0
    • View Profile
Re: Universal Mouse Driver
« Reply #74 on: 2016.January.31. 20:14:18 »
Another Mouse driver version.

I have at last fixed the driver initialization. Now the driver resist a soft reset, because when an initialisation code(8 ) is received, it tries to open a channel to the Mouse device. If return code is FAh(*** Device does not exist) the device is linked again. Any other return code say us that the device is active, so no action is done.

Also I have sorted out the buttons of the joystick ports, as I swapped by mistake the Central and the Secondary ones.

Edit: Links on all the EnterMice wikis updated
« Last Edit: 2016.February.01. 09:57:06 by gflorez »