Use ~10€ to connect modern mouse to MSX

Pagina 5/18
1 | 2 | 3 | 4 | | 6 | 7 | 8 | 9 | 10

Van NYYRIKKI

Enlighted (5615)

afbeelding van NYYRIKKI

05-01-2014, 15:08

Ok, then we have a plan! Just to clear out things, I write data format down in detail once again:

- All the bits that are discussed here are actually inverted when talking to hardware! (Because originally also DX & DY are inverted)
- If bytes 3/4 are not read within 3000 microseconds (counting starts from reading of 1st byte) mouse will return 1st byte on next read.
- Data is sent out 1 nibble at a time using pin 8 as clock (just like in original mouse protocol) Minimum time between clocks is 0.18 microseconds.

Byte 1: X-axis signed delta (Original protocol)

Byte 2: Y-axis signed delta (Original protocol)

Byte 3 high nibble = ID nibble: (bits 7-4) = 0001
bits 7 & 6 are "00" for MSX-BIOS mouse identification
bits 5 & 4 are "01"for "PS/2 protocol" identification

Byte 3 low nibble = Button nibble:
bit 3 : 0 = Unused, reserved for future (to expand ID or to support additional button)
bit 2 : 5th mouse button: 0=Not pressed, 1=Pressed
bit 1 : 4th mouse button: 0=Not pressed, 1=Pressed
bit 0 : 3rd button (wheel button): 0=Not pressed, 1=Pressed

Byte 4: Z-axis signed delta

----

Your idea of "game controller"-protocol also sounds good, but let's take one step at a time Nishi

Van sd_snatcher

Prophet (3367)

afbeelding van sd_snatcher

05-01-2014, 15:56

I just ask you to be careful when trying to change the protocol, because while working on joylib and joystest I discovered that both MSX and Sega used a common standard for joyport devices detection that lasted until the Sega Saturn. There are very few collisions between the two worlds (just the Megadrive Mouse vs MSX-Mouse for now), but the rest is mostly well designed and respected. Some X68000 and PC98 devices seems to also follow this standard. This is probably what allowed the Micomsoft's XE-1AP to be compatible with all those systems.

Take a look at this thread for a simple tool that dumps the device signature.

This compatibility allows many Sega devices to be connected and detected to the MSX without trouble, just requiring a simple pinout adapter. Here's the list of device signatures so far:

#00 ; MSX-Mouse or Sega-Mouse (Megadrive)
#88 ; MSX-Trackball
#3f ; Megadrive Multi-tap
#cf ; Saturn standard pad
#11 ; Saturn 3-Line protocol device
#9D ; MSX-Touchpad
#DD ; MSX-Touchpad
#EE ; Arkanoid pad ***Check this on real hardware
#0B ; Saturn mouse

I still don't know the signature of the Micomsoft XE-1AP, as I never had any in my hands.

The signatures are also used by the MSX-BIOS to ignore a incorrect device when using a BIOS routine for another device. For example, mouse, trackball and touchpad are ignored when using the joystick or touchpad routines. Games that read the joystick port directly normally suffer from the protocol differences, forcing the user to disconnect the mouse/touchpad/whatever while playing the game. This another example of how important is to use the MSX-BIOS instead of direct access. This allowed the vast expansibility and flexibility that the entire system has.

A very good English documentation about the joystick standard, the communication protocol and detection can be obtained on the Sega SMPC User's Manual, available here. I don't know if there were other English docs about this. Probably they're all in Japanese, as most other MSX documentation that we don't already have.

If you're going to extend the protocol, try to follow the guidelines detailed in the Sega SMPC document.

Van NYYRIKKI

Enlighted (5615)

afbeelding van NYYRIKKI

05-01-2014, 16:32

@SD-Snatcher
We are taking very good care of expanding the standard in a way that it will not cause problems with other MSX-devices (Trackball) or existing mouse support in MSX-programs. This makes it possible for the mouse to act not only as 5-button + wheel mouse but also as normal mouse and as Joystick as well ! (Yes, using MSX-BIOS you can read both Joystick and mouse information from the same port, in same program & without problem)

The process is very similar to ie. 6-button Sega PAD, so I can't imagine that it would cause problems on that platform either. (Although Sega software does not support even normal MSX-mouse now) I also think that the new protocol will work with MSX-mouse enabled Roland synthesizers without problem. How ever we can't tell for sure until some tests have been completed.

Van sd_snatcher

Prophet (3367)

afbeelding van sd_snatcher

05-01-2014, 17:10

No problem. I wasn't arguing against the protocol expansion, but only wanted to contribute with the information I already had at hand. Smile

For example, you asked if Symbos should read 2 or 4 bytes. That info is described in the Sega SMPC doc.

BTW, I would like to suggest one improvement to the protocol: To add overflow flags for each direction, just like the Sega Saturn Mouse has.

Van NYYRIKKI

Enlighted (5615)

afbeelding van NYYRIKKI

05-01-2014, 18:30

sd_snatcher wrote:

BTW, I would like to suggest one improvement to the protocol: To add overflow flags for each direction, just like the Sega Saturn Mouse has.

If you ask me: No, not gonna happen!
Why would I like to use a bit to tell that everything went wrong? I could use that bit to make sure it will not!
I can agree that if something like this happens (not very realistic) the last values on each direction can be agreed as overflow conditions, but I don't want to give a whole bit for that purpose.

Van Prodatron

Paragon (1789)

afbeelding van Prodatron

06-01-2014, 00:33

@SD_snatcher: Thanx for the info, this ID stuff is really interesting! (unfortunately I am not an MSX "native", so that was new for me)

Regarding Overflows:
On the Amstrad we handle overflows for the PS/2 mouse in this way:
- if the delta is too big, the maximum delta will be sent and the remaining value is stored and then added to the next delta. So on Z80 side you never have to take care about overflows, on controller side big values won't get lost (just will arrive with a little delay) and on protocol side you don't "waste" any bits.

Anyhow... Are we fine now with the last version of the PS/2 protocol?

Van sd_snatcher

Prophet (3367)

afbeelding van sd_snatcher

06-01-2014, 01:06

Ok! This approach for the overflow seems very good, indeed. Smile

Van NYYRIKKI

Enlighted (5615)

afbeelding van NYYRIKKI

06-01-2014, 01:51

Prodatron wrote:

Anyhow... Are we fine now with the last version of the PS/2 protocol?

If you ask me, Yes! go, go!!! Smile

Van Prodatron

Paragon (1789)

afbeelding van Prodatron

06-01-2014, 17:27

Ok, I am reactivating the MSX development environment now Smile Hope to have something until the weekend.

Van edoz

Prophet (2302)

afbeelding van edoz

06-01-2014, 17:50

Prodatron wrote:

Ok, I am reactivating the MSX development environment now Smile Hope to have something until the weekend.

Super! If I remember correctly you still have the driver problems on the MSX ? Or are those solved ? You told me last year there was something about that ?

Pagina 5/18
1 | 2 | 3 | 4 | | 6 | 7 | 8 | 9 | 10