Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: USB vs PS/2 vs COM vs LPT  (Read 101056 times)

0 Members and 1 Guest are viewing this topic.

SavannahLion

  • Wiki Contributor
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5986
  • Last login:December 19, 2015, 02:28:15 am
Re: USB vs PS/2 vs COM vs LPT
« Reply #120 on: September 25, 2010, 11:08:23 am »
Awww come on guys the is the funniest thing I've seen in a while :jerry

Oh what the hell. Driver is a moron anyways.

 :jerry :jerry :jerry

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #121 on: September 25, 2010, 11:16:14 am »
Actually I found something there...
http://msdn.microsoft.com/en-us/library/ms645546(v=VS.85).aspx

Quote:
- "In this sample, an application wants raw input from the keyboard and mouse but wants to ignore legacy window messages (which would come from the same keyboard and mouse). "

Code: [Select]
RAWINPUTDEVICE Rid[2];
       
Rid[0].usUsagePage = 0x01;
Rid[0].usUsage = 0x02;
Rid[0].dwFlags = RIDEV_NOLEGACY;   // adds HID mouse and also ignores legacy mouse messages
Rid[0].hwndTarget = 0;

Rid[1].usUsagePage = 0x01;
Rid[1].usUsage = 0x06;
Rid[1].dwFlags = RIDEV_NOLEGACY;   // adds HID keyboard and also ignores legacy keyboard messages
Rid[1].hwndTarget = 0;

if (RegisterRawInputDevices(Rid, 2, sizeof(Rid[0])) == FALSE) {
    //registration failed. Call GetLastError for the cause of the error
---end quote


Do you notice the word "IGNORE", and the sentence "which would come from the same keyboard and mouse".

Obviously legacy input is still there, sure you can "ignore" it too, as you will, but that will not make it go away.

newmanfamilyvlogs

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1694
  • Last login:June 15, 2022, 05:20:38 pm
    • forum.arcadecontrols.com/index.php/topic,103584.msg1096585.html#msg1096585
    • Newman Family Vlogs
Re: USB vs PS/2 vs COM vs LPT
« Reply #122 on: September 25, 2010, 11:18:36 am »
http://www.microsoft.com/whdc/archive/usbhost.mspx?pf=true#usbh1
Quote
The time line in Figure 1 starts with a power-up (cold boot) event on the PC.
•   
Immediately after power-up and for some period of time, the BIOS controls the PC and the host controller. During this time interval, a user should be able to use a USB keyboard to enter BIOS Setup and then use all keys on the USB keyboard that are valid during BIOS Setup.
•   
If the user does not choose to enter BIOS Setup, at some point the BIOS starts the operating system and the operating system takes control of the PC and the host controller. As shown in Figure 1, code in a routine in the operating system host controller driver performs the necessary steps to hand off control of the legacy keyboard support function from the BIOS to the operating system host controller driver (in this article, that routine is called StopBIOS).
•   
The next event shown in Figure 1 occurs when the user employs the Shutdown menu to shutdown to MS-DOS. This causes the host controller driver to be unloaded; before unloading it executes a routine that performs the necessary steps to hand off control of the legacy keyboard support function to the BIOS (in this article, that host controller driver routine is called StartBIOS).


This kinda looks like it.

Derrick Renaud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:December 06, 2024, 04:31:44 pm
Re: USB vs PS/2 vs COM vs LPT
« Reply #123 on: September 25, 2010, 11:24:18 am »
 :banghead:

I give up.  You are right.  BIOS has supported multiple keyboards since day 1. Everything goes through the BIOS, even though Windows shuns programs using it.  It has nothing to do with old APIs being provided from new APIs.  I imagine when they make new APIs it is for the sole purpose of wrapping the old APIs in a new layer of confusion that provides no benifit.

Thanks for making me see the light.  I will now move on to more important things.
D.

 :cheers:

Derrick Renaud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:December 06, 2024, 04:31:44 pm
Re: USB vs PS/2 vs COM vs LPT
« Reply #124 on: September 25, 2010, 11:34:32 am »
Do you notice the word "IGNORE", and the sentence "which would come from the same keyboard and mouse".

Obviously legacy input is still there, sure you can "ignore" it too, as you will, but that will not make it go away.

I should not respond to this, but your logic is amusingly baffling.   ;D

It does not make it go away, but it does not mean it is being used.  The program (MAME) can and does have direct access to the input device (keyboard, mouse, etc.)  which I have stated, gets combined into the legacy device.  Which eventually gets sent to the virtual BIOS for those old programs that need it.

Heck even the remote desktop mouse and keyboard get combined into the legacy devices.  MAME could be coded to use those as seperate input too.  It would serve no purpose, which is why they are ignored to stop MAME users from complaining about it, but I digress.

The simple logic of the fact that MAME can access individual keyboards which you can not do with the BIOS, means something else must be going on.

Anyways, good luck and keep tring to connect the dots.
« Last Edit: September 25, 2010, 11:39:38 am by Derrick Renaud »

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #125 on: September 25, 2010, 11:51:14 am »
cotmm68030,

That's probably the best link so far.

http://www.microsoft.com/whdc/archive/usbhost.mspx?pf=true#usbh1


Operating System Takes Control of the UHCI Host Controller

- Configure the host controller.
- Enable a USB keyboard and mouse.
- Set up the host controller scheduler.

* Route USB keyboard and mouse input to the 8042 Keyboard Controller (KBC).

============

BIOS legacy support means emulation is provided in hardware/firmware. No BIOS legacy support means there will need to be a driver loaded somewhere in main CPU memory, which is provide by Windows but not DOS. In either way that emulation runs pretty much the same code which communicates with keyboard controller and port 0x60.

« Last Edit: September 25, 2010, 12:04:50 pm by Driver-Man »

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #126 on: September 25, 2010, 12:00:04 pm »
Quote from: Derrick Renaud
It does not make it go away, but it does not mean it is being used.  

Heck even the remote desktop mouse and keyboard get combined into the legacy devices.

Ok, I'll believe that. Thank you.

Malenko

  • KNEEL BEFORE ZODlenko!
  • Trade Count: (+58)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 14019
  • Last login:July 02, 2025, 09:03:11 pm
  • Have you played with my GingerBalls?
    • forum.arcadecontrols.com/index.php/topic,142404.msg1475162.html
Re: USB vs PS/2 vs COM vs LPT
« Reply #127 on: September 25, 2010, 12:37:17 pm »
but how do you know the JAMMA PCB is legal?


seriously, you are the worst kind of idiot. You quote docs out of context and when you are rebutted by like 50 different people all saying the same thing, you still assume you are the only correct one. I don't know a metric ton of APIs or port specifications, but when something new comes out, its still supports the old stuff during the change over. I skimmed over some of the docs you and others have posted, and I get it better then you do.
If you're replying to a troll you are part of the problem.
I also need to follow this advice. Ignore or report, don't reply.

Jack Burton

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1384
  • Last login:April 07, 2025, 02:12:05 pm
  • .
Re: USB vs PS/2 vs COM vs LPT
« Reply #128 on: September 25, 2010, 01:08:50 pm »
In the Street Fighter community there has always been the suspicion that USB connections add lag in some way that isn't present in the older types of connections that you found in consoles like the NES, SNES, PSX, and PS2.  And of course on an original PCB.   So this conversation is very interesting to me and that community.  

It is the current belief over on the shoryuken.com forums  that the Playstation Network and Xbox Live versions of Super Street Fighter II HD Remix suffer from small amount of input delay compared to the Dreamcast and arcade versions.  

In my opinion, having played the DC and arcade versions since they each respectively came out I can definitely tell the HD versions on the new consoles do not feel as quick and solid.  However I recognize that there are probably many other factors coming into play that could cause this.  The process of porting a game from CPSII to DC to cross platform Xbox/Ps3 could introduce all kinds of strange things.  

I've read this whole thread.  At first I was hoping that by using the parallel port I could restore that quick, precise NES-like control that I enjoy that I have never found replicated on a PC.  

Currently the closest I've been able to come to that is by using a Microsoft Sidewinder connected to a gameport and the emulator Nestopia.  It just feels better than using a PS3 Six-axis or Xbox 360 pad.  

Is there really any lower input delay over the gameport or is it all just in my head? :dunno  
I'm serious, I really don't know.  It could be that the stiffer buttons on the sidewinder just give the illusion of quicker, more responsive control.  

I do not like this Driver-man.

I respect the opinions of most of the posters in this thread other than him a great deal. Collectively they have been my greatest teachers on all things emulation.  
Thanks to you all.  

So my question to RandyT, Mon Mothma, Andy, etc.  Is there any real added benefit to using Ps/2, Serial, or parallel port connections?  

From a stand point of the standards themselves, and not whatever factors are involved in the PC they are connected to.  In an ideal environment are there any differences in performance between USB, PS/2, Serial, NES, gameport, and parallel port connections?

If it is even a small advantage I'm completely willing to go the extra length for it. Convenience is not important to me.  My main emulation machine has an LPT port on it and I'm willing to build a custom controller for it (diodes, resistors and all)  if it will get me just a little advantage.  

« Last Edit: September 25, 2010, 01:18:53 pm by Jack Burton »

AndyWarne

  • Trade Count: (+18)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1938
  • Last login:April 11, 2021, 03:37:09 am
    • Ultimarc
Re: USB vs PS/2 vs COM vs LPT
« Reply #129 on: September 25, 2010, 01:36:01 pm »
Food for thought....

Turn off USB legacy support in your BIOS.  How odd that windows still can use the keyboard.


Absolutely. Thats the easiest way to prove that keyboard input (post Windows 98) does not go via the motherboard keyboard controller, as turning this off disables this path.
Prior to XP, Windows could read the keyboard either via the USB controller or via the legacy route. If there was a problem with the USB controller (eg no drivers installed) the USB keyboard would still work, but it was slow, because it was routing through the legacy support. In fact it was noticeably slow in gaming. The original troubleshooting page for the I-PAC had a check for Windows 98 to ensure the USB controller was working and just to be sure, disable legacy USB Support in case the I-PAC ended up going through legacy.
In XP if the USB controller is not working, the USB keyboard will not work as there is no legacy path.

The correct situation is Windows 98 could use the Port 60 route but did not unless it had to. XP does NOT use the port 60 route. Anything on the web which states otherwise is either outdated or simply wrong.
« Last Edit: September 25, 2010, 01:48:07 pm by AndyWarne »

DJ_Izumi

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1098
  • Last login:November 04, 2023, 04:19:22 pm
Re: USB vs PS/2 vs COM vs LPT
« Reply #130 on: September 25, 2010, 04:11:34 pm »
It is the current belief over on the shoryuken.com forums  that the Playstation Network and Xbox Live versions of Super Street Fighter II HD Remix suffer from small amount of input delay compared to the Dreamcast and arcade versions.  

In my opinion, having played the DC and arcade versions since they each respectively came out I can definitely tell the HD versions on the new consoles do not feel as quick and solid.

...Do you mean Marvel Vs. Capcom 2?  Cause I'm pretty certian that SSFIIHDR was never on DC or Arcades.

That said, didn't the Dreamcast and NAOMI use the very USB like 'Maple Bus'?  The maple bus as I understand is a serial bus with a lot in common with USB.

Jack Burton

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1384
  • Last login:April 07, 2025, 02:12:05 pm
  • .
Re: USB vs PS/2 vs COM vs LPT
« Reply #131 on: September 25, 2010, 05:27:54 pm »
It is the current belief over on the shoryuken.com forums  that the Playstation Network and Xbox Live versions of Super Street Fighter II HD Remix suffer from small amount of input delay compared to the Dreamcast and arcade versions.  

In my opinion, having played the DC and arcade versions since they each respectively came out I can definitely tell the HD versions on the new consoles do not feel as quick and solid.

...Do you mean Marvel Vs. Capcom 2?  Cause I'm pretty certian that SSFIIHDR was never on DC or Arcades.

That said, didn't the Dreamcast and NAOMI use the very USB like 'Maple Bus'?  The maple bus as I understand is a serial bus with a lot in common with USB.

HD Remix is merely a tweaking of some of the gameplay features of the game.   It is 99% identical to Super Turbo.  The responsiveness of the controls should be identical under ideal circumstances.  And of course there is HD Super Turbo mode as well.  

One of my friends was looking at the NAOMI specs a while back as part of an emulation project and relayed to me that it was indeed some manner of serial input over a usb cable.  


AndyWarne

  • Trade Count: (+18)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1938
  • Last login:April 11, 2021, 03:37:09 am
    • Ultimarc
Re: USB vs PS/2 vs COM vs LPT
« Reply #132 on: September 25, 2010, 07:40:30 pm »

So my question to RandyT, Mon Mothma, Andy, etc.  Is there any real added benefit to using Ps/2, Serial, or parallel port connections?  


It would be nice to be able to prove by testing rather than theorising, but this is not easy to do in terms of overall response. What is easy to test though is lag between simultaneously-pressed keys.
The Passmark keyboard test (www.passmark.com) displays this figure. On an I-PAC connected via PS/2 it is a consistent 1ms. When connected via USB it is a consistent zero.

DJ_Izumi

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1098
  • Last login:November 04, 2023, 04:19:22 pm
Re: USB vs PS/2 vs COM vs LPT
« Reply #133 on: September 25, 2010, 08:26:16 pm »
HD Remix is merely a tweaking of some of the gameplay features of the game.   It is 99% identical to Super Turbo.  The responsiveness of the controls should be identical under ideal circumstances.  And of course there is HD Super Turbo mode as well.

I have great difficulty believing this.  Other sources put SSF2HDR as being 'heavily modified' and this makes sense.  Going from CPS-2 and Dreamcast (Which probably just emulated the CPS-2 hardware rather than being a port) to PS3 and 360, adding 720p visuals, adding full music as opposed to something sythnsized in the chip, and then getting all of that running as a NATIVE piece of software on multicore hardware.  I just think it's highly unlikely to say it's 99% the same in terms of the 'guts' of the problem and how it works.  It would be more reasonable to assume the built an original game while copying the rule set from the old game.  It's certianly not a 'port' by any reasonable use of the word so comparing them is like apples and orange.

Something like MvC2 which is PORTED from the NAOMI code to it's other platforms, including PS3 and 360 is a much more reasonable comparison.  But then look at the PS2 and Xbox1 ports of MvC2 which were largely considdered to be plagued with minor issues or 'broken' as the fighting game fanatics call it.

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #134 on: September 25, 2010, 08:49:59 pm »
Quote from: Malenko
You quote docs out of context and when you are rebutted by like 50 different people all saying the same thing, you still assume you are the only correct one. I don't know a metric ton of APIs or port specifications, but when something new comes out, its still supports the old stuff during the change over. I skimmed over some of the docs you and others have posted, and I get it better then you do.

Little human, do you even know why do you hate me? Never mind, I forgive you, but there is no need to be emotionally unstable over technical discussion and blame me for your inability to understand, relax. You have some opinion, that's great, all you have to do now is find some source and quote it here to back it up.


Quote from: AndyWarne
Quote
Turn off USB legacy support in your BIOS.  How odd that windows still can use the keyboard.

Thats the easiest way to prove that keyboard input (post Windows 98) does not go via the motherboard keyboard controller, as turning this off disables this path.

False. Turning BIOS legacy support off will only disable hardware level PS/2 emulation, and so Windows will use its own emulation driver, that will be doing the SAME THING - interfacing with keyboard controller and port 0x60.


Is this Microsoft page outdated and simply wrong:
http://www.microsoft.com/whdc/archive/usbhost.mspx


Quote
XP does NOT use the port 60 route. Anything on the web which states otherwise is either outdated or simply wrong.

XP does NOT use the port 60 route. Can you show us anything on the web that says so? Or perhaps that's some mysterious unspoken truth everyone is supposed to believe without questioning?

saint

  • turned to the Dark Side
  • Supreme Chancellor
  • Trade Count: (+6)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 6149
  • Last login:July 05, 2025, 12:51:00 pm
  • I only work in cyberspace...
    • Build Your Own Arcade Controls
Re: USB vs PS/2 vs COM vs LPT
« Reply #135 on: September 25, 2010, 08:52:09 pm »
Quote from: Malenko
You quote docs out of context and when you are rebutted by like 50 different people all saying the same thing, you still assume you are the only correct one. I don't know a metric ton of APIs or port specifications, but when something new comes out, its still supports the old stuff during the change over. I skimmed over some of the docs you and others have posted, and I get it better then you do.

Little human, do you even know why do you hate me? Never mind, I forgive you, but there is no need to be emotionally unstable over technical discussion and blame me for your inability to understand, relax. You have some opinion, that's great, all you have to do now is find some source and quote it here to back it up.

This attitude has to stop now or you have to find another forum.

--- saint
--- John St.Clair
     Build Your Own Arcade Controls FAQ
     http://www.arcadecontrols.com/
     Project Arcade 2!
     http://www.projectarcade2.com/
     saint@arcadecontrols.com

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #136 on: September 25, 2010, 08:56:44 pm »
"seriously, you are the worst kind of idiot."


...and you are willing to tolerate that kind of attitude?
« Last Edit: September 25, 2010, 08:58:19 pm by Driver-Man »

Jack Burton

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1384
  • Last login:April 07, 2025, 02:12:05 pm
  • .
Re: USB vs PS/2 vs COM vs LPT
« Reply #137 on: September 25, 2010, 08:57:30 pm »
HD Remix is merely a tweaking of some of the gameplay features of the game.   It is 99% identical to Super Turbo.  The responsiveness of the controls should be identical under ideal circumstances.  And of course there is HD Super Turbo mode as well.

I have great difficulty believing this.  Other sources put SSF2HDR as being 'heavily modified' and this makes sense.  Going from CPS-2 and Dreamcast (Which probably just emulated the CPS-2 hardware rather than being a port) to PS3 and 360, adding 720p visuals, adding full music as opposed to something sythnsized in the chip, and then getting all of that running as a NATIVE piece of software on multicore hardware.  I just think it's highly unlikely to say it's 99% the same in terms of the 'guts' of the problem and how it works.  It would be more reasonable to assume the built an original game while copying the rule set from the old game.  It's certianly not a 'port' by any reasonable use of the word so comparing them is like apples and orange.

Something like MvC2 which is PORTED from the NAOMI code to it's other platforms, including PS3 and 360 is a much more reasonable comparison.  But then look at the PS2 and Xbox1 ports of MvC2 which were largely considdered to be plagued with minor issues or 'broken' as the fighting game fanatics call it.

I believe the case with ST is that it was ported from the original source code from the CPS2 to the Dreamcast.  I do not think it is an emulator.  I only have my own recollections of things I've read on SRK over the years to back this up.  I can probably find out if you're curious.  

The C or C++ source for the Dreamcast version is what was used for the PSN and Xbox live versions with probably some heavy modification.  I do know for a fact that they did not build "an original game using the same rules".

However, this is off-topic here so If you want to continue dicussion I can do so via pm's and probably link you to some threads on srk.  

CheffoJeffo

  • Cheffo's right! ---saint
  • Wiki Master
  • Trade Count: (+2)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7784
  • Last login:July 14, 2025, 12:11:49 pm
  • Worthless button pusher!
Re: USB vs PS/2 vs COM vs LPT
« Reply #138 on: September 25, 2010, 09:00:35 pm »
Is this Microsoft page outdated and simply wrong:
http://www.microsoft.com/whdc/archive/usbhost.mspx

Quote
Support for USB and Legacy Keyboards and Mouse Devices
Updated: December 4, 2001


Working: Not Enough
Projects: Too Many
Progress: None

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #139 on: September 25, 2010, 09:07:39 pm »
Ok, CheffoJeffo, can you find better and more up-to-date document? There is no point in saying all these documents are wrong and my quotes out of context, just find any document that says otherwise, anything at all.



MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: USB vs PS/2 vs COM vs LPT
« Reply #140 on: September 25, 2010, 09:48:34 pm »
Quote from: MonMotha
Windows (and Linux, and any other "real" OS) kick the BIOS emulation to the curb (turn it off).
According to what? Show me.
Did you read the rest of the post?  I ran a native Win32 application that read port 0x60.  I got PS/2 data, but not USB data.  If emulation of USB keyboards via port 0x60 were present, I would have gotten USB keyboard data via that interface, as well, but I didn't.

Quote
I ran the Win32 native application that bangs directly on port 0x60.  It got data from the onboard PS/2 keyboard but neither of the USB keyboards I had attached.  This is consistent with what I just said: Windows reads port 0x60 for PS/2 keyboard data but gets USB data from elsewhere (directly from the HCI) and merges it together itself for presentation to userspace applications via the Win32 API.  Since reading port 0x60 bypasses the Win32 API, it will only get data actually present on port 0x60 which is PS/2 data.

No source code, no binary downloads, can we not try it out?
Oh wait, you DID read that part!  You just conveniently ignored it above.

As to where the source is, I already posted it previously in this thread.  It's the same code you built for DOS just with inportb and outportb defined since Windows doesn't include them anymore.  It's the same program that crashes unless you take special consideration (e.g. using "userport") to unblock raw IO port access.  Userport also comes with source code, if you really want to read it.

Quote
The DOS version *DOES* get data from all sources because it's running inside NTVDM.  NTVDM uses the conventional Windows APIs to get keyboard data before stuffing it into an emulated port 0x60 interface.  Hence, any keyboard Windows knows about will be passed to a DOS application inside NTVDM via port 0x60.  This ONLY happens because that DOS application is running inside an EMULATION LAYER to emulate DOS.

According to what? Why is it OpenHCI USB specification only confirms what I said? Why can you not quote any source to confirm your claims? Show me.
OpenHCI has nothing to do with this.  Heck, if you're on an Intel motherboard, you probably don't even have an OCHI controller.  You probably have a UHCI one.

We know that NT runs DOS applications inside NTVDM.  DOS applications can't run directly on NT, so it has to.
We know that NTVDM emulates legacy BIOS interfaces.

There are lots of articles all over the place that describe this, including Microsoft's website.
Try some of these (3 links).  The last one is especially informative, though it's also the oldest, referring to NT 4.0. 
The other articles confirm that this still applies to Win2k, upon which XP is based.  This KnowledgeBase article shows that it still applies to WinXP, too.

Just search that last page link of the 3 for NTVDM (second hit), and you'll find this little tidbit:
Quote from: Microsoft Technet
MS-DOS-based applications run on Windows NT 4.0 in a process called an NT Virtual DOS Machine (NTVDM). NTVDM is a 32-bit Windows application that simulates an Intel 486 computer running MS-DOS.
Quote from: Microsoft Technet
To run MS-DOS-based applications, the NTVDM creates a virtual computer including support for:
•Intel x86 instructions, provided by the Instruction Execution Unit
•Read-only memory basic input and output (ROM BIOS) interrupt services, provided by the MS-DOS emulation module
•MS-DOS Interrupt 21 services, provided by the MS-DOS emulation module
•Virtual hardware for devices, such as the screen and keyboard, provided by Virtual Device Drivers
(Emphasis mine)

In other words:
NTVDM uses the conventional Windows APIs to get keyboard data before stuffing it into an emulated port 0x60 interface.  Hence, any keyboard Windows knows about will be passed to a DOS application inside NTVDM via port 0x60.
(Isn't it handy when you can quote yourself?)

Basically, any DOS application you run on modern (meaning less than 10 years old) Windows is running inside an emulation layer.  This means that attempting to extrapolate basic underlying system behavior from the behavior of a DOS application running on said modern Windows OS will give misleading and even irrelevant results.


Is this Microsoft page outdated and simply wrong:
http://www.microsoft.com/whdc/archive/usbhost.mspx
Did you read that page?  That page basically says that, since the BIOS supports legacy emulation of USB devices upon startup and this would conflict with Windows talking to USB devices directly, Windows has to kick it out of the way so that it can talk to USB devices directly.  Look at Figure 1 and read the section "Operating System Takes Control of the OHCI Host Controller" (there is also one detailed for UHCI controllers).


Yeah, you're trolling.  I'd just ignore you, but I'd be afraid that others on here would believe the crap you're spewing and make poor decisions based on it.


So my question to RandyT, Mon Mothma, Andy, etc.  Is there any real added benefit to using Ps/2, Serial, or parallel port connections? 

From a stand point of the standards themselves, and not whatever factors are involved in the PC they are connected to.  In an ideal environment are there any differences in performance between USB, PS/2, Serial, NES, gameport, and parallel port connections?

If it is even a small advantage I'm completely willing to go the extra length for it. Convenience is not important to me.  My main emulation machine has an LPT port on it and I'm willing to build a custom controller for it (diodes, resistors and all)  if it will get me just a little advantage. 

Not really.

The parallel port is handy if you don't want to buy anything, are willing to do a fair bit of software hackery, and only need up to 13 inputs.  Beyond that the matrixing/multiplexing required makes it inferior to dedicated, multi-input encoders in terms of either complexity or having ghosting issues.  While it's easy to make this a very non-laggy interface, you have to possibly worry about switch bounce and such with directly connected inputs, and a properly designed USB interface has no effective lag by providing data faster than the PC software needs it.

The serial port has no real usage in this application.  It requires software hackery like the parallel port would while being much slower than USB and still requiring a "smart" outboard device to communicate.  It would only really be useful if you had a microcontroller with a UART (common) but not a USB interface (these are less common and more complex) that you were already using and wanted to interface to your PC.

PS/2 ports offer no real advantages over a properly designed USB encoder.  I'd only use it if USB was unavailable or I was building my own quick-and-dirty hardware and didn't want to deal with the hardware/software complexity of USB.

USB is readily available and, when applied properly, has no real downsides to its use with gaming and emulation.  It's one of the more complex solutions to implement for the designer, but it provides plug-and-play ease for the user once the design has been done.

Jack Burton

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1384
  • Last login:April 07, 2025, 02:12:05 pm
  • .
Re: USB vs PS/2 vs COM vs LPT
« Reply #141 on: September 25, 2010, 11:37:51 pm »
Thank you mon mothma.

Reading this:

http://en.wikipedia.org/wiki/Game_port

I was struck by a few pieces of information.

"Unlike most other joystick connectors (and controllers) during the early days of home computing and game consoles, the game port is actually analog rather than digital, relying on some form of ADC to interpret joystick movements. "

"While other joystick standards (such as Atari or NES joysticks) are very easy and straightforward for programmers to use, the game port requires careful programming and well-timed software interrupt  triggering to read an input. This of course caused performance issues as reading the game port took a notable amount of CPU time, especially compared to systems with a 'normal' digital (TTL) joystick port."

I don't know if this would actually make a practical difference, but it does sound like my faith in the gameport as a low lag connection was misplaced.  Looks like it needs to be read just like USB does.  It is not the same as an NES controller.  Of course in practical use I'm guessing the amount of processing time required is trivial for gameport just like it is for USB.  Right? 

MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: USB vs PS/2 vs COM vs LPT
« Reply #142 on: September 26, 2010, 03:49:37 am »
Thank you mon mothma.

Reading this:

http://en.wikipedia.org/wiki/Game_port

I was struck by a few pieces of information.

"Unlike most other joystick connectors (and controllers) during the early days of home computing and game consoles, the game port is actually analog rather than digital, relying on some form of ADC to interpret joystick movements. "

"While other joystick standards (such as Atari or NES joysticks) are very easy and straightforward for programmers to use, the game port requires careful programming and well-timed software interrupt  triggering to read an input. This of course caused performance issues as reading the game port took a notable amount of CPU time, especially compared to systems with a 'normal' digital (TTL) joystick port."

I don't know if this would actually make a practical difference, but it does sound like my faith in the gameport as a low lag connection was misplaced.  Looks like it needs to be read just like USB does.  It is not the same as an NES controller.  Of course in practical use I'm guessing the amount of processing time required is trivial for gameport just like it is for USB.  Right? 

The PC game port kinda sucks, yeah.  It consists of a half-assed ADC for the joystick axes and a few digital inputs for buttons.  There's no IRQ available; the CPU has to poll it, and the A/D conversion timing is, historically, at least, largely CPU driven (hence that article complaining about timing issues).  The as for interfacing arcade game controls, there's 4 button inputs available, and they can be talked to in a similar way to the PC parallel port.

The NES controller is basically a bunch of buttons hooked up to a parallel load, serial out shift register (74xx166 style).  The NES would strobe the load/latch input, then shift out all the bits serially.  Effectively, this forms something like a SPI interface (and I've seen the SPI port of a microcontroller used to talk to it).  Since the number of bits is low (8 buttons: 4 for the D-Pad, A, B, Start, Select), even a moderate clock frequency of e.g. 83.33kHz (used by the NES) results in a maximum usable poll rate of 9.26kHz (83.33k/9 - 9 to include an extra bit time to latch the data) if you polled it continuously.  This document describes the protocol in some detail.

This type of serial transfer can also be bit-banged pretty easily on a parallel port, and I know there are lots of examples out there.  The CPU overhead required isn't too outrageous, though it probably requires busy loops (wasted CPU time) since it's not worth yielding CPU time during the period between clock edges on most OSes (even "highly interactive" Linux configurations only preempt 1000 times/sec).


Many other game console controllers work similarly.  The Playstation Dualshock (2), for example, is basically a smarter version of that.  The host can perform serial transfers to manipulate what mode the controller is in or ask for controller state data.  If the host requests controller state data, the controller responds with a bunch of bits that map to the various buttons as well as some wider bit fields that represent the position of the analog sticks.  For the Dualshock 2 with analog buttons, the buttons are more than a single bit; they are instead several bits that represent a number related to how hard the user is pressing the button.

Bit banged parallel port interfaces for dualshocks are also pretty common.  When talking to a dedicated microcontroller or similar, a SPI controller or USART can be used.


The Neo-Geo AES and Atari sticks are some of the few that really are just a bunch of totally unmultiplexed digital inputs on a connector.  Since that was also how the arcade controls worked, and MVS and AES hardware was virtually identical, this makes some sense for the Neo-Geo, and Atari sticks just don't have very many inputs.

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #143 on: September 26, 2010, 05:29:53 am »
Quote from: MonMotha
That page basically says that, since the BIOS supports legacy emulation of USB devices upon startup and this would conflict with Windows talking to USB devices directly, Windows has to kick it out of the way so that it can talk to USB devices directly.  Look at Figure 1 and read the section "Operating System Takes Control of the OHCI Host Controller" (there is also one detailed for UHCI controllers).

No. That is not really about Windows, but any OS. It says that OS has the choice to use BIOS drivers, if present. It also says PS/2 emulation is within SMM, which is transparent to the operating system and application software, and so this functionality stays as a part of whatever higher-level operation is wrapped around it.


Quote
Basically, any DOS application you run on modern (meaning less than 10 years old) Windows is running inside an emulation layer.  This means that attempting to extrapolate basic underlying system behavior from the behavior of a DOS application running on said modern Windows OS will give misleading and even irrelevant results.

How about this "Passmark keyboard test" from www.passmark.com, AndyWarne was talking about?

I get minimum of 7-8 ms lag between each scan code sent with USB keyboard. With PS/2 keyboard this lag is 4-5 ms. That comes down to about two keys per frame @ 60FPS. And so, I was right after all, at least as far as my own computer goes. -- I also tried several "USB sniffer" programs, and according to this little investigation I see key codes are always transmitted one by one, and there are all sorts of lags and two-way communication going on in between each packet.

Anyway, do you accept 'Passmark keyboard test' as "benchmark" program to settle this argument?


Quote
The parallel port is handy if you don't want to buy anything, are willing to do a fair bit of software hackery, and only need up to 13 inputs.  Beyond that the matrixing/multiplexing required makes it inferior to dedicated, multi-input encoders in terms of either complexity or having ghosting issues.

- "are willing to do a fair bit of software hackery,"

Not true, many emulators have this driver built in, plus there are "joystick" OS specific drivers for Windows, Linux and DOS. This is mature and very well tested interface enjoyed by many people who know about it, for the last 8 years or more.


- "and only need up to 13 inputs."

TGXLPT sets the maximum number of inputs, 9x7 = 63.


- "Beyond that the matrixing/multiplexing required makes..."

8 bits at the time, gathering 24 inputs in just three instructions...
Did you not say that is exactly how arcade games originally did it?
« Last Edit: September 26, 2010, 05:43:10 am by Driver-Man »

AndyWarne

  • Trade Count: (+18)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1938
  • Last login:April 11, 2021, 03:37:09 am
    • Ultimarc
Re: USB vs PS/2 vs COM vs LPT
« Reply #144 on: September 26, 2010, 05:48:08 am »

False. Turning BIOS legacy support off will only disable hardware level PS/2 emulation, and so Windows will use its own emulation driver, that will be doing the SAME THING - interfacing with keyboard controller and port 0x60.


Is this Microsoft page outdated and simply wrong:
http://www.microsoft.com/whdc/archive/usbhost.mspx


Its outdated.

Quote
XP does NOT use the port 60 route. Anything on the web which states otherwise is either outdated or simply wrong.


XP does NOT use the port 60 route. Can you show us anything on the web that says so? Or perhaps that's some mysterious unspoken truth everyone is supposed to believe without questioning?

OK here you go: http://www.microsoft.com/whdc/archive/usbcompat.mspx?pf=true#E2C

Also go into Device Manager and look at a HID keyboard, and Driver Details. There you will find i8042prt.sys (the emulation driver) is not there.
« Last Edit: September 26, 2010, 06:20:51 am by AndyWarne »

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #145 on: September 26, 2010, 06:00:58 am »
Quote from: AndyWarne
OK here is a USB bus analyzer trace. This is the result of pressing 5 keys at the same time. Note the 2ms time intervals, and the fact all pressed keys (5 keys) are sent together.

I did not respond to this earlier because I did not see any time intervals in that screen shot there (1st page). -- It never occurred to me before we can sort all this out without any arguments actually. AndyWarne was right to come along with such testing tools, I wish I paid more attention to that before, as that's the easiest and most reliable source of information, especially since no one believes the word I say, for some reason, and what's even better such software will tell every one about their specific situation with their own particular computer.

Anyhow, if we forget about everything else, 2ms intervals between each scan code would give you about 8 keys per frame max @ 60FPS, if you are not using arrow keys that is. However, releasing or *TAPPING* buttons, just as using arrow keys, will emit double scan codes, which can leave you with less than 8 keys per frame. -- Perhaps that's "good enough", but if it is 2 keys per frame like on my computer, well that's not "good enough", not for me anyway.

MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: USB vs PS/2 vs COM vs LPT
« Reply #146 on: September 26, 2010, 09:00:06 am »
Quote from: MonMotha
That page basically says that, since the BIOS supports legacy emulation of USB devices upon startup and this would conflict with Windows talking to USB devices directly, Windows has to kick it out of the way so that it can talk to USB devices directly.  Look at Figure 1 and read the section "Operating System Takes Control of the OHCI Host Controller" (there is also one detailed for UHCI controllers).

No. That is not really about Windows, but any OS. It says that OS has the choice to use BIOS drivers, if present. It also says PS/2 emulation is within SMM, which is transparent to the operating system and application software, and so this functionality stays as a part of whatever higher-level operation is wrapped around it.
Yes, PS/2 emulation happens within SMM.  The SMM takes data from the USB HCI and dumps it into the emulated port 0x60 interface.  However, that document also details how Windows disables this emulation so that it can take control of the USB HCI directly.  A different procedure is used for OHCI and UHCI, but both processes result in the same thing: SMM emulation is disabled (by causing the USB HCI to never generate any SMI signals to activate it) and the OS (whatever it is, in this case Windows) can talk to the HCI directly.

If you think that document says that emulation is left on while Windows is running, you're not reading it right.

I'm guessing the process differs some now that EHCI (and whatever USB 3.0 uses) is around, but it's still the same concept: the "real" OS disables SMM emulation of legacy keyboard/mouse for USB keyboard/mouse so that it can take direct control over the USB HCI.  The OS is then responsible for handling all USB devices, including HID boot protocol keyboards and mice, on its own.  The OS will still ask port 0x60 for actual PS/2 keyboard data.

Quote
Basically, any DOS application you run on modern (meaning less than 10 years old) Windows is running inside an emulation layer.  This means that attempting to extrapolate basic underlying system behavior from the behavior of a DOS application running on said modern Windows OS will give misleading and even irrelevant results.

How about this "Passmark keyboard test" from www.passmark.com, AndyWarne was talking about?

I get minimum of 7-8 ms lag between each scan code sent with USB keyboard. With PS/2 keyboard this lag is 4-5 ms. That comes down to about two keys per frame @ 60FPS. And so, I was right after all, at least as far as my own computer goes. -- I also tried several "USB sniffer" programs, and according to this little investigation I see key codes are always transmitted one by one, and there are all sorts of lags and two-way communication going on in between each packet.

Anyway, do you accept 'Passmark keyboard test' as "benchmark" program to settle this argument?
Looks like it's probably a native Win32 application, so NTVDM is not in play.

You'll note that 1/125th of a second is 7.87ms.  7-8ms of lag is consistent with a 125Hz polling rate.  This is the forced polling rate for low-speed USB HID devices in Windows.  Most keyboards are low-speed, so Windows will poll them at 125Hz regardless of what they otherwise may ask for.

I'm not surprised that PS/2 keyboards are slightly less laggy than a 125Hz polled USB keyboard.  While the PS/2 keyboard clock is usually only ~100kHz (less than 1/10th the bit clock of even low speed USB), the keyboard controller has a real interrupt to signal the CPU with, so it can potentially get data there very quickly once it is received.

Note that Andy says his IPAC keyboard encoder has a polling rate of 500Hz.  Since the IPAC is a full speed device, Windows will use the polling rate specified in its descriptor.  A 500Hz polling rate would mean one poll every 2ms or about 4 times faster than a normal keyboard.  I'd be interested to see the passmark lag results for an IPAC or other HID device with a faster than typical polling rate.

Note also that games (especially arcade games being emulated in MAME) only check the inputs at a certain rate, regardless of how often new input data may be available.  For arcade games, this is typically once per frame.  Since the framerate is usually ~60Hz, as long as new data is available at least that often (and 120Hz+ would guarantee it), there's little to be gained from higher polling rates or lower input lag.

Quote
The parallel port is handy if you don't want to buy anything, are willing to do a fair bit of software hackery, and only need up to 13 inputs.  Beyond that the matrixing/multiplexing required makes it inferior to dedicated, multi-input encoders in terms of either complexity or having ghosting issues.

- "are willing to do a fair bit of software hackery,"

Not true, many emulators have this driver built in, plus there are "joystick" OS specific drivers for Windows, Linux and DOS. This is mature and very well tested interface enjoyed by many people who know about it, for the last 8 years or more.


- "and only need up to 13 inputs."

TGXLPT sets the maximum number of inputs, 9x7 = 63.


- "Beyond that the matrixing/multiplexing required makes..."

8 bits at the time, gathering 24 inputs in just three instructions...
Did you not say that is exactly how arcade games originally did it?

I didn't say that it was slow or had high overhead (in fact, I specifically mentioned that it can be a very low latency interface and at least hinted that application can be electrically simple, but of course you neglected to quote any of that).  I said that it is more complex than many users will want to deal with.  You say that TGXLPT is built into many emulators, and while that may be true, you have to go to some trouble to make raw parallel port access work on WinNT (to include XP).  This is more trouble than some users may want to deal with.  In fact, I can only find references to using MAME with that TGXLPT interface when running MAME on DOS, but it may support it on Windows provided the user goes to the trouble of enabling raw port access or installing a 3rd party driver.  USB (and PS/2, for that matter) keyboard encoders are literally plug-and-play.

What I meant by matrixing or multiplexing is that either external multiplexors (ICs) are required or a matrix has to be built to handle more than 13 inputs.  The tgxlpt interface you linked to is a matrix.  If you don't use a butt-ton of diodes, a matrix will quickly have problems with ghosting (potentially any time more than 2 inputs are triggered).  Many users don't want to wire up a ton of diodes, and I don't blame them.  Matrixes are fine when ghosting is not an issue, e.g. on a TV remote control, but we generally don't use them on arcade controls for this reason.

Either a digitally multiplexed or a matrixed solution will require more IO instructions to read the whole thing.  For your tgxlpt interface you seem to adore, you read 5 inputs at a time (on the status port) then 4 inputs (on the control port) and have to manipulate the data port to scan the matrix.  Each group of 5 inputs requires 3 IO instructions plus potentially a brief spinloop delay (wasting CPU time) to let the matrix settle (this may or may not be required depending on stray capacitance and how fast IO instructions actually run on your CPU).  So, to read all 63 inputs (the 7 groups of 9) requires at least 7*3=21 instructions plus instructions required to correct polarities and re-pack the data into 8-bit variables if desired.  Not that any of this really matters given how fast CPUs are, these days.  The issue with multiplexing and matrixing is really more of a physical implementation hassle.


Quote from: AndyWarne
OK here is a USB bus analyzer trace. This is the result of pressing 5 keys at the same time. Note the 2ms time intervals, and the fact all pressed keys (5 keys) are sent together.

I did not respond to this earlier because I did not see any time intervals in that screen shot there (1st page). -- It never occurred to me before we can sort all this out without any arguments actually. AndyWarne was right to come along with such testing tools, I wish I paid more attention to that before, as that's the easiest and most reliable source of information, especially since no one believes the word I say, for some reason, and what's even better such software will tell every one about their specific situation with their own particular computer.

Anyhow, if we forget about everything else, 2ms intervals between each scan code would give you about 8 keys per frame max @ 60FPS, if you are not using arrow keys that is. However, releasing or *TAPPING* buttons, just as using arrow keys, will emit double scan codes, which can leave you with less than 8 keys per frame. -- Perhaps that's "good enough", but if it is 2 keys per frame like on my computer, well that's not "good enough", not for me anyway.

You're reading it wrong.  Every 2ms, a HID report frame is transferred to the host.  This report frame contains a large number of scancodes.  In the trace Andy posted, 5 scancodes were sent every 2ms, and there's plenty of unused positions (having NULL 0x00 data) in the report (it's cut off on the display, even), suggesting that the device could send quite a few more.  USB HID devices do not send key up/key down events for each key like a PS/2 device does; they instead send a "report" every time they are polled that lists the entirety of the keys pressed (up to a maximum limit).  The IPAC sends this report every 2ms (or rather tells the host to request the report every 2ms, which it does).  They can do this because USB is pretty fast (1.5Mbps or 12Mbps) compared to the PS/2 AT keyboard interface (~10-20kbps).

Thus, there is NO limit on the number of keys pressed per frame other than the number of keys the device can handle being held down at once.  While this number is typically 6 for conventional keyboards as that's what is used in boot protocol mode, it's possible to make a device where this limit is "the number of keys physically present", and I believe Andy has said that this is how the IPAC is set up.  Thus, the IPAC could handle you simultaneously pressing every input on the encoder in one 2ms interval (good luck!) then releasing them all simultaneously just 2ms later (again, good luck!).  How HID reporting works is all detailed in the USB HID specification we've all been asking you to read.  Clearly, you haven't done so.

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #147 on: September 26, 2010, 11:28:19 am »
Quote from: AndyWarne
OK here you go: http://www.microsoft.com/whdc/archive/usbcompat.mspx?pf=true#E2C

Touché!

Figure 1. Architecture for Legacy Support for USB and PS/2


Figure 2. Architecture after the operating system takes control



CONGRATULATIONS!!! The winner is you!

And, bonus points for diagrams. Thank you.

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #148 on: September 26, 2010, 12:00:17 pm »
Quote from: MonMotha
If you think that document says that emulation is left on while Windows is running, you're not reading it right.

You were telling the truth after all, but points go to AndyWarne. You are informative indeed, but at the end Andy won with single elegant hit, right between Driver-Man's eyes, oouch! In any case, I thank you too. -- Perhaps it was unreasonable for me to ask for such evidence, but at least we established one more point, slightly less relevant now when we can obtain actual real-world measurements with the software tools such as 'keyboard testers" and "USB sniffers". Your persistence was not in vain, but the battle goes on.... with great power comes great responsibility!


Quote
Quote
Anyway, do you accept 'Passmark keyboard test' as "benchmark" program to settle this argument?
Looks like it's probably a native Win32 application, so NTVDM is not in play.

I'll take that as a "yes".


Quote
You'll note that 1/125th of a second is 7.87ms.  7-8ms of lag is consistent with a 125Hz polling rate.

Let's also make a note that is what it is, and that's ONE KEY per 8ms. -- Your "pipe" can be big and wide, but if there is only a tiny hole at the end where "water" can come out (heh), then that little hole is what will define the maximum "flow rate", hence the name "bottleneck".

We are looking for the bottleneck and USB protocol is not it, move on. My USB sniffer says USB keyboard does indeed transfer 8 bytes long packages, so that can probably do 6 keys at once, and 2 bytes for modifiers, I guess.


HOWEVER, that 8 byte "USB buffer" does not get copied as bunch to some "usb keyboard buffer", but each byte goes to port 0x81, which is pretty much USB equivalent of PS/2 port 0x60. The point is, "entrance" to keyboard buffer is one byte wide again, and that is the "bottleneck".



Quote
Every 2ms, a HID report frame is transferred to the host.  This report frame contains a large number of scancodes.  In the trace Andy posted, 5 scancodes were sent every 2ms, and there's plenty of unused positions (having NULL 0x00 data) in the report (it's cut off on the display, even), suggesting that the device could send quite a few more.

Ok, you can send as many as you like as often as you like. But, of what use is that if you need to plug each byte separately, one by one, to port 0x81, and possibly even wait until application (OS) clears the port before able to put another scan code in, just like with PS/2 and port 0x60.

This is why it is important that we establish benchmark software for READING the input. According to "Passmark keyboard test", regardless of 8 bytes per 8ms, it still can still read only ONE KEY in that time-window, or so it says.


=====
And, for the love of drugs, why has no one taken my "dramatic persona" as a joke? What in the world is so offensive about me fooling around with "Spider-Man" spoof? It's allegory, it's a joke, it's to make it more interesting for me, to add some drama and provoke response, to see if anyone will come up with some interesting come-backs.... But that was only 2%, and Saint saw that. He was smart enough to see through my "theatricality", and wise enough to allow it continue for the sake of information. I admire that. Thank you Saint.

Marsupial

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 511
  • Last login:April 17, 2024, 09:00:56 pm
  • I am teh Mars!
Re: USB vs PS/2 vs COM vs LPT
« Reply #149 on: September 26, 2010, 12:19:32 pm »
Quote from: AndyWarne
OK here you go: http://www.microsoft.com/whdc/archive/usbcompat.mspx?pf=true#E2C

Touché!

Figure 1. Architecture for Legacy Support for USB and PS/2


Figure 2. Architecture after the operating system takes control



CONGRATULATIONS!!! The winner is you!

And, bonus points for diagrams. Thank you.


What, you needed drawing to understand/believe what's been said and referrenced all along???
-Mars

Marsupial

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 511
  • Last login:April 17, 2024, 09:00:56 pm
  • I am teh Mars!
Re: USB vs PS/2 vs COM vs LPT
« Reply #150 on: September 26, 2010, 12:22:26 pm »

=====
And, for the love of drugs, why has no one taken my "dramatic persona" as a joke? What in the world is so offensive about me fooling around with "Spider-Man" spoof? It's allegory, it's a joke, it's to make it more interesting for me, to add some drama and provoke response, to see if anyone will come up with some interesting come-backs.... But that was only 2%, and Saint saw that. He was smart enough to see through my "theatricality", and wise enough to allow it continue for the sake of information. I admire that. Thank you Saint.


So you were a troll indeed.

thanks for the proof.
-Mars

RandyT

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7014
  • Last login:July 18, 2025, 01:59:43 pm
  • Friends don't let friends hack keyboards.
    • GroovyGameGear.com
Re: USB vs PS/2 vs COM vs LPT
« Reply #151 on: September 26, 2010, 02:04:28 pm »
Note also that games (especially arcade games being emulated in MAME) only check the inputs at a certain rate, regardless of how often new input data may be available.  For arcade games, this is typically once per frame.  Since the framerate is usually ~60Hz, as long as new data is available at least that often (and 120Hz+ would guarantee it), there's little to be gained from higher polling rates or lower input lag.

If anyone is to take anything away from this sillyness, it should be the nugget quoted above.  Anything above what would provide absolute accuracy for the intended application is absolutely of no use.  Period.

RandyT

AndyWarne

  • Trade Count: (+18)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1938
  • Last login:April 11, 2021, 03:37:09 am
    • Ultimarc
Re: USB vs PS/2 vs COM vs LPT
« Reply #152 on: September 26, 2010, 03:26:09 pm »

Ok, you can send as many as you like as often as you like. But, of what use is that if you need to plug each byte separately, one by one, to port 0x81, and possibly even wait until application (OS) clears the port before able to put another scan code in, just like with PS/2 and port 0x60.



This is total gibberish. Anything more at this point is going to simply be troll-food.
End of story.
« Last Edit: September 26, 2010, 03:32:57 pm by AndyWarne »

SavannahLion

  • Wiki Contributor
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5986
  • Last login:December 19, 2015, 02:28:15 am
Re: USB vs PS/2 vs COM vs LPT
« Reply #153 on: September 26, 2010, 09:29:55 pm »
=====
And, for the love of drugs, why has no one taken my "dramatic persona" as a joke? What in the world is so offensive about me fooling around with "Spider-Man" spoof? It's allegory, it's a joke, it's to make it more interesting for me, to add some drama and provoke response, to see if anyone will come up with some interesting come-backs.... But that was only 2%, and Saint saw that. He was smart enough to see through my "theatricality", and wise enough to allow it continue for the sake of information. I admire that. Thank you Saint.

Because it's lame. It's stupid. It's immature. It's disrespectful to Saint and the community as a whole. It's clear that you do not respect those who know a hell of a lot more than you. Worse, you present patently incorrect information as absurdly correct then blame everyone else who is correct as wrong, wrong, wrong. Then you insist on being spoonfed the information condensed, itemized and fully referenced. Then when someone does point you to what you need to read, you just hop around asking, "where? where? where?"

What if the discussion had been about wiring up LED's and you told everyone to wire up Randy's LED lightbar directly to 120v? Or told everyone that they didn't need an isolation transformer?

This was just about application layers. Last time it was copyright. What's the next load of nonsense?

I say enough with the theatrical nonsense. It's not needed or required here.

If you have a question or want to present your work for peer review, then do so without all the "theatrical" ---That which is odiferous and causeth plants to grow---.
« Last Edit: September 26, 2010, 09:33:21 pm by SavannahLion »

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #154 on: September 26, 2010, 11:13:52 pm »
Quote from: Marsupial
So you were a troll indeed.

I can not respond, nor improve, unless I know what are you actually complaining about. What are you accusing me of? What am I doing wrong and how does that hurt you or anyone?


Quote from: RandyT
If anyone is to take anything away from this sillyness, it should be the nugget quoted above.  Anything above what would provide absolute accuracy for the intended application is absolutely of no use.  Period.

RandyT

Only Sith deals in absolutes.

Would you mind if we go on and measure it anyway?

Why do you not make USB keyboard encoders, but only PS/2?



Quote from: AndyWarne
This is total gibberish. Anything more at this point is going to simply be troll-food. End of story.

Do you mind if we actually measure it, may I?

TEST: Press Q+W+E+R at the same time, hold for a while, and then release them in the same


* USBTrace 1.3.0
http://www.topshareware.com/USBTrace-transfer-42419.htm






* Passmark keyboard test
http://www.passmark.com/products/keytest.htm




It is clear in from both programs that regardless of USB keyboard packet size, there can only be retrieved a maximum of ONE KEY per 8ms, thus 4 simultaneous key presses, like in my example above, will still need to communicate four packets, with lag between each one that equals to Windows default USB polling rate, on this particular computer of mine. As I was saying all along.



Yes, SavannahLion, I do have a question.

Please let me know the numbers you get with these two programs. Press [Q+W+E+R] at the same time, hold for a while and release them in the same, then simply capture the screenshots and show us how many keys per second is your computer capable of. Can you do that, please?


- "Mutants. Since the discovery of their existence they have been regarded with fear, suspicion, often hatred. Across the planet, debate rages... Either way it is a historical fact: Sharing the world has never been humanity's defining attribute."

RandyT

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7014
  • Last login:July 18, 2025, 01:59:43 pm
  • Friends don't let friends hack keyboards.
    • GroovyGameGear.com
Re: USB vs PS/2 vs COM vs LPT
« Reply #155 on: September 26, 2010, 11:56:55 pm »
Only Sith deals in absolutes.

Reality = not your bag, eh?

Quote
Why do you not make USB keyboard encoders, but only PS/2?

Somewhat spotty compatibility with older OSes when you deviate from the "boot compatible" keyboard device.  I even have a device that should be boot compliant which works fine under 98SE and XP, but performs poorly for gaming under 2K.  Haven't tested it with Win7 yet, but I'll bet it's ok.  If it is, it will probably see the light of day eventually.  PS/2 just works, though, and I've seen a lot of folks here resort to using it when the USB side of things doesn't go their way.  That's why I tend to coax folks into using PS/2 for key input if they have the port available to them, and have never had anyone be disappointed with the performance they experience for doing so.  If nothing else, it does an excellent job for this application, and doesn't use up a USB port that could be used for something else a little less mundane.

RandyT
« Last Edit: September 27, 2010, 12:00:06 am by RandyT »

JustMichael

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1438
  • Last login:September 27, 2015, 01:19:40 am
  • Mmmmm!! Cheesecake!!
Re: USB vs PS/2 vs COM vs LPT
« Reply #156 on: September 27, 2010, 12:47:44 am »
Passmark does NOT calculate the keys per second correctly:
« Last Edit: September 27, 2010, 01:07:31 am by JustMichael »

Malenko

  • KNEEL BEFORE ZODlenko!
  • Trade Count: (+58)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 14019
  • Last login:July 02, 2025, 09:03:11 pm
  • Have you played with my GingerBalls?
    • forum.arcadecontrols.com/index.php/topic,142404.msg1475162.html
Re: USB vs PS/2 vs COM vs LPT
« Reply #157 on: September 27, 2010, 01:33:03 am »
I wish I knew why we are all so inclined to be your personal google. 2 "big threads" by you, both you dont really read the info provided until someone posts up some pictures for you. Guess I'll start replying with words written in a venn diagram via MSPaint and post in GIF format but I think even that effort would be wasted.

What exactly was the point of this thread again?
If you're replying to a troll you are part of the problem.
I also need to follow this advice. Ignore or report, don't reply.

JustMichael

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1438
  • Last login:September 27, 2015, 01:19:40 am
  • Mmmmm!! Cheesecake!!
Re: USB vs PS/2 vs COM vs LPT
« Reply #158 on: September 27, 2010, 03:48:43 am »
What exactly was the point of this thread again?

Now that is a very good question!  :applaud:

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #159 on: September 27, 2010, 04:41:37 am »
Quote from: Malenko
What exactly was the point of this thread again?

Everyone can obtain their own numbers now, after that, the point is whatever you choose it to be. You could also ask your friendly neighborhood Driver-Man to make you a better driver for that crappy USB connection of yours.


Quote from: JustMichael
Now that is a very good question!

Don't you see 7ms lag between each key would mean only about TWO KEYS per frame @60 FPS animation?
If you don't see what kind of impact that can have on game play, then this is perfect forum to ask about it.


===
Yes, that program does not calculate 'key/sec' correctly, possibly it gets confused with buffering, so sometimes keys will keep coming long after you stop pressing any keys, which might very well be the Windows fault, and if MAME uses that same way to read keyboard, than the MAME too would inherit that same buffering bug/behavior. I never noticed anything like it though, but perhaps I did not try hard enough. You? Have you seen any bugs like that in MAME?


Quote from: Marsupial
What, you needed drawing to understand/believe what's been said and referrenced all along???

I suppose you could say that, yes. Why?



Do you not see the "bottleneck"?



« Last Edit: September 27, 2010, 08:29:21 am by Driver-Man »