mame icon indicating copy to clipboard operation
mame copied to clipboard

atari/mediagx: Adds Preliminary Input Handling, gets machine working for a51site4

Open montymxb opened this issue 1 year ago • 2 comments

First time committer. I was working on this driver for a good portion of last year, and never got around to putting a PR up. The driver still needs to be 'modernized', and uses some older approaches that need to be phased out -- to my understanding. Still, I figured it's helpful to share this and see if it's possible to add it in, or at least iterate from this point forward. ...

This PR adds input handling support for the atari/mediagx driver. Previously the machine was flagged as not working, and was capable of starting up with no real functionality. This PR implements a functional (but still incomplete) mapping for handling inputs properly. In practice this allows starting up & running a51site4 (albeit with performance limitations).

The changes include:

  • P1/P2 start buttons work
  • P1/P2 coin insertions work
  • P1/P2 JGun X/Y tracking & triggers work (but JGuns may need to be calibrated in test menu first)
  • Test/Diagnostic menu can be accessed as expected

As a result, a51site4 can be run and played (provided you have the hardware to mitigate performance issues).

Limitations:

  • Emulation speed is inconsistent at times, sometimes slowing down or speeding up depending on the computational complexity at hand. Not the worst issue, but something to keep in mind.
  • Performance varies based on your hardware, same as before essentially, but overall not very performant. Testing this on some newer hardware (an M1) produced buttery smooth results, but an older machine struggled to even do seconds per frame at times.
  • Audio is really bad. It's playing in short fragments, very clippy, not so great. I did play around with the CPU clock rate in an attempt to see if the audio would come out clean (dropping it to some absurdly low values), and it did come out perfectly clean; however that's not really a fix and was just an experiment. I think the sound timer for the AD1847 can be adjusted to rectify this properly, but that's as far I got there.
  • Emulator has to be manually stopped (ESC is not bound correctly yet). This is more of a limitation on my understanding on how to do this properly.
  • Coin insertion doesn't work without a double tap most of the time, but beyond that works fine.
  • Coin tracking is not quite right, i.e. statistics are logged mostly under slot 1, likely needs further refinement.
  • Muzzle flash is absent (almost had it at one point with the state logic, but got a bit hairy to keep other things working as expected).
  • Saving is still not supported.

Also, assuming I'll be squashing these commits before adding anything in? The earlier history is chock full of tests, iterations, too many comments, and other such changes.

montymxb avatar Nov 02 '23 19:11 montymxb

As per #8835 the driver in general needs a real modernization to PCI specs so we aren't interested in pushing this PR as-is. However I'll use this as a consultation for making a proper parallel port bus slot for the inputs soon enough.

Emulation speed is inconsistent at times, sometimes slowing down or speeding up depending on the computational complexity at hand. Not the worst issue, but something to keep in mind.

It's pretty rough and really depends on bus penalties (MediaGX is pretty known to not exactly be the most performant x86 arch ever).

angelosa avatar Nov 02 '23 20:11 angelosa

@angelosa right I see. Well that still sounds good to me, so long as this helps makes progress overall.

Also, if there's anything I can do to help or clarify the changes I made here, feel free to let me know.

montymxb avatar Nov 03 '23 09:11 montymxb