Welcome, Guest. Please login or register.


Author Topic: BoxSoft Mouse Interface (Read 44284 times)

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13718
  • Country: hu
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 32.0 Firefox 32.0
    • View Profile
    • http://enterprise.iko.hu/
Re: BoxSoft Mouse Interface
« Reply #60 on: 2014.October.14. 16:34:17 »
No, you read all switches in one row with an "IN A, (port)". isn't it?
No, you can't do this on Enterprise.

Offline Z80System

  • EP addict
  • *
  • Posts: 3939
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 37.0.2062.124 Chrome 37.0.2062.124
    • View Profile
Re: BoxSoft Mouse Interface
« Reply #61 on: 2014.October.14. 16:43:45 »
Quote
What you want.
Mouse put 4 bit to the joy 4 direction wire.
4 bit is stand.
You can read 0,1,2,3. Or 3,2,1,0. Or 0,3,2,1 Or 2,3,1,0 Or...

Do you think mouse or boxsoft ? Cause I speak boxsoft<->EP ...

But okay, I will know which direction (bit) EP wants from me from 4 bits (without the order, I would not like to probe all combinations ...:)),

But how do I know which 4 bit is the actual one ? Which 4 bits of which byte in the message ?
Z80 System

Offline Z80System

  • EP addict
  • *
  • Posts: 3939
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 37.0.2062.124 Chrome 37.0.2062.124
    • View Profile
Re: BoxSoft Mouse Interface
« Reply #62 on: 2014.October.14. 16:47:18 »
I will not have a real MSX mouse, converting the 4 bits only ...

My mouse will be ps/2, I have to give the "bytes" in the protocol, too ...
Z80 System

Online gflorez

  • EP addict
  • *
  • Posts: 2931
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 32.0 Firefox 32.0
    • View Profile
Re: BoxSoft Mouse Interface
« Reply #63 on: 2014.October.14. 17:09:51 »
Ok, ok I've mistaken the System joystick call(that returns all the bits in a row) with the real joystick reading. Sorry

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13718
  • Country: hu
  • OS:
  • Unknown Unknown
  • Browser:
  • Opera 9.80 (Opera Mini 7.6.35843) Opera 9.80 (Opera Mini 7.6.35843)
    • View Profile
    • http://enterprise.iko.hu/
Re: BoxSoft Mouse Interface
« Reply #64 on: 2014.October.14. 17:15:18 »
Do you think mouse or boxsoft ? Cause I speak boxsoft<->EP ...
Boxsoft don't do anything conversion with the mouse signals, just electricialy interfacing it. If anything output on 'Left' wire on mouse you can read as 'Left' direction of EP joy port.
You can also connect Amiga or Atari ST mouse to the Boxsoft interface, will work. (Just need a full CPU power for handle it, then practicaly not useable with EP)

Offline Z80System

  • EP addict
  • *
  • Posts: 3939
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 37.0.2062.124 Chrome 37.0.2062.124
    • View Profile
Re: BoxSoft Mouse Interface
« Reply #65 on: 2014.October.14. 17:23:56 »
Quote
Boxsoft don't do anything conversion with the mouse signals, just electricialy interfacing it. If anything output on 'Left' wire on mouse you can read as 'Left' direction of EP joy port.
You can also connect Amiga or Atari ST mouse to the Boxsoft interface, will work. (Just need a full CPU power for handle it, then practicaly not useable with EP)

Okay ... but see from my side ...

I am the microcontroller connected to the EP,
I have relative mouse coordinates from the PS/2 mouse,

EP wants from me 4 bit of the information at once (responding to the direction wires),

but how do I know wich 4 bits of the X,Y relative mouse coordinates required just now ?
Z80 System

Online gflorez

  • EP addict
  • *
  • Posts: 2931
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 32.0 Firefox 32.0
    • View Profile
Re: BoxSoft Mouse Interface
« Reply #66 on: 2014.October.14. 18:42:39 »
Z80System. Now I understand. You need how and where the information flows, the protocol inside.

Then you must read and understand the Mouse.xr disassembly.....

Online gflorez

  • EP addict
  • *
  • Posts: 2931
  • Country: es
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 32.0 Firefox 32.0
    • View Profile
Re: BoxSoft Mouse Interface
« Reply #67 on: 2014.October.14. 23:42:17 »
I've disassembled the PIC16F628A code of the ps2 to MSX proyect, but I hardly can understand it....

Offline lgb

  • EP addict
  • *
  • Posts: 3535
  • Country: hu
  • æðsta yfirmaður
  • OS:
  • Linux (Ubuntu) Linux (Ubuntu)
  • Browser:
  • Firefox 32.0 Firefox 32.0
    • View Profile
    • http://lgb.hu/
Re: BoxSoft Mouse Interface
« Reply #68 on: 2014.October.15. 01:17:29 »
As far as I can remember (when I wrote the support for JSep to emulate boxsoft mouse interface): writing to port B7 bit 1 should change its value, which triggers the interface to provide the next "half byte" (that is, 4 bit), since MSX mouse seems to support this 4 bit thing stuff. The order is something like this: high nibble of X motion (motion = 8 bit signed value of the motion since the last read or such, provided in two 4 bit chunks/nibbles/half bytes), low nibble of X motion, high nibble of Y motion, low nibble of Y motion. With the mentioned "strobe" signal, you can "step" which one you want to read. Now, how you can read your 4 bits then? Use port B5 you would use as with keyboard too to select the bit within the current "half byte" you want to examine. And then, read port B6. It will give the state of the selected bit of the current 4 bit of the 8 bit movement of the X/Y :D Madness, I must to say. So, reading B6 port, bit 0 is the final result. Bit 2 gives the state of the mouse button, for me it seems it does not depend on the selection but always (?) but I am not sure. At least I emulate button this way in JSep and it seems working.

I am not sure this is what you are interested in, or not and I should go back to sleep :)

Offline Z80System

  • EP addict
  • *
  • Posts: 3939
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 37.0.2062.124 Chrome 37.0.2062.124
    • View Profile
Re: BoxSoft Mouse Interface
« Reply #69 on: 2014.October.15. 07:48:54 »
Quote
I am not sure this is what you are interested in, or not and I should go back to sleep :)

Yes, I was interested in this,
and more.

I think you left out wich bit (or value) in a b5 port write (alias joystick direction) is wich bit of the 4 bit "half byte" ... there are many combinations,

and I do not know an other thing, too:

You specified the order of the "half bytes" like XHigh,XLow,YHigh,YLow ... but its a looped thing ...

When I'm a microcontroller, I know the order, which one to send after which one, okay,
but I do not know "when the first is", or "which are just now" ...

So, I just turned on the EP, mouse.xr starts run, reading XH,XL,YH,YL again XH,XL,YH,YL again XH,XL,YH,YL again XH,XL ...
and NOW, I connected the converter (the boxsoft, or my microcontroller thing), mouse.xr will want to read YH next, because that is the next in its order,

how will I know which one is wanted by mouse.xr ?

When I know it, I will know the next one from the order ... But what is the current, at the connectiong of the interface ?
« Last Edit: 2014.October.15. 07:52:09 by Z80System »
Z80 System

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13718
  • Country: hu
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 32.0 Firefox 32.0
    • View Profile
    • http://enterprise.iko.hu/
Re: BoxSoft Mouse Interface
« Reply #70 on: 2014.October.15. 08:14:46 »
So, I just turned on the EP, mouse.xr starts run, reading XH,XL,YH,YL again XH,XL,YH,YL again XH,XL,YH,YL again XH,XL ...
and NOW, I connected the converter (the boxsoft, or my microcontroller thing), mouse.xr will want to read YH next, because that is the next in its order,
Please think in 1980' years: everything needed to be connected before computer power on! These not a USB plug and play days :-)

Online gflorez

  • EP addict
  • *
  • Posts: 2931
  • Country: es
  • OS:
  • Linux Linux
  • Browser:
  • Firefox 33.0 Firefox 33.0
    • View Profile
Re: BoxSoft Mouse Interface
« Reply #71 on: 2014.October.15. 08:16:11 »
I think that pic disassembly has all the clues you need. Is very short but it contains the PS/2 and the MSX parts, and how they interact.

It is worth to study some pic asembler.

And don't worry for the EP part, as Mouse.xr already knows how to read a MSX mouse.
« Last Edit: 2014.October.15. 08:23:26 by gflorez »

Offline Z80System

  • EP addict
  • *
  • Posts: 3939
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 37.0.2062.124 Chrome 37.0.2062.124
    • View Profile
Re: BoxSoft Mouse Interface
« Reply #72 on: 2014.October.15. 08:44:32 »
Quote
Please think in 1980' years: everything needed to be connected before computer power on! These not a USB plug and play days :-)

Are you sure about this ?

There can be a simple way to signal a "message start", for example two strobe signal close to each other in time, or such ...

In your case anyway, when you connect the boxsoft stuff into a working EP (with a running mouse.xr), the mouse have to work wrong ...
Z80 System

Offline Z80System

  • EP addict
  • *
  • Posts: 3939
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 37.0.2062.124 Chrome 37.0.2062.124
    • View Profile
Re: BoxSoft Mouse Interface
« Reply #73 on: 2014.October.15. 08:46:32 »
Quote
It is worth to study some pic asembler.

I am not really a reverse engineer type of guys ... I do that only when I have to ...

If lgb knows the answers, those will be good for me ... :)
« Last Edit: 2014.October.15. 11:34:23 by Z80System »
Z80 System

Offline BruceTanner

  • EP lover
  • *
  • Posts: 515
  • Country: gb
  • OS:
  • Windows NT 6.3 Windows NT 6.3
  • Browser:
  • Chrome 37.0.2062.124 Chrome 37.0.2062.124
    • View Profile
Re: BoxSoft Mouse Interface
« Reply #74 on: 2014.October.15. 11:22:14 »
Please think in 1980' years: everything needed to be connected before computer power on! These not a USB plug and play days :-)

The cartridge hardware was designed to be hot-swappable - that is why the power "fingers" on the edge connector are longer than the others (power is connected first/disconnected last). But because BASIC ended up using the cartridge this turned out not to be useful :oops: But you have probably noticed when at the "ok" prompt you can unplug the cartridge and plug it back in again and then just continue as though nothing had happened (as long as you have nothing else in the cartridge ROM with interrupt code!)