Thanks for documenting this approach FRS, it seems pretty useful!
I guess I kind of get the confusion about the term MSX-HID, since I’ve seen it thrown about a couple of times here and never really knew what that was about (since I didn’t remember it from the old days). Good that there’s a wiki page about it now! It seems quite a nice unified approach to detection.
Long ago I added is-it-mouse-or-joystick detection to a project with this kind of method. There I also un-detected the mouse automatically when it moved precisely 1 pixel towards the bottom right (iirc) for several consecutive frames. Is connection loss detection maybe also a topic worth exploring?
Speaking of the devil, I have another example - I hope less controversial - of an innacurate term on that wiki page: The word PWM is being used to categorize the devices that acts like the standard MSX paddle, but while the monostable inside the paddle _do_ respond to a pulse with a variable time, it _does_not_ modulate a cyclic wave. Another term, more exact, would fit better, like "Time Encoded" or "Variable Pulse Width" devices.
Indeed PWM is incorrect term in this case... fixed. I selected "Time encoded" as "Variable Pulse Width" is longer and also makes me think of servos... Here we anyway talk about single triggered pulse.
I guess I kind of get the confusion about the term MSX-HID, since I’ve seen it thrown about a couple of times here and never really knew what that was about (since I didn’t remember it from the old days). Good that there’s a wiki page about it now! It seems quite a nice unified approach to detection.
I think the reason is that the "MSX-HID" is not much older than the wiki-page it self:
The goddam thing needed a name, otherwise it's not even possible to create an article.
I must say I already did consider changing the article name to something more easy to find, like "Detecting devices in joystick port", but I think I already wrote so much of the page again that at least for now I just didn't want to hijack the name as well.
Thank you all for the improvements on the wiki article. When written by only one person, there's always a risk that the choice of words will be interpreted in an unexpected way by someone else.
About the name, I would prefer to retain it. Otherwise it will a PITA to write any documentation. It's way easier to write something like "use MSX-HID to detect" and "this device is MSX-HID compatible" than "use that detection method that clocks the pin-8 then reads the fingerprint, and is described on the MSX-Wiki" and "this device can be detected by that method that clocks the pin-8, then reads the fingerprint and is described on the MSX-Wiki".
I was a little confused about MSX-HID before. I mean, wow, when was this standard introduced on MSX? On PC, HID standard came late 1990's...
This conversation clarified a lot, and the wiki page is better now.
Interesting beast this "general purpose port". I have an old cassette game called Maxima, that doesn't read joystick on my Yamaha CX5MII. On my other MSXs that works. Also the port works with other games. Maybe this subject needs another thread...
The joystick common pin must be connected to the pin-8. It was designed this way to allow for detection and interoperability with other devices. If wired incorrectly, detection will fail. For example, GTPAD will incorrectly detect such a badly wired joystick as a mouse or trackball depending on the combination of buttons being pressed.
Remember: those are not only joystick ports. The standard calls then “General Purpose I/O ports” for a reason.
Yes but we speak about joystick, not about other devices. We can't connect other devices at same time on the same port.
I don't want to reopen the debate, but when I recently read the article on MSX-HID, I didn't understood that it was empirical results. The name sounds very official and I thought it was a standard from the MSX era. Maybe the introduction could clarify it. I won't insist; reading this thread made it clear to me. ^^
That being said, I have a question about how this detection method works. I'm a dummy in electronics so I don't understand all these references to pins and their high/low values.
I just added mouse support in MSXgl and saw that there was a special timing to write to PSG's register R#15 to get two 8-bit values via 4 nibble reads through R#14.
The MSX-HID article talks about byte1, byte2 and byte3; is this the result of reading R#14 with bits #4 or #5 set to 1 in R#15 and then reading twice with those bits reset?
What timing is needed between the readings? The same as for the mouse?
(about 420 z80-cycle to re-initialize the device and 140 between each reading)
I tried to read the FRS's HIDtest detection code, but it's really hard for me to understand.
I fully agree, when I first read the article I was also confused with this "HID" thing that didn't seemed to be explained. When I found this thread I understood that "MSX-HID" is a term invented by the article writer for the sake of the discussion and just referrers to detecting signatures of standard MSX input devices in general. Judging by what others have said in this thread I'm not alone in being confused by this, so I think this should be stated clearly in the article, otherwise the readers will probably tear out their hair when looking through the MSX redbook for "HID".
I don't think "fingerprint" is any more clear than "signature" though, both are commonly used terms for these kinds of things.
I added the remark.
Although this trick is not very reliable, you can use it provided you do not rely 100% on it. That is to say, launch the auto-detection of the mouse and then still ask the user the question if it is not detected or the confirmation when detected.
You will tell me that you will save memory by asking the question directly and you will be right, but it looks more professional when the peripherals are autodetected.
Yes, it sound interesting to set default setting in a application that support more than one type of device for example. Or display warning message.
Still, I'm not sure how I'm suppose to get those numbers. ^^
- Write R#15 with 'pulse' set, then read R#14 three times?
- Write R#15 with 'pulse' set, read R#14 once, reset R#15 'pulse', then read R#14 twice?
And what about the timing between those access?
Datapack talks about it here :
http://ngs.no.coocan.jp/doc/wiki.cgi/datapack?page=3%BE%CF+%...
(see 3.7.2 カウンタモード) :
And here is an extract from the Pratique du MSX (which says almost the same thing in French) :