Welcome, Guest. Please login or register.


Author Topic: Universal Mouse Driver (Read 77593 times)

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: Universal Mouse Driver
« Reply #105 on: 2016.September.05. 15:32:28 »
Today I come with something to taste, those with a working Xep128 or an EnterMice can see how a pointer can be represented on a text mode.

First download this beta version of the Mouse driver.

Then install it on the Enterprise, copying it to the SD, floppy or SD-image.

Execute Mouse.xr and the driver is made resident until the next hard reset.

Then type the Basic listing and execute it. The Basic program will stop but you will see that odd red character or a blue underline in the middle of the screen.
 
Move the mouse pointer wherever you like....

You can type something or move the internal joystick while moving the mouse pointer.

Observe that the Editor scroll doesn't interrupt the action.

If you change to 80 text mode or vice versa, please close channel 1 before doing it, as it can cause errors and I still have to refine the driver.
« Last Edit: 2016.September.09. 02:33:34 by gflorez »

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: Universal Mouse Driver
« Reply #106 on: 2016.September.06. 13:05:19 »
I have made this snapshot for Ep128emu, but the control is made with joy 1 so, very squary and slow movement.
« Last Edit: 2016.September.06. 13:25:25 by gflorez »

Offline geco

  • EP addict
  • *
  • Posts: 7069
  • Country: hu
    • Támogató Támogató
Re: Universal Mouse Driver
« Reply #107 on: 2016.September.06. 18:29:26 »
It is good, I see one thing what could be better, if 2 direction is pressed eg right+up then cursor is drawn twice, 1 step up, and then right, 1st drawing step is not needed.

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: Universal Mouse Driver
« Reply #108 on: 2016.September.06. 18:46:48 »
Yes, but it is because EP128emu is using joy1 as mouse controller, and the movements are contiguous, 1 character boundary at a time. I can assure you that with a mouse the pointer jumps naturally long distances when you move fast your hand.

Now you have a working Xep128. Please, why don't you try this beta mouse driver on it? 

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: Universal Mouse Driver
« Reply #109 on: 2016.September.06. 19:57:55 »
I have to explain it better.

The mouse driver works internally in pixel coordinates on all modes. If you read the Mouse driver system variables, 184 to 187 you will be returned with the coordinates on the pixel grid.

But on text modes the pointer moves by character boundaries, and the driver converts on the fly the pixel coordinates to rows and columns, dividing X and Y by 8(or 16) and 18. Only absolute numbers are allowed, so it can be that some pixel coordinates on very short distances, lower than 8 or 9 pixels, give odd values.
 
As I said before, trying to correct this will lead to more complex routines that would waste more time than the saved.

But with a  mouse controller this "error" is unnoticed, the movement of the pointer is more natural than with a joystick, because diagonals don't have always 45 degrees like on digital controllers.

 

Offline geco

  • EP addict
  • *
  • Posts: 7069
  • Country: hu
    • Támogató Támogató
Re: Universal Mouse Driver
« Reply #110 on: 2016.September.06. 22:30:54 »
unfortunately the mouse has strange behaviour on XEP at me, MOUSE.XR works like mouse not attached, the cursor goes to the bottom right corner, I tried SWAP, there the pointer moves, but bit abnormally. [ Guests cannot view attachments ]

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: Universal Mouse Driver
« Reply #111 on: 2016.September.07. 00:20:25 »
You have to set EnterMice emulation on Xep128 config file. " mousemode = 4"

Then "set 189, 4" on Basic.


Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: Universal Mouse Driver
« Reply #112 on: 2016.September.09. 02:58:16 »
I have at last fixed the errors when changing modes or the video page is closed. New beta version on the message above.

Also the underline pointer on text 80 has been moved 1 pixel higher for better view.

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

Now I have to find a way to interact with the Editor when clicking.

When found I'll implement a new Mouse command to automatically open a mouse channel on video channel 102.

Typing something like ":MOUSE EDITOR" will serve to have an active mouse pointer on Basic, WP or Exdos.

But prettier names for the command are accepted.....

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: Universal Mouse Driver
« Reply #113 on: 2016.September.09. 12:11:27 »
But.... the command may be insufficient, It can be tedious to type the command on every Editor session.

I have a better idea: with the mouse driver installed and once inside an application, only a left click will activate it if no other mouse channel is open. Or if the two main buttons are clicked at the same time. This is possible because even without an opened  channel, the driver is still accepting interrupts, and then it can check key clicks all the time.

Of course this can collide with other programs that open a text page without using the editor. I have to study how to implement it.

Offline geco

  • EP addict
  • *
  • Posts: 7069
  • Country: hu
    • Támogató Támogató
Re: Universal Mouse Driver
« Reply #114 on: 2016.September.09. 20:29:11 »
It is a good idea :-)
Thx , i will try to modifiy the config file.

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: Universal Mouse Driver
« Reply #115 on: 2016.September.21. 16:23:40 »
Now that EP128emu emulates EnterMice, I can put here a snapshot. Obviously it will only work on the beta version.

It shows how a mouse pointer can work on a text video page. Observe the red characters at the left. When the mouse pointer and the Editor cursor collide that is what happens. But that is only seen on the screen, not saved on the Editor buffer. If the screen is scrolled the artefacts disappear. Better don't move the two controllers near at the same time.

You can also test Text 80 mode, simply type "text 80"+enter and then "run"+enter.

Still I've not figured out how to inject a escape sequence to the Editor channel(esc+=+Y+X).

The structure of the channel descriptor is not on the EXDOS Technical Information, so I am a little lost...

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: Universal Mouse Driver
« Reply #116 on: 2016.September.23. 23:53:37 »
I have promoted the mouse driver to 1.102.

The changes are:


-The velocity fix introduced on version 1.1 by Boxsoft didn't had protection  against verbose and  that produced jumps to the pointer on some extreme cases. I want to thank IstvanV for detecting the error and fixing it himself.

-The newly implemented text modes don't produce big problems to the editor modes, so they will remain as definitive. Later I can change the aspect of the underline hi-res pointer if requested. The low-res pointer uses character 127, so it can be redefined.

-A new  check every 5/50 sec of pointer idling has been implemented to test if the video page has been modified. This protects the mouse channel from drawing the pointer out of the video page. The protection is partial, as it only checks the very first LPT line of the video page associated to the mouse channel, but will suit most normal cases. This system works on all video modes, allowing scroll on text modes.

I am still searching for a way to print escape sequences on the Editor channel while on interrupt.... It will allow the use of the mouse on every application that uses the Editor.

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: Universal Mouse Driver
« Reply #117 on: 2016.September.29. 08:02:02 »
With the aid of Epdos commands CHANS and DEVS, I have figured out how can I force the Editor coordinates when inside the mouse driver interrupt.

The descriptions given by the commands, and also the information inside the EXOS disassembly pdf, have convinced me to emulate the little routine that is executed when the "ESC+=" escape sequence is written to the Editor channel.

The problem is that I must emulate the original Editor driver and also the modified Editor driver that is installed with the language Roms.

The original ones manage their variables on fixed memory  address on segment FF, different for Exos 2.0 and 2.1, while the modified Editor driver works with a relocatable memory area. Of course I will discard the Exos 2.0 version, because the mouse driver doesn't work on earlier Enterprise.

As a curiosity, I have found that on Exdos 2.0 the system channel numeration begins on 97h(151), while on the definitive versions it begins on 65h(101).
« Last Edit: 2016.September.29. 08:06:18 by gflorez »

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: Universal Mouse Driver
« Reply #118 on: 2016.September.30. 10:52:10 »
The EnterMice wiki has been updated.

Now there is a brief mention to the new text modes. For now I am not putting more because they are still evolving. I hope to change soon the hi-res underline cursor to the same character than on low-res mode. Then, as an added bonus, both pointers will be redefinable on the same character 127. Even I can redefine it as an arrow inside the driver.

I have reduced the warning about closing the mouse channel if the video page changes or is closed, as now the driver auto-checks and deactivates by itself.

Also I have put the superb EP128emu on the emulators chapter.

Offline pear

  • EP lover
  • *
  • Posts: 825
  • Country: pl
  • Z80 only
    • Támogató Támogató
Re: Universal Mouse Driver
« Reply #119 on: 2016.September.30. 17:05:04 »
Polish version was updated.