Welcome, Guest. Please login or register.


Author Topic: Universal Mouse Driver (Read 21525 times)

Online gflorez

  • EP addict
  • *
  • Posts: 2380
  • Country: es
  • OS:
  • Unknown Unknown
  • Browser:
  • Firefox 42.0 Firefox 42.0
    • View Profile
Re: Universal Mouse Driver
« Reply #45 on: 2015.December.08. 00:34:20 »
Zozo says that the last modifications don't work  on a 10 MHz Enterprise.

Second tentative for CPU efficience:
 
« Last Edit: 2015.December.08. 10:07:03 by gflorez »

Online Zozosoft

  • EP addict
  • *
  • Posts: 13081
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 42.0 Firefox 42.0
    • View Profile
    • http://enterprise.iko.hu/
Re: Universal Mouse Driver
« Reply #46 on: 2015.December.08. 20:38:45 »
Now working!

Online gflorez

  • EP addict
  • *
  • Posts: 2380
  • Country: es
  • OS:
  • Unknown Unknown
  • Browser:
  • Firefox 42.0 Firefox 42.0
    • View Profile
Re: Universal Mouse Driver
« Reply #47 on: 2015.December.08. 22:02:57 »
Good news!

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 #48 on: 2016.January.01. 13:55:22 »
Happy year for all!


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

Today I bring here a weird experiment. I have fooled the Mouse driver to think that a TEXT 80 mode is a GRAPHIC HIRES one(mode 2 processed as mode 1) .

The attributes of the two modes are very different so the pointer is shown like a mess... the hack is very stable and only produces artefacts when the Editor cursor collides with the Mouse pointer.

Also up and down movements are swapped, and the scroll hides sometimes the pointer or it appears where we don't expect...

Play a little with the internal joystick to see the effect.

It can serve as a teaser of what I want to implement... But I progress very slowly.
« Last Edit: 2016.January.02. 01:00:23 by gflorez »

Offline endi

  • EP addict
  • *
  • Posts: 6766
  • Country: hu
  • grafikus, játékfejlesztõ, programozás, scifi, tudományok, vallás
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 47.0.2526.73 Chrome 47.0.2526.73
    • View Profile
    • Honlapom
Re: Universal Mouse Driver
« Reply #49 on: 2016.January.01. 14:51:51 »
try to read the memory address of the row from the lpt row
A diplomás magyar programozó megcsinált egy pacmant egy év alatt, majd lefikázta a világ legjobb játékait. :D

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 #50 on: 2016.January.01. 16:25:28 »
At the moment it is the driver drawing rutine who does the work. I still haven't modified it to manage mode 2.

Edit: Ah, you mean to avoid the scroll effect....
« Last Edit: 2016.January.02. 00:01:10 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 #51 on: 2016.January.04. 15:34:00 »
I forgot to say, this special Mouse driver has been modified to accept the text screen.

The behaviour of the Editor with the screen lines can be better viewed in this snapshot. The test Basic program creates a new Text 80 window and the Interpreter is maintained in a loop after the Mouse channel is opened.

The mouse pointer works normal, except the bad attributes issue.

But once you press STOP, things turn to be worse...

The solution, like Endi points, is to use the LPT addresses instead of the direct memory addressing the mouse driver uses.

Online 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 #52 on: 2016.January.04. 15:42:52 »
except the bad attributes issue.
It is a normal, not a surprise.
Text 80 use 8 colors on Hires-2 page, two high bits of graphics data used for select color pairs.

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 #53 on: 2016.January.09. 11:00:40 »
I am now working on the option 6, Microsoft serial. A very big error has stopped me for months...

At least now the pointer moves, but jumpy.

Actually serial movement is mixed with the internal joystick movement. Zozo suggest to leave serial alone, as the mix is no more necessary. It seems easy to do.

And, how about a secondary button for the joysticks options(0, 1 and 2)?

All the other options have at least two buttons(Boxsoft only when emulated on Entermice). On the external joysticks is easy for me to select a candidate button, but I need a secondary button for the keyboard.

Any suggestion? Maybe Enter?

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 #54 on: 2016.January.09. 16:03:23 »
By the way, what key combinations  use SimbOS for mouse buttons on the internal joystick mode?

Edit: I've found them: Ins and Stop as main and secondary. That combination is not possible on EXOS...

Alt is in the same row(8 ) as Space. May be Alt+Space? Is there that key combination in EXOS or the Editor?
« Last Edit: 2016.January.10. 14:01:29 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 #55 on: 2016.January.11. 02:29:41 »
Imagine a program that makes use of the mouse driver. It reads mouse movement and at least the main and secondary buttons. The main button to select some areas or objects in the screen, and the secondary to change aspects of the selection.

Until now this could not be done with the internal and external joystick.

You can say this is false, but I mean only "using the driver".

Changing values to the System Var 189 you can use six modes of input device.

When programming for Entermice, the aplication now can be tested on a bare Enterprise without the adapter, because I have added Enter as the secondary button(main is Space) when using the internal joystick. No more buttons or wheel simulation, sorry, but enough.

Also I have added secondary and centre buttons on external joystick, compatibles with the new second and third fire buttons that Entermice provides.

The buttons will be shown on System Var 190 for proper coding.

For now I am still betatesting.....


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 #56 on: 2016.January.18. 10:14:21 »
As a suggest from Zozo I begun this last weekend to think of a way to implement an automatic detection of the connected controller. This is chronologically what I have been thinking:

There are some problems here, one of them is how to discriminate Boxsoft mode from EnterMice mode.

Theoretically it could be done comparing the lectures of the two columns, J(Boxsoft) and K(EnterMice), in the same cycle, selecting the column that returns different than 0,0. But the user must be moving the mouse in one of the modes, as a lecture returns 0,0 if not moving, the same if not exist or disconnected.

Both modes have extended Prodatron's protocol when in EnterMice adapter, and also Pear's protocol extension.

Pressing main buttons can do, but Entermice mode uses fire of Joy 1, and it collides with detecting the three Joysticks.

On the other side the Joysticks return nothing when in rest position....
« Last Edit: 2016.January.18. 10:22:08 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 #57 on: 2016.January.18. 10:15:56 »
Then Zozo said:

I suggest ask Prodatron how Symbos detect the mouse. Then need to run this routine on K and if not found run it on J.
If both not found then try to search serial mouse. It is also not found then set the default to internal joy.
These will be done in the initialization part and set the default for the variable 189.

If I know right Symbos try to read few times the mouse, and if only read empty values, then mouse not conected.

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 #58 on: 2016.January.18. 10:17:56 »
I said:

Mouse on K and J can be read at the same time, the Mouse.xr routine takes the data of the three columns at the same time. Discrimination of Boxoft or EnterMice can be made in only one cycle if the mouse is moving.  The same can be said for the joysticks. Serial can be detected by the movement and, only when initializing the UART, discriminated by the "M" character.


I think the best option is:

A new setting on var 189, for example 7, as automatic.

1-Initialise the driver.
2-Put a counter to 0
3-Test the controllers.
4-Found one of them moving?, take it as the "working" one.
5-If not, default is the the last "working" one, if not the internal joystick.
6-Normal lecture cycle and drawing. If still moving, go to 6
7-Increment the counter only if not moving. If not greater than a given value, go to 6
2-An opportunity for a change.... go to 2.

I think it can work if the pauses on the movement are utilized to search for controllers.
« Last Edit: 2016.January.19. 10:04:59 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 #59 on: 2016.January.18. 10:21:07 »
To discriminate the Joystick 1 from the Boxsoft the only way I know is to search for an "impossible" combination for a joystick:

No more than two direction keys can be pressed at once.
Only the Up-Right, Right-Down, Down-Left or Left-UP pairs are acceptable.

I think is easy to find an impossible value in one or two cycles.
« Last Edit: 2016.January.18. 10:42:34 by gflorez »