Welcome, Guest. Please login or register.


Author Topic: BoxSoft Mouse Interface (Read 72452 times)

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: BoxSoft Mouse Interface
« Reply #135 on: 2014.November.20. 12:45:36 »
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....
« Last Edit: 2014.November.22. 01:25:35 by gflorez »

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: BoxSoft Mouse Interface
« Reply #136 on: 2014.November.21. 12:58:33 »
I'm thinking that since the PS / 2 mice reading gives too high values to be pixel accurate and, as PS/2 mices have already the velocity built inside, I could divide the data by two, the inverse of what the modification 1.1 does.

But, how can I fast divide by two or four a twos complement?

I have planed it preserving bit 7 and doing one or two right shifts pushing at the left some 0's on the positives or 1's on the negatives.
« Last Edit: 2014.November.22. 01:24:48 by gflorez »

Offline BruceTanner

  • EP lover
  • *
  • Posts: 607
  • Country: gb
Re: BoxSoft Mouse Interface
« Reply #137 on: 2014.November.21. 13:11:04 »
But, how can I fast divide by two or four a twos complement?

I have planed it preserving bit 7 and doing one or two right shifts pushing at the left some 0's on the positives or 1's on the negatives.

You need SRA r - that's exactly what it does! (Shift Right Arithmetic). Compare with SRL r, Shift Right Logical, which always shifts zeros in.

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: BoxSoft Mouse Interface
« Reply #138 on: 2014.November.21. 13:15:50 »
Ok thanks...

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14723
  • Country: hu
    • http://enterprise.iko.hu/
Re: BoxSoft Mouse Interface
« Reply #139 on: 2014.November.22. 00:26:58 »
Disassembly of ALL MOUSE.XR versions.

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: BoxSoft Mouse Interface
« Reply #140 on: 2014.November.22. 01:23:53 »
Great!, it gives me more clues to understand how it works. For me the best is the 1.1. I'll modify it soon to work with my PS/2 adapter...

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: BoxSoft Mouse Interface
« Reply #141 on: 2014.November.22. 01:32:17 »
The only drawback I see to Mouse.xr: it hardly can work with turbo machines, the delays on the reading routine must be modified.

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14723
  • Country: hu
    • http://enterprise.iko.hu/
Re: BoxSoft Mouse Interface
« Reply #142 on: 2014.November.22. 09:14:21 »
The only drawback I see to Mouse.xr: it hardly can work with turbo machines, the delays on the reading routine must be modified.
Yes, it is true.

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: BoxSoft Mouse Interface
« Reply #143 on: 2014.November.22. 22:55:28 »
I've made three modifications to the 1.1 driver, auto-link, swap coordinates and two SRA,a instead of ADD a,a. Now it is completely quiet in its behaviour...... except when I move it excessively quick, as it loses track.

But I think it is a problem of the PS/2 converter, not from the driver nor my "fixes", it acts the same with the unmodified driver.

Still waiting for the Eprom programmer.
« Last Edit: 2014.November.23. 15:32:49 by gflorez »

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: BoxSoft Mouse Interface
« Reply #144 on: 2014.November.23. 11:46:37 »
I forgot to put an auto-link Mouse11.xr. For the Neos mouse only.
« Last Edit: 2014.November.23. 15:34:41 by gflorez »

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: BoxSoft Mouse Interface
« Reply #145 on: 2014.November.26. 08:50:33 »
At last I got the PIC programmer.

Now I have the code from inside the PS/2 adapter and...... surprisinly  it's  exactly the same as the Brasilian project, modified from the Japanesse one.....

So Kevin Mount lied me and he borrowed that code and project as his.....? I don't know.

Now is time to study some PIC assembler....

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: BoxSoft Mouse Interface
« Reply #146 on: 2014.November.29. 18:24:45 »
I possibly could(?:oops: ) change the content of my adapter, but I wonder: will not be better to use the adapter described on the MSX.org blog?

It is a super easy project based on a very small and cheap Arduino, and it has support for wheel and four more buttons. In addition the programming is already made according to the standard created by Prodatron and Nyyrikki in MSX.org.

The basic Boxsoft+adapter can be rapidly accessible for all and then everybody will enjoy SimbOS better...
« Last Edit: 2014.December.02. 12:10:11 by gflorez »

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: BoxSoft Mouse Interface
« Reply #147 on: 2014.November.29. 18:35:38 »
I forgot to say that the protocol is backwards compatible with the original MSX standard, so  EGI and Paintbox will continue working.


Edit: Mouse.xr has to be modified to be able to read the  adapter  but SymbOS will read it directly.
« Last Edit: 2014.December.01. 09:34:22 by gflorez »

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: BoxSoft Mouse Interface
« Reply #148 on: 2014.December.05. 17:22:18 »
I've found that the Neos mouse was very popular in MSX computers but with other faces:

http://www.old-computers.com/museum/hardware/Yamaha_Mouse_s1.jpg
http://www.old-computers.com/museum/hardware/Yamaha_Mouse_s2.jpg

http://i.imgur.com/Vkosc.jpg
http://i.imgur.com/qhAMz.jpg

http://www.bastilborghs.nl/images/Hardware%20pictures/VZ1931.jpg

Even the buttons of the Roland Mu-1(also a MSX mouse) or Phillips SBC 3810 reminds the Neos:

http://myweb.tiscali.co.uk/clouzeau/s760/images/mu1.jpg
http://www.bastilborghs.nl/images/Hardware%20pictures/SBC3810.jpg

Once upon a time the CPCs had a MSX mouse adapter like the C64(Mouse Cheese) and the Enterprise(Boxsoft):

http://fotos.miarroba.com/fotos/4/2/4267f422.jpg



Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: BoxSoft Mouse Interface
« Reply #149 on: 2014.December.07. 00:10:39 »
It's funny. Here is described the protocol of the CPC-Mousepack 2.0.
(other names:Gerdes Mouse, Centaure mouse, ASS Reis-Mouse or Reisware-Mouse)

It is exactly the MSX protocol but they(the people who wrote the page) don't know it. The four nibbles are read from one adapter that mimics pressing the keyboard rows. Almost like the Boxsoft adapter on the Enterprise...
« Last Edit: 2014.December.07. 16:37:56 by gflorez »