Author Topic: Best I/O controller for WolfMAME  (Read 128 times)

0 Members and 1 Guest are viewing this topic.

Offline KongTower

  • Jr. Member
  • *
  • Posts: 35
Best I/O controller for WolfMAME
« on: February 09, 2018, 05:51:06 PM »
As an arcade game developer, I have far more than the typical amount of knowledge for how inputs get to the video state-machine and logic.

One thing that is always a potential compromise is when, for example, you are using an I/O controller which samples at a frequency that is less than twice the frequency of the game's input polling schedule.

Typically the input polling schedule is some integral number of video retraces.  For example, I happen to know that for Defender, Eugene reads the controls twice per video retrace.  Once at the top scanline and once at mid scanline.

On original hardware, the polling would simply read a de-bounced switch directly, and latency is minimized.

But when you have microprocessors and memory and FIFO buffers and a separate update loop (like USB's 100Hz) you experience all manner of problems with the input that most people simply are unaware of.

When confronted with this problem for pinball, I went the distance and used a hard-core data-acquision device that was several hundred dollars (designed for scientists, not video game players).  I used this so that I could poll the CPU's clock counter in the interrupt service routine to come up with an arrival time.

Some people think that minimizing latency is the whole job, but it's not.

If you get a different answer completely from a few nanoseconds difference in arrival time after the chaos and domino effect of the minute initial difference pans through a physical simulation, you want to gather all of the data.  And with pinball, there are only two buttons, but the data of the input is in the precision of the arrival time.

Now for Donkey Kong, 1000 Hz polling would very likely be plenty good enough.

So when I made a Pac-Man game, I used a much cheaper USB device that had a 1000 Hz poll rate.

Now I understand that most people are not going to understand what I'm talking about and that's fine.  But here are my questions:

#1: who has the best I/O card for minimizing noise that results from slower poll rates or from arrival times being rounded to the nearest period of the hardware's polling rate?
#2: is anyone interested in adding support for one of the 1000Hz devices that I made work for my games?

I'd love to use, at least, the 1000Hz USB data-acquision hardware that I think is all you would need to get the best result in Donkey Kong.

I would also love to spec out parts for a competitive WolfMAME build in order to get as serious as possible about the details to position yourself competitively to prevent errors in the input system adding noise to the precise nature of your donkey kong timing skills.

Let me know if anyone is interested, and we can talk about the next steps.  Hopefully this has been solved, but I totally expect more people claiming this is not an issue at 100Hz USB polling (it is).

This was what I found that does 1000Hz without being too expensive back a few years ago.  I expect there should be something CHEAPER but I assure you that this one works and could be added to MAME if it's not already supported.

http://www.ni.com/pdf/manuals/375267a.pdf
« Last Edit: February 09, 2018, 06:23:28 PM by KongTower »

Offline YesAffinity

  • Elite Member
  • *
  • Posts: 420
Re: Best I/O controller for WolfMAME
« Reply #1 on: February 09, 2018, 07:46:32 PM »
If you get a different answer completely from a few nanoseconds difference in arrival time after the chaos and domino effect of the minute initial difference pans through a physical simulation, you want to gather all of the data.
uh...what?

Now I understand that most people are not going to understand what I'm talking about and that's fine.
oh, good.  :)  But here are my questions:

#1: who has the best I/O card for minimizing noise that results from slower poll rates or from arrival times being rounded to the nearest period of the hardware's polling rate?
uh...what?

Seriously tho, I'm following where you're going, and love the idea.  This suggestion is probably going to be completely dumb compared to the level you're at, but have you checked any of the current gen encoders that are commonly used in fighting game enthusiast circles?  PCB's like the MC cthulhu or the  Brooks products.  They are USB devices, so possibly that immediately throws them in the class of the 100hz limitations you were talking about.  I have (3) MC chtulhu's and they all work great on a number of consoles, PC's, even through a undamned decoder that is hardwired to my JAMMA test rig (a poor man's supergun).  But I think I see where you're going, looking at the picture, but isn't the IPAC also a USB device, and would be bottlenecked by that limitation as well?

Sorry, just an inquisitive problem solver here, nowhere near the level you're working on this task, but I'm eagerly following.  <popcorn>
Matthew 21:22

DK Arcade PB (verified): 970,200 KS
DK Start PB (verified): 126,600
DK L1-1 PB (verified): 11,400
DK PB 1st Man: 622,000

Donkey Kong Direct Feed How-To - http://donkeykongforum.com/index.php?topic=1413.0
DK Killscreener Twitch TV  Streamer DKF Blogger

Offline KongTower

  • Jr. Member
  • *
  • Posts: 35
Re: Best I/O controller for WolfMAME
« Reply #2 on: February 10, 2018, 08:22:28 AM »
PCB's like the MC cthulhu or the  Brooks products.  They are USB devices, so possibly that immediately throws them in the class of the 100hz limitations you were talking about.  I have (3) MC chtulhu's and they all work great on a number of consoles, PC's, even through a undamned decoder that is hardwired to my JAMMA test rig (a poor man's supergun).  But I think I see where you're going, looking at the picture, but isn't the IPAC also a USB device, and would be bottlenecked by that limitation as well?

Sorry, just an inquisitive problem solver here, nowhere near the level you're working on this task, but I'm eagerly following.  <popcorn>

100Hz polling rate is not intrinsic to USB.  It's just what the low-cost hardware pre-packaged solutions generally offer.  The National Instruments hardware shown above that runs about $100 used on E-bay does 1000 Hz and it's USB.  You may also know that gaming mice can be cranked up to 1000Hz on USB (like the Logitech and Razor mice that cost $50 and up).

But I know that MOST low cost USB inputs mangle your arrival times by pushing them forwards to the next 10 millisecond boundary.

You need to understand the Nyquist Theorom to know that trying to represent a 60Hz signal on a 100Hz carrier is not sufficient to represent all of the frequencies.  You need 120hz at a minimum.  In addition to being able to simply represent (at all) those frequencies, when sampling to get a 60hz signal off a 100hz carrier rate your arrival time for 16.66ms goes to 20.00ms with a 3.33ms error on arrival time.  You also have a 40Hz beat frequency that is noise.  There are other details, but Google can help if you're curious.

1000Hz generally works great and just rounds everything to the nearest (higher) millisecond on arrival time.  This is a fine solution without needing more precision than 1ms on arrival time (which is fine for all games that run even up to 500hz).

My pinball game ran the engine at 1000hz, the graphics update at 120hz and the input at 3Ghz.  And it was the first pinball to support ALL of the professional pinball play-moves.  I did UltraPin ten years earlier, so I have a lot of time to think about it to get it right.
« Last Edit: February 10, 2018, 08:26:26 AM by KongTower »