I'm not totally figured out the driver, but in my humble opinion, it is very well created.
It has all its variables inside, doesn't need to allocate memory, but then it can´t be converted to a Rom unless it is rewritten.
Basically is an EXOS device, and what the routine does is to Link it to the system, providing a "Device Descriptor" as explained in the Kernel Specification chapter 6.2.
Then Mouse.xr has all the entry points of a device, although some aren't used.
The most important one is Interrupt, that executes a mouse read and a redraw every 50Hz, provided that a mouse channel has been Open-ed, another of the valid entries of the driver. To do the task in this little time, the different positions of the cursor in the screen coordinates have been pre-calculated for the three most used graphics modes, 1, 5 and 15. The other modes return the 221 error: *** Invalid video mode.
To use another interface, I've seen it's better to modify the sub_c3c8 call, as is there from where the computer synchronizes with and reads the Neos mouse.
sub_C3C8:
;Joysticks
ld a, (byte_C680) ;input device, EXOS variable 189, default 3
cp 1
jp z, loc_C32A ;go to external joystick 1 reading
cp 2
jp z, loc_C32F ;go to external joystick 2 reading
or a
jp z, loc_C325 ;go to internal joystick reading
;Here begin the Neos mouse reading, "byte_C680"=3
ld hl, byte_C685 ;first byte
ld a, 2 ;RTS low
out (0B7h), a
ld b, 8 ;long delay
call sub_C46E
call sub_C4A0 ; read four higher bits
rld ;push them in (HL)
xor a ;RTS high
out (0B7h), a
ld b, 5 ;short delay
call sub_C46E
call sub_C4A0 ;read four lower bits
rld ;push them in (HL)
ld hl, byte_C686 ;second byte
ld a, 2 ;RTS low
out (0B7h), a
ld b, 5 ;short delay
call sub_C46E
call sub_C4A0 ;read four higher bits
rld ;push them in (HL)
xor a ;RTS high
out (0B7h), a
ld b, 5 ;short delay
call sub_C46E
call sub_C4A0 ;read four lower bits
rld ;push them in (HL)
xor a
out (0B5h), a
in a, (0B6h)
and 4 ;state of the alternate Fire key saved on "byte_C67F"
srl a
srl a
xor 1
ld (byte_C67F), a
call sub_C4B1 ;this is the "corrections and drawing" routine where the "velocity" 1.1 modification was made
ld a, (byte_C685)
ld c, a
ld a, (byte_C686)
or c
ret
Then, if you put some value in "byte_C685" and "byte_C686" they are added to the actual position of the pointer. I think if I swap them I can fix the bad orientation of my PS/2 to MSX mouse adapter. I will try....