| Main > Main Forum |
| USB vs PS/2 vs COM vs LPT |
| (1/43) > >> |
| Driver-Man:
There is one thing about "Building Your Own Arcade Controls" that no one seem to realize, it also happens to be the most important thing of all - sampling rate in relation to multiple simultaneous input. For some reason USB seem to be the most popular, which is a mistake, whether you are using keyboard hack, I-Pac or some USB joystick hack. USB, PS/2 and COM are serial communication ports, which means you can only send one bit at the time. It's further restricted with the operating frequency and slowed down by the processing and control bits overhead. Originally arcade games read input in parallel, so the states of all the buttons is known instantaneously for every single frame of animation. If you press all the 12 buttons in Street Fighter and release them very next frame, after 1/60 of a second, the game engine would know. -- This you can hardly achieve with any of the serial ports as it takes time to communicate multiple simultaneous inputs, so the input info always comes later than it occurred and individual timings are uncertain. Only LPT can communicate *instantaneous* state of the port at any given time and as often as the CPU clock ticks, 8 bits at the time, in parallel, which means you can read the state of 16 buttons in just two instructions. In contrast, the serial communication driver would need to perform at least about 8x16 = 128 instructions, plus the data encoding and buffer manipulation. Now, there is also no point in using Genesis or PS2 joystick via parallel port if they themselves send information serially, which they do. In fact, of all the parallel ports drivers and joysticks there is only one you want to use - TurboGraFX or "tgxlpt1". http://www2.burg-halle.de/~schwenke/parport.html Good news is MAME already supports this interface, even better news is that this just happens to be the CHEAPEST one you can build. You only need the wires to connect microswithes with your LPT port, that's all. In my experience you DO NOT even need any resistors or diodes. |
| Osirus23:
Wow you're right, with a 2.0Ghz CPU those 16 buttons would take 0.000000064 seconds to process. Imagine the lag. I can't believe how foolish we've been all this time. ::) |
| SavannahLion:
Well... you raise an interesting point there, however there are two things to consider. The discussion really only applies to older computers. While I'm all for the preservation of older computers (My Atari XEGS can attest to that). The sad fact of the matter is most, of not all my PCs eventually get re-purposed for other uses until they're eventually retired (eg stored) serving no other purpose other than to fire up and test old software. I have not actually re-purposed any of my older PC's to play MAME exclusively (not yet anyways). Which leads me to my next point. Personally, I haven't purchased a new PC or motherboard with any sort of RS232 or parallel port in roughly eight years or so. I haven't purchased a new PC with a PS/2 port in roughly five. Believe me when I say this fact probably hurts me more than most. Not having a traditional serial or parallel port means I've had to find new programmers that support USB or make attempts at finding and or using less than ---smurfy--- USB<->serial cables. Not having PS/2 means I've had to make some minor adjustments to my all time favorite PS/2 based HIDs. USB is the most popular because that is what dominates the peripheral interface. So, for most of us, the decision is already made. :dunno You raise an interesting point, but it is made moot by the decreasing presence of these ports. --- Quote from: Osirus23 on September 19, 2010, 10:05:22 pm ---Wow you're right, with a 2.0Ghz CPU those 16 buttons would take 0.000000064 seconds to process. Imagine the lag. I can't believe how foolish we've been all this time. ::) --- End quote --- Wouldn't any potential limitation not lie with the CPU but with the bus speed of USB? But yeah, that too. The difference in serial communication on a 2010 2.0 GHZ processor and parallel communication on a 18 year old computer running at 12MHz is pretty much negligible. |
| JustMichael:
--- Quote from: Driver-Man on September 19, 2010, 09:39:16 pm ---There is one thing about "Building Your Own Arcade Controls" that no one seem to realize, it also happens to be the most important thing of all - sampling rate in relation to multiple simultaneous input. For some reason USB seem to be the most popular, which is a mistake, whether you are using keyboard hack, I-Pac or some USB joystick hack. USB, PS/2 and COM are serial communication ports, which means you can only send one bit at the time. It's further restricted with the operating frequency and slowed down by the processing and control bits overhead. --- End quote --- You seem to think transmitting data 1 bit at a time is a bad thing. If you haven't noticed, hard drives have gone from parallel ATA to serial ATA. They transmits the data 1 bit at a time. They have smaller cables (due to fewer wires needed) and even more data comes through in the same amount of time. Did you know that a lot of the "internet" is transmitted 1 bit at a time? One pulse of laser light in that fiber optic at a time. Just because a method transmits 1 bit at a time doesn't necessarily make it slower. You do realize that the windows default polling rate for HID (Human Interface Device) USB devices is 125hz (125 times per second). You said Mame looks for input 60 times per second. Hmmm, looks like USB exceeds this. Now let's look and see if USB can transmit all the keys pressed at once. Let's use the slowest USB specification USB 1.0, which transmits around 1.5Mhz which translates into about 180 kilobytes per second. Lets divide that 180K by 125 (default polling rate in windows) and we get 1.44K or 1,440 bytes. Now let's toss away 1/2 of that to "overhead" (yes I know overhead stuff is nowhere near that high). That leaves 720 bytes. I think 720 bytes is more than enough room to transmit what keys are being pressed. Just so you know, devices like the I-PAC read their inputs in parallel to avoid any possible ghosting and they even read their inputs more than 60 times a second. So a USB device like an I-PAC will report what keys are being pressed 2 times for each time that Mame asks for inputs. It looks like USB devices exceed what Mame needs. --- Quote ---Only LPT can communicate *instantaneous* state of the port at any given time and as often as the CPU clock ticks, 8 bits at the time, in parallel, which means you can read the state of 16 buttons in just two instructions. --- End quote --- Doesn't matter one bit (pun intended). The state of the port only matters when you are looking at it. If you look at it 60 times a second, its state only matters during those 60 times. USB gets checked twice as often. --- Quote ---Good news is MAME already supports this interface, even better news is that this just happens to be the CHEAPEST one you can build. --- End quote --- You seemed to have forgotten to add in a very nasty cost. The cost of someone's "Time". Simply put when you add in the time for us to search around to find out how to interface to the LPT port, time to decide what parts we will need and time to go and buy them and time to try to assemble the whole thing (even if we don't fry anything). Now personally I would rather buy an I-PAC knowing that it will work and spend the few hours I saved having fun with my children. Is the LPT interface cheaper? IMHO, money-wise yes but overall no (especially if you fry something). --- Quote ---You only need the wires to connect microswithes with your LPT port, that's all. In my experience you DO NOT even need any resistors or diodes. --- End quote --- Highly depended upon manufacturer of the LPT port. I would recommend sticking to whatever is the accepted method of interfacing to the LPT port and not using "just wires". |
| CheffoJeffo:
* CheffoJeffo really hopes that RandyT posts in this thread. :droid |
| Navigation |
| Message Index |
| Next page |